arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2107.06419cs.LGcs.AR
收藏

FLAT:一种缓解注意力瓶颈的优化数据流

FLAT: An Optimized Dataflow for Mitigating Attention Bottlenecks

Georgia Institute of Technology(佐治亚理工学院);Microsoft(微软);Google(谷歌);Google Research, Brain Team(谷歌研究院大脑团队)

Sheng-Chun Kao, Suvinay Subramanian, Gaurav Agrawal, Amir Yazdanbakhsh, Tushar Krishna

摘要:

注意力机制主要用于捕捉单词之间的成对相关性,已成为机器学习的支柱,并从自然语言处理扩展到其他领域。这种自适应的增长是以过大的存储器需求和计算复杂性为代价的,特别是在输入元素数量更大的情况下。这种限制是由于固有的有限数据重用机会和内存占用的二次增长,导致严重的内存限制和输入元素的有限可扩展性。这项工作解决了这些挑战,设计了一个定制的低优化,称为FLAT,注意力机制,而不改变其功能。这个神经网络通过一个独特的融合机制来处理代价高昂的注意力操作,将记忆足迹的二次增长转变为仅仅是线性增长。为了实现这种定制机制的全部潜力,我们提出了一种平铺的方法,以提高跨注意力操作的数据重用。我们的方法既减轻了片外带宽瓶颈,以及减少了片上存储器的要求。FLAT提供1.94倍(1.76倍)的加速和49%和(42%)的能源节省相比,最先进的边缘(云)加速器没有定制的优化。当片上资源稀缺(20 KB-200 KB)时,FLAT在各种传统的基于注意力的模型中平均产生1.5倍的端到端延迟减少,输入序列长度从512-token到64 K-token。我们的评估表明,应用于注意力操作的最先进的DNN算法达到了512个元素以上输入的效率极限。相比之下,FLAT为多达64 K个元件的输入解锁Transformer模型

英文摘要:

Attention mechanisms, primarily designed to capture pairwise correlations between words, have become the backbone of machine learning, expanding beyond natural language processing into other domains. This growth in adaptation comes at the cost of prohibitively large memory requirements and computational complexity, especially at higher number of input elements. This limitation is due to inherently limited data reuse opportunities and quadratic growth in memory footprints, leading to severe memory-boundedness and limited scalability of input elements. This work addresses these challenges by devising a tailored dataflow optimization, called FLAT, for attention mechanisms without altering their functionality. This dataflow processes costly attention operations through a unique fusion mechanism, transforming the memory footprint quadratic growth to merely a linear one. To realize the full potential of this bespoke mechanism, we propose a tiling approach to enhance the data reuse across attention operations. Our method both mitigates the off-chip bandwidth bottleneck as well as reduces the on-chip memory requirement. FLAT delivers 1.94x (1.76x) speedup and 49% and (42%) of energy savings compared to the state-of-the-art Edge (Cloud) accelerators with no customized dataflow optimization. When on-chip resources are scarce (20 KB-200 KB), FLAT yields, on average, 1.5x end-to-end latency reduction across a diverse range of conventional attention-based models with input sequence lengths ranging from 512-token to 64K-token. Our evaluations demonstrate that state-of-the-art DNN dataflow applied to attention operations reach the efficiency limit for inputs above 512 elements. In contrast, FLAT unblocks transformer models for inputs with up to 64K elements

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

↑