[Paper Review] Adaptive SpMV/SpMSpV on GPUs for Input Vectors of Varied Sparsity
This paper proposes an adaptive SpMV/SpMSpV framework for GPUs that dynamically selects among eight optimized kernels at runtime based on input vector sparsity and hardware characteristics. Using a lightweight, ensemble machine learning kernel selector, the framework achieves significant performance gains over prior state-of-the-art methods across BFS and PageRank workloads on NVIDIA K40m, P100, and V100 GPUs.
Despite numerous efforts for optimizing the performance of Sparse Matrix and Vector Multiplication (SpMV) on modern hardware architectures, few works are done to its sparse counterpart, Sparse Matrix and Sparse Vector Multiplication (SpMSpV), not to mention dealing with input vectors of varied sparsity. The key challenge is that depending on the sparsity levels, distribution of data, and compute platform, the optimal choice of SpMV/SpMSpV kernel can vary, and a static choice does not suffice. In this paper, we propose an adaptive SpMV/SpMSpV framework, which can automatically select the appropriate SpMV/SpMSpV kernel on GPUs for any sparse matrix and vector at the runtime. Based on systematic analysis on key factors such as computing pattern, workload distribution and write-back strategy, eight candidate SpMV/SpMSpV kernels are encapsulated into the framework to achieve high performance in a seamless manner. A comprehensive study on machine learning based kernel selector is performed to choose the kernel and adapt with the varieties of both the input and hardware from both accuracy and overhead perspectives. Experiments demonstrate that the adaptive framework can substantially outperform the previous state-of-the-art in real-world applications on NVIDIA Tesla K40m, P100 and V100 GPUs.
Motivation & Objective
- Address the lack of efficient optimization for Sparse Matrix and Sparse Vector Multiplication (SpMSpV) on GPUs, especially when input vector sparsity varies during execution.
- Overcome the limitations of static kernel selection, which fails to adapt to diverse input sparsity levels, data distributions, and evolving GPU architectures.
- Design a flexible, high-performance framework that automatically selects the optimal SpMV/SpMSpV kernel at runtime based on input and hardware characteristics.
- Develop a low-overhead, accurate kernel selector using machine learning to balance prediction accuracy and computational cost across diverse application and hardware scenarios.
Proposed method
- Systematically analyze key performance factors—computing pattern, workload distribution, and write-back strategy—to identify eight candidate SpMV/SpMSpV kernels.
- Design a hybrid kernel space combining matrix-driven row-major and vector-driven column-major SpMSpV patterns, with variations in load balancing and memory access patterns.
- Implement a three-model ensemble (e.g., decision trees) for kernel selection, trained on 2,010 real-world sparse matrices and diverse input vectors to predict optimal kernels.
- Integrate the kernel selector into a runtime framework that evaluates input characteristics and selects the best-performing kernel with minimal overhead.
- Optimize memory access and thread divergence by tailoring write-back strategies and workload distribution based on sparsity and matrix structure.
- Ensure portability and adaptability across different GPU platforms (K40m, P100, V100) by decoupling kernel selection from low-level hardware details.
Experimental results
Research questions
- RQ1What are the key performance factors that influence SpMV/SpMSpV efficiency on GPUs when input vector sparsity varies?
- RQ2Can a larger set of kernel variants (beyond just two) significantly improve performance across diverse input and hardware configurations?
- RQ3How can a machine learning-based kernel selector be designed to achieve high accuracy with low runtime overhead for dynamic SpMV/SpMSpV workloads?
- RQ4To what extent does the proposed adaptive framework outperform static or heuristic-based kernel selection in real-world graph and machine learning workloads?
- RQ5How well does the framework generalize across different GPU architectures without requiring re-tuning?
Key findings
- The proposed adaptive framework achieves substantial performance improvements over the previous state-of-the-art in both BFS and PageRank workloads on NVIDIA K40m, P100, and V100 GPUs.
- The framework's machine learning-based kernel selector reduces prediction overhead while maintaining high accuracy, enabling real-time kernel selection with minimal performance penalty.
- The inclusion of eight diverse kernel variants—spanning different computing patterns, workload distribution, and write-back strategies—enables better adaptation to varying input sparsity and matrix structures.
- The framework demonstrates strong generalization across different GPU platforms, showing consistent performance gains without manual tuning per architecture.
- The adaptive approach significantly outperforms the heuristic-based method from the push-pull library, which relies on a fixed sparsity threshold for kernel switching.
- The ensemble machine learning model achieves high prediction accuracy on unseen matrices and input vectors, validating its robustness and scalability.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.