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

Energon:使用动态稀疏注意力实现Transformers的有效加速

Energon: Towards Efficient Acceleration of Transformers Using Dynamic Sparse Attention

Peking University(北京大学);Alibaba Inc.(阿里巴巴公司)

Zhe Zhou, Junlin Liu, Zhenyu Gu, Guangyu Sun

摘要:

近年来,Transformer模型已经彻底改变了自然语言处理(NLP),并在计算机视觉(CV)任务中表现出良好的性能。尽管它们有效,但由于复杂的数据移动和二次计算复杂性,Transformers的注意力操作很难加速,从而限制了资源受限的边缘计算平台上的实时推理。为了应对这一挑战,我们提出了Energon,这是一种算法架构协同设计方法,可以使用动态稀疏注意力加速各种Transformers。注意结果只依赖于少数几个重要的查询密钥对的观察,我们提出了一个混合精度多轮过滤(MP-MRF)算法,在运行时动态识别这样的对。我们在每个过滤轮中采用低位宽,并且在注意阶段仅使用高精度张量来降低整体复杂度。通过这种方式,我们显着降低计算成本,精度损失可以忽略不计。为了使这种算法具有更低的延迟和更好的能源效率,我们还提出了一个Energon协处理器架构。精心设计的管道和专门的优化共同提高了性能并降低了功耗。在NLP和CV基准测试上进行的大量实验表明,与英特尔至强5220 CPU和NVIDIA V100 GPU相比,Energon实现了$168\times$和$8.7\times$地理平均加速,并降低了高达$10^4\times$和$10^3\times$的能耗。与最先进的注意力加速器SpAtten和$A^3$相比,Energon还实现了$1.7\times, 1.25\times$加速和$1.6 \times, 1.5\times $更高的能效。

英文摘要:

In recent years, transformer models have revolutionized Natural Language Processing (NLP) and shown promising performance on Computer Vision (CV) tasks. Despite their effectiveness, transformers' attention operations are hard to accelerate due to the complicated data movement and quadratic computational complexity, prohibiting the real-time inference on resource-constrained edge-computing platforms. To tackle this challenge, we propose Energon, an algorithm-architecture co-design approach that accelerates various transformers using dynamic sparse attention. With the observation that attention results only depend on a few important query-key pairs, we propose a Mix-Precision Multi-Round Filtering (MP-MRF) algorithm to dynamically identify such pairs at runtime. We adopt low bitwidth in each filtering round and only use high-precision tensors in the attention stage to reduce overall complexity. By this means, we significantly mitigate the computational cost with negligible accuracy loss. To enable such an algorithm with lower latency and better energy efficiency, we also propose an Energon co-processor architecture. Elaborated pipelines and specialized optimizations jointly boost the performance and reduce power consumption. Extensive experiments on both NLP and CV benchmarks demonstrate that Energon achieves $168\times$ and $8.7\times$ geo-mean speedup and up to $10^4\times$ and $10^3\times$ energy reduction compared with Intel Xeon 5220 CPU and NVIDIA V100 GPU. Compared to state-of-the-art attention accelerators SpAtten and $A^3$, Energon also achieves $1.7\times, 1.25\times$ speedup and $1.6 \times, 1.5\times $ higher energy efficiency.

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

↑