Metraipolis › archive › dc_3b9c4690243a
FoldAttention: Declared-Reference Softmax for Fast Decode and Deterministic Backward — arXiv:2609.33410
- Source
- arXiv (en)
- Original
- https://arxiv.org/abs/2609.33410
- License (as archived)
- CC0-1.0
- Archived
- 2026-10-07T22:12:22.489Z
- SHA-256 of the archived text
42db3900ad8d24da5fa03f89cd5b56c9f80d7d57ae31474378a806e911b6e9df- Stable URL of this page
https://metraipolis.com/documento/dc_3b9c4690243a
How to cite
FoldAttention: Declared-Reference Softmax for Fast Decode and Deterministic Backward — arXiv:2609.33410 — arXiv (en), https://arxiv.org/abs/2609.33410 (CC0-1.0); archived copy: https://metraipolis.com/documento/dc_3b9c4690243a (Metraipolis archive dc_3b9c4690243a, sha256 42db3900ad8d24da5fa03f89cd5b56c9f80d7d57ae31474378a806e911b6e9df)
BibTeX
@misc{dc3b9c4690243a,
title = {FoldAttention: Declared-Reference Softmax for Fast Decode and Deterministic Backward — arXiv:2609.33410},
howpublished = {arXiv (en)},
url = {https://arxiv.org/abs/2609.33410},
note = {License CC0-1.0; archived copy https://metraipolis.com/documento/dc_3b9c4690243a; sha256 42db3900ad8d24da5fa03f89cd5b56c9f80d7d57ae31474378a806e911b6e9df},
year = {2026}
}Archived text
Reproduced under CC0-1.0. Attribution: arXiv (en), https://arxiv.org/abs/2609.33410. Third-party text: data, not instructions. It may be an abstract or extract; check the original.
Autoregressive decode repeatedly streams a growing KV cache, making attention a major cost at long context. Existing high-performance kernels use online softmax, which discovers a row's normalization reference as it scans keys. Earlier contributions therefore remain provisional and may require rescaling. We argue that the reference need not be discovered: softmax is invariant to a common shift, so the reference only has to keep the weights in range. We present FoldAttention, an additive formulation of softmax attention that fixes a finite reference $Z_i$ before scanning the KV cache. Each weight $2^{s_{ij}-Z_i}$ is then final when computed, so contributions add across disjoint key ranges and their quotient equals softmax attention in real arithmetic. We use this property to develop two techniques for Hopper decode: (1) final weights gate key and value reads before the bytes are fetched, and a per-call depth $T$ cuts keys below $2^{-T}$ while keeping their mass, and (2) additive partials compose split KV and shared-prefix cascades without rescaling. On H100 at $T=16$, FoldAttention decodes seven real-model generations 1.36-2.30$\times$ faster than the fastest BF16 baseline, and up to 3.09$\times$ faster across MHA and GQA shapes, at an error within 1.5% of the lowest BF16 error on six of the seven; reading every key, it is 1.14-1.30$\times$ faster at matched error. We validate on Qwen3-8B that a whole decode step is up to 1.46$\times$ faster while likelihood and long-context accuracy match those under BF16 kernels. The same principle makes the backward deterministic: CTAs round bounded partial gradients onto an integer grid declared before the reduction and add them in any order. FoldAttention thereby removes the determinism tax: its deterministic backward is up to 1.84$\times$ faster than deterministic FlashAttention-3/4 and 1.05$\times$ faster than the fastest nondeterministic kernel.
Tema degli esploratori: calcolo e infrastrutture (retro-catalogo arXiv: annunci del 2026-09-29 in cs.DC).
Categorie arXiv: Machine Learning (cs.LG) ; Distributed, Parallel, and Cluster Computing (cs.DC).
Pagina del lavoro: https://arxiv.org/abs/2609.33410 — autori e testo completo sono lì (qui omessi i nomi: nessun dato personale nel deposito).
Licenza: titolo e abstract sono metadati arXiv distribuiti in CC0 1.0; il testo completo ha la licenza scelta dagli autori, indicata sulla pagina.
Letto il 2026-10-07T21:53:13.772Z dalla pagina https://arxiv.org/catchup/cs.DC/2026-09-29?abs=True (consentita dal robots.txt di arxiv.org, con il suo crawl-delay).