TL;DR
This paper introduces novel microarchitectural mechanisms and a compiler to enable efficient "out-of-order" task spawning in Chip Multiprocessors (CMPs) with Thread-Level Speculation (TLS). This approach unlocks significant performance gains for complex, irregular integer applications that were previously difficult to accelerate with TLS.
What Problem Does This Paper Address?
Chip Multiprocessors (CMPs) are powerful platforms for parallel processing, and Thread-Level Speculation (TLS) is a technique that allows them to extract parallelism from sequential code by speculatively executing tasks. However, existing TLS systems often struggle with "out-of-order" task spawning, where tasks can be initiated in an unpredictable sequence, not strictly following the original program's execution order. This is crucial for exploiting parallelism in nested subroutines and loops, but it poses significant challenges for managing task order, ensuring correct commits and squashes, and efficiently allocating resources on the CMP. Without addressing these issues, TLS speedups for non-numerical applications have been modest.
Methods
The paper proposes three core microarchitectural mechanisms:
- Splitting Timestamp Intervals: Instead of single timestamps, tasks are assigned timestamp intervals ({Base, Range}). When a task spawns a child, its interval is split, giving a higher-range subinterval to the more speculative child and keeping a lower-range subinterval for the parent. This allows for efficient and decentralized task ordering, even with out-of-order spawns.
- Immediate Successor List (IS List): Each task maintains a pointer to its immediate successor in the sequential execution order. This hardware-managed list enables fast commit and squash operations by allowing a task to quickly propagate commit tokens or kill signals to its successors.
- Dynamic Task Merging: This technique allows the hardware to transparently merge consecutive tasks at runtime based on dynamic load conditions. If a CPU is busy, a task can skip its spawn instruction and merge with its successor, effectively pruning the task tree and freeing up resources for more critical tasks. This is managed by a "Number of Ends to Skip" (NES) counter.
These mechanisms are supported by a fully-automated TLS compiler that generates code for out-of-order spawning. The compiler identifies potential tasks (subroutines, continuations, loop iterations) and inserts spawn instructions, optimizing their placement.
Datasets
The evaluation uses the full SpecInt 2000 benchmark suite, specifically the Reference data set. The paper notes that some applications (eon, gcc, perlbmk) could not be compiled with their infrastructure. They compare three versions of these binaries:
- BaseApp: The unmodified, sequential version compiled with optimization.
- InOrder: TLS with in-order task spawning.
- OutOrder: TLS with the proposed out-of-order task spawning mechanisms.
Key Insights and Ideas
- Out-of-order spawning is key for irregular applications: The paper strongly argues that the inability to handle out-of-order task spawning is a major bottleneck for achieving significant TLS speedups in complex integer applications.
- Decentralized mechanisms are crucial for CMPs: The proposed solutions (timestamp intervals, IS list, task merging) are designed to be decentralized and operate locally within each processor, making them suitable for CMP architectures.
- Dynamic Task Merging is highly effective with out-of-order spawn: While task merging showed little benefit for in-order TLS, it significantly boosts performance when combined with out-of-order spawning, suggesting that dynamic resource management is critical when parallelism is less predictable.
- Compiler and hardware synergy is essential: The success of the proposed approach relies on both the microarchitectural support and a sophisticated, automated compiler that can effectively identify and generate tasks for out-of-order execution.
- TLS overheads can be significant: While TLS offers speedups, factors like instruction bloat (due to extra spawn/commit instructions) and wasted cycles from squashed tasks can offset gains, highlighting the importance of efficient mechanisms.
Key Results
- A 4-core CMP with the proposed out-of-order TLS mechanisms (TLS4 OutOrder) achieved an average speedup of 1.30 for the SpecInt 2000 applications.
- In contrast, the same architecture with in-order TLS (TLS4 InOrder) achieved only an average speedup of 1.04.
- The TLS4 OutOrder architecture outperformed a 6-issue superscalar processor by 20% on average, even at the same clock frequency.
- On average, 45% of committed dynamic instructions were in tasks spawned out-of-order, demonstrating the significant exploitation of this parallelism.
- Dynamic task merging was found to be crucial, with its elimination causing a 29% drop in average speedup for the out-of-order TLS system.
Limitations and Future Work
- Compiler limitations: The compiler infrastructure had limitations, preventing the compilation of some SpecInt applications (eon, gcc, perlbmk).
- Timestamp wrap-around and interval exhaustion: While the paper addresses these as special cases, they represent potential edge cases that require careful handling. The paper notes that these are rare in their experiments.
- Future work: The authors suggest that further improvements can be made as the opportunities for out-of-order spawn in challenging applications become better understood. They also mention that their architecture sensitivity analysis was not fully included due to space constraints, implying further exploration is possible.
Summary updated