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 条
[41]   Hardware-Software Co-design for Reconfigurable Field Programmable Gate Arrays Using Mixed-Integer Programming [J].
Ali, Faridah M. ;
Al-Hamadi, Helal ;
Ghoniem, Ahmed ;
Sherali, Hanif D. .
INFORMATICA-JOURNAL OF COMPUTING AND INFORMATICS, 2012, 36 (03) :287-295
[42]   Optimizing hardware-software co-design based on non-ideality in memristor crossbars for in-memory computing [J].
Jiang, Pinfeng ;
Song, Danzhe ;
Huang, Menghua ;
Yang, Fan ;
Wang, Letian ;
Liu, Pan ;
Miao, Xiangshui ;
Wang, Xingsheng .
SCIENCE CHINA-INFORMATION SCIENCES, 2025, 68 (02)
[43]   Hardware-software co-design of an open-source automatic multimodal whole slide histopathology imaging system [J].
Li, Bin ;
Nelson, Michael S. ;
Chacko, Jenu V. ;
Cudworth, Nathan ;
Eliceiri, Kevin W. .
JOURNAL OF BIOMEDICAL OPTICS, 2023, 28 (02)
[44]   Hardware-Software Co-design to Mitigate DRAM Refresh Overheads: A Case for Refresh-Aware Process Scheduling [J].
Kotra, Jagadish B. ;
Shahidi, Narges ;
Chishti, Zeshan A. ;
Kandemir, Mahmut T. .
TWENTY-SECOND INTERNATIONAL CONFERENCE ON ARCHITECTURAL SUPPORT FOR PROGRAMMING LANGUAGES AND OPERATING SYSTEMS (ASPLOS XXII), 2017, :723-736
[45]   Hardware-Software Co-design to Mitigate DRAM Refresh Overheads: A Case for Refresh-Aware Process Scheduling [J].
Kotra, Jagadish B. ;
Shahidi, Narges ;
Chishti, Zeshan A. ;
Kandemir, Mahmut T. .
OPERATING SYSTEMS REVIEW, 2017, 51 (02) :723-736
[46]   Hardware-Software Co-design to Mitigate DRAM Refresh Overheads: A Case for Refresh-Aware Process Scheduling [J].
Kotra, Jagadish B. ;
Shahidi, Narges ;
Chishti, Zeshan A. ;
Kandemir, Mahmut T. .
ACM SIGPLAN NOTICES, 2017, 52 (04) :723-736
[47]   A compact and scalable hardware/software co-design of sike [J].
Massolino P.M.C. ;
Longa P. ;
Renes J. ;
Batina L. .
IACR Transactions on Cryptographic Hardware and Embedded Systems, 2020, 2020 (02) :245-271
[48]   Hardware/Software Co-design for Machine Learning Accelerators [J].
Chen, Hanqiu ;
Hao, Cong .
2023 IEEE 31ST ANNUAL INTERNATIONAL SYMPOSIUM ON FIELD-PROGRAMMABLE CUSTOM COMPUTING MACHINES, FCCM, 2023, :233-235
[49]   METHODOLOGY FOR THE HARDWARE/SOFTWARE CO-DESIGN OF DATAFLOW PROGRAMS [J].
Roquier, Ghislain ;
Thavot, Richard ;
Mattavelli, Marco .
2011 IEEE WORKSHOP ON SIGNAL PROCESSING SYSTEMS (SIPS), 2011, :174-179
[50]   A Programmable CNN Architecture and Its Hardware-Software Co-design Approach for Image Processing and Stimulating Visual Illusions [J].
Zheng, Jianwei ;
Xu, Chunhang ;
Guo, Donghui .
2016 IEEE INTERNATIONAL CONFERENCE ON SOFTWARE QUALITY, RELIABILITY AND SECURITY COMPANION (QRS-C 2016), 2016, :389-394