PreprintCited by 1,286Parallel Computing and Optimization TechniquesAdvanced Neural Network ApplicationsTopic Modeling

The DOI matches its DataCite record; 88 of the 88 references it cites were found in a registry or an index; 40 of the 48 sources its claims cite were checked for support.

FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness

Open access

Abstract

Machine learning's explosive growth has produced a proliferation of accelerator architectures, yet no framework maps a workload's computational character to the hardware that serves it best. We build that framework: decomposing ML workloads — transformers, CNNs, GNNs, diffusion and state-space models — into core compute primitives characterized by arithmetic intensity, memory-access pattern, and parallelism, and evaluating how GPUs, TPUs, systolic arrays, dataflow processors, wafer-scale engines, and neuromorphic chips serve them. Using hierarchical roofline and utilization modelling, we show the binding constraint has shifted from peak FLOPS to memory bandwidth and data-movement energy — which quantization only sharpens — and consolidate eight persistent, unsolved problems. These motivate the central contribution: the Fused Memory-Compute Tile (FMCT, codename Habanero), an SRAM-first, HBM-free accelerator combining a three-mode (GEMM / bandwidth / fused) phase-adaptive tile switched by compiler directive, a non-linear unit fused into the systolic datapath, compute-in-memory as a selectable mode rather than the whole architecture, and an inline KV-cache compression engine. A validated component-level energy model shows ~4-7× batch-1 efficiency gains over HBM GPUs. We position FMCT against its closest SRAM-first, no-HBM analogs — d-Matrix Corsair and Tenstorrent — and OpenAI's HBM-retaining Jalapeño ASIC, closing with principles for memory-centric, workload-adaptive accelerators.

Overview

AI snapshot

Written from the paper’s full text.

TL;DR

FlashAttention is an IO-aware exact attention algorithm that uses tiling and recomputation to avoid materializing the large \(N \times N\) attention matrix in GPU HBM, reducing memory reads/writes while computing exact attention. It speeds up Transformer training and enables longer contexts, including first better-than-chance Transformer results on Path-X and Path-256.

Key findings

  • FlashAttention requires fewer HBM accesses than standard attention: \(\Theta(N^2 d^2 M^{-1})\) vs. \(\Theta(Nd + N^2)\), and is up to 9× fewer HBM accesses for typical \(d\) and \(M\).
  • It trains models faster: 15% end-to-end wall-clock speedup on BERT-large (seq. length 512) over the MLPerf 1.1 record, up to 3× speedup on GPT-2 (seq. length 1K), and 2.4× on Long-Range Arena (seq. length 1K–4K).
  • Longer context improves quality: 0.7 better perplexity on GPT-2 and 6.4 points of lift on long-document classification; FlashAttention achieves 61.4% accuracy on Path-X (16K), and block-sparse FlashAttention achieves 63.1% on Path-256 (64K).
  • Attention benchmarking: FlashAttention is up to 3× faster than standard attention for common sequence lengths and up to 20× more memory efficient than exact attention baselines; block-sparse FlashAttention is faster than all existing approximate attention methods tested.

Methods

  • Algorithm design: exact attention computed by tiling Q, K, V blocks into on-chip SRAM, incrementally performing softmax reduction, and recomputing attention in the backward pass from stored softmax statistics instead of storing the \(N \times N\) attention matrix.
  • Analysis: proves IO complexity for forward and backward passes, plus a lower bound showing no exact attention algorithm can asymptotically improve HBM accesses over all SRAM sizes; extends to block-sparse FlashAttention with IO complexity scaled by sparsity.
  • Experiments: CUDA implementation benchmarked on A100, RTX 3090, and T4 GPUs; trained BERT-large, GPT-2, Long-Range Arena, MIMIC-III, ECtHR, Path-X, and Path-256, comparing runtime, memory, and accuracy against exact, approximate, and sparse attention baselines.

Limitations

  • The paper states that building IO-aware attention implementations currently requires writing a new CUDA kernel for each new attention implementation, using a lower-level language than PyTorch, with significant engineering effort, and implementations may not transfer across GPU architectures.
  • The paper states its IO-aware implementation is optimal within constants for single-GPU attention, but multi-GPU attention adds another memory hierarchy and is left as future work.
  • The paper states the lower bound is proved over a subrange of SRAM sizes \(M\), and parameterized complexity lower bounds in terms of \(M\) are left as future work; the text also makes evident that some approximate attention methods become faster than FlashAttention beyond sequence length 1K, though block-sparse FlashAttention remains faster than all tested approximate methods.

Model-written summary. Check it against the paper before relying on it.

Integrity signals

Registry

DataCite · 10.48550/arxiv.2205.14135

Cites

0 citation errors · 0 not checkable

Statistics

Nothing to recompute.

Verification

Claims the paper makes

38 Own result · 35 No basis given · 17 Own interpretation · 14 Partly supported · 7 Supported · 3 Couldn’t confirm · 3 Own method · 1 Mixed support · 1 Sources not found · 1 Not checked yet · accuracy not yet measured

Show all 58 claims

  • It may state two separate claims as one. 48
  • Probably not a substantial claim. 19
62 of 62
  • The paper relies on this without support.

    Common Python interfaces to deep learning such as PyTorch and Tensorflow do not allow fine-grained control of memory access.

    “However, common Python interfaces to deep learning such as PyTorch and Tensorflow do not allow fine-grained control of memory access.”
  • The paper relies on this without support.

    All gradient checkpointing implementations known to the authors trade speed for memory.

    “While gradient checkpointing has been suggested to reduce the maximum amount of memory required [66], all implementations (that we know off) have to trade speed for memory.”
  • The paper relies on this without support.

    Attention time and memory scale quadratically in the sequence length.

    “However, one of their computational bottlenecks is that their time and memory scales quadratic in the sequence length.”
  • The paper relies on this without support.

    RTX 3090 memory bandwidth is roughly 900 GB/s and A100 memory bandwidth is roughly 1.5 TB/s, and the RTX 3090's is lower.

    “since the memory bandwidth on an RTX 3090 is lower than on an A100 (roughly 900 GB/s vs. 1.5 TB/s).”
  • The paper relies on this without support.

    T4 SRAM is smaller than A100 SRAM.

    “T4 SRAM is smaller than A100, so we need to make the block sizes smaller in FlashAttention .”
  • The paper relies on this without support.

    T4 GPUs are commonly used for inference.

    “T4 GPUs are commonly used for inference, so we also report speedup on the forward pass only.”
6 of 6

Claims other papers make about this one

Each is checked against this paper’s own text: does it say what the citing paper says it does?

Self-check

Percentages, sums and reported differences re-computed from the paper’s own numbers.

Each contradiction between two passages listed here was confirmed by an independent check.

3 of 3

Citations

Cites

The publisher hasn’t deposited this paper’s reference list.

Research works printed but not linked: 9

  1. [4][4] L Susan Blackford, Antoine Petitet, Roldan Pozo, Karin Remington, R Clint Whaley, James Demmel, Jack Dongarra, Iain Duff, Sven Hammarling, Greg Henry, et al. An updated set of basic linear algebra subprograms (blas). ACM Transactions on Mathematical Software , 28(2):135-151, 2002. -
  2. [26][26] Jean Feydy, Joan Glaunès, Benjamin Charlier, and Michael Bronstein. Fast geometric learning with symbolic matrices. Advances in Neural Information Processing Systems , 33, 2020. -
  3. [40][40] John Hennessy and David Patterson. Memory hierarchy design. Computer Architecture: A Quantitative Approach , pages 390-525, 2003. -
  4. [44][44] Zhe Jia and Peter Van Sandt. Dissecting the Ampere GPU architecture via microbenchmarking. GPU Technology Conference, 2021. -
  5. [55][55] Ji Lin, Yongming Rao, Jiwen Lu, and Jie Zhou. Runtime neural pruning. In I. Guyon, U. V. Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett, editors, Advances in Neural Information Processing Systems , volume 30. Curran Associates, Inc., 2017. -
  6. [59][59] Frank McSherry, Michael Isard, and Derek G Murray. Scalability! but at what COST ? In 15th Workshop on Hot Topics in Operating Systems (HotOS XV) , 2015. -
  7. [65][65] Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, et al. Pytorch: An imperative style, highperformance deep learning library. Advances in neural information processing systems , 32, 2019. -
  8. [67][67] Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, Ilya Sutskever, et al. Language models are unsupervised multitask learners. OpenAI blog , 1(8):9, 2019. -
  9. [88][88] David P Woodruff. Optimal space lower bounds for all frequency moments. In SODA , volume 4, pages 167-175. Citeseer, 2004. -

Cited by

Sorted by citations

Metadata

Authors
Dao, T., Fu, D. Y., Ermon, S., Rudra, A., & Ré, C.
Venue
arXiv
Publisher
arXiv
Published
2022
Pages
16344-16359
ISSN
1049-5258 (ISSN-L)
OpenAlex
W7133227460
Cited by
1,214
References
0
Citations by year
2026: 555 · 2025: 316 · 2024: 256 · 2023: 86 · 2022: 1
FWCI
132.50
Type
conference paper
Language
en
Open access
Locations
  • neural information processing systems (publishedVersion)
  • arXiv (Cornell University) (submittedVersion)
  • arXiv (Cornell University)
Funders
  • National Science Foundation (1763315, 1563078, 1937301)
  • U.S. Department of Defense (N000141712266)
  • Accenture
  • Nvidia
  • VMware
  • National Institutes of Health (N000141712266, CCF1563078, CCF1763315)
  • National Defense Science and Engineering Graduate
  • Office of Naval Research (N000141712266, ONR-N00014, N00014-20, N00014)
  • National Institute of Biomedical Imaging and Bioengineering (U54EB020405)
Topics
  • Physical Sciences › Computer Science › Hardware and Architecture › Parallel Computing and Optimization Techniques
  • Physical Sciences › Computer Science › Computer Vision and Pattern Recognition › Advanced Neural Network Applications
  • Physical Sciences › Computer Science › Artificial Intelligence › Topic Modeling
Keywords
FlashAttention, memory efficiency, transformer attention, large language models, GPU memory optimization

About these checks

Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.

A language model drew the claims from the paper on 2026-09-28, under version 3 of the claim definition (prompt extract-v3).

A second model labelled each claim on 2026-09-28 (model jev-1.13-20260917, definition revision gold-guideline-v0.2).

Cited sources are checked with a language model’s help (gpt-6-sol).

Statistics and arithmetic are recomputed, not judged.

Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.

What counts as a claim ›How we measure confidence ›How we check this ›

Are you an author, or do you see a problem with this page? Request a review