arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2603.00040cs.LGcs.AI
收藏

Attn-QAT:4位注意力与量化感知训练

Attn-QAT: 4-Bit Attention With Quantization-Aware Training

Stanford University(斯坦福大学);University of Wisconsin-Madison(威斯康星大学麦迪逊分校);Georgia Institute of Technology(佐治亚理工学院)

Peiyuan Zhang, Matthew Noto, Wenxuan Tan, Chengquan Jiang, Will Lin, Wei Zhou, Hao Zhang

AI总结:

Attn-QAT通过稳定4位量化感知训练实现高效的注意力计算,提升模型推理速度并保持性能。

摘要:

实现可靠的4位注意力是新兴FP4能力GPU上端到端FP4计算的前提,然而由于FP4的动态范围极小以及注意力的重尾激活特性,注意力仍然是主要障碍。本文首次系统研究了4位量化感知训练(QAT)在注意力中的应用。我们发现,

英文摘要:

Achieving reliable 4-bit attention is a prerequisite for end-to-end FP4 computation on emerging FP4-capable GPUs, yet attention remains the main obstacle due to FP4's tiny dynamic range and attention's heavy-tailed activations. This paper presents the first systematic study of 4-bit quantization-aware training (QAT) for attention. We find ``drop-in'' QAT -- naively combining an FP4 forward pass with high-precision Flash Attention (FA)-style backward pass -- leads to training instability. We identify two key principles for stable FP4 attention: (1) matching low-precision recomputation of attention scores in the backward pass and (2) resolving implicit precision assumptions in FA's gradient calculation. Based on these insights, we propose Attn-QAT and implement fused Triton kernels for training and FP4 inference kernels. Across diffusion and language models, Attn-QAT recovers the quality drop from FP4 attention without explicit outlier-mitigation heuristics used in prior FP4 attention, and delivers up to a 1.5x speedup on an RTX 5090 over SageAttention3 and up to a 1.74x speedup over FA4 on a GB300. Video demos can be found at https://drive.google.com/drive/folders/190F6xbBDUF2kGQYIcXBt3ehSYij5jlim?usp=sharing. Code can be found at https://haoailab.com/FastVideo/training/attn_qat/.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑