Lune

ICLR2025Top-tier venue

SageAttention: Accurate 8-Bit Attention for Plug-and-play Inference Acceleration

Jintao Zhang, Jia Wei, Pengle Zhang, Jun Zhu, Jianfei Chen

2025Year
70Top-tier citations

Abstract

The transformer architecture predominates across various models. As the heart of the transformer, attention has a computational complexity of O(N 2 ), compared to O(N ) for linear transformations. When handling large sequence lengths, attention becomes the primary time-consuming component. Although quantization has proven to be an effective method for accelerating model inference, existing quantization methods primarily focus on optimizing the linear layer. In response, we first analyze the feasibility of quantization in attention detailedly. Following that, we propose SageAttention, a highly efficient and accurate quantization method for attention. The OPS (operations per second) of our approach outperforms FlashAttention2 and xformers by about 2.1x and 2.7x, respectively. SageAttention also achieves superior accuracy performance over FlashAt-tention3. Comprehensive experiments confirm that our approach incurs almost no end-to-end metrics loss across diverse models-including those for large language processing, image generation, and video generation. The code is available at https://github.com/thu-ml/SageAttention .

Ask about this paper

Your agent reads all of it.

Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.

Questions to start from

Your agent calls

Luneget_paper_fulltext

Ask in Lune

Free to start. No credit card required.

lune papers fulltext 54b74dc3-fb45-4cf5-9767-10119ac4a890

Cited by top-tier papers70

Ask how each one uses it

Builds on41

Related papers

Dusk over the sea between two cliffs drawn in fine vertical lines