arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2510.17189cs.LGcs.AR
收藏

SOLE:面向高效 Transformer 推理的 Softmax 与 LayerNorm 软硬件协同设计

SOLE: Hardware-Software Co-design of Softmax and LayerNorm for Efficient Transformer Inference

Department of Electronic Engineering, Tsinghua University, Beijing, China(电子工程系,清华大学,北京,中国)

Wenxun Wang, Shuchang Zhou, Wenyu Sun, Peiqin Sun, Yongpan Liu

AI总结:

针对 Transformer 中 Softmax 与 LayerNorm 的推理瓶颈,提出 SOLE 软硬件协同设计,以低精度计算和存储在无需重训下保持精度,并显著提升速度、能效和面积效率。

摘要:

Transformer 在自然语言处理(NLP)和计算机视觉(CV)任务中均表现出卓越性能。然而,由于 Softmax 和层归一化(LayerNorm)的低效,其实时推理速度和效率受到限制。以往基于函数逼近的工作实现效率不高,因为它们重视计算却忽视内存开销问题。此外,此类方法依赖重新训练来弥补逼近误差,这可能成本高昂且不便。本文提出 SOLE,这是一种针对 Softmax 和 LayerNorm 的软硬件协同设计,由 E2Softmax 和 AILayerNorm 组成。E2Softmax 利用指数函数的 log2 量化和基于对数的除法来逼近 Softmax,而 AILayerNorm 采用低精度统计计算。与最先进设计相比,我们在 Softmax 和 LayerNorm 上同时实现了低精度计算和低位宽存储。实验表明,SOLE 无需重新训练即可保持推理精度,同时相比 GPU 提供数量级的加速和能耗节省;在 Softmax 和 LayerNorm 上,相比此前最先进的定制硬件,分别实现 3.04 倍、3.86 倍的能效提升,以及 2.82 倍、3.32 倍的面积效率提升。

英文摘要:

Transformers have shown remarkable performance in both natural language processing (NLP) and computer vision (CV) tasks. However, their real-time inference speed and efficiency are limited due to the inefficiency in Softmax and Layer Normalization (LayerNorm). Previous works based on function approximation suffer from inefficient implementation as they place emphasis on computation while disregarding memory overhead concerns. Moreover, such methods rely on retraining to compensate for approximation error which can be costly and inconvenient. In this paper, we present SOLE, a hardware-software co-design for Softmax and LayerNorm which is composed of E2Softmax and AILayerNorm. E2Softmax utilizes log2 quantization of exponent function and log-based division to approximate Softmax while AILayerNorm adopts low-precision statistic calculation. Compared with state-of-the-art designs, we achieve both low-precision calculation and low bit-width storage on Softmax and LayerNorm. Experiments show that SOLE maintains inference accuracy without retraining while offering orders of magnitude speedup and energy savings over GPU, achieving 3.04x, 3.86x energy-efficiency improvements and 2.82x, 3.32x area-efficiency improvements over prior state-of-the-art custom hardware for Softmax and LayerNorm, respectively.

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

↑