SpAtten: Efficient Sparse Attention Architecture with Cascade Token and Head Pruning

计算机科学 安全性令牌 加速 修剪 语言模型 人工智能 计算 并行计算 量化(信号处理) 德拉姆 还原(数学) 算法 计算机硬件 计算机安全 农学 生物 几何学 数学
作者
Hanrui Wang,Zhekai Zhang,Song Han
出处
期刊:High-Performance Computer Architecture 被引量:317
标识
DOI:10.1109/hpca51647.2021.00018
摘要

The attention mechanism is becoming increasingly popular in Natural Language Processing (NLP) applications, showing superior performance than convolutional and recurrent architectures. However, general-purpose platforms such as CPUs and GPUs are inefficient when performing attention inference due to complicated data movement and low arithmetic intensity. Moreover, existing NN accelerators mainly focus on optimizing convolutional or recurrent models, and cannot efficiently support attention. In this paper, we present SpAtten, an efficient algorithm-architecture co-design that leverages token sparsity, head sparsity, and quantization opportunities to reduce the attention computation and memory access. Inspired by the high redundancy of human languages, we propose the novel cascade token pruning to prune away unimportant tokens in the sentence. We also propose cascade head pruning to remove unessential heads. Cascade pruning is fundamentally different from weight pruning since there is no trainable weight in the attention mechanism, and the pruned tokens and heads are selected on the fly. To efficiently support them on hardware, we design a novel top-k engine to rank token and head importance scores with high throughput. Furthermore, we propose progressive quantization that first fetches MSBs only and performs the computation; if the confidence is low, it fetches LSBs and recomputes the attention outputs, trading computation for memory reduction.Extensive experiments on 30 benchmarks show that, on average, SpAtten reduces DRAM access by 10.0× with no accuracy loss, and achieves 1.6×, 3.0×, 162×, 347× speedup, and 1.4×, 3.2×, 1193×, 4059× energy savings over A 3 accelerator, MNNFast accelerator, TITAN Xp GPU, Xeon CPU, respectively.
最长约 10秒,即可获得该文献文件

科研通智能强力驱动
Strongly Powered by AbleSci AI
科研通是完全免费的文献互助平台,具备全网最快的应助速度,最高的求助完成率。 对每一个文献求助,科研通都将尽心尽力,给求助人一个满意的交代。
实时播报
明理道之完成签到,获得积分10
2秒前
蜗牛角发布了新的文献求助10
2秒前
vicky发布了新的文献求助10
2秒前
唐诗阅完成签到,获得积分10
2秒前
2秒前
4秒前
紫轩发布了新的文献求助30
4秒前
fcdawn完成签到,获得积分10
4秒前
4秒前
乐乐应助俭朴的皮卡丘采纳,获得10
5秒前
HY发布了新的文献求助10
5秒前
科研通AI6.4应助lu采纳,获得10
5秒前
落后海云完成签到,获得积分10
6秒前
7秒前
WHW发布了新的文献求助10
7秒前
9秒前
典雅碧空发布了新的文献求助10
9秒前
FashionBoy应助傻傻的咖啡豆采纳,获得10
9秒前
Wsn完成签到,获得积分10
9秒前
自由雪菲力完成签到,获得积分10
10秒前
Zzjinyu发布了新的文献求助10
10秒前
hong发布了新的文献求助30
10秒前
10秒前
10秒前
11秒前
12秒前
向日葵完成签到 ,获得积分10
12秒前
12秒前
13秒前
小金人完成签到,获得积分10
13秒前
蜗牛角完成签到,获得积分10
13秒前
cdercder应助yyy采纳,获得20
13秒前
论文文文发布了新的文献求助10
13秒前
14秒前
yyyyy完成签到,获得积分10
14秒前
zls完成签到,获得积分10
14秒前
尼禄发布了新的文献求助10
14秒前
lei发布了新的文献求助10
14秒前
脑洞疼应助优秀的大白菜采纳,获得10
14秒前
星辰大海应助HY采纳,获得10
14秒前
高分求助中
Adhesion Science: Principles & Practice 1234
Cold War Transcended: Australia's China Policy, 1949-1990 998
Signals, Systems, and Signal Processing 610
Fundamentals of Pharmaceutical and Biologics Regulations: A Global Perspective, Second Edition 600
Testimonial Injustice and Trust 510
Burger's Medicinal Chemistry and Drug Discovery 400
Fundamentals of Body MRI 3rd Edition 400
热门求助领域 (近24小时)
化学 材料科学 医学 生物 纳米技术 工程类 有机化学 化学工程 生物化学 计算机科学 物理 内科学 复合材料 催化作用 物理化学 光电子学 电极 细胞生物学 基因 无机化学
热门帖子
关注 科研通微信公众号,转发送积分 6644727
求助须知:如何正确求助?哪些是违规求助? 8400990
关于积分的说明 17963607
捐赠科研通 5835543
什么是DOI,文献DOI怎么找? 2969252
邀请新用户注册赠送积分活动 1944333
关于科研通互助平台的介绍 1862222