FlashAttention-3: Fast and Accurate Attention with Asynchrony and Low-precision

异步(计算机编程) 计算机科学 电信 异步通信
作者
Jay P. Shah,Ganesh Bikshandi,Ying Zhang,Vijay Thakkar,Pradeep Ramani,Tri Dao
出处
期刊:Cornell University - arXiv 被引量:1
标识
DOI:10.48550/arxiv.2407.08608
摘要

Attention, as a core layer of the ubiquitous Transformer architecture, is the bottleneck for large language models and long-context applications. FlashAttention elaborated an approach to speed up attention on GPUs through minimizing memory reads/writes. However, it has yet to take advantage of new capabilities present in recent hardware, with FlashAttention-2 achieving only 35% utilization on the H100 GPU. We develop three main techniques to speed up attention on Hopper GPUs: exploiting asynchrony of the Tensor Cores and TMA to (1) overlap overall computation and data movement via warp-specialization and (2) interleave block-wise matmul and softmax operations, and (3) block quantization and incoherent processing that leverages hardware support for FP8 low-precision. We demonstrate that our method, FlashAttention-3, achieves speedup on H100 GPUs by 1.5-2.0$\times$ with FP16 reaching up to 740 TFLOPs/s (75% utilization), and with FP8 reaching close to 1.2 PFLOPs/s. We validate that FP8 FlashAttention-3 achieves 2.6$\times$ lower numerical error than a baseline FP8 attention.

科研通智能强力驱动
Strongly Powered by AbleSci AI
科研通是完全免费的文献互助平台,具备全网最快的应助速度,最高的求助完成率。 对每一个文献求助,科研通都将尽心尽力,给求助人一个满意的交代。
实时播报
大力的灵雁应助阔达语儿采纳,获得30
2秒前
asilamu发布了新的文献求助10
2秒前
hypo完成签到,获得积分20
3秒前
Fanny发布了新的文献求助10
4秒前
6秒前
吴晨曦完成签到,获得积分10
6秒前
科研通AI6.1应助一介书生采纳,获得10
7秒前
wlincarol完成签到,获得积分10
8秒前
领导范儿应助hypo采纳,获得10
8秒前
淮安石河子完成签到 ,获得积分10
11秒前
科研通AI6.1应助yuan采纳,获得10
12秒前
12秒前
13秒前
传奇3应助恰恰恰采纳,获得10
14秒前
jia完成签到 ,获得积分10
15秒前
打打应助小格爱科研采纳,获得10
16秒前
科研通AI6.3应助Ftucyctucutct采纳,获得10
17秒前
阿航完成签到,获得积分10
17秒前
18秒前
18秒前
棠真发布了新的文献求助10
18秒前
dcy完成签到,获得积分10
21秒前
Hhh发布了新的文献求助30
21秒前
爆米花应助晶9426采纳,获得10
22秒前
烂漫的从彤完成签到,获得积分10
22秒前
科研通AI6.3应助asilamu采纳,获得10
22秒前
23秒前
纸鸟发布了新的文献求助10
23秒前
现代飞鸟完成签到,获得积分10
24秒前
寒冷尔柳完成签到 ,获得积分10
25秒前
FashionBoy应助Jrssion采纳,获得10
25秒前
明杰发布了新的文献求助30
25秒前
Co完成签到 ,获得积分10
25秒前
小可爱完成签到,获得积分10
25秒前
26秒前
123456完成签到 ,获得积分10
26秒前
chen完成签到 ,获得积分10
27秒前
恰恰恰发布了新的文献求助10
27秒前
LOWRY完成签到,获得积分10
28秒前
脆脆完成签到,获得积分10
29秒前
高分求助中
(应助此贴封号)【重要!!请各用户(尤其是新用户)详细阅读】【科研通的精品贴汇总】 10000
Modern Epidemiology, Fourth Edition 5000
Handbook of pharmaceutical excipients, Ninth edition 5000
Digital Twins of Advanced Materials Processing 2000
Weaponeering, Fourth Edition – Two Volume SET 2000
Polymorphism and polytypism in crystals 1000
Signals, Systems, and Signal Processing 610
热门求助领域 (近24小时)
化学 材料科学 医学 生物 工程类 纳米技术 有机化学 生物化学 化学工程 物理 计算机科学 复合材料 内科学 催化作用 物理化学 光电子学 电极 冶金 基因 遗传学
热门帖子
关注 科研通微信公众号,转发送积分 6022925
求助须知:如何正确求助?哪些是违规求助? 7645148
关于积分的说明 16170838
捐赠科研通 5171197
什么是DOI,文献DOI怎么找? 2767027
邀请新用户注册赠送积分活动 1750413
关于科研通互助平台的介绍 1637000