Repository navigation
Releases
20261130 SageAttention 2.2.0 + SageAttention 3 1.0.0
Upstream merge
Merged 11 upstream commits through cd00653, covering CUDA stream and device handling, Blackwell SM-count detection, 64-bit Triton indexing, and C++ standard selection. Upstream changes
Optimizations
- SageAttention 2.2 reduces shared-memory bank conflicts in the SM120 V transpose.
- SageAttention 3 reduces Windows kernel launch overhead, quantizes strided V directly, and fuses BF16 mean correction on Windows SM120.
On RTX 5090, median Sage3 attention latency on MiniMax H3 Video fell 25.0% at 4,862 tokens and 7.2% at 13,546 tokens versus the 20261124 release.
20261124 sageattention-2.2.0 + sageattn3-1.0.0
Optimizations
- SageAttention 3 shape routing uses measured sequence-length cutoffs to select SageAttention 2.2 for eligible BF16 self-attention calls through
sageattn3_blackwell. Routing is enabled on Windows with an RTX 5090, PyTorch 2.12.1+cu130, and a compatible SageAttention 2.2 installation. The cutoff depends on head count, head dimension, and Q/K/V layout. - SageAttention 3 V quantization evaluates up to three E4M3 scales per 16-token value block. It tests the rounded
amax / 6scale and its finite neighbors, then picks the candidate with the lowest NVFP4 reconstruction error. Inspired by [ScaleSweep](https://arxiv.org/abs/2606.07618).
Validation
On the 3,097-token MiniMax H3 Image replay, shape routing lowered attention P50 from 1.218 ms to 0.820 ms and relative L1 error from 6.06% to 1.06% compared with direct Sage3. [Benchmarks and image comparisons](https://github.com/mengqin/SageAttention/blob/05b1fda8a1a5f445601662c5ec7e073cac4a645b/README.md#windows-performance-and-accuracy)
20261123 sageattention-2.2.0 + sageattn3-1.0.0
Starting with this release, both packages ship as cp310-abi3 wheels. Choose the wheel that matches your PyTorch and CUDA build. The same wheel works across CPython 3.10 and later versions supported by that PyTorch build.
Supported versions
- Added Windows builds for CUDA 13.0, 13.2, and 13.4, with PyTorch versions up to 2.15.0.
- CUDA 12.8 builds are available for both packages. CUDA 12.4 and 12.6 builds are available for SageAttention 2.2.
Optimizations
- SageAttention 2.2 uses standard E4M3 conversion and computes softmax row sums from the rounded FP8 probabilities on supported paths. It keeps FP32 row sums when returning log-sum-exp and reduces peak memory during FP8 value quantization. [VC-Attention](https://arxiv.org/abs/2609.15810)
- SageAttention 3 selects the NVFP4 scale with the lowest reconstruction error from five candidates per Q/K block. It also fuses Q centering with FP4 quantization on aligned inputs. [Four Over Six](https://arxiv.org/abs/2512.02010)
Fixes
- SageAttention 2.2 fixed CUDA Graph replay, causal masking for unequal query and key lengths, and NaNs in zero-scale FP8 value channels.
- SageAttention 3 fixed causal and padding masks after FP4 token permutation and restored accumulation for the key block before the causal diagonal. [Upstream #410](thu-ml#410) · [Upstream #408](thu-ml#408)
- Windows builds fixed a CUDA 13 PTX compilation error on Hopper.
20251229 sageattention-2.2.0 + sageattn3-1.0.0
Staying in sync with the upstream code, the upstream project has restored some pull requests, including support for sm12.1.
20251214 sageattention-2.2.0 + sageattn3-1.0.0
Synchronized with upstream code, fixed the crash issue in Sage Attention 3, and resolved other build problems.
20251207 sageattention-2.2.0
Sage Attention 2.2.0 build based on the original branch from 2025/12/7.