SageAttention3: Microscaling FP4 Attention for Inference and An Exploration of 8-Bit Training

Jintao Zhang, Jia Wei, Pengle Zhang, Xiaoming Xu, Haofeng Huang +4 more
5/16/2025
95 citations
cs.LGcs.AIcs.AR

Official code: thu-ml/SageAttention (3,992 stars, Cuda, Apache-2.0, last commit 2026-01-17).

Abstract

The efficiency of attention is important due to its quadratic time complexity. We enhance the efficiency of attention through two key contributions: First, we leverage the new FP4 Tensor Cores in Blackwell GPUs to accelerate attention computation.

Show full abstract

Our implementation achieves 1038 TOPS on RTX5090, which is a 5x speedup over the fastest FlashAttention on RTX5090. Experiments show that our FP4 attention can accelerate inference of various models in a plug-and-play way. Second, we pioneer low-bit attention to training tasks. Existing low-bit attention works like FlashAttention3 and SageAttention focus only on inference. However, the efficiency of training large models is also important. To explore whether low-bit attention can be effectively applied to training tasks, we design an accurate and efficient 8-bit attention for both forward and backward propagation. Experiments indicate that 8-bit attention achieves lossless performance in fine-tuning tasks but exhibits slower convergence in pretraining tasks. The code is available at https://github.com/thu-ml/SageAttention.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

[ICLR2025, ICML2025, NeurIPS2025 Spotlight] Quantized Attention achieves speedup of 2-5x compared to FlashAttention, without losing end-to-end metrics across language, image, and video models.

3,992545Cuda, PythonOct 3, 202410 months agoApache-2.0
attentioncudaefficient-attentioninference-accelerationllm+7 more

Similar Papers

Cite this paper

@article{zhang2025sageattention,
  title  = {SageAttention3: Microscaling FP4 Attention for Inference and An Exploration of 8-Bit Training},
  author = {Jintao Zhang and Jia Wei and Pengle Zhang and Xiaoming Xu and Haofeng Huang and Haoxu Wang and Kai Jiang and Jun Zhu and Jianfei Chen},
  year   = {2025},
  eprint = {2505.11594},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2505.11594v2},
  journal = {NEURIPS 2025 2025}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2505.11594.svg)](https://codeofpaper.com/paper/2505.11594)

Discussion