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

基于动态稀疏注意的Transformer加速算法

Transformer Acceleration with Dynamic Sparse Attention

University of California, Santa Barbara(加州大学圣巴巴拉分校)

Liu Liu, Zheng Qu, Zhaodong Chen, Yufei Ding, Yuan Xie

摘要:

Transformers是NLP应用的主流,在其他领域(如计算机视觉)也越来越受欢迎。尽管改进了模型质量,但巨大的计算成本使得Transformers难以部署,特别是当新兴应用中的序列长度很大时。处理注意力机制作为Transformer的重要组成部分,由于其二次复杂度,成为其执行的瓶颈。现有技术探索注意力中的稀疏模式以支持长序列建模,但是这些工作是关于静态或固定模式的。我们证明了稀疏模式是动态的,取决于输入序列。因此,我们提出了动态稀疏注意力(DSA),可以有效地利用动态稀疏的Transformers的注意。与其他方法相比,我们的方法可以实现更好的平衡精度和模型的复杂性。展望未来,我们将确定挑战并提供解决方案,以便在现有硬件(GPU)和专用硬件上实现DSA,从而实现Transformer执行的实际加速和效率改进。

英文摘要:

Transformers are the mainstream of NLP applications and are becoming increasingly popular in other domains such as Computer Vision. Despite the improvements in model quality, the enormous computation costs make Transformers difficult at deployment, especially when the sequence length is large in emerging applications. Processing attention mechanism as the essential component of Transformer is the bottleneck of execution due to the quadratic complexity. Prior art explores sparse patterns in attention to support long sequence modeling, but those pieces of work are on static or fixed patterns. We demonstrate that the sparse patterns are dynamic, depending on input sequences. Thus, we propose the Dynamic Sparse Attention (DSA) that can efficiently exploit the dynamic sparsity in the attention of Transformers. Compared with other methods, our approach can achieve better trade-offs between accuracy and model complexity. Moving forward, we identify challenges and provide solutions to implement DSA on existing hardware (GPUs) and specialized hardware in order to achieve practical speedup and efficiency improvements for Transformer execution.

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

↑