[Paper Review] High-performance sparse matrix-matrix products on Intel KNL and multicore architectures
This paper optimizes sparse matrix-matrix multiplication (SpGEMM) for Intel KNL and multicore systems by addressing memory allocation and thread scheduling bottlenecks in heap- and hash-table-based algorithms. It demonstrates that unsorted output significantly boosts performance, with hash-based SpGEMM outperforming Intel MKL and Kokkos-Kernels across most real-world graph workloads, especially at high compression ratios.
Sparse matrix-matrix multiplication (SpGEMM) is a computational primitive that is widely used in areas ranging from traditional numerical applications to recent big data analysis and machine learning. Although many SpGEMM algorithms have been proposed, hardware specific optimizations for multi- and many-core processors are lacking and a detailed analysis of their performance under various use cases and matrices is not available. We firstly identify and mitigate multiple bottlenecks with memory management and thread scheduling on Intel Xeon Phi (Knights Landing or KNL). Specifically targeting multi- and many-core processors, we develop a hash-table-based algorithm and optimize a heap-based shared-memory SpGEMM algorithm. We examine their performance together with other publicly available codes. Different from the literature, our evaluation also includes use cases that are representative of real graph algorithms, such as multi-source breadth-first search or triangle counting. Our hash-table and heap-based algorithms are showing significant speedups from libraries in the majority of the cases while different algorithms dominate the other scenarios with different matrix size, sparsity, compression factor and operation type. We wrap up in-depth evaluation results and make a recipe to give the best SpGEMM algorithm for target scenario. A critical finding is that hash-table-based SpGEMM gets a significant performance boost if the nonzeros are not required to be sorted within each row of the output matrix.
Motivation & Objective
- To identify and resolve performance bottlenecks in SpGEMM on multicore and Intel KNL architectures, particularly in memory management and thread scheduling.
- To evaluate and optimize existing SpGEMM algorithms—specifically heap-based and hash-table-based—on modern shared-memory platforms.
- To provide a practical, data-driven recipe for selecting the best SpGEMM algorithm based on matrix characteristics such as size, sparsity, compression ratio, and input/output sorting.
- To extend performance evaluation beyond synthetic matrices to real graph workloads, including multi-source BFS and triangle counting.
- To demonstrate that unsorted output can yield significant performance gains across multiple SpGEMM implementations.
Proposed method
- Developed a hash-table-based SpGEMM algorithm optimized for Intel KNL, reducing memory allocation overhead and improving load balancing across threads.
- Optimized a heap-based shared-memory SpGEMM algorithm by minimizing dynamic memory allocation and tuning thread scheduling for high-thread-count environments.
- Used microbenchmarks to analyze memory access patterns and isolate performance bottlenecks related to MCDRAM usage on KNL, especially under varying matrix densities.
- Evaluated multiple public SpGEMM implementations—including Intel MKL and Kokkos-Kernels—on real and synthetic matrices under diverse workloads.
- Introduced a performance recipe based on compression ratio and sparsity, with separate recommendations for real-world and synthetic data.
Experimental results
Research questions
- RQ1How do memory allocation and thread scheduling impact SpGEMM performance on multicore and Intel KNL architectures?
- RQ2What are the performance characteristics of heap-based and hash-table-based SpGEMM algorithms under real graph workloads such as multi-source BFS and triangle counting?
- RQ3How does MCDRAM utilization vary with matrix density and SpGEMM workload characteristics on KNL?
- RQ4In what scenarios does unsorted output provide a performance advantage over sorted output in SpGEMM?
- RQ5What criteria can guide users in selecting the optimal SpGEMM algorithm for a given matrix type and hardware platform?
Key findings
- The hash-table-based SpGEMM algorithm outperforms Intel MKL and Kokkos-Kernels in the majority of real-world graph workloads, especially at high compression ratios.
- The heap-based SpGEMM algorithm dominates for low-compression-ratio inputs, such as those arising in triangle counting (L×U multiplication), particularly when outputs are unsorted.
- Unsorted output yields significant performance improvements across all SpGEMM implementations, with the largest gains observed in hash-based and heap-based codes.
- MCDRAM provides a substantial performance boost for denser matrices (average nonzeros per row >4), where SpGEMM becomes bandwidth-bound, but offers minimal benefit for sparser matrices.
- For synthetic matrices with uniform sparsity, the hash-based implementation dominates across nearly all configurations, while the heap-based approach performs best for very sparse or uniformly distributed data.
- The performance of SpGEMM on KNL is highly sensitive to matrix characteristics: compression ratio, sparsity, and non-zero pattern dictate algorithm dominance, validating the need for a data-aware algorithm selection strategy.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.