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

DAPA:面向设备的Transformer推理与训练的分布感知分段激活函数

DAPA: Distribution Aware Piecewise Activation Functions for On-Device Transformer Inference and Training

Singapore University of Technology and Design(新加坡科技设计大学)

Maoyang Xiang, Bo Wang

AI总结:

本文提出DAPA,一种基于预激活数据分布的分段激活函数,通过非均匀分段提升泛化能力,并利用分布加权均方误差量化以减少硬件资源消耗,实验证明其在GELU计算和DSP利用率上均有显著提升。

摘要:

非线性激活函数在设备端推理和训练中起关键作用,因其消耗大量硬件资源并对系统性能和能效有显著影响。本文提出Distribution-Aware Piecewise Activation (DAPA),一种可微且硬件友好的Transformer架构激活函数,通过利用预激活数据的分布特性。DAPA采用非均匀分段近似,将更细的分段分配给分布的高概率区域,从而在泛化能力上优于先前的分段线性方法。所得到的近似进一步使用Distribution-Weighted Mean Square Error量化,以减少硬件部署中的延迟和资源利用率。我们的HLS实现表明,DAPA在GELU计算上加速了16倍,并在视觉Transformer和GPT-2模型中减少了DSP利用率16倍,同时保持了可比或更好的性能。

英文摘要:

Non-linear activation functions play a pivotal role in on-device inference and training, as they not only consume substantial hardware resources but also impose a significant impact on system performance and energy efficiency. In this work, we propose Distribution-Aware Piecewise Activation (DAPA), a differentiable and hardware-friendly activation function for Transformer architectures by exploiting the distribution of pre-activation data. DAPA employs a non-uniform piecewise approximation that allocates finer segments to high-probability regions of the distribution, improving generalizability over prior piecewise linear methods. The resulting approximation is further quantized using Distribution-Weighted Mean Square Error to reduce latency and resource utilization for hardware deployment. Our HLS implementation demonstrates that DAPA speeds up GELU computation by 16$\times$ and decreases DSP utilization by 16$\times$ while maintaining comparable or better performance across vision Transformers and GPT-2 models.

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

↑