[Paper Review] Accelerating SpMM Kernel with Cache-First Edge Sampling for Graph Neural Networks
This paper proposes ES-SpMM, a cache-first edge sampling mechanism and codesigned SpMM kernel that accelerates GNN inference by sampling edges to fit the graph into GPU shared memory, reducing computation and improving cache locality. It achieves up to 4.35x speedup over cuSPARSE with no accuracy loss and 45.3x speedup with less than 1% accuracy loss on standard GNN benchmarks.
Graph neural networks (GNNs), an emerging deep learning model class, can extract meaningful representations from highly expressive graph-structured data and are therefore gaining popularity for wider ranges of applications. However, current GNNs suffer from the poor performance of their sparse-dense matrix multiplication (SpMM) operator, even when using powerful GPUs. Our analysis shows that 95% of the inference time could be spent on SpMM when running popular GNN models on NVIDIA's advanced V100 GPU. Such SpMM performance bottleneck hinders GNNs' applicability to large-scale problems or the development of more sophisticated GNN models. To address this inference time bottleneck, we introduce ES-SpMM, a cache-first edge sampling mechanism and codesigned SpMM kernel. ES-SpMM uses edge sampling to downsize the graph to fit into GPU's shared memory. It thus reduces the computation cost and improves SpMM's cache locality. To evaluate ES-SpMM's performance, we integrated it with a popular GNN framework, DGL, and tested it using representative GNN models and datasets. Our results show that ES-SpMM outperforms the highly optimized cuSPARSE SpMM kernel by up to 4.35x with no accuracy loss and by 45.3x with less than a 1% accuracy loss.
Motivation & Objective
- To address the performance bottleneck in GNN inference caused by slow sparse-dense matrix multiplication (SpMM) on GPUs.
- To reduce SpMM computation time and improve cache locality without sacrificing model accuracy.
- To eliminate preprocessing overheads by integrating edge sampling directly into the SpMM kernel.
- To enable seamless integration with existing GNN frameworks like DGL without modifying user code.
- To provide a general-purpose, high-performance SpMM solution applicable to diverse GNN workloads.
Proposed method
- Introduces an in-kernel edge sampling mechanism that performs sampling on the GPU, eliminating CPU preprocessing and leveraging GPU parallelism.
- Employs a cache-first design that targets shared memory size as the sampling limit, ensuring the sampled graph fits entirely in shared memory.
- Uses coalesced global memory access patterns to efficiently load sampled data into shared memory.
- Employs two lightweight sampling strategies—Bucket and FastRand—that balance speed and accuracy based on dataset characteristics.
- Supports standard CSR format to avoid format conversion overhead and enables drop-in replacement in DGL without user code changes.
- Codesigns the sampling logic with the SpMM kernel to coherently optimize for memory access and computation reduction.
Experimental results
Research questions
- RQ1Can edge sampling be integrated into the SpMM kernel to eliminate preprocessing overhead and accelerate inference?
- RQ2Can a cache-first sampling strategy that fits the sampled graph into shared memory significantly improve SpMM performance?
- RQ3To what extent can SpMM performance be accelerated with minimal accuracy loss using in-kernel edge sampling?
- RQ4How does ES-SpMM compare to highly optimized SpMM kernels like cuSPARSE in terms of speed and accuracy?
- RQ5Can ES-SpMM be seamlessly integrated into existing GNN frameworks without modifying user-level code?
Key findings
- ES-SpMM achieves up to 4.35x speedup over the highly optimized cuSPARSE SpMM kernel with no accuracy loss on standard GNN benchmarks.
- With less than a 1% accuracy loss, ES-SpMM achieves a 45.3x speedup over cuSPARSE, demonstrating exceptional performance-accuracy trade-offs.
- The majority of inference time (up to 95%) in standard GCN models is spent on SpMM, confirming SpMM as the primary performance bottleneck.
- The in-kernel sampling mechanism reduces overhead compared to CPU-based preprocessing, enabling faster and more efficient sampling.
- ES-SpMM maintains high performance across multiple GNN models (GCN and GraphSAGE) and datasets (Reddit, Cora, PubMed, Ppi).
- The integration with DGL is transparent, requiring no changes to user-level code, and supports standard CSR format without format conversion.
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.