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

SparkAttention:适用于Volta GPU架构上大型模型的高性能多头注意力机制

SparkAttention: High-Performance Multi-Head Attention for Large Models on Volta GPU Architecture

Youxuan Xu, Tong Wu, Shigang Li, Xueying Wang, Jingjing Wang

AI总结:

针对Volta GPU架构张量核心单元(TCU)计算形状特殊导致MHA加速不足的问题,提出SparkAttention库,通过利用TCU和核融合减少HBM访问与开销,在V100上相比PyTorch平均加速1.80倍(最高2.46倍),提升大型Transformer模型训练效率。

摘要:

Transformer广泛应用于自然语言处理和计算机视觉等多个领域。然而,由于多头注意力(MHA)机制,大型Transformer模型的训练时间颇具挑战性,尤其是随着模型规模增大,训练成本愈发高昂,因此高效利用各类资源进行模型训练至关重要。目前NVIDIA Volta GPU仍被广泛使用,但由于其张量核心单元(TCU)支持的计算形状与其他GPU架构不同,多数研究未聚焦于利用该架构加速Transformer训练。为解决此问题,我们提出SparkAttention——一个旨在加速Volta GPU上MHA训练的加速库,它利用TCU和核融合技术减少高带宽内存(HBM)访问次数与开销。在NVIDIA V100 GPU上的端到端实验结果显示,SparkAttention相比PyTorch平均实现1.80倍(最高2.46倍)的加速。

英文摘要:

Transformer are widely used in various fields such as natural language processing and computer vision. However, the training time for large Transformer models can be challenging due to the Multi-Head Attention (MHA) mechanism. Especially as models become larger, training becomes more costly. So it is crucial to utilize various resources for efficient model training. Currently, NVIDIA Volta GPU is still widely used. However, because the computational shapes supported by Tensor Core Units (TCU) of Volta GPU differ from other GPU architectures, most efforts have not focused on using them to accelerate Transformer training. To address this issue, we propose SparkAttention, an acceleration library designed to speed up MHA training on the Volta GPU. SparkAttention leverages TCU and kernel fusion to reduce the number of high bandwidth memory (HBM) accesses and overhead. Our End-to-End experimental results on an NVIDIA V100 GPU show that SparkAttention achieves on average 1.80$\times$ (up to 2.46$\times$) speedup compared to using PyTorch.

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

↑