Skip to main content
QUICK REVIEW

[Paper Review] Adaptive Row-grouped CSR Format for Storing of Sparse Matrices on GPU

Martin Heller, Tomáš Oberhuber|arXiv (Cornell University)|Mar 26, 2012
Matrix Theory and AlgorithmsComputer Science6 citations
TL;DR

This paper proposes an adaptive row-grouped CSR format for storing sparse matrices on GPU, optimizing matrix-vector multiplication (SpMV) by dynamically grouping matrix rows into variable-sized chunks based on non-zero element distribution. The method improves memory coalescing and load balancing, achieving up to 10x speedup over CUSPARSE and 5–8x over CPU CSR for certain matrices like rajat23 and GHS_indef, particularly in circuit simulation and optimization problems.

ABSTRACT

We present new adaptive format for storing sparse matrices on GPU. We compare it with several other formats including CUSPARSE which is today probably the best choice for processing of sparse matrices on GPU in CUDA. Contrary to CUSPARSE which works with common CSR format, our new format requires conversion. However, multiplication of sparse-matrix and vector is significantly faster for many atrices. We demonstrate it on set of 1 600 matrices and we show for what types of matrices our format is profitable.

Motivation & Objective

  • Address the performance variability of SpMV on GPU due to irregular sparse matrix structures.
  • Overcome limitations of standard CSR and ELLPACK formats in handling matrices with highly variable row lengths.
  • Improve memory coalescing and load balancing in GPU-based SpMV by introducing adaptive chunking of matrix rows.
  • Develop a format that dynamically adjusts chunk size based on matrix characteristics to maximize GPU utilization.
  • Demonstrate superior performance on a diverse set of 1,600 sparse matrices compared to state-of-the-art formats like CUSPARSE, Hybrid, and Row-grouped CSR.

Proposed method

  • Divide sparse matrix rows into variable-sized chunks based on non-zero element count, with each chunk stored contiguously in memory.
  • Store non-zero values and column indices in column-major order to enable coalesced global memory access on GPU.
  • Map one GPU thread to each chunk, enabling parallel processing of chunks across warps.
  • Use a thread mapping array to track which row each chunk belongs to, enabling partial sum reduction across chunks per row.
  • Implement a kernel that processes each chunk in parallel, with early termination when column indices exceed the current row’s range.
  • Introduce a configurable parameter, desiredChunkSize, to tune performance based on matrix regularity—smaller values for irregular matrices, larger for regular ones.

Experimental results

Research questions

  • RQ1How does the adaptive row-grouped CSR format improve SpMV performance compared to standard CSR and other GPU-optimized formats?
  • RQ2For which types of sparse matrices does the adaptive row-grouped CSR format outperform CUSPARSE, Hybrid, and Row-grouped CSR formats?
  • RQ3What is the impact of the desiredChunkSize parameter on performance, and how should it be tuned for different matrix types?
  • RQ4Can the new format achieve significant speedups on matrices from circuit simulations and optimization problems where traditional formats underperform?
  • RQ5To what extent does the format reduce artificial zero overhead and improve memory coalescing compared to ELLPACK-based methods?

Key findings

  • The adaptive row-grouped CSR format achieved up to 18 GFLOPS on the Schenk_AFE matrix with desiredChunkSize = 32, compared to 11 GFLOPS with desiredChunkSize = 1.
  • For the rajat23 matrix, the new format achieved 5.1 GFLOPS with desiredChunkSize = 1, a 11x speedup over CPU CSR and 6x speedup over CSR on GPU.
  • The new format outperformed CUSPARSE on 1,168 out of 1,600 matrices, with speedups of up to 10x on matrices like raj, rajat23, GHS_indef, and IBM_EDA.
  • The Row-grouped CSR format was nearly twice as fast as the new format on finite difference matrices like norris/torso2 and t2d_q.
  • The Hybrid format was slower than the new format on 1,318 matrices, and CUSPARSE on 1,358 matrices, indicating broad superiority of the new format.
  • Performance varied significantly across matrices, with some matrices showing CPU performance superior by two orders of magnitude, especially small matrices with tens to hundreds of unknowns.

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.