arXiv:2409.14023cs.ARcs.AI2024-09被引 6

FAMOUS在FPGA上高效加速Transformer的注意力计算,性能超越主流硬件。

FAMOUS: Flexible Accelerator for the Attention Mechanism of Transformer on UltraScale+ FPGAs

  • 通过分块矩阵优化资源分配,提升FPGA算力与内存利用率
  • 在U55C上实现328 GOPS吞吐量,支持8个并行注意力头、768维嵌入
  • 适合需要低延迟高吞吐的AI推理场景,如NLP和计算机视觉

Transformer神经网络广泛应用于自然语言处理、机器翻译和计算机视觉等领域,其核心在于多头自注意力模块对序列数据的高效分析。然而,针对该机制的专用硬件加速器仍较少。本文提出FAMOUS,一种面向超大规模FPGA(Ultrascale+)的灵活注意力计算硬件加速器,通过高效的矩阵分块策略,优化处理单元与片上内存的使用,提升并行性并降低延迟。在Xilinx Alveo U55C和U200数据中心卡上的实验表明,FAMOUS在U55C上最高可达到328 GOPS吞吐量,支持8个并行注意力头、768维嵌入维度和64×64分块大小。相比Intel Xeon Gold 5220R CPU和NVIDIA V100 GPU,分别快3.28倍和2.6倍;比现有最优FPGA加速器快1.3倍。

原文摘要 · Abstract (English)

Transformer neural networks (TNNs) are being applied across a widening range of application domains, including natural language processing (NLP), machine translation, and computer vision (CV). Their popularity is largely attributed to the exceptional performance of their multi-head self-attention blocks when analyzing sequential data and extracting features. To date, there are limited hardware accelerators tailored for this mechanism, which is the first step before designing an accelerator for a complete model. This paper proposes \textit{FAMOUS}, a flexible hardware accelerator for dense multi-head attention (MHA) computation of TNNs on field-programmable gate arrays (FPGAs). It is optimized for high utilization of processing elements and on-chip memories to improve parallelism and reduce latency. An efficient tiling of large matrices has been employed to distribute memory and computing resources across different modules on various FPGA platforms. The design is evaluated on Xilinx Alveo U55C and U200 data center cards containing Ultrascale+ FPGAs. Experimental results are presented that show that it can attain a maximum throughput, number of parallel attention heads, embedding dimension and tile size of 328 (giga operations/second (GOPS)), 8, 768 and 64 respectively on the U55C. Furthermore, it is 3.28$\times$ and 2.6$\times$ faster than the Intel Xeon Gold 5220R CPU and NVIDIA V100 GPU respectively. It is also 1.3$\times$ faster than the fastest state-of-the-art FPGA-based accelerator.

FPGA加速注意力机制Transformer硬件优化

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。