Inference & Serving · 2022

FlashAttention (1/2/3): IO-Aware Exact Attention

Tri Dao, Daniel Y. Fu, Stefano Ermon, Atri Rudra, Christopher Ré, Jay Shah

Computes exact attention with an IO-aware tiling and online-softmax algorithm that avoids materializing the full attention matrix in GPU high-bandwidth memory, removing the memory and bandwidth bottleneck that made long sequences slow and costly.

Editorial record

Plain-language summary

The kernel splits queries, keys, and values into blocks that fit in fast on-chip SRAM, computes softmax incrementally with running statistics, and recomputes intermediates during the backward pass instead of storing them, so memory scales linearly rather than quadratically in sequence length. This yields wall-clock speedups and lower memory use without approximation, giving identical results to standard attention. It enabled training and serving with longer context windows and became a default attention implementation in mainstream frameworks.

Knowledge graph

Relationships

Antecedents

Descendants

Source record

Provenance

Record ID
P-400
Record created
2026-07-13
Last reviewed
2026-07-14
Record version
2

Citation caveat: Citation metadata is approximate and marked unverified in the source dataset.