对比细粒度低比特量化,发现整数格式在8比特时更优,4比特则需技巧才能胜出。
INT v.s. FP: A Comprehensive Study of Fine-Grained Low-bit Quantization Formats
- 比较了整数与浮点在细粒度量化中的表现,重点分析块大小32的8比特格式。
- MXINT8在精度和硬件效率上优于对应浮点格式,而NVINT4经优化可超越NVFP4。
- 提出对称裁剪方法,使8比特整数训练几乎无损,适合未来芯片设计参考。
现代AI硬件如Nvidia Blackwell架构正越来越多采用低精度浮点(FP)格式以应对大语言模型中普遍存在的激活异常值。然而,针对不同粒度下FP与整数(INT)量化格式的统一比较仍缺位,导致算法与硬件协同设计缺乏明确指导。本文系统研究了两者之间的权衡,揭示关键性能转折点:粗粒度量化中FP占优,但细粒度(块级)情况下更为复杂。研究表明,对于主流8比特细粒度格式(如块大小32的MX),MXINT8在算法精度与硬件效率上均优于其对应的FP版本;而对于4比特格式,尽管FP(如MXFP4、NVFP4)通常精度更高,但通过哈达玛旋转等异常值抑制技术,NVINT4可超越NVFP4。此外,我们提出一种对称裁剪方法,解决了细粒度低比特整数训练中的梯度偏差问题,实现MXINT8训练近乎无损性能。这些发现挑战当前硬件发展方向,表明‘一刀切’式浮点方案并非最优,建议未来AI加速器优先采用细粒度整数格式,尤其是MXINT8,以更好平衡精度、功耗与效率。
原文摘要 · Abstract (English)
Modern AI hardware, such as Nvidia's Blackwell architecture, is increasingly embracing low-precision floating-point (FP) formats to handle the pervasive activation outliers in Large Language Models (LLMs). Despite this industry trend, a unified comparison of FP and integer (INT) quantization across varying granularities has been missing, leaving algorithm and hardware co-design without clear guidance. This paper fills that gap by systematically investigating the trade-offs between FP and INT formats. We reveal a critical performance crossover: while FP excels in coarse-grained quantization, the comparison at fine-grained (block-wise) levels is more nuanced. Our comprehensive comparison demonstrates that for popular 8-bit fine-grained formats (e.g., MX with block size 32), MXINT8 is superior to its FP counterpart in both algorithmic accuracy and hardware efficiency. However, for 4-bit formats, FP (e.g., MXFP4, NVFP4) often holds an accuracy advantage , though we show that NVINT4 can surpass NVFP4 when outlier-mitigation techniques like Hadamard rotation are applied. We also introduce a symmetric clipping method that resolves gradient bias in fine-grained low-bit INT training, enabling nearly lossless performance for MXINT8 training. These findings challenge the current hardware trajectory, demonstrating that a one-size-fits-all FP approach is suboptimal and advocating that fine-grained INT formats, particularly MXINT8, offer a better balance of accuracy, power, and efficiency for future AI accelerators.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。