Skip to main content
QUICK REVIEW

[论文解读] AccelTran: A Sparsity-Aware Accelerator for Dynamic Inference with Transformers

Shikhar Tuli, Niraj K. Jha|arXiv (Cornell University)|Feb 28, 2023
Advanced Neural Network Applications被引用 5
一句话总结

AccelTran 提出了一种面向稀疏性的动态推理加速器,专为 Transformer 模型设计,通过 DynaTran 实现运行时激活剪枝,减少无效计算,从而提升吞吐量和能效。该架构采用分块矩阵运算与优化的数据流策略,实现最高 1.33× 的稀疏度提升,吞吐量达 Raspberry Pi 的 330K×,能耗降低 93K×,在吞吐量上超越 Energon 5.73×,在能效上领先 3.69×。

ABSTRACT

Self-attention-based transformer models have achieved tremendous success in the domain of natural language processing. Despite their efficacy, accelerating the transformer is challenging due to its quadratic computational complexity and large activation sizes. Existing transformer accelerators attempt to prune its tokens to reduce memory access, albeit with high compute overheads. Moreover, previous works directly operate on large matrices involved in the attention operation, which limits hardware utilization. In order to address these challenges, this work proposes a novel dynamic inference scheme, DynaTran, which prunes activations at runtime with low overhead, substantially reducing the number of ineffectual operations. This improves the throughput of transformer inference. We further propose tiling the matrices in transformer operations along with diverse dataflows to improve data reuse, thus enabling higher energy efficiency. To effectively implement these methods, we propose AccelTran, a novel accelerator architecture for transformers. Extensive experiments with different models and benchmarks demonstrate that DynaTran achieves higher accuracy than the state-of-the-art top-k hardware-aware pruning strategy while attaining up to 1.2$ imes$ higher sparsity. One of our proposed accelerators, AccelTran-Edge, achieves 330K$ imes$ higher throughput with 93K$ imes$ lower energy requirement when compared to a Raspberry Pi device. On the other hand, AccelTran-Server achieves 5.73$ imes$ higher throughput and 3.69$ imes$ lower energy consumption compared to the state-of-the-art transformer co-processor, Energon. The simulation source code is available at https://github.com/jha-lab/acceltran.

研究动机与目标

  • 为解决因 Transformer 推理的二次方复杂度和大尺寸激活张量带来的高计算与内存开销。
  • 通过低开销的运行时激活剪枝,减少注意力机制中的无效计算。
  • 通过矩阵分块与多样化数据流策略,提升硬件利用率与能效。
  • 通过专用加速器变体(AccelTran-Edge 与 AccelTran-Server),实现在边缘与服务器平台上的高吞吐、低功耗推理。
  • 克服以往加速器仅关注权重重构或采用单体矩阵处理方式的局限,避免数据重用差与并行度低的问题。

提出的方法

  • 提出 DynaTran,一种动态推理方案,在运行时以极低计算开销剪枝激活张量,提升中间激活张量的稀疏度。
  • 采用矩阵分块与多种数据流策略,提升处理单元间的访存重用率,优化硬件利用率。
  • 设计周期精确的加速器架构 AccelTran,配备针对 Softmax、层归一化与 DynaTran 操作的专用 RTL 模块,实现关键操作的单周期执行。
  • 引入新型控制模块,将 Transformer 计算图映射为分块的、硬件优化的操作,并动态选择最优数据流。
  • 通过集成移动剪枝模型,同时支持权重重构与激活张量稀疏性,并在 Transformer 管道的所有乘法运算中充分利用稀疏性。
  • 针对边缘与服务器部署进行优化,提供两种变体:AccelTran-Edge 用于移动平台,AccelTran-Server 用于云规模推理。
Figure 1 : Memory requirements for (a) BERT-Tiny and (b) BERT-Base.
Figure 1 : Memory requirements for (a) BERT-Tiny and (b) BERT-Base.

实验结果

研究问题

  • RQ1动态运行时激活剪枝能否在保持高精度的前提下,提升 Transformer 推理的吞吐量与能效?
  • RQ2如何通过矩阵分块与多样化数据流策略,提升 Transformer 加速器中的数据重用率与硬件利用率?
  • RQ3在硬件感知的 Transformer 加速器中,权重重构与激活张量稀疏性能否被同时高效利用?
  • RQ4与静态剪枝或 Top-k 策略相比,硬件感知的动态推理方案在精度与性能上表现如何?
  • RQ5单一加速器架构能否高效支持具有不同性能与功耗约束的边缘与服务器部署?

主要发现

  • DynaTran 的稀疏度相比最先进 Top-k 硬件感知剪枝策略最高提升 1.33×,且精度更优。
  • AccelTran-Edge 相较于 Raspberry Pi 设备,吞吐量提升 330,000×,能耗降低 93,000×。
  • AccelTran-Server 的吞吐量相比最先进 Energon 协处理器提升 5.73×,能耗降低 3.69×。
  • 所提出的加速器设计通过同时利用权重重构与激活张量稀疏性,实现比仅依赖权重重构更高的吞吐量与能效。
  • 矩阵分块与优化数据流显著提升硬件利用率,性能优于单体矩阵处理或矩阵-向量分解方法。
  • 控制模块支持动态调度与数据流选择,可高效执行高度并行化的同构 Transformer 层。
Figure 2 : AccelTran workflow for an input transformer model and its acceleration in hardware.
Figure 2 : AccelTran workflow for an input transformer model and its acceleration in hardware.

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。