In computational science and data analytics, many workloads involve irregular and sparse computations that are inherently difficult to optimize for modern hardware. A key kernel is Sparse General Matrix-Matrix Multiplication (SpGEMM), which underpins simulations, graph analytics, and machine learning applications. SpGEMM exhibits irregular memory access patterns and workload imbalance, making it challenging to achieve high performance on GPUs. Current GPU SpGEMM solutions typically rely on a two-pass workflow to address load imbalance and reduce memory access. The symbolic pass, which determines the number of output elements per row, accounts for roughly 28% of the total runtime on average. In this work, we question the necessity of exact symbolic computation and introduce an estimation-based SpGEMM workflow. Our approach replaces the costly symbolic step with lightweight HyperLogLog estimators, combined with an analysis strategy that dynamically selects the optimal workflow and guides accumulator configuration. In addition, we introduce a hybrid accumulator design, including a novel hash-based accumulator that leverages both shared and global memory. Our approach consistently outperforms leading GPU SpGEMM implementations across a wide range of both square and rectangular matrices, achieving speedups of 1.4x-2.8x on NVIDIA A100 and H100 architectures.
翻译:在计算科学与数据分析领域,许多工作负载涉及不规则且稀疏的计算,这些计算本质上难以在现代硬件上优化。关键内核之一是稀疏通用矩阵-矩阵乘法(SpGEMM),它支撑着模拟、图分析和机器学习应用。SpGEMM具有不规则的内存访问模式和工作负载不平衡特征,这使得在GPU上实现高性能面临挑战。当前的GPU SpGEMM解决方案通常依赖两阶段工作流来解决负载不平衡并减少内存访问。符号阶段(用于确定每行输出元素数量)平均约占总体运行时间的28%。在本工作中,我们质疑精确符号计算的必要性,并提出了一种基于估计的SpGEMM工作流。我们的方法用轻量级HyperLogLog估计器替代昂贵的符号步骤,结合动态选择最优工作流并指导累加器配置的分析策略。此外,我们引入了一种混合累加器设计,包括一种利用共享内存和全局内存的新型哈希累加器。我们的方法在正方形和长方形矩阵的广泛测试中持续优于领先的GPU SpGEMM实现,在NVIDIA A100和H100架构上实现了1.4倍至2.8倍的加速。