FPGA上实现可动态适配的Transformer加速器,提升能效与速度。
A Runtime-Adaptive Transformer Neural Network Accelerator on FPGAs
- 通过动态矩阵分块与量化设计,适应不同Transformer模型运行需求。
- 相比NVIDIA K80 GPU和i7-8700K CPU,功耗降低1.2倍和2.87倍。
- 适合嵌入式与数据中心场景下对能效敏感的实时Transformer推理任务。
Transformer神经网络在自然语言处理、机器翻译和计算机视觉中表现优异,但对计算与内存资源要求高,尤其在资源受限的FPGA设备上面临挑战。不同应用场景下模型处理时间差异大,需定制化模型参数,而现有加速器缺乏运行时自适应能力,且依赖特定稀疏模式,增加硬件设计复杂性。本文提出ADAPTOR,一种面向FPGA上Transformer编码器与解码器密集矩阵运算的运行时自适应加速器。该设计通过高效矩阵分块策略优化处理单元与片上内存利用率,提升并行度并降低延迟,且完全量化以增强计算效率与可移植性。在Xilinx Alveo U55C数据卡及VC707、ZCU102嵌入式平台上的评估显示,其功耗分别比NVIDIA K80 GPU和i7-8700K CPU低1.2倍与2.87倍,较部分先进FPGA加速器提速1.7至2.25倍。
原文摘要 · Abstract (English)
Transformer neural networks (TNN) excel in natural language processing (NLP), machine translation, and computer vision (CV) without relying on recurrent or convolutional layers. However, they have high computational and memory demands, particularly on resource-constrained devices like FPGAs. Moreover, transformer models vary in processing time across applications, requiring custom models with specific parameters. Designing custom accelerators for each model is complex and time-intensive. Some custom accelerators exist with no runtime adaptability, and they often rely on sparse matrices to reduce latency. However, hardware designs become more challenging due to the need for application-specific sparsity patterns. This paper introduces ADAPTOR, a runtime-adaptive accelerator for dense matrix computations in transformer encoders and decoders on FPGAs. ADAPTOR enhances the utilization of processing elements and on-chip memory, enhancing parallelism and reducing latency. It incorporates efficient matrix tiling to distribute resources across FPGA platforms and is fully quantized for computational efficiency and portability. Evaluations on Xilinx Alveo U55C data center cards and embedded platforms like VC707 and ZCU102 show that our design is 1.2$\times$ and 2.87$\times$ more power efficient than the NVIDIA K80 GPU and the i7-8700K CPU respectively. Additionally, it achieves a speedup of 1.7 to 2.25$\times$ compared to some state-of-the-art FPGA-based accelerators.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。