针对FP4量化性能不如预期的问题,提出专为微缩浮点格式优化的新方法。
Bridging the Gap Between Promise and Performance for Microscaling FP4 Quantization
- 设计针对FP4特性的MR-GPTQ算法,融合块哈达玛变换与格式优化。
- 在NVIDIA B200上实现3.6倍层内加速,RTX5090上达6倍层内加速。
- 显著提升MXFP4精度,接近NVFP4水平,适合追求极致性能的部署场景。
近期支持在NVIDIA和AMD GPU上的硬件加速微缩4位浮点格式(如MXFP4和NVFP4)被寄予厚望,有望革新大语言模型推理。然而其实际效益尚未证实。本文首次对后训练量化中的MXFP4与NVFP4进行系统研究,揭示了理论承诺与现实表现间的差距。分析表明,现有方法在处理FP4时面临两大挑战:(1) NVFP4的小分组大小会破坏传统异常值缓解技术;(2) MXFP4的2次幂缩放量化引入高误差,严重损害精度。为此,我们提出Micro-Rotated-GPTQ(MR-GPTQ),一种适配FP4特性的GPTQ变体,通过块级哈达玛变换和格式定制优化,显著提升性能。我们还开发了高性能GPU核函数,通过权重量化旋转融合与激活的快速在线计算,实现近乎零开销的部署。实验显示,在NVIDIA B200上,层内速度提升最高达3.6倍,端到端提升2.2倍;在RTX5090上,层内提速达6倍,端到端提升4倍。广泛实验证明,MR-GPTQ在精度上可匹敌甚至超越现有最优方案,大幅改善MXFP4表现,使其接近NVFP4水平。结论表明,尽管FP4并非自动优于INT4,但格式专用方法如MR-GPTQ可开启新的精度-性能平衡边界。
原文摘要 · Abstract (English)
The recent hardware-accelerated microscaling 4-bit floating-point formats such as MXFP4 and NVFP4, supported on NVIDIA and AMD GPUs, promise to revolutionize large language model (LLM) inference. Yet, their practical benefits remain unproven. We present the first comprehensive study of MXFP4 and NVFP4 for post-training quantization, revealing gaps between their promise and real-world performance. Our analysis shows that state-of-the-art methods struggle with FP4, due to two key issues: (1) NVFP4's small group size provably neutralizes traditional outlier mitigation techniques; (2) MXFP4's power-of-two scale quantization severely degrades accuracy due to high induced error. To bridge this gap, we introduce Micro-Rotated-GPTQ (MR-GPTQ), a variant of the classic GPTQ quantization algorithm that tailors the quantization process to FP4's unique properties, by using block-wise Hadamard transforms and format-specific optimizations. We support our proposal with a set of high-performance GPU kernels that enable the MR-GPTQ format with negligible overhead, by rotation fusion into the weights, and fast online computation of the activations. This leads to speedups vs. FP16 of up to 3.6x layer-wise, and 2.2x end-to-end on NVIDIA B200, and of 6x layer-wise and 4x end-to-end on RTX5090. Our extensive empirical evaluation demonstrates that MR-GPTQ matches or outperforms state-of-the-art accuracy, significantly boosting MXFP4, to the point where it can near the accuracy that of NVFP4. We conclude that, while FP4 is not an automatic upgrade over INT4, format-specialized methods like MR-GPTQ can unlock a new frontier of accuracy-performance trade-offs.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。