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

OpSparse:GPU上稀疏广义矩阵乘法的高度优化框架

OpSparse: a Highly Optimized Framework for Sparse General Matrix Multiplication on GPUs

Zhaoyang Du, Yijin Guan, Tianchan Guan, Dimin Niu, Linyong Huang, Hongzhong Zheng, Yuan Xie

摘要:

稀疏广义矩阵乘法(SpGEMM)在许多实际应用中是一个重要而昂贵的计算原语。由于SpGEMM固有的不规则性及其输入矩阵的多样性,在现代处理器(如GPU)上开发高性能SpGEMM实现具有挑战性。最先进的SpGEMM库(即,$nsparse$和$spECK$)采用若干算法来解决全局负载平衡、局部负载平衡和结果矩阵的分配的挑战。虽然这些库专注于SpGEMM的高级算法设计,但它们忽略了几个低级别的特定于体系结构的优化,这导致其库中的实现效率低下。在本文中,我们将其低效的实现分为七类。基于我们的观察,我们提出了一个高度优化的SpGEMM库称为$OpSparse$。$OpSparse$中的优化包括1)通过提高共享存储器的利用率来优化装仓方法,2)通过减少对散列表的访问来优化散列方法,3)通过设置适当的装仓范围来提高散列方法中的散列冲突率和硬件利用率之间的折衷,4)通过最小化元数据的全局存储器使用来减少全局存储器利用的开销,以及5)通过将全局存储器分配与内核执行重叠来提高执行并行性。在Nvidia Tesla V100 GPU上使用26个常用矩阵进行的性能评估表明,$OpSparse$分别在三个最先进的库($cuSPARSE$、$nsparse$和$spECK$)上实现了高达$27.8\times$、$1.81\times$和$2.04\times$的性能加速。

英文摘要:

Sparse general matrix multiplication (SpGEMM) is an important and expensive computation primitive in many real-world applications. Due to SpGEMM's inherent irregularity and the vast diversity of its input matrices, developing high-performance SpGEMM implementation on modern processors such as GPUs is challenging. The state-of-the-art SpGEMM libraries (i.e., $nsparse$ and $spECK$) adopt several algorithms to tackle the challenges of global load balance, local load balance, and allocation of the result matrix. While these libraries focus on the high-level algorithm design for SpGEMM, they neglect several low-level architecture-specific optimizations, which causes inefficient implementations in their libraries. In this paper, we classify their inefficient implementations into seven categories. Based on our observations, we propose a highly optimized SpGEMM library called $OpSparse$. The optimizations in $OpSparse$ include 1) optimizing the binning method by improving the utilization of the shared memory, 2) optimizing the hashing method by reducing the access to the hash table, 3) improving the trade-off between hash collision rate and hardware utilization in the hashing method by setting appropriate binning ranges, 4) reducing the overheads of global memory utilization by minimizing the global memory usage of the metadata, and 5) improving the execution parallelism by overlapping global memory allocation with kernel execution. Performance evaluations with 26 commonly used matrices on an Nvidia Tesla V100 GPU show that $OpSparse$ achieves up to $27.8\times$, $1.81\times$, and $2.04\times$ performance speedup over three state-of-the-art libraries: $cuSPARSE$, $nsparse$, and $spECK$, respectively.

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

↑