基于GPU的SpMM算法对输入动态的启发式适应性
Heuristic Adaptability to Input Dynamics for SpMM on GPUs
摘要:
稀疏矩阵-矩阵乘法(Sparse Matrix-Matrix Multiplication,SpMM)已经成为各个领域的基本组成部分。许多先前的研究利用GPU进行SpMM加速,因为GPU提供高带宽和并行性。我们指出,静态设计并不总是提高SpMM在不同输入数据上的性能(例如,>85\%的性能损失与一个单一的算法)。本文从一个新的角度考虑了输入动态的挑战,但仍有以下问题有待解决:(1)考虑稀疏性的正交设计原则。对于这样一个稀疏问题的正交设计原则应该被提取出来形成不同的算法,并进一步用于性能调整。(2)算法空间中的非平凡实现。结合正交设计原则来创建新的算法需要应对新的挑战,如线程竞争处理。(3)对输入动态的启发式适应性。需要启发式适应性来针对输入动态动态地优化代码。为了解决这些挑战,我们首先提出了一种新的三环模型来提取正交设计原则的SpMM在GPU上。该模型不仅涵盖了以前的SpMM设计,而且还提出了以前研究中没有的新设计。我们提出的技术,如条件减少实现算法在以前的研究中丢失。我们进一步提出了DA-SpMM,一个数据感知的启发式GPU内核的SpMM。DA-SpMM考虑输入动态自适应优化代码。大量的实验结果表明,DA-SpMM与最好的NVIDIA cuSPARSE算法相比,平均获得了1.26倍~ 1.37倍的加速比,对于像图神经网络这样的应用,端到端加速比高达5.59倍。
英文摘要:
Sparse Matrix-Matrix Multiplication (SpMM) has served as fundamental components in various domains. Many previous studies exploit GPUs for SpMM acceleration because GPUs provide high bandwidth and parallelism. We point out that a static design does not always improve the performance of SpMM on different input data (e.g., >85\% performance loss with a single algorithm). In this paper, we consider the challenge of input dynamics from a novel auto-tuning perspective, while following issues remain to be solved: (1) Orthogonal design principles considering sparsity. Orthogonal design principles for such a sparse problem should be extracted to form different algorithms, and further used for performance tuning. (2) Nontrivial implementations in the algorithm space. Combining orthogonal design principles to create new algorithms needs to tackle with new challenges like thread race handling. (3) Heuristic adaptability to input dynamics. The heuristic adaptability is required to dynamically optimize code for input dynamics. To tackle these challenges, we first propose a novel three-loop model to extract orthogonal design principles for SpMM on GPUs. The model not only covers previous SpMM designs, but also comes up with new designs absent from previous studies. We propose techniques like conditional reduction to implement algorithms missing in previous studies. We further propose DA-SpMM, a Data-Aware heuristic GPU kernel for SpMM. DA-SpMM adaptively optimizes code considering input dynamics. Extensive experimental results show that, DA-SpMM achieves 1.26x~1.37x speedup compared with the best NVIDIA cuSPARSE algorithm on average, and brings up to 5.59x end-to-end speedup to applications like Graph Neural Networks.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。