TL;DR
This paper introduces Atomic Active Messages (AAM), a novel mechanism that leverages Hardware Transactional Memory (HTM) to significantly accelerate irregular graph computations on both shared and distributed memory systems. By treating fine-grained graph operations as coarse hardware transactions, AAM offers a simpler and more performant alternative to traditional fine-grained atomics, achieving speedups of over 100% on benchmarks like Graph500 BFS.
What Problem Does This Paper Address?
Modern computational problems, from social network analysis to machine learning, are increasingly driven by massive graphs. However, processing these graphs efficiently in parallel is challenging due to their inherent irregular and data-driven nature. Traditional approaches often rely on complex synchronization primitives like locks or fine-grained atomics, which are error-prone and can become performance bottlenecks. Furthermore, distributed graph processing introduces complexities in managing data across nodes. This paper addresses the need for a simpler, more scalable, and performant way to handle these irregular computations, particularly by exploring the potential of emerging hardware transactional memory (HTM) technologies.
Methods
The core innovation is Atomic Active Messages (AAM), which combines the Active Messages (AM) model with HTM. Instead of individual, fine-grained atomic operations, AAM allows developers to define operators that are executed as coarse-grained hardware transactions. This approach offers several advantages:
- Coarsening and Coalescing: AAM employs techniques like coarsening (grouping multiple operations into a single transaction) and coalescing (bundling messages to remote nodes) to amortize HTM overheads and reduce synchronization.
- HTM Integration: The paper details how to implement AAM using HTM, specifically exploring Intel's Haswell TSX (HLE/RTM) and IBM's Blue Gene/Q HTM.
- Performance Modeling: A simple performance model is developed to understand the trade-offs between atomics and HTM, predicting that HTM's overheads are higher initially but can be amortized with coarser transactions.
- Novel Classification of Messages: AAM categorizes messages into four types (FF&AS, FF&MF, FR&AS, FR&MF) based on data flow direction and commit behavior, enabling tailored programming for different graph algorithms.
- Distributed Transaction Protocol: A protocol is introduced to handle transactions that access data on remote nodes, ensuring atomicity and correctness.
Datasets
The paper evaluates AAM using:
- Kronecker graphs: Used extensively for performance analysis, particularly for BFS, with varying sizes and degree distributions (power-law).
- Erdős-Renyi (ER) graphs: Used for PageRank evaluation with different edge probabilities.
- Real-world graphs: A diverse set including community networks (cWT wiki-Talk, email-EuAll), social networks (com-orkut, com-lj, com-youtube), purchase networks (amazon0601), road networks (roadNet-CA, roadNet-TX, roadNet-PA), citation graphs (cit-Patents), and web graphs (web-Google, web-BerkStan, web-Stanford). These were used to evaluate AAM's performance against existing frameworks like Graph500, Galois, HAMA, and SNAP.
Key Insights and Ideas
- HTM for Irregularity: HTM is not just for regular scientific codes; it offers significant advantages for irregular, data-driven graph computations where fine-grained atomics are problematic.
- Coarsening is Key: The performance gains of AAM are heavily dependent on effective coarsening of transactions. Single-vertex transactions are often slower than atomics, but larger transactions can amortize overheads and outperform atomics.
- Platform Differences Matter: HTM performance varies significantly across architectures. The larger L2 cache on Blue Gene/Q appears to provide better performance for HTM than the smaller L1 cache on Haswell, especially for longer transactions.
- Aborts are Manageable (with care): While HTM aborts are a concern, the paper shows that with proper coarsening and coalescing, their impact can be mitigated, and in some cases, AAM can outperform highly optimized atomic-based solutions.
- Active Messages + HTM = Powerful Combination: The synergy between the flexible communication model of Active Messages and the atomic execution of HTM creates a potent framework for distributed graph processing.
Key Results
- Significant Speedups: AAM achieved speedups of over 100% for Graph500 BFS on both BG/Q and Haswell compared to atomic-based implementations.
- Optimal Transaction Sizes: The paper identified optimal transaction sizes (M) for different architectures and graph types, ranging from M=2 for Haswell to M=144 for BG/Q.
- Real-World Performance: AAM demonstrated competitive or superior performance on various real-world graph datasets compared to established frameworks like Graph500, Galois, HAMA, and SNAP, particularly for BFS and PageRank.
- Distributed Performance: For distributed operations, AAM with coalescing outperformed atomic-based remote operations by 5-7 times for marking remote vertices and showed a ~20% speedup for incrementing remote ranks.
- Aborts Analysis: Detailed analysis of abort reasons revealed platform-specific behaviors, with Haswell being more susceptible to buffer overflows and BG/Q showing a higher ratio of transactions to aborts.
Limitations and Future Work
- HTM Limitations: The paper acknowledges that HTM implementations have limitations (e.g., restricted operations within transactions, potential for livelock).
- Manual Coarsening: While the runtime system offers automatic coarsening, manual coarsening by the developer can be challenging.
- Future Work:
- Developing compiler passes to automatically identify and transform single-vertex transactions into coarser ones.
- Extending the performance model to enable online selection of optimal HTM parameters based on graph sampling and runtime conditions.
- Exploring the integration of AAM with code analysis techniques for further optimization.
- Investigating other HTM implementations or alternative concurrency mechanisms like distributed STM or flat-combining.
Summary updated