Papers › FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
Tri Dao, Daniel Y. Fu, Stefano Ermon, Atri Rudra, Christopher Ré
Transformers are slow and memory-hungry on long sequences, since the time and memory complexity of self-attention are quadratic in sequence length. Approximate attention methods have attempted to address this problem by trading off model quality to reduce the compute complexity, but often do not achieve wall-clock speedup. We argue that a missing principle is making attention algorithms IO-aware -- accounting for reads and writes between levels of GPU memory. We propose FlashAttention, an IO-aware exact attention algorithm that uses tiling to reduce the number of memory reads/writes between GPU high bandwidth memory (HBM) and GPU on-chip SRAM. We analyze the IO complexity of FlashAttention, showing that it requires fewer HBM accesses than standard attention, and is optimal for a range of SRAM sizes. We also extend FlashAttention to block-sparse attention, yielding an approximate attention algorithm that is faster than any existing approximate attention method. FlashAttention trains Transformers faster than existing baselines: 15% end-to-end wall-clock speedup on BERT-large (seq. length 512) compared to the MLPerf 1.1 training speed record, 3× speedup on GPT-2 (seq. length 1K), and 2.4× speedup on long-range arena (seq. length 1K-4K). FlashAttention and block-sparse FlashAttention enable longer context in Transformers, yielding higher quality models (0.7 better perplexity on GPT-2 and 6.4 points of lift on long-document classification) and entirely new capabilities: the first Transformers to achieve better-than-chance performance on the Path-X challenge (seq. length 16K, 61.4% accuracy) and Path-256 (seq. length 64K, 63.1% accuracy).
In Syntology View this paper on Syntology, its page in Syntology's graph. That page adds which of its functions are also present in other papers' code Syntology holds, with dates, and its dated run record as JSON and a README badge. It also lists the repositories linked to the paper, the abstract and the calls for agents.
Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.
For agents, on Syntology's MCP service (how to connect):
get_harvested_code_for_paper(arxiv_id="2205.14135")get_code(code_sha256="…")with a sample'scode_sha256from the list belowget_citation_path(paper_1="2205.14135", paper_2="…")with another paper's arXiv id or titleget_concepts_for_paper(arxiv_id="2205.14135")
Code
No sample from the archive's official repository (dao-ailab/flash-attention) is linked to this paper; the 30 samples below come from 5 repositories the archive does not mark official. Syntology harvested code from dao-ailab/flash-attention for 2 other papers.
dao-ailab/flash-attention: Syntology's graph links these samples to FlashAttention-3: Fast and Accurate Attention with Asynchrony and Low-precision (arXiv:2407.08608; that paper's own run record: 16 ran (of which 0 constructed an object rather than computing a result; 7 with no instrument failure: 4 honoured, 0 violated, 3 with no contract checked; 9 where Syntology's instrument failed) · 2 unverified) and ELSA: Exact Linear-Scan Attention for Fast and Memory-Light Vision Transformers (arXiv:2604.23798; that paper's own run record: 16 ran (of which 0 constructed an object rather than computing a result; 7 with no instrument failure: 4 honoured, 0 violated, 3 with no contract checked; 9 where Syntology's instrument failed) · 2 unverified); nothing checks that they implement this paper's method.
Syntology 30 code samples harvested from 5 repositories linked to this paper: 24 ran (of which 2 constructed an object rather than computing a result; 18 with no instrument failure: 0 honoured, 1 violated, 17 with no contract checked; 6 where Syntology's instrument failed) · 6 unverified. Where Syntology's instrument failed: 5 where our contract draft was wrong; 1 where the contract check could not run; failures of Syntology's instrument, not of the code.
By repository: community (archive-listed): 21 samples from 4 repositories, 17 ran (11 with no instrument failure; 6 where Syntology's instrument failed); found in paper text by Syntology: 9 samples from 1 repository, 7 ran (7 with no instrument failure; 0 where Syntology's instrument failed). The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.
No sample is linked to this paper from 8 of its repositories that Syntology harvested for other papers:
- dao-ailab/flash-attention, official repository: harvested for 2 other papers, listed under the repository
- ROCm/flash-attention, community (archive-listed): harvested for another paper, listed under the repository
- answerdotai/modernbert, community (archive-listed): harvested for 3 other papers, listed under the repository
- csguoh/fastvar, community (archive-listed): harvested for another paper, listed under the repository
- microsoft/chunk-attention, community (archive-listed): harvested for another paper, listed under the repository
- facebookresearch/xformers, community (archive-listed): harvested for 2 other papers, listed under the repository
- pytorch/pytorch, community (archive-listed): harvested for another paper, listed under the repository
- NVIDIA/apex, found in paper text by Syntology: Syntology's graph links these samples to BigBIO: A Framework for Data-Centric Biomedical Natural Language Processing (arXiv:2206.15076; that paper's own run record: 1 ran (of which 0 constructed an object rather than computing a result; 1 with no instrument failure: 0 honoured, 0 violated, 1 with no contract checked; 0 where Syntology's instrument failed) · 0 unverified); nothing checks that they implement this paper's method.
Levels written between 2026-09-22 and 2026-09-24 (UTC): the dates Syntology's graph wrote each sample's verification level, not when the code executed.
13 repositories listed; official and paper-mentioned ones first.
Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.
A paper named beside a repository with no sample linked to this paper is shown with that paper's own run record, not this paper's: “ran” means executed on a synthesized input, not that the code is correct, and “where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Papers are listed in arXiv-id order, at most three per repository.
Code Syntology ran Syntology
30 samples harvested: 24 ran (of which 2 constructed an object rather than computing a result; 18 with no instrument failure: 0 honoured, 1 violated, 17 with no contract checked; 6 where Syntology's instrument failed) · 6 unverified. “Where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Syntology's record for this page has not changed since , the first build that kept a record date for it; when this build read Syntology's graph is in the build record. That date is not when the samples ran.
Licence: 1 of the 30 samples is pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.
Harvested from 5 repositories linked to this paper, official or community; the list below is grouped by repository, each group headed by its name and what it is to the paper. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. A line beginning “fixture:” under a sample that ran gives the arguments Syntology's fixture called the sample with, each as name:type/rank/element kind (? where none was recorded), and the type of what the fixture's run returned, exactly as the harness recorded them; the arguments and the returned type were recorded by two separate runs of the same fixture. No output value is shown, and a returned type says nothing about whether the output was right. “Level recorded” gives the UTC date when Syntology's graph wrote the sample's verification level, not when the code executed; where the level was written before Syntology's graph kept that date, the row says “level recorded, date not recorded”. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself. “Our draft was wrong” and “the contract check could not run” are failures of Syntology's instrument, not of the code: the sample ran on Syntology's synthesized input, and then the drafted contract did not describe it, or the check itself raised an error (RAISES), lacked a dependency (DEP_MISSING) or ran out of time (TIMEOUT); hover the label for which. A metamorphic tier, where shown, is evidence of the output's shape, not that the sample implements the method.
Each sample ends with its code_sha256. A sample's code_sha256 is Syntology's identity for that exact code. It is printed in full (16 hexadecimal characters for every sample in this build), and get_code(code_sha256="…") takes it exactly as printed. An agent calls it on Syntology's MCP service (how to connect); click an identity to copy that call.
Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples are grouped by repository: a repository marked official first, then by how directly the repository is tied to the paper, then in the archive's order; never by how many ran. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of six reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar); this paper's copy was not located, so its licence is not recorded; or this paper's copy is cleared, but the stored copy of the same code that Syntology serves is not. Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.
A function or class name links to its page when the name occurs in the harvested code of at least 5 papers; the name is a string, not an identity. A census tag appears when Syntology's census ran implementations with that name on one shared input per bucket: it gives how many were compared, from how many papers, and how many distinct outputs they produced, and names this sample's bucket when this sample was one of them.
3a48757821245a9c · report
fixture: returned FlashSelfAttention · level recorded 2026-09-22 7ec53192aa7f5504 · report
fixture: signature q:Tensor/5/float, k:Tensor/5/float, v:Tensor/5/float, bias:Tensor/4/float, mask:Tensor/3/bool · returned Tensor · level recorded 2026-09-24 e70a5be792d21381 · report
fixture: signature fn:callable/0/? · returned function · level recorded 2026-09-24 8c357c18a7a5df9f · report
fixture: signature fn:callable/0/? · returned function · level recorded 2026-09-24 f6a5967228c7a9d2 · report
fixture: signature n:int/0/int, d:int/0/int, h:int/0/int, use_mask:bool/0/bool, device:device/0/?, dtype:dtype/0/?, batch:int/0/int, std:float/0/float · returned tuple · level recorded 2026-09-24 dfce9c8c32b2f721 · report
fixture: signature dtype:dtype/0/? · returned float · level recorded 2026-09-24 405da6c9ec4f68dd · report
fixture: signature value:str/0/str · returned list · level recorded 2026-09-24 1b603b0ef7263401 · report
fixture: signature q:Tensor/5/float, k:Tensor/5/float, v:Tensor/5/float, bias:Tensor/4/float, mask:Tensor/3/bool · returned Tensor · level recorded 2026-09-24 7f47b6e7368cff8b · report
fixture: signature value:str/0/str · returned list · level recorded 2026-09-24 5e1eae834b42ab87 · report
fixture: signature arr:list/1/Tensor · returned Tensor · level recorded 2026-09-22 2ae574072ec6f776 · report
fixture: signature fn:callable/0/? · returned function · level recorded 2026-09-22 a0902e24bf5299e7 · report
fixture: signature t:Tensor/2/float, ps:list/1/Size, pattern:str/0/str · returned Tensor · level recorded 2026-09-22 a91304b317adcfe6 · report
86ca4a3f9ab20a35 · report
836e169269626b2d · report
fixture: returned FlashCosineSimAttention · level recorded 2026-09-22 445b382660c20892 · report
fixture: signature q:Tensor/4/float, k:Tensor/4/float, v:Tensor/4/float, mask:Tensor/2/bool, scale:int/0/int, groups:int/0/int, causal:bool/0/bool, l2norm_qk:bool/0/bool, use_triton:bool/0/bool, sequence_parallel:bool/0/bool · returned Tensor · level recorded 2026-09-22 bf71ddb7b6318152 · report
fixture: signature t:Tensor/2/float, groups:int/0/int · returned Tensor · level recorded 2026-09-22 census: 12 implementations from 20 papers, 3 distinct outputs on one shared input this sample: bucket 1 of 1, arg 1: rank 2, kind float, dtype float32 flash_cosine_sim_attention/flash_cosine_sim_attention.py ran · our draft was wrong fingerprinted MIT (permissive) ·
ebc7297040578822 · report
fixture: signature t:Tensor/2/float · returned Tensor · level recorded 2026-09-22 ccb62a80e7c1e0af · report
fixture: signature t:Tensor/2/float · returned Tensor · level recorded 2026-09-22 69095fe94801bb6a · report
518990c8ea44ffc6 · report
e370fc6ece6221ed · report
fixture: signature from_blocked_mask:ArrayImpl/3/float, to_blocked_mask:ArrayImpl/3/float · returned ArrayImpl · level recorded 2026-09-24 0d78a4ebde5b96c9 · report
fixture: signature file_path:str/0/str, batch_size:int/0/int · returned DatasetV1Adapter · level recorded 2026-09-24 64a65eaa8e65ea8c · report
fixture: signature file_path:str/0/str, batch_size:int/0/int · returned DatasetV1Adapter · level recorded 2026-09-24 59e4e06672a6c268 · report
fixture: signature file_path:str/0/str, batch_size:int/0/int · returned DatasetV1Adapter · level recorded 2026-09-24 1affbc4020c2fc7b · report
fixture: signature x:dict/0/? · returned dict · level recorded 2026-09-24 60bb0fb77bbdfb3e · report
fixture: signature max_len:int/0/int · returned function · level recorded 2026-09-24 fbeafd410f521a6f · report
fixture: signature text:str/0/str · returned list · level recorded 2026-09-24 5aedb376f0772dfe · report
5e965cd1402c118a · report
Method as code Syntology
What Syntology's graph records as this paper's claimed method, lifted into code: each assembly names its bricks (functions and classes), each with its own role and its own verification level. An assembly is not a check that the code implements the method correctly or reproduces the paper's results. Levels are each brick's own verification level in Syntology's graph (level 0: no recorded run), listed brick by brick and never combined into one level; “ran” means the brick executed on a synthesized input, not that its output is correct, and the instrument figure counts failures of Syntology's instrument, not of the code. Where a model read the code against the paper's claim, each assembly's label verdict is one model's judgement, kept in this page's JSON twin; it is not calibrated, so no card prints it. Siblings are assemblies lifted from this paper in the same batch for the same method: alternative readings kept side by side; none replaces or supersedes another.
3 assemblies on this paper: 3 harvested, 0 generated, listed in 1 groups (siblings lifted in one batch form one group).
3 sibling assemblies for FlashAttention (harvested), lifted in the same batch on 2026-09-09: alternative readings kept side by side; none replaces or supersedes another.
harvested Assembly for FlashAttention (graph method: FlashAttention). 1 brick; individually on a fixture: 1 ran (of which 1 constructed an object rather than computing a result; 1 with no instrument failure: 0 honoured, 0 violated, 1 with no contract checked; 0 where Syntology's instrument failed) · 0 unverified; the one sample that ran constructed an object rather than computing a result. The assembly has not been run end-to-end.
one of 3 siblings
- FlashSelfAttention entry · level 1 · ran ·
3a48757821245a9c
harvested Assembly for FlashAttention (graph method: FlashAttention). 8 bricks; individually on a fixture: 6 ran (of which 1 constructed an object rather than computing a result; 2 with no instrument failure: 0 honoured, 1 violated, 1 with no contract checked; 4 where Syntology's instrument failed) · 2 unverified. The assembly has not been run end-to-end.
one of 3 siblings
- flash_cosine_sim_attention entry · level 1 · ran; the contract check could not run (DEP_MISSING) ·
445b382660c20892 - exists helper · level 1 · ran · violated contract ·
aa5486a3650902d8 - flash_cosine_sim_attention_cpu helper · level 0 · unverified ·
69095fe94801bb6a - l2norm_tensors helper · level 0 · unverified ·
518990c8ea44ffc6 - grouped_l2norm helper · level 1 · ran · our draft was wrong ·
bf71ddb7b6318152 - l2norm helper · level 1 · ran · our draft was wrong ·
ebc7297040578822 - l2norm_cpu helper · level 1 · ran · our draft was wrong ·
ccb62a80e7c1e0af - FlashCosineSimAttention helper · level 1 · ran ·
836e169269626b2d
harvested Assembly for FlashAttention (graph method: FlashAttention). 7 bricks; individually on a fixture: 5 ran (of which 0 constructed an object rather than computing a result; 3 with no instrument failure: 0 honoured, 3 violated, 0 with no contract checked; 2 where Syntology's instrument failed) · 2 unverified. The assembly has not been run end-to-end.
one of 3 siblings
- Attend entry · level 0 · unverified ·
a91304b317adcfe6 - and_reduce helper · level 1 · ran · violated contract ·
5e1eae834b42ab87 - default helper · level 1 · ran · violated contract ·
60fff7c3c400d7ff - exists helper · level 1 · ran · violated contract ·
aa5486a3650902d8 - pack_one helper · level 0 · unverified ·
86ca4a3f9ab20a35 - unpack_one helper · level 1 · ran · our draft was wrong ·
a0902e24bf5299e7 - once helper · level 1 · ran · our draft was wrong ·
2ae574072ec6f776
Each brick ends with its code_sha256, Syntology's identity for that exact code; click one to copy the get_code call that returns it. For agents, on Syntology's MCP service: assembly(arxiv_id="2205.14135") returns these assemblies with each brick's role and wiring (how to connect).
Tasks
1 archive task tag without a task page not shown.
Results from the paper archive 2025-07-28
No leaderboard rows for this paper in the archive.
Methods
Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections