SageAttention2++: A More Efficient Implementation of SageAttention2
Jintao Zhang, Xiaoming Xu, Jia Wei, Haofeng Huang, Pengle Zhang, Chendong Xiang, Jun Zhu, Jianfei Chen

TL;DR
SageAttention2++ introduces a more efficient implementation of attention by leveraging FP8 Matmul instructions, achieving significant speedups while maintaining accuracy across multiple model types.
Contribution
It proposes using FP8 Matmul with FP16 accumulation to accelerate SageAttention2, resulting in nearly 4x speedup over FlashAttention without accuracy loss.
Findings
SageAttention2++ is 3.9x faster than FlashAttention.
Maintains the same attention accuracy as SageAttention2.
Effective across language, image, and video models.
Abstract
The efficiency of attention is critical because its time complexity grows quadratically with sequence length. SageAttention2 addresses this by utilizing quantization to accelerate matrix multiplications (Matmul) in attention. To further accelerate SageAttention2, we propose to utilize the faster instruction of FP8 Matmul accumulated in FP16. The instruction is 2x faster than the FP8 Matmul used in SageAttention2. Our experiments show that SageAttention2++ achieves a 3.9x speedup over FlashAttention while maintaining the same attention accuracy as SageAttention2. This means SageAttention2++ effectively accelerates various models, including those for language, image, and video generation, with negligible end-to-end metrics loss. The code will be available at https://github.com/thu-ml/SageAttention.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
- 🤗jt-zhang/SageAttention2_plusmodel· ♡ 26♡ 26
- 🤗jt-zhang/SageAttention3model· ♡ 54♡ 54
- 🤗TurboDiffusion/TurboWan2.1-T2V-1.3B-480Pmodel· ♡ 26♡ 26
- 🤗TurboDiffusion/TurboWan2.2-I2V-A14B-720Pmodel· ♡ 157♡ 157
- 🤗TurboDiffusion/TurboWan2.1-T2V-14B-720Pmodel· ♡ 8♡ 8
- 🤗TurboDiffusion/TurboWan2.1-T2V-14B-480Pmodel· ♡ 10♡ 10
- 🤗vantagewithai/TurboWan2.2-I2V-A14B-720P-ComfyUImodel· ♡ 1♡ 1
- 🤗vantagewithai/TurboWan2.2-I2V-A14B-720P-ComfyUI-GGUFmodel· 254 dl· ♡ 1254 dl♡ 1
- 🤗vantagewithai/TurboWan2.1-T2V-14B-720P-ComfyUImodel
- 🤗vantagewithai/TurboWan2.1-T2V-14B-720P-ComfyUI-GGUFmodel· 85 dl· ♡ 285 dl♡ 2
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsGenerative Adversarial Networks and Image Synthesis · Multimodal Machine Learning Applications · Advanced Neural Network Applications
MethodsSoftmax · Attention Is All You Need
