arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2007.03179cs.DC
收藏

GE-SpMM:通用稀疏矩阵-图神经网络的GPUs矩阵乘法

GE-SpMM: General-purpose Sparse Matrix-Matrix Multiplication on GPUs for Graph Neural Networks

Guyue Huang, Guohao Dai, Yu Wang, Huazhong Yang

摘要:

图神经网络(GNN)在各个领域都取得了显著的进步。稀疏矩阵-矩阵乘法(SpMM)是GNN中的基本运算符,它执行稀疏矩阵和稠密矩阵之间的乘法。在GPU等并行硬件上加速SpMM可能面临以下挑战:从GNN应用程序的角度来看,需要考虑兼容性。一般的GNN算法需要类似于SpMM的操作(例如,池化),这在当前高性能GPU库中不支持(例如,Nvidia cuSPARSE)。此外,在以前的实现中的复杂的预处理将导致沉重的数据格式转换开销在GNN框架。从GPU硬件的角度来看,GPU上的SpMV(稀疏矩阵向量)设计中的优化并不适用于SpMM。SpMM暴露了密集输出矩阵中的列并行性,但是从SpMV直接泛化导致对全局内存中的稀疏矩阵的低效的、未合并的访问。稀疏行数据可以在GPU线程之间重用,这在从SpMV继承的SpMM设计中是不可能的。为了应对这些挑战,我们提出了GE-SpMM。GE-SpMM对以最常见的压缩稀疏行(CSR)格式表示的稀疏矩阵执行类似于SpMM的操作,因此它可以嵌入到GNN框架中,无需预处理开销,并支持通用GNN算法。我们引入了合并行缓存方法来并行处理列,并确保合并访问稀疏矩阵数据。我们还提出了粗粒度的Warp合并,以减少GPU warp之间的冗余数据加载。在真实世界的图数据集上的实验表明,GE-SpMM比Nvidia cuSPARSE和GraphBLAST的加速比分别高达1.41倍和1.81倍。我们还将GE-SpMM嵌入到GNN框架中,并在流行的GNN模型(如GCN和GraphSAGE)上获得高达3.67倍的加速比。

英文摘要:

Graph Neural Networks (GNNs) have achieved significant improvements in various domains. Sparse Matrix-Matrix multiplication (SpMM) is a fundamental operator in GNNs, which performs a multiplication between a sparse matrix and a dense matrix. Accelerating SpMM on parallel hardware like GPUs can face the following challenges: From the GNN application perspective, the compatibility needs to be considered. General GNN algorithms require SpMM-like operations (e.g., pooling) between matrices, which are not supported in current high-performance GPU libraries (e.g., Nvidia cuSPARSE). Moreover, the sophisticated preprocessing in previous implementations will lead to heavy data format conversion overheads in GNN frameworks. From the GPU hardware perspective, optimizations in SpMV (Sparse Matrix-Vector) designs on GPUs do not apply well to SpMM. SpMM exposes the column-wise parallelism in the dense output matrix, but straightforward generalization from SpMV leads to inefficient, uncoalesced access to sparse matrix in global memory. The sparse row data can be reused among GPU threads, which is neither possible in SpMM designs inherited from SpMV. To tackle these challenges, we propose GE-SpMM. GE-SpMM performs SpMM-like operation on sparse matrices represented in the most common Compressed Sparse Row (CSR) format, so it can be embedded in GNN frameworks with no preprocessing overheads and support general GNN algorithms. We introduce the Coalesced Row Caching method to process columns in parallel and ensure coalesced access to sparse matrix data. We also present the Coarse-grained Warp Merging to reduce redundant data loading among GPU warps. Experiments on a real-world graph dataset show that GE-SpMM achieves up to 1.41X speedup over Nvidia cuSPARSE and up to 1.81X over GraphBLAST. We also embed GE-SpMM in GNN frameworks and get up to 3.67X speedup over popular GNN models like GCN and GraphSAGE.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑