Skip to main content
QUICK REVIEW

[Paper Review] Design Principles for Sparse Matrix Multiplication on the GPU

Carl Yang, Aydın Buluç|arXiv (Cornell University)|Mar 22, 2018
Parallel Computing and Optimization TechniquesComputer Science8 citations
TL;DR

This paper proposes two novel GPU-optimized sparse matrix-dense matrix multiplication (SpMM) algorithms using compressed sparse row (CSR) format, leveraging merge-based load-balancing and row-major coalesced memory access to achieve 4.1× peak speedup and 31.7% geomean speedup over state-of-the-art implementations on real-world datasets. The approach avoids costly format conversions and focuses on latency hiding and instruction-level parallelism for superior GPU utilization.

ABSTRACT

We implement two novel algorithms for sparse-matrix dense-matrix multiplication (SpMM) on the GPU. Our algorithms expect the sparse input in the popular compressed-sparse-row (CSR) format and thus do not require expensive format conversion. While previous SpMM work concentrates on thread-level parallelism, we additionally focus on latency hiding with instruction-level parallelism and load-balancing. We show, both theoretically and experimentally, that the proposed SpMM is a better fit for the GPU than previous approaches. We identify a key memory access pattern that allows efficient access into both input and output matrices that is crucial to getting excellent performance on SpMM. By combining these two ingredients---(i) merge-based load-balancing and (ii) row-major coalesced memory access---we demonstrate a 4.1x peak speedup and a 31.7% geomean speedup over state-of-the-art SpMM implementations on real-world datasets.

Motivation & Objective

  • To improve performance of sparse matrix-dense matrix multiplication (SpMM) on GPUs without requiring format conversion from CSR.
  • To address the challenge of irregular memory access and load imbalance in SpMM on GPU architectures.
  • To identify and exploit a critical memory access pattern that enables efficient coalesced access to both input and output matrices.
  • To develop a heuristic for dynamically selecting between two SpMM kernel variants based on matrix characteristics.
  • To demonstrate that SpMM can outperform dense matrix multiplication (GEMM) at low sparsity levels (below 9%)

Proposed method

  • Generalizes two main SpMV algorithm classes—row splitting and merge-based—into SpMM for GPU execution.
  • Designs a merge-based kernel that coalesces memory access by aligning thread blocks with dense matrix rows and using a merge path to balance workload across warps.
  • Implements a lightweight heuristic that selects between the merge-based and row-splitting kernels with 99.3% accuracy compared to optimal choice.
  • Optimizes memory access by ensuring row-major coalescing for both sparse input and dense output matrices, minimizing latency and maximizing throughput.
  • Uses cooperative thread arrays (CTAs) and warp-level primitives to minimize thread divergence and maximize occupancy.
  • Tight-coupling of load-balancing logic with computation avoids abstraction overhead while maintaining performance

Experimental results

Research questions

  • RQ1Can merge-based load-balancing be effectively extended from SpMV to SpMM on GPUs?
  • RQ2What memory access pattern enables high-performance SpMM on GPUs without format conversion?
  • RQ3How can dynamic kernel selection between two SpMM variants be achieved with high accuracy and low runtime cost?
  • RQ4At what sparsity level does SpMM outperform GEMM on GPUs?
  • RQ5Can performance be significantly improved over vendor-optimized CSR SpMM implementations without changing the input format?

Key findings

  • The proposed merge-based SpMM kernel achieves a 4.1× peak speedup and 31.7% geomean speedup over state-of-the-art SpMM implementations on 157 real-world matrices from the SuiteSparse Collection.
  • The method outperforms both cuSPARSE csrmm and csrmm2 functions across diverse sparse matrices, with consistent gains on tall-skinny matrices.
  • The heuristic for kernel selection achieves 99.3% accuracy compared to the optimal choice, enabling near-optimal performance with minimal overhead.
  • SpMM becomes faster than GEMM when the sparse matrix has less than 9% nonzero elements, demonstrating efficiency at low sparsity.
  • The approach maintains high GPU occupancy and minimizes thread divergence by ensuring coalesced memory access and balanced workload distribution.
  • The performance gains are attributed to effective latency hiding through instruction-level parallelism and coalesced row-major memory access patterns

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.