[Paper Review] SMASH: Sparse Matrix Atomic Scratchpad Hashing
SMASH introduces a novel SpGEMM kernel for the PIUMA architecture that uses atomic hashing, tokenization, and memory fragmentation to achieve 9.4× speedup over baseline implementations. By leveraging PIUMA's distributed global address space, DMA engines, and multi-threaded cores, SMASH V3 maximizes DRAM bandwidth utilization (95.9%) and achieves near-100% core utilization through dynamic workload balancing and in-memory hashtable merging of partial products.
Sparse matrices, more specifically SpGEMM kernels, are commonly found in a wide range of applications, spanning graph-based path-finding to machine learning algorithms (e.g., neural networks). A particular challenge in implementing SpGEMM kernels has been the pressure placed on DRAM memory. One approach to tackle this problem is to use an inner product method for the SpGEMM kernel implementation. While the inner product produces fewer intermediate results, it can end up saturating the memory bandwidth, given the high number of redundant fetches of the input matrix elements. Using an outer product-based SpGEMM kernel can reduce redundant fetches, but at the cost of increased overhead due to extra computation and memory accesses for producing/managing partial products. In this thesis, we introduce a novel SpGEMM kernel implementation based on the row-wise product approach. We leverage atomic instructions to merge intermediate partial products as they are generated. The use of atomic instructions eliminates the need to create partial product matrices. To evaluate our row-wise product approach, we map an optimized SpGEMM kernel to a custom accelerator designed to accelerate graph-based applications. The targeted accelerator is an experimental system named PIUMA, being developed by Intel. PIUMA provides several attractive features, including fast context switching, user-configurable caches, globally addressable memory, non-coherent caches, and asynchronous pipelines. We tailor our SpGEMM kernel to exploit many of the features of the PIUMA fabric. This thesis compares our SpGEMM implementation against prior solutions, all mapped to the PIUMA framework. We briefly describe some of the PIUMA architecture features and then delve into the details of our optimized SpGEMM kernel. Our SpGEMM kernel can achieve 9.4x speedup as compared to competing approaches.
Motivation & Objective
- Address the performance bottleneck of SpGEMM on general-purpose architectures due to irregular memory access and workload imbalance.
- Optimize SpGEMM kernel mapping on the domain-specific PIUMA architecture to exploit its unique features like DGAS, DMA engines, and multi-threaded cores.
- Eliminate redundant DRAM accesses caused by intermediate partial product matrices in row-wise SpGEMM approaches.
- Achieve high hardware utilization by balancing dynamic workloads across threads and minimizing idle cycles.
- Explore the feasibility of in-memory hashtable-based merging of partial products to avoid on-chip scratchpad limitations and improve data reuse.
Proposed method
- Implement SMASH V1 using atomic hashing to directly store partial products in a global hashtable, avoiding intermediate matrix storage and redundant DRAM reads.
- Introduce SMASH V2 with tokenization to balance workload by dynamically allocating work based on estimated FLOPs per row, improving thread utilization.
- Apply SMASH V3 with memory fragmentation and a producer-consumer model to reduce memory access overhead and improve data locality.
- Leverage PIUMA’s DMA engines to offload data movement from compute cores, freeing MTCs for computation and reducing instruction cycle overhead.
- Store the hashtable in DRAM instead of on-chip SPAD to reduce on-chip memory pressure and enable larger-scale sparse matrix operations.
- Use a combination of high-order and low-order bit hashing for collision resolution, with dynamic load balancing to mitigate hotspot issues.
Experimental results
Research questions
- RQ1How can SpGEMM kernels be optimized to achieve near-saturation of DRAM bandwidth on domain-specific accelerators?
- RQ2What role does dynamic workload balancing play in improving multi-threaded core utilization in irregular SpGEMM workloads?
- RQ3Can in-memory hashtable merging eliminate the need for intermediate partial product matrices and reduce redundant memory accesses?
- RQ4How do architectural features like DGAS, DMA engines, and networked instructions impact SpGEMM performance on PIUMA?
- RQ5What are the performance trade-offs of using a DRAM-stored hashtable versus on-chip scratchpad for partial products in SpGEMM kernels?
Key findings
- SMASH V3 achieved a 9.4× speedup over SMASH V1 by combining dynamic load balancing, memory fragmentation, and efficient DMA usage.
- SMASH V3 utilized 95.9% of available DRAM bandwidth, nearly saturating the memory subsystem despite shared access between input data and partial products.
- Instruction throughput increased by 155% in SMASH V3 compared to V1, indicating higher computational efficiency and reduced idle cycles.
- Thread utilization reached nearly 100% in SMASH V3 due to effective workload balancing via the producer-consumer model, significantly outperforming unbalanced V1.
- The use of in-memory hashtables enabled immediate merging of partial products and eliminated the need for intermediate storage, reducing memory footprint and access overhead.
- Despite potential hotspot risks from hashing collisions, the overall performance gains from bandwidth saturation and load balancing outweighed the impact of collision resolution overhead.
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.