Fast Sparse Matrix-Vector Multiplication on GPUs: Implications for Graph Mining
Introduction
Sparse Matrix-Vector Multiplication (SpMV) is the computational backbone of many graph mining algorithms, including Google’s PageRank. However, real-world graphs typically follow a power-law distribution, where a small number of "celebrity" nodes have massive connectivity while most nodes have very few connections. This distribution leads to significant performance bottlenecks on GPUs, specifically workload imbalance among threads and poor memory locality due to irregular access patterns.
Researchers at Ohio State University have developed an "architecture-conscious" approach to SpMV that addresses these issues through a combination of novel tiling, column reordering, and a self-tuning composite storage format. Their method achieves a 2x speedup over industrial GPU libraries and up to a 32x speedup over optimized CPU implementations.
Architecture-Conscious Methodology
The proposed method transforms the sparse matrix through a multi-step pipeline to optimize it for GPU hardware characteristics, specifically targeting the texture cache and warp execution model.
The strategy involves three key components:
- Tiling for Texture Cache: The matrix is divided into fixed-width tiles. This ensures that the segment of the vector being accessed fits entirely within the GPU’s texture cache, turning random memory access into high-speed local streams.
- Column Reordering: By reordering columns based on the number of non-zeros (NNZ), the system can isolate dense sub-matrices (high-degree nodes) and apply specialized optimizations to them.
- Composite Tile Storage: Within each tile, rows are reordered and grouped to ensure balanced workloads across GPU warps.
Composite Tile Storage and Load Balancing
A major innovation of this work is the hybrid storage scheme used within each tile. To prevent "thread divergence"—where some threads in a warp are idle while others are working—the system ranks rows by length and groups them into specific workloads.
Rows are categorized and stored using a hybrid approach:
- Long rows are stored in a modified Compressed Sparse Row (CSR) format.
- Short rows are stored in an Ellpack (ELL) format.
This ensures that all 32 threads within a warp perform similar amounts of computation. Additionally, an Automatic Parameter Tuner uses a performance model to calculate the optimal configuration for any given graph at runtime, eliminating the need for manual tuning.
Performance and Scalability
The "Tile-Composite" approach was tested on massive real-world datasets, including web-scale crawls like uk-union with over 5.5 billion edges.
- Speed: The implementation achieved a 1.8x to 2.1x speedup over NVIDIA’s industrial-strength HYB kernel on power-law graphs.
- CPU Comparison: The GPU method was 18x to 32x faster than highly optimized CPU implementations.
- Application Impact: For core algorithms like PageRank and HITS, total execution time was reduced by approximately 50%.
- Scalability: The system demonstrated 70% parallel efficiency when scaled across multiple GPUs for billion-edge graphs.
Conclusion and Future Outlook
While the method requires an initial overhead for sorting and reordering, this cost is effectively amortized over the many iterations required by graph mining algorithms. By leveraging the GPU's texture cache and implementing a self-aware storage format, this research provides a robust framework for high-performance graph analysis. Future work may involve extending the predictive performance model to hybrid CPU-GPU architectures to further optimize data placement.
Summary updated