NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Distributed-Memory Parallel Algorithms for Sparse Matrix and Sparse Tall-and-Skinny Matrix Multiplication

Isuru Ranawaka, Md Taufique Hussain, Charles Block, Gerasimos Gerogiannis, Josep Torrellas, Ariful Azad

TL;DR

This paper introduces a novel distributed-memory parallel algorithm optimized specifically for Tall-and-Skinny Sparse Matrix-Matrix Multiplication (TS-SpGEMM). By combining a dual-copy matrix distribution strategy, sparsity-aware 2D virtual tiling, and dynamic local/remote computation modes, the algorithm achieves an average 5× speedup over state-of-the-art 2D and 3D SUMMA algorithms and scales efficiently up to 65,536 cores.

What Problem Does This Paper Address?

Sparse matrix-matrix multiplication (SpGEMM) is a foundational workload in scientific computing, graph analytics, and machine learning. While multiplying two square matrices is well-studied, many real-world applications—such as multi-source breadth-first search (BFS), sparse graph embedding, and algebraic multigrid (AMG) solvers—require multiplying a massive square sparse matrix $A$ by a "tall and skinny" sparse matrix $B$ (where the number of columns $d$ is much smaller than the number of rows $n$).

Standard distributed SpGEMM algorithms like Sparse SUMMA partition matrices using 2D grids, which perform poorly in the TS-SpGEMM context because matrix $B$ does not have enough columns to distribute effectively across a large process grid. Conversely, naive 1D partitioning schemes suffer from massive communication overheads or run out of memory when a process encounters a dense row and attempts to fetch too much of matrix $B$ at once. This paper bridges the gap by designing a communication-efficient, memory-bounded distributed algorithm tailored specifically for the unique geometry of TS-SpGEMM.

Methods

The authors build their approach on Gustavson’s row-by-row sparse multiplication algorithm and introduce three key innovations:

  1. Dual-Copy Matrix Distribution: The algorithm utilizes a 1D row partitioning for matrices $A$, $B$, and $C$. Crucially, it also maintains a second copy of matrix $A$ partitioned column-wise ($A^c$). By storing $A^c$, each process can independently determine exactly which rows of its local $B$ matrix are needed by other processes, completely eliminating the communication round typically required to send data requests.
  2. Sparsity-Aware Tiling: To prevent memory exhaustion from dense rows, the algorithm breaks the local 1D submatrices into virtual 2D tiles. Processes perform multiplications tile-by-tile, ensuring that the concurrent memory footprint required to store remote rows of $B$ remains tightly bounded.
  3. Hybrid Computation Modes (Local vs. Remote): For every tile, the algorithm performs a symbolic step to evaluate whether it is cheaper to fetch the required rows of $B$ to compute $C$ locally (local mode), or to ship the tile of $A$ to the remote process holding $B$ to compute partial results of $C$ there (remote mode).

The distribution strategy and the tile mode selection mechanism are illustrated in the paper's architectural overviews:

Matrix distribution strategy using row-partitioned $A$ and column-partitioned $A^c$
Tile mode selection deciding between local and remote computation based on communication costs

Datasets

The algorithm was evaluated using several prominent real-world graph datasets from the SNAP and SuiteSparse Matrix Collections, alongside synthetic Erdős-Rényi (ER) random matrices:

  • Web and Social Graphs: GAP-web, uk-2002, it-2004, arabic-2005, flicker.
  • Citation Networks: pubMed, cora, citeseer.
  • Matrix B Variations: The tall-and-skinny matrix $B$ was generated synthetically with varying dimensions ($d \in [4, 16384]$) and sparsity levels ranging from 80% to 99%.

Key Insights and Ideas

  • Trading Memory for Communication: Storing a second copy of matrix $A$ ($A^c$) doubles its memory footprint but pays massive dividends by eliminating request-phase communication latency. In large-scale distributed systems, this is a highly favorable trade-off.
  • Communication Inversion: The realization that it is sometimes cheaper to send the computation to the data (remote mode) rather than pulling the data to the computation (local mode) allows the algorithm to adapt dynamically to highly skewed, irregular graph topologies.
  • Cache-Friendly Accumulators: The authors found that for small column dimensions ($d \le 1024$), a dense Sparse Accumulator (SPA) outperforms sophisticated hash-based accumulators because the dense vector fits entirely within the CPU's lowest-level cache.

Key Results

  • Performance Gains: The proposed TS-SpGEMM algorithm achieved an average 5× speedup over 2D and 3D Sparse SUMMA (implemented in CombBLAS) and the 1D distributed Gustavson implementation in PETSc.
  • Scalability: The algorithm demonstrated near-linear strong scaling up to 512 nodes (65,536 cores) on the NERSC Perlmutter supercomputer.
  • Application Impact: When integrated into a multi-source BFS pipeline, TS-SpGEMM delivered up to a 10× speedup in peak iterations and a 5× average speedup over SUMMA-based alternatives.
  • SpGEMM vs. SpMM Boundary: The authors established that TS-SpGEMM consistently outperforms dense tall-and-skinny matrix multiplication (SpMM) methods as long as the matrix $B$ is at least 50% sparse.

Limitations and Future Work

  • Memory Footprint: The primary drawback is the requirement to store two copies of the square matrix $A$. While acceptable for many systems, it can restrict execution on memory-constrained hardware.
  • Structural Load Imbalance: Because the algorithm relies on 1D partitioning, scale-free graphs with highly skewed degree distributions (i.e., a few massive hub nodes creating extremely dense rows) can still cause computational load imbalances across processes.

Future work includes adapting these tiling and hybrid-mode techniques to broader distributed SpMM frameworks and fused matrix multiplication kernels.

Summary updated

BibTeX
@inproceedings{ranawaka2024distributed,
  author = {Isuru Ranawaka and Md Taufique Hussain and Charles Block and Gerasimos Gerogiannis and Josep Torrellas and Ariful Azad},
  title = {{Distributed-Memory Parallel Algorithms for Sparse Matrix and Sparse Tall-and-Skinny Matrix Multiplication}},
  booktitle = {SC},
  year = {2024},
}
Figure