适用于边缘设备的高效Softmax和层归一化及保证归一化的硬件设计
Hardware-Efficient Softmax and Layer Normalization with Guaranteed Normalization for Edge Devices
AI总结:
本文提出一种适用于边缘设备的高效Softmax和层归一化设计,通过硬件高效近似方法保持归一化特性,实现高精度与低功耗的平衡。
摘要:
在Transformer模型中,非GEMM(非通用矩阵乘法)操作——特别是Softmax和层归一化(LayerNorm)——由于其非线性特性往往主导硬件成本。为解决此问题,先前的近似研究主要针对秩导向任务,适用于分类任务。然而,边缘自然语言处理(NLP)应用和边缘生成式人工智能主要基于分数导向任务进行评估,因此需要保证归一化的非GEMM操作。我们提出了一种适用于边缘设备的高效Softmax和LayerNorm设计,通过硬件高效近似方法同时保持归一化(Softmax:$\sum p = 1$,LayerNorm:$σ= 1$)。我们的架构用Verilog HDL描述,并使用三星28nm CMOS工艺进行综合。在精度评估中,我们实现了高精度且降级极小:GLUE +0.07%,SQuAD -0.01%,困惑度 -0.09%。实现结果表明,我们的架构非常小:Softmax为$942\,μm^2$,LayerNorm为$1199\,μm^2$。与现有技术相比,我们分别实现了面积减少11倍和14倍的改进。
英文摘要:
In Transformer models, non-GEMM (non-General Matrix Multiplication) operations -- especially Softmax and Layer Normalization (LayerNorm) -- often dominate hardware cost due to their nonlinear nature. To address this, previous approximation studies mainly target rank-oriented tasks, which is acceptable for classification. However, edge Natural Language Processing (NLP) applications and edge generative AI are largely evaluated based on score-oriented tasks, so normalization-guaranteed non-GEMM operations are essential. We propose a hardware-efficient Softmax and LayerNorm with Guaranteed Normalization for Edge devices. Our design employs hardware-efficient approximation methods while preserving the normalization (Softmax: $\sum p = 1$, LayerNorm: $σ= 1$). Our architecture is described in Verilog HDL and synthesized using the Samsung 28nm CMOS process. In accuracy evaluation, we achieve high accuracy with minimal degradation: GLUE +0.07%, SQuAD -0.01%, perplexity -0.09%. Implementation results show that our architecture is small: $942\,μm^2$ for Softmax, $1199\,μm^2$ for LayerNorm. Compared to the state of the art, we achieve up to 11x and 14x reduction in area, respectively.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。