[论文解读] FTRANS: Energy-Efficient Acceleration of Transformers using FPGA
FTRANS 提出了一种基于 FPGA 的高效能加速框架,用于 Transformer 模型,采用增强型块循环矩阵(BCM)模型压缩技术与定制硬件架构。该框架在仅造成极小精度损失的情况下,实现了高达 16× 的模型尺寸压缩,并将吞吐量提升至 CPU 的 27.07×,能量效率提升 81×,在能量效率方面较 GPU 提升 8.80×。
In natural language processing (NLP), the "Transformer" architecture was proposed as the first transduction model replying entirely on self-attention mechanisms without using sequence-aligned recurrent neural networks (RNNs) or convolution, and it achieved significant improvements for sequence to sequence tasks. The introduced intensive computation and storage of these pre-trained language representations has impeded their popularity into computation and memory-constrained devices. The field-programmable gate array (FPGA) is widely used to accelerate deep learning algorithms for its high parallelism and low latency. However, the trained models are still too large to accommodate to an FPGA fabric. In this paper, we propose an efficient acceleration framework, Ftrans, for transformer-based large scale language representations. Our framework includes enhanced block-circulant matrix (BCM)-based weight representation to enable model compression on large-scale language representations at the algorithm level with few accuracy degradation, and an acceleration design at the architecture level. Experimental results show that our proposed framework significantly reduces the model size of NLP models by up to 16 times. Our FPGA design achieves 27.07x and 81x improvement in performance and energy efficiency compared to CPU, and up to 8.80x improvement in energy efficiency compared to GPU.
研究动机与目标
- 为解决在计算资源与内存受限的边缘设备上部署大型、计算密集型 Transformer 模型的挑战。
- 在不造成显著精度下降的前提下,减小 BERT 和 RoBERTa 等预训练 NLP 模型的模型尺寸。
- 设计一种低功耗、高吞吐量的 FPGA 架构,以高效加速压缩后的 Transformer 模型。
- 与 CPU 和 GPU 实现相比,实现更优的能量效率与性能表现。
提出的方法
- 提出一种增强型 BCM 基础权重表示方法,在算法层面实现 Transformer 模型权重的压缩,最大限度减少精度损失。
- 引入两阶段优化方法,用于调度计算并缓解 FPGA 上的资源约束。
- 设计一种定制化 FPGA 架构,通过优化数据流与资源利用率以支持压缩后的模型。
- 采用高层次综合(HLS)技术,借助 Xilinx SDx 2017.1 自动化 FPGA 实现并优化并行性。
- 在 BCM 压缩基础上引入量化技术,进一步减小模型尺寸并提升硬件效率。
- 通过批量大小自适应与延迟/功耗权衡分析,确定吞吐量与能量效率最优的配置。
实验结果
研究问题
- RQ1增强型 BCM 基于压缩方法是否能有效减小大规模 Transformer 模型尺寸,同时保持极小的精度损失?
- RQ2如何优化基于 FPGA 的加速,以实现对压缩后 NLP 模型的高吞吐量与低延迟?
- RQ3与 CPU 和 GPU 相比,基于 FPGA 的推理在能量效率与性能方面有何提升?
- RQ4所提出的框架是否能够实现在低功耗嵌入式设备上部署大型 NLP 模型?
主要发现
- FTRANS 在 RoBERTa 等 NLP 模型上实现了高达 16× 的模型压缩,仅造成极小的精度损失。
- 在 IMDB 基准测试中,FPGA 实现的吞吐量比 CPU 提高 27.07×,能量效率提升 81×。
- 与 GPU(RTX 5000)相比,FTRANS 将功耗降低 5.01×,能量效率提升 8.80×。
- 在嵌入式 Jetson TX2 上,FTRANS 的能量效率比嵌入式 GPU 提高 2.44×。
- 延迟-功耗比最优的批量大小为 8,可在吞吐量与能耗之间实现良好平衡。
- FPGA 上的资源利用率保持较低水平,RoBERTa(base)仅使用 6,531 个 DSP 和 452,661 个 LUT,支持在紧凑型 FPGA 上部署。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。