Abstract
Sparse matrix indexing operations—permutation, extraction, and assignment—are fundamental to graph analytics and scientific computing. Traditional distributed-memory libraries often implement these operations as special cases of Sparse Matrix-Matrix Multiplication (SpGEMM), leading to significant communication overhead and load imbalance. This paper introduces HipPerm, HipExtract, and HipAssign, a suite of high-performance algorithms based on a direct "Identify-Exchange-Build" (IEB) strategy. These algorithms achieve up to a 55x speedup over existing libraries like CombBLAS and demonstrate seamless scaling up to 65,536 cores on modern supercomputers.
Introduction
In the realm of large-scale data processing, sparse matrices are ubiquitous. While linear algebraic operations like matrix-vector multiplication are well-optimized, indexing operations—reordering rows (permutation), pulling subgrids (extraction), or updating specific regions (assignment)—frequently suffer from inefficiencies. Many distributed frameworks treat a permutation as $P A Q^T$, where $P$ and $Q$ are permutation matrices. However, because permutation matrices are "hypersparse" (containing only one entry per row/column), general-purpose SpGEMM algorithms waste resources communicating data that never contributes to the final result.
The Identify–Exchange–Build (IEB) Framework
To overcome the limitations of algebraic abstractions, the authors propose the Identify–Exchange–Build (IEB) model. This approach treats the matrix as a collection of coordinates to be moved directly to their target locations, bypassing intermediate matrix construction.
- Identify: Each process examines its local non-zero elements and, using permutation vectors, determines the exact destination process and local indices for each element.
- Exchange: Data is moved across the network using efficient
MPI_Alltoallvcommunication, ensuring only necessary data is transmitted. - Build: Upon receiving data, each process reconstructs its local submatrix in a compressed format.
Technical Innovations
The suite utilizes a 2D data distribution, partitioning matrices across a square grid of $\sqrt{p} \times \sqrt{p}$ processors. This distribution is significantly more scalable than 1D row-blocking for large-scale systems. Furthermore, the algorithms employ synchronization-free multithreading. By using a two-pass approach—counting elements for memory pre-allocation before filling buffers—the system allows multiple CPU threads to operate in parallel without the performance penalties of mutex locks.
Core Operations and Fusion
The suite consists of three primary kernels designed to handle various indexing tasks. A key advantage of the IEB model is the ability to "fuse" these operations. For instance, in dynamic graph applications, a user can simultaneously update a graph (Assign) and rebalance its distribution (Permute) in a single communication step, reducing total execution time by up to 38%.
Experimental Results
The researchers evaluated the suite using 19 diverse matrices from the SuiteSparse Matrix Collection, ranging from social networks (twitter7) to massive biological networks (Metaclust50) and hyperlink graphs with 128 billion non-zeros. Testing was conducted on the Perlmutter (NERSC) and Big Red 200 supercomputers.
- Performance: HipPerm is on average 55x faster than CombBLAS and 5.54x faster than PETSc for random permutations.
- Scalability: The algorithms demonstrated near-linear scaling up to 4,096 MPI processes (65,536 cores).
- Memory Efficiency: By avoiding the memory spikes common in SpGEMM-based methods, the Hip suite successfully processed the Hyperlink dataset, which often causes other libraries to crash.
Conclusion
By moving from mathematical abstractions to a direct data-movement strategy, HipPerm, HipExtract, and HipAssign provide a new standard for sparse matrix indexing in distributed memory. Future work includes the integration of these kernels into the widely used CombBLAS library and extending the IEB patterns to GPU-accelerated clusters to further enhance performance in heterogeneous computing environments.
Summary updated