RDMA-Based Algorithms for Sparse Matrix Multiplication on GPUs

Benjamin Brock, Aydin Buluç, Katherine A. Yelick

TL;DR

This paper introduces a suite of asynchronous, RDMA-based algorithms for distributed sparse matrix multiplication (SpMM and SpGEMM) on GPUs. By leveraging one-sided communication via NVSHMEM, the authors bypass the synchronization bottlenecks of traditional bulk-synchronous methods, achieving superior scaling and enabling efficient dynamic work stealing for imbalanced datasets.

What Problem Does This Paper Address?

Sparse matrix multiplication is a fundamental building block for graph neural networks (GNNs), genomics, and large-scale simulations. However, performing these operations across multiple GPUs in a distributed system is notoriously difficult.

The standard approach is "bulk-synchronous," where every processor performs a bit of work and then waits at a "barrier" for everyone else to finish before moving to the next step. Because sparse data is inherently "lumpy"—some parts of a matrix are much denser than others—this leads to massive load imbalance. If one GPU is stuck processing a dense cluster, every other GPU in the cluster sits idle. While researchers often try to fix this by randomly shuffling (permuting) the data, that process is expensive and often destroys the "locality" that makes local computations fast in the first place.

Methods

The authors move away from the "wait-for-everyone" model toward an asynchronous RDMA (Remote Direct Memory Access) approach.

  • One-Sided Communication: Using the NVSHMEM library, a GPU can directly "get" a tile of data from a remote GPU’s memory or "put" a result into it without the remote GPU needing to pause its own work to acknowledge the message.
  • Asynchronous Algorithms: They implemented several variants, including "Stationary C" (where the processor owning a piece of the output matrix pulls the necessary inputs) and "Stationary A/B" (where owners of input tiles push partial results to a remote queue).
  • Smart Optimizations: To keep the "pipes" full, they use non-blocking fetches (prefetching the next tile while calculating the current one) and "iteration offsets." The latter staggers which GPUs are requesting which tiles, preventing a "thundering herd" effect where every GPU tries to grab data from the same node simultaneously.
  • Dynamic Work Stealing: Because the system is asynchronous, they implemented a lightweight reservation system. If a GPU finishes its assigned tiles early, it can "steal" work from an overburdened neighbor, ensuring no hardware stays idle.

Datasets

The researchers evaluated their work using a diverse set of real-world sparse matrices from the SuiteSparse and SNAP collections, including:

  • Social/Graph Data: Reddit, Amazon Large, Friendster, and com-Orkut.
  • Scientific/Structural: Mouse Gene, ldoor (structural engineering), and nlpkkt160 (nonlinear programming).
  • Synthetic: R-MAT model-generated matrices used to simulate specific load imbalance scenarios.

Key Insights and Ideas

  • The Synchronization Tax: The paper demonstrates that even a modest 20% end-to-end load imbalance can be amplified to a 2.3x slowdown when forced through the synchronization points of traditional algorithms.
  • Inter-node Roofline Model: The authors adapted the classic "Roofline Model" (usually used for single-chip performance) to distributed systems. This allows them to predict whether a matrix operation is limited by the GPU's compute power or the network's injection bandwidth.
  • Locality-Aware Stealing is Key: Randomly stealing work is often too slow because the "thief" has to fetch all the data from scratch. The authors found that "locality-aware" stealing—where a GPU only steals work related to data it already owns—is far more effective.

Key Results

  • Outperforming the Gold Standard: The RDMA-based SpMM consistently outperformed the bulk-synchronous SUMMA implementation (using CUDA-aware MPI). The advantage was most pronounced when the dense matrix was "skinny" (fewer columns), a common scenario in GNNs where communication overhead usually kills performance.
  • Scaling to the Summit: The algorithms showed strong scaling up to 384 GPUs on the Summit supercomputer.
  • Handling Imbalance: For highly irregular matrices like com-Orkut and Friendster, the locality-aware work-stealing algorithm significantly reduced the time lost to idle processors compared to static assignments.

Limitations and Future Work

  • Local Kernel Bottlenecks: For SpGEMM (sparse times sparse), the performance was often limited by the local cuSPARSE library's compute speed rather than the network. This suggests that while the communication is now efficient, the local math kernels on the GPU still have room for optimization.
  • Memory Constraints: RDMA requires "pinning" memory, which can be restrictive on systems where GPU memory is already at a premium.
  • Future Directions: The authors suggest that these asynchronous patterns could be integrated into higher-level graph frameworks or extended to more complex 3D tiling strategies to further reduce communication volume.

Summary updated

BibTeX
@inproceedings{brock2024rdma,
  author = {Benjamin Brock and Aydin Buluç and Katherine A. Yelick},
  title = {{RDMA-Based Algorithms for Sparse Matrix Multiplication on GPUs}},
  booktitle = {ICS},
  year = {2024},
  doi = {10.1145/3650200.3656623},
}
Figure