Introduction
Sparse-sparse matrix multiplication (SpGEMM) is a critical computational kernel used across diverse scientific domains, including graph analytics, bioinformatics, and climate modeling. In distributed-memory environments, the performance of SpGEMM is primarily limited by communication overhead rather than computational throughput. Traditional 2D and 3D partitioning schemes, while robust, often suffer from being "sparsity-oblivious," moving data based on fixed grid layouts rather than the actual distribution of non-zero elements. This paper presents a novel 1D distributed-memory algorithm that leverages sparsity-awareness and modern networking primitives to significantly reduce communication costs.
Methodology: Sparsity-Aware 1D Partitioning
The proposed algorithm revitalizes 1D partitioning by addressing its historical weaknesses: high message frequency and data packing overhead. The approach rests on three technical pillars:
- MPI RDMA (Remote Direct Memory Access): By utilizing
MPI_Get, the algorithm allows processors to fetch data directly from the memory of remote nodes. This one-sided communication bypasses the need for the CPU to manually pack and unpack buffers, eliminating a significant source of latency. - Block Fetching Strategy: To mitigate the overhead of many small messages, the algorithm employs a block fetching mechanism. Instead of requesting individual columns, processors fetch contiguous blocks of data. If a processor requires at least one column within a block to complete its local computation, the entire block is retrieved, balancing the benefits of sparsity-awareness with network efficiency.
- Structure-Preserving Partitioning: Unlike 2D algorithms that often rely on random permutation to balance load, this 1D approach benefits from the natural clustering of non-zeros. Tools like METIS and ParMETIS are used to organize the matrix, ensuring that communication is minimized by keeping related data on the same or nearby processors.
Experimental Evaluation
The algorithm was evaluated on the NERSC Perlmutter supercomputer using a variety of real-world datasets, including fluid dynamics (stokes), bioinformatics (eukarya), and engineering (hv15r) matrices. The tests focused on comparing the sparsity-aware 1D implementation against traditional sparsity-oblivious approaches and state-of-the-art 2D/3D libraries like CombBLAS.
Results and Discussion
The experimental results demonstrate that sparsity-awareness provides a transformative advantage in communication efficiency. For the hv15r dataset, the algorithm achieved a 96% reduction in communication volume compared to a randomly permuted (sparsity-oblivious) baseline. This reduction translated directly into performance gains, with a 5.73x speedup observed for matrix squaring operations.
Furthermore, the algorithm exhibited strong scaling, maintaining performance improvements as the system scaled up to 16,384 processor cores. While the algorithm is most effective on matrices with inherent structural clusters, it remains competitive even in less ideal scenarios, outperforming 2D and 3D implementations in several key configurations. The integration of RDMA and block fetching effectively resolves the "fine-grained communication" problem that previously hindered 1D SpGEMM.
Conclusion
By combining one-sided RDMA communication with a sparsity-aware block fetching strategy, this 1D SpGEMM algorithm offers a highly efficient alternative to traditional partitioning schemes. It demonstrates that preserving and exploiting the natural structure of sparse matrices is key to scaling fundamental algebraic operations on modern supercomputers. Future work will focus on optimizing block size parameters and integrating this approach into broader multi-stage solvers, such as Algebraic Multigrid (AMG) methods.
Summary updated