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

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

11 Jul 2024arXiv:2407.08608archive 2025-07-28

Jay Shah, Ganesh Bikshandi, Ying Zhang, Vijay Thakkar, Pradeep Ramani, Tri Dao

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× 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× lower numerical error than a baseline FP8 attention.

PaperPDFCodeCode Syntology ran

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):

Code

Syntology 18 code samples harvested from 1 repository linked to this paper: 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. Where Syntology's instrument failed: 4 where our contract draft was wrong; 5 where the contract check could not run; failures of Syntology's instrument, not of the code.

By repository: official repository: 18 samples from 1 repository, 16 ran (7 with no instrument failure; 9 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 1 of its repositories that Syntology harvested for other papers:

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.

dao-ailab/flash-attention officialmentioned in paperpytorchBSD-3-ClauseSyntology: 18 samples, 16 ran (9 instrument-failed) · 2 unverified report
sandai-org/magiattention mentioned on GitHubpytorchSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to Ring Attention with Blockwise Transformers for Near-Infinite Context (arXiv:2310.01889; that paper's own run record: 20 ran (of which 0 constructed an object rather than computing a result; 14 with no instrument failure: 3 honoured, 3 violated, 8 with no contract checked; 6 where Syntology's instrument failed) · 8 unverified); nothing checks that they implement this paper's method. report

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

18 samples harvested: 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. “Where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Syntology's record for this page last changed ; when this build read Syntology's graph is in the build record. That date is not when the samples ran.

4ran · honoured contract
4ran · our draft was wrong
5ran; the contract check could not run
3ran
2unverified

Licence: 10 of the 18 samples are pointer only, meaning Syntology does not serve that copy's text. For 10 of them, this paper's copy is under a permissive licence and cleared, but the stored copy of the same code that Syntology serves is not; the licence label's tooltip gives Syntology's recorded reason. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from dao-ailab/flash-attention. “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.

dao-ailab/flash-attention official repository 18 samples, 16 ran (9 instrument-failed) · 2 unverified
apply_rotary_emb_torch in 8 papers flash_attn/layers/rotary.py ran; the contract check could not run (RAISES) BSD-3-Clause (permissive) here; the stored copy is pointer only · 5ec949977c334f87 · report fixture: signature x:Tensor/4/float, cos:Tensor/2/float, sin:Tensor/2/float, interleaved:bool/0/bool · returned Tensor · level recorded 2026-09-24
attention_pytorch flash_attn/cute/benchmark_flash_attention_fp8.py ran; the contract check could not run (RAISES) · metamorphic tier: invariant fingerprinted BSD-3-Clause (permissive) · 4afe00a5853d633f · report fixture: signature qkv:Tensor/5/float, causal:bool/0/bool · returned Tensor · level recorded 2026-09-22
attention_pytorch benchmarks/benchmark_flash_attention.py ran; the contract check could not run (RAISES) BSD-3-Clause (permissive) · 942ce4d7b0714c0a · report fixture: signature qkv:Tensor/5/float, dropout_p:float/0/float, causal:bool/0/bool · returned Tensor · level recorded 2026-09-24
convert_blockmask flash_attn/flash_blocksparse_attn_interface.py ran; the contract check could not run (RAISES) BSD-3-Clause (permissive) here; the stored copy is pointer only · cc628b160e090ba1 · report fixture: signature blockmask:Tensor/2/float, causal:bool/0/bool · returned Tensor · level recorded 2026-09-24
efficiency flash_attn/cute/benchmark_flash_attention_fp8.py ran · honoured contract fingerprinted BSD-3-Clause (permissive) · f29cb637db3ec374 · report fixture: signature flop:int/0/int, seconds:float/0/float · returned float · level recorded 2026-09-22
efficiency benchmarks/benchmark_flash_attention.py ran · honoured contract fingerprinted BSD-3-Clause (permissive) · b5de75d142329f03 · report fixture: signature flop:float/0/float, time:float/0/float · returned float · level recorded 2026-09-24
flash_attn_qkvpacked_func flash_attn/flash_attn_interface.py ran BSD-3-Clause (permissive) here; the stored copy is pointer only · 7541ce9614862680 · report fixture: returned Tensor · level recorded 2026-09-24
flops flash_attn/cute/benchmark_flash_attention_fp8.py ran · honoured contract fingerprinted BSD-3-Clause (permissive) · e73bdfbda28da341 · report fixture: signature batch:int/0/int, seqlen:int/0/int, headdim:int/0/int, nheads:int/0/int, causal:bool/0/bool · returned int · level recorded 2026-09-22
flops benchmarks/benchmark_flash_attention.py ran BSD-3-Clause (permissive) · 8d5fb28ca2f46eb8 · report fixture: signature batch:int/0/int, seqlen:int/0/int, headdim:int/0/int, nheads:int/0/int, causal:bool/0/bool, mode:str/0/str · returned int · level recorded 2026-09-24
init_to_zero in 17 papers flash_attn/flash_attn_triton.py ran · our draft was wrong BSD-3-Clause (permissive) here; the stored copy is pointer only · 1586b639a5abd0b0 · report fixture: signature name:str/0/str · returned function · level recorded 2026-09-24
maybe_contiguous in 8 papers flash_attn/flash_attn_interface.py ran · our draft was wrong fingerprinted BSD-3-Clause (permissive) here; the stored copy is pointer only · 19ad2ccd82e378c1 · report fixture: signature x:Tensor/3/float · returned Tensor · level recorded 2026-09-24
pad_input in 16 papers flash_attn/bert_padding.py ran BSD-3-Clause (permissive) here; the stored copy is pointer only · a8cf6124094beaab · report fixture: signature hidden_states:Tensor/2/float, indices:Tensor/1/int, batch:int/0/int, seqlen:int/0/int · returned Tensor · level recorded 2026-09-24
rotate_half in 424 papers
census: 24 implementations from 96 papers, 4 distinct outputs across 2 buckets, one shared input per bucket
flash_attn/layers/rotary.py ran; the contract check could not run (RAISES) fingerprinted BSD-3-Clause (permissive) here; the stored copy is pointer only · 163292f43a3c861b · report fixture: signature x:Tensor/2/float, interleaved:bool/0/bool · returned Tensor · level recorded 2026-09-24
round_multiple flash_attn/flash_attn_interface.py ran · honoured contract fingerprinted BSD-3-Clause (permissive) here; the stored copy is pointer only · a0595f1c95cacf06 · report fixture: signature x:int/0/int, m:int/0/int · returned int · level recorded 2026-09-24
unpad_input in 12 papers flash_attn/bert_padding.py ran · our draft was wrong BSD-3-Clause (permissive) here; the stored copy is pointer only · d84093c20a0ed8fd · report fixture: signature hidden_states:Tensor/3/float, attention_mask:Tensor/2/int, unused_mask:Tensor/2/int · returned tuple · level recorded 2026-09-24
unpad_input_for_concatenated_sequences in 5 papers flash_attn/bert_padding.py ran · our draft was wrong fingerprinted BSD-3-Clause (permissive) here; the stored copy is pointer only · 62394c842aafb022 · report fixture: signature hidden_states:Tensor/3/float, attention_mask_in_length:Tensor/2/int · returned tuple · level recorded 2026-09-24
convert_to_cudnn_type hopper/benchmark_flash_attention_fp8.py unverified BSD-3-Clause (permissive) · a9519adef33152bb · report
cudnn_spda_setup hopper/benchmark_flash_attention_fp8.py unverified BSD-3-Clause (permissive) · 58ebcd8dbefa010d · report

Tasks

Quantization

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

Absolute Position EncodingsAdamAttentionBPEDense ConnectionsDropoutLabel SmoothingLayer NormalizationLinear LayerMulti-Head AttentionPosition-Wise Feed-Forward LayerResidual ConnectionSPEEDSoftmaxTransformer

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