TL;DR
This paper introduces the Transactional WaveCache, a novel memory ordering mechanism for the WaveScalar dataflow architecture. It enables speculative, out-of-order execution of memory operations across different "waves" (atomic code regions), inspired by transactional memory concepts, to significantly boost performance by exploiting parallelism.
What Problem Does This Paper Address?
Modern computing is increasingly reliant on parallelism to overcome the slowdown in single-core processor speed increases. While dataflow architectures offer inherent parallelism, they traditionally struggle to efficiently support the sequential memory semantics required by imperative programming languages. The WaveScalar architecture attempts to bridge this gap by executing waves as dataflow computations while maintaining wave-level sequential memory ordering. However, this strict ordering can still limit performance. This paper addresses this limitation by proposing a more aggressive approach that allows memory operations from different waves to execute speculatively and out-of-order, thereby unlocking further parallelism.
Methods
The core innovation is the Transactional WaveCache (TWC). It extends the WaveScalar architecture by treating each "wave" as a transactional memory unit. Key aspects of the TWC include:
- Speculative Execution: Memory operations from different waves can execute out-of-order, even if they are not strictly sequential in the program.
- Transactional Semantics: Waves are treated as atomic regions. If a speculative wave encounters a hazard (conflict), it and all subsequent "child" waves are aborted and re-executed.
- Commit Mechanism: A wave can commit as soon as its preceding waves have committed, allowing for early commit of non-speculative waves.
- Hazard Detection: The system explicitly detects Read-After-Write (RAW), Write-After-Write (WAW), and Write-After-Read (WAR) hazards between speculative waves.
- Rollback and Re-execution: Upon detecting a hazard, the system rolls back the speculative execution and re-executes the affected waves.
- Data Structures: Novel data structures like the Wave-Context-Table (WCT) and MemOp-History (MOH) are introduced to manage speculative operands and track memory operations for hazard detection and rollback.
- Operand Management: Mechanisms like MT Checkups and Execution Maps are employed to manage and discard old operands from speculative executions, preventing them from interfering with current computations.
Datasets
The paper evaluates its approach using a set of artificial benchmarks. These include:
- MATRIX group: Benchmarks that calculate determinants of matrices and summarize lines, with variations for initialization and dependencies.
- VECTOR-FULL-DEP: A benchmark designed to force WAR, WAW, and RAW hazards.
The authors mention that their implementation relies on the Kahuna WaveScalar architectural simulator and a WaveScalar binary translator, but does not yet support full Alpha emulation, multi-threaded execution, or Decoupled Stores.
Key Insights and Ideas
- Transactional Memory for Dataflow: Applying transactional memory principles to a dataflow architecture like WaveScalar is a powerful way to extract more parallelism from memory operations.
- Speculation as a Performance Driver: Aggressively allowing out-of-order speculative memory accesses, even with the overhead of potential rollbacks, can lead to substantial performance gains.
- Hazard Management is Crucial: The effectiveness of speculative execution hinges on robust hazard detection and efficient rollback mechanisms. The paper demonstrates that even with significant hazards, performance can still improve.
- Orthogonality of Techniques: The Transactional WaveCache is orthogonal to other memory disambiguation techniques like Decoupled Stores, suggesting that combining them could yield even greater benefits.
Key Results
The Transactional WaveCache (TWC) demonstrates significant performance improvements across various benchmarks:
- High Speedups: For applications with few memory accesses or few conflicts, speedups of around 90% were achieved.
- Memory-Intensive Applications: For more memory-intensive applications, speedups of 33.1% and 24% were observed.
- Hazard-Rich Applications: For an application with a high density of WAW, WAR, and RAW hazards (VECTOR-FULL-DEP), a remarkable speedup of 139.7% was verified.
- Memory Bandwidth Bottlenecks: In scenarios where memory bandwidth becomes a bottleneck, slowdowns of up to 16% were observed.
- Speculation Window Impact: Speedups generally increase with the Speculation Window size, but often plateau at relatively small finite values (less than 20).
Limitations and Future Work
- Limitations:
- The current implementation does not support full Alpha emulation, multi-threaded execution, or Decoupled Stores.
- Performance can degrade (slowdowns) when memory bandwidth is a bottleneck.
- The mechanisms for erasing old operands do not guarantee complete removal but aim to minimize their impact.
- Future Work:
- Improve the Kahuna simulator and WaveScalar binary translator to run larger applications.
- Study alternative designs to simplify the complexity of the Transactional WaveCache.
- Investigate other mechanisms for throttling parallelism and achieving synchronization.
- Explore the combination of Transactional WaveCache with other techniques like Decoupled Stores.
Summary updated