Hardware Accelerator for Multi-Head Attention and Position-Wise Feed-Forward in the Transformer

计算机科学 现场可编程门阵列 变压器 硬件加速 计算 循环神经网络 人工神经网络 计算机硬件 卷积神经网络 计算机工程 计算机体系结构 嵌入式系统 人工智能 算法 电气工程 工程类 电压
作者
Siyuan Lu,Meiqi Wang,Shuang Liang,Jun Lin,Zhongfeng Wang
标识
DOI:10.1109/socc49529.2020.9524802
摘要

Designing hardware accelerators for deep neural networks (DNNs) has been much desired. Nonetheless, most of these existing accelerators are built for either convolutional neural networks (CNNs) or recurrent neural networks (RNNs). Recently, the Transformer model is replacing the RNN in the natural language processing (NLP) area. However, because of intensive matrix computations and complicated data flow being involved, the hardware design for the Transformer model has never been reported. In this paper, we propose the first hardware accelerator for two key components, i.e., the multi-head attention (MHA) ResBlock and the position-wise feed-forward network (FFN) ResBlock, which are the two most complex layers in the Transformer. Firstly, an efficient method is introduced to partition the huge matrices in the Transformer, allowing the two ResBlocks to share most of the hardware resources. Secondly, the computation flow is well designed to ensure the high hardware utilization of the systolic array, which is the biggest module in our design. Thirdly, complicated nonlinear functions are highly optimized to further reduce the hardware complexity and also the latency of the entire system. Our design is coded using hardware description language (HDL) and evaluated on a Xilinx FPGA. Compared with the implementation on GPU with the same setting, the proposed design demonstrates a speed-up of 14.6 x in the MHA ResBlock, and 3.4 x in the FFN ResBlock, respectively. Therefore, this work lays a good foundation for building efficient hardware accelerators for multiple Transformer networks.
最长约 10秒,即可获得该文献文件

科研通智能强力驱动
Strongly Powered by AbleSci AI
科研通是完全免费的文献互助平台,具备全网最快的应助速度,最高的求助完成率。 对每一个文献求助,科研通都将尽心尽力,给求助人一个满意的交代。
实时播报
s0x0y0完成签到,获得积分10
刚刚
1秒前
善学以致用应助sto采纳,获得10
1秒前
孟子豪发布了新的文献求助10
1秒前
3秒前
3秒前
红炉点血完成签到,获得积分10
3秒前
SYLH应助zhangzhang采纳,获得10
4秒前
CipherSage应助沐雪采纳,获得10
4秒前
相濡以沫发布了新的文献求助10
4秒前
完美世界应助Wiesen采纳,获得30
5秒前
wzh19940205完成签到,获得积分10
7秒前
可爱的函函应助Alexander L采纳,获得10
7秒前
8秒前
5Cu发布了新的文献求助30
8秒前
fighting发布了新的文献求助10
8秒前
香蕉觅云应助Jing采纳,获得10
8秒前
9秒前
10秒前
哦哦哦哦哦拖拉大王完成签到,获得积分20
11秒前
隐形曼青应助辛夷采纳,获得10
13秒前
rong发布了新的文献求助10
13秒前
稳重发布了新的文献求助10
13秒前
Hello应助cherish采纳,获得10
14秒前
14秒前
14秒前
fighting完成签到,获得积分10
14秒前
14秒前
111完成签到,获得积分20
15秒前
15秒前
KKK完成签到,获得积分10
15秒前
华仔应助怅望千秋采纳,获得10
16秒前
天天快乐应助孝艺采纳,获得10
16秒前
今后应助ccccc采纳,获得10
17秒前
17秒前
18秒前
Niki发布了新的文献求助30
19秒前
Young发布了新的文献求助10
19秒前
酷波er应助创新采纳,获得10
20秒前
111发布了新的文献求助10
20秒前
高分求助中
Encyclopedia of Mathematical Physics 2nd edition 888
Chinesen in Europa – Europäer in China: Journalisten, Spione, Studenten 500
Arthur Ewert: A Life for the Comintern 500
China's Relations With Japan 1945-83: The Role of Liao Chengzhi // Kurt Werner Radtke 500
Two Years in Peking 1965-1966: Book 1: Living and Teaching in Mao's China // Reginald Hunt 500
材料概论 周达飞 ppt 500
Nonrandom distribution of the endogenous retroviral regulatory elements HERV-K LTR on human chromosome 22 500
热门求助领域 (近24小时)
化学 材料科学 医学 生物 工程类 有机化学 物理 生物化学 纳米技术 计算机科学 化学工程 内科学 复合材料 物理化学 电极 遗传学 量子力学 基因 冶金 催化作用
热门帖子
关注 科研通微信公众号,转发送积分 3807180
求助须知:如何正确求助?哪些是违规求助? 3352033
关于积分的说明 10356632
捐赠科研通 3067986
什么是DOI,文献DOI怎么找? 1684822
邀请新用户注册赠送积分活动 809913
科研通“疑难数据库(出版商)”最低求助积分说明 765795