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

被引:4
作者
Wang, Wenxun [1 ]
Zhou, Shuchang [2 ]
Sun, Wenyu [1 ]
Sun, Peiqin [2 ]
Liu, Yongpan [1 ]
机构
[1] Tsinghua Univ, Dept Elect Engn, Beijing, Peoples R China
[2] MEGVII Technol, Beijing, Peoples R China
来源
2023 IEEE/ACM INTERNATIONAL CONFERENCE ON COMPUTER AIDED DESIGN, ICCAD | 2023年
关键词
Transformers; neural networks; hardware-software co-design; softmax; layer normalization;
D O I
10.1109/ICCAD57390.2023.10323725
中图分类号
TP301 [理论、方法];
学科分类号
081202 ;
摘要
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.
引用
收藏
页数:9
相关论文
共 50 条
  • [1] Softermax: Hardware/Software Co-Design of an Efficient Softmax for Transformers
    Stevens, Jacob R.
    Venkatesan, Rangharajan
    Dai, Steve
    Khailany, Brucek
    Raghunathan, Anand
    2021 58TH ACM/IEEE DESIGN AUTOMATION CONFERENCE (DAC), 2021, : 469 - 474
  • [2] Hardware-Software Co-Design for Decimal Multiplication
    Mian, Riaz-ul-haque
    Shintani, Michihiro
    Inoue, Michiko
    COMPUTERS, 2021, 10 (02) : 1 - 19
  • [3] Hardware-Software Co-design for BLDC Motor Speed Controller Design
    Alecsa, Bogdan
    Onea, Alexandru
    ADVANCED MATERIALS RESEARCH II, PTS 1 AND 2, 2012, 463-464 : 1256 - +
  • [4] A novel hardware-software co-design for automatic white balance
    Chen, Chin-Hsing
    Tan, Sun-Yen
    Huang, Wen-Tzeng
    LECTURE NOTES IN SIGNAL SCIENCE, INTERNET AND EDUCATION (SSIP'07/MIV'07/DIWEB'07), 2007, : 203 - +
  • [5] Hardware-software co-design of resource constrained systems on a chip
    Thepayasuwan, N
    Doboli, A
    24TH INTERNATIONAL CONFERENCE ON DISTRIBUTED COMPUTING SYSTEMS WORKSHOPS, PROCEEDINGS, 2004, : 818 - 823
  • [6] Hopscotch: A Hardware-Software Co-Design for Efficient Cache Resizing on Multi-Core SoCs
    Jiang, Zhe
    Yang, Kecheng
    Fisher, Nathan
    Guan, Nan
    Audsley, Neil C.
    Dong, Zheng
    IEEE TRANSACTIONS ON PARALLEL AND DISTRIBUTED SYSTEMS, 2024, 35 (01) : 89 - 104
  • [7] An analytical method for reliability analysis of hardware-software co-design system
    Zeng, Yanhao
    Xing, Liudong
    Zhang, Qun
    Jia, Xujie
    QUALITY AND RELIABILITY ENGINEERING INTERNATIONAL, 2019, 35 (01) : 165 - 178
  • [8] Co-Z ECC scalar multiplications for hardware, software and hardware-software co-design on embedded systems
    Baldwin, Brian
    Goundar, Raveen R.
    Hamilton, Mark
    Marnane, William P.
    JOURNAL OF CRYPTOGRAPHIC ENGINEERING, 2012, 2 (04) : 221 - 240
  • [9] Hardware-Software Co-Design of an Image Feature Extraction and Matching Algorithm
    Chien, Chiang-Heng
    Chien, Chiang-Ju
    Hsu, Chen-Chien
    2019 2ND INTERNATIONAL CONFERENCE ON INTELLIGENT AUTONOMOUS SYSTEMS (ICOIAS 2019), 2019, : 37 - 41
  • [10] Hardware-Software Co-Design for On-Chip Learning in AI Systems
    Varshika, M. L.
    Mishra, Abhishek Kumar
    Kandasamy, Nagarajan
    Das, Anup
    2023 28TH ASIA AND SOUTH PACIFIC DESIGN AUTOMATION CONFERENCE, ASP-DAC, 2023, : 624 - 631