arXiv:2510.17189cs.LGcs.AR2025-10被引 52

提出软硬件协同设计的Softmax和归一化方案,显著提升Transformer推理效率。

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

  • 用对数量化和查表法近似Softmax,低精度计算同时减少存储开销。
  • 无需重训练即可保持精度,相比最先进方法能效提升3.04倍以上。
  • 适合部署在边缘设备的高效Transformer推理系统,尤其关注能效场景。

Transformer在自然语言处理和计算机视觉任务中表现卓越,但其实时推理速度和效率受限于Softmax和层归一化(LayerNorm)的计算低效。以往基于函数近似的方案虽关注计算效率,却忽视内存开销,且依赖重训练补偿近似误差,成本高、不便。本文提出硬件-软件协同设计SOLE,包含E2Softmax和AILayerNorm。E2Softmax采用指数函数的log2量化与基于对数的除法近似实现Softmax,AILayerNorm则使用低精度统计量计算。相比现有最优设计,该方案实现了低精度计算与低比特存储的双重优势。实验表明,SOLE在无需重训练的前提下维持了推理精度,相较GPU实现数量级加速与能耗降低,分别在能效上提升3.04倍、3.86倍,在面积效率上提升2.82倍、3.32倍,优于先前最先进的专用硬件设计。

原文摘要 · Abstract (English)

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.

Transformer推理优化软硬件协同能效提升

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。