atlas

Research map / Architectures and efficiency / Attention and transformers

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

NeurIPS 2024 · Architectures and efficiency › Attention and transformers · approach: Block-sparse attention kernels · 71 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Redesigns FlashAttention for Hopper GPUs using warp-specialized asynchrony, intra-warpgroup GEMM-softmax overlap, and FP8 with block quantization and incoherent processing.

Problem

Attention on newer GPUs (Hopper H100) achieves low utilization (FlashAttention-2 ~35%) because it does not exploit asynchronous hardware units or low-precision FP8 tensor cores, and FP8 attention suffers accuracy loss from outliers.

Approach

Exploit Hopper asynchrony (TMA and WGMMA) via producer-consumer warp specialization with pingpong scheduling and a 2-stage GEMM-softmax pipeline, and adapt the forward pass to FP8 with in-kernel V transposition, block quantization, and Hadamard-based incoherent processing to reduce error.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Use FlashAttention-3 instead of FlashAttention-2H100 attention, FP16 forward pass · H100 forward pass, FP16speedup: 1.5-2.0×Helped
Use FlashAttention-3 instead of FlashAttention-2H100 attention, FP16 backward pass · H100 backward pass, FP16speedup: 1.5-1.75×Helped
Use FlashAttention-3 instead of standard attentionH100 attention, FP16 · H100 attention, FP16speedup: 3-16×Helped
Use FlashAttention-3 instead of standard attentionOutlier-feature attention, FP16 · Outlier-feature attention, FP16RMSE: 3.2e-4 -> 1.9e-4Helped
Use block quantization and incoherent processingFP8 FlashAttention-3 · Outlier-feature attention, FP8RMSE: 2.4e-2 -> 9.1e-3Helped
Add GEMM-softmax pipelining (ablation)FP16 FlashAttention-3 with warp-specialization · Non-causal FP16 attention, batch 4, sequence length 8448, 16 heads, head dimension 128TFLOPs/s: 582 -> 661Helped
Add warp-specialization (ablation)FP16 FlashAttention-3 with GEMM-softmax pipelining · Non-causal FP16 attention, batch 4, sequence length 8448, 16 heads, head dimension 128TFLOPs/s: 570 -> 661Helped
Remove block quantization (ablation)FP8 FlashAttention-3 · Outlier-feature attention, FP8RMSE: 9.1e-3 -> 9.3e-3Hurt
Remove incoherent processing (ablation)FP8 FlashAttention-3 · Outlier-feature attention, FP8RMSE: 9.1e-3 -> 2.4e-2Hurt
Use 3-stage instead of 2-stage GEMM-softmax pipelining (ablation)FlashAttention-3 · Forward attentionperformanceHurt

Surprising findings

Limitations

Experimental setup

Benchmarks: attention forward/backward speed on H100 SXM5 RMSE vs FP64 reference

Metrics: TFLOPs/s runtime ms RMSE

Baselines: FlashAttention-2 FlashAttention-2 Triton cuDNN 9 attention PyTorch standard attention FP8 per-tensor scaling baseline

Builds on: FlashAttention FlashAttention-2 CUTLASS QuIP

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy