Algorithm-hardware Co-design of Attention Mechanism on FPGA Devices

计算机科学 现场可编程门阵列 核(代数) 稳健性(进化) 并行计算 矩形 嵌入式系统 计算机硬件 计算机工程 生物化学 化学 几何学 数学 组合数学 基因
作者
Xinyi Zhang,Yawen Wu,Peipei Zhou,Xulong Tang,Jingtong Hu
出处
期刊:ACM Transactions in Embedded Computing Systems [Association for Computing Machinery]
卷期号:20 (5s): 1-24 被引量:30
标识
DOI:10.1145/3477002
摘要

Multi-head self-attention (attention mechanism) has been employed in a variety of fields such as machine translation, language modeling, and image processing due to its superiority in feature extraction and sequential data analysis. This is benefited from a large number of parameters and sophisticated model architecture behind the attention mechanism. To efficiently deploy attention mechanism on resource-constrained devices, existing works propose to reduce the model size by building a customized smaller model or compressing a big standard model. A customized smaller model is usually optimized for the specific task and needs effort in model parameters exploration. Model compression reduces model size without hurting the model architecture robustness, which can be efficiently applied to different tasks. The compressed weights in the model are usually regularly shaped (e.g. rectangle) but the dimension sizes vary (e.g. differs in rectangle height and width). Such compressed attention mechanism can be efficiently deployed on CPU/GPU platforms as their memory and computing resources can be flexibly assigned with demand. However, for Field Programmable Gate Arrays (FPGAs), the data buffer allocation and computing kernel are fixed at run time to achieve maximum energy efficiency. After compression, weights are much smaller and different in size, which leads to inefficient utilization of FPGA on-chip buffer. Moreover, the different weight heights and widths may lead to inefficient FPGA computing kernel execution. Due to the large number of weights in the attention mechanism, building a unique buffer and computing kernel for each compressed weight on FPGA is not feasible. In this work, we jointly consider the compression impact on buffer allocation and the required computing kernel during the attention mechanism compressing. A novel structural pruning method with memory footprint awareness is proposed and the associated accelerator on FPGA is designed. The experimental results show that our work can compress Transformer (an attention mechanism based model) by 95x. The developed accelerator can fully utilize the FPGA resource, processing the sparse attention mechanism with the run-time throughput performance of 1.87 Tops in ZCU102 FPGA.
最长约 10秒,即可获得该文献文件

科研通智能强力驱动
Strongly Powered by AbleSci AI
更新
大幅提高文件上传限制,最高150M (2024-4-1)

科研通是完全免费的文献互助平台,具备全网最快的应助速度,最高的求助完成率。 对每一个文献求助,科研通都将尽心尽力,给求助人一个满意的交代。
实时播报
LZ完成签到,获得积分10
刚刚
幸福龙猫发布了新的文献求助150
1秒前
1秒前
李小二发布了新的文献求助10
2秒前
2秒前
科研通AI2S应助美丽萝莉采纳,获得10
2秒前
KIQING完成签到,获得积分10
2秒前
sbrcpyf完成签到,获得积分10
3秒前
4秒前
大个应助chen采纳,获得10
4秒前
4秒前
5秒前
5秒前
敏感时光发布了新的文献求助10
6秒前
京运发布了新的文献求助10
7秒前
KIQING发布了新的文献求助10
8秒前
czy发布了新的文献求助10
8秒前
超好运关注了科研通微信公众号
9秒前
务实蓝完成签到,获得积分20
9秒前
10秒前
11秒前
abc完成签到,获得积分10
12秒前
SciGPT应助李小二采纳,获得10
13秒前
fcc完成签到,获得积分10
14秒前
红橙黄绿蓝靛紫111完成签到,获得积分10
15秒前
Ava应助zhao0611采纳,获得10
15秒前
16秒前
神勇的天问完成签到 ,获得积分10
18秒前
18秒前
18秒前
zh应助务实蓝采纳,获得20
20秒前
飞快的一曲完成签到 ,获得积分10
20秒前
cm完成签到 ,获得积分10
20秒前
duoyi完成签到,获得积分10
23秒前
cocolu应助傅老师采纳,获得10
27秒前
酷炫翠桃应助vocrious采纳,获得10
28秒前
29秒前
高兴的小完成签到,获得积分10
29秒前
29秒前
传奇3应助arzu采纳,获得10
30秒前
高分求助中
Mantiden: Faszinierende Lauerjäger Faszinierende Lauerjäger Heßler, Claudia, Rud 1000
PraxisRatgeber: Mantiden: Faszinierende Lauerjäger 1000
Natural History of Mantodea 螳螂的自然史 1000
A Photographic Guide to Mantis of China 常见螳螂野外识别手册 800
Barge Mooring (Oilfield Seamanship Series Volume 6) 600
ANSYS Workbench基础教程与实例详解 500
Spatial Political Economy: Uneven Development and the Production of Nature in Chile 400
热门求助领域 (近24小时)
化学 医学 生物 材料科学 工程类 有机化学 生物化学 物理 内科学 纳米技术 计算机科学 化学工程 复合材料 基因 遗传学 物理化学 催化作用 细胞生物学 免疫学 冶金
热门帖子
关注 科研通微信公众号,转发送积分 3325583
求助须知:如何正确求助?哪些是违规求助? 2956316
关于积分的说明 8580004
捐赠科研通 2634266
什么是DOI,文献DOI怎么找? 1441859
科研通“疑难数据库(出版商)”最低求助积分说明 667952
邀请新用户注册赠送积分活动 654788