MXAttention: Data-Free Optimal Scaling and Pre-Normalization Quantization for MXFP4 Attention

Jianlin Yu, Jing Lin, Linghui Kong, Aiyue Chen, Weiyi Sun +11 more
7/27/2026
cs.LGcs.AIcs.CV

No confident code implementation found for this paper. 2 possible matches can be shown below.

Abstract

The quadratic cost of attention is a major bottleneck in diffusion-based video generation models. MXFP4 attention provides a promising path toward efficient inference, but direct MXFP4 quantization often degrades generation quality due to two numerical issues: the clipping-underflow trade-off from power-of-two scaling and the row-wise normalization error introduced in the softmax loop. We propose MXAttention, a data-free post-training quantization framework for MXFP4 attention. MXAttention introduces two components: Universal Optimal Scaling (UOS), which exploits the periodic structure of power-of-two microscaling to derive a distribution-independent optimal scaling boundary Qmax=7.25 without calibration or search, and Pre-Normalization Quantization (PNQ), which quantizes unnormalized softmax exponentials before row-wise summation to preserve normalization by construction. Experiments on Wan2.2 and HunyuanVideo show that MXAttention closes at least 95% of the VBench Imaging Quality gap between OCP MXFP4 and FP16, substantially improves frame-level similarity, and preserves FP16-level generation quality with less than 0.01 absolute degradation on all reported VBench metrics. MXAttention also achieves performance competitive with strong NVFP4-based baselines with negligible overhead when fused into the attention pipeline. The implementation is publicly available in MindIE-SD.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 2 weaker matches are hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{yu2026mxattention,
  title  = {MXAttention: Data-Free Optimal Scaling and Pre-Normalization Quantization for MXFP4 Attention},
  author = {Jianlin Yu and Jing Lin and Linghui Kong and Aiyue Chen and Weiyi Sun and Chenyu Zeng and Wangli Lan and Jinxi Li and Zhuo Zheng and Ziyang Yue and Danning Ke and Fei Yi and Tianchi Hu and Yuan Ding and Yiwu Yao and Junsong Wang},
  year   = {2026},
  eprint = {2607.24377},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2607.24377v1}
}

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/2607.24377.svg)](https://codeofpaper.com/paper/2607.24377)

Discussion