小块量化反导致性能下降,新格式可解决此问题。
Is Finer Better? The Limits of Microscaling Formats in Large Language Models

- 发现更小分块反而降低模型精度,与预期相反。
- 实验证明精度下降源于张量分布窄与量化范围有限的相互作用。
- 提出新格式FP8 UE5M3,兼容硬件且无需全局缩放操作。
微尺度量化通过每块张量量化实现高效模型压缩,但其在硬件上部署需支持原生矩阵乘法并采用高效误差缓解策略。本文报告了微尺度量化中一种意外现象:当分块大小低于阈值时,量化模型输出性能反而下降。这与更小分块应提升表示能力的预期相悖。我们通过实验分析多个大语言模型的分布,识别出异常行为的触发条件;理论框架表明,该现象由窄张量分布与量化尺度动态范围受限共同驱动,与预训练模型及理想分布数据高度吻合。基于此,我们提出使用FP8无符号E5M3(UE5M3)作为微尺度格式中的尺度新格式,其性能与传统FP8无符号E4M3相当,同时避免了权重和激活的全局缩放操作。
原文摘要 · Abstract (English)
Microscaling data formats leverage per-block tensor quantization to enable aggressive model compression with limited loss in accuracy. Unlocking their potential for efficient training and inference necessitates hardware-friendly implementations that handle matrix multiplications in a native format and adopt efficient error-mitigation strategies. Herein, we report the emergence of a surprising behavior associated with microscaling quantization, whereas the output of a quantized model degrades as block size is decreased below a given threshold. This behavior clashes with the expectation that a smaller block size should allow for a better representation of the tensor elements. We investigate this phenomenon both experimentally and theoretically, decoupling the sources of quantization error behind it. Experimentally, we analyze the distributions of several Large Language Models and identify the conditions driving the anomalous behavior. Theoretically, we lay down a framework showing remarkable agreement with experimental data from pretrained model distributions and ideal ones. Overall, we show that the anomaly is driven by the interplay between narrow tensor distributions and the limited dynamic range of the quantized scales. Based on these insights, we propose the use of FP8 unsigned E5M3 (UE5M3) as a novel hardware-friendly format for the scales in FP4 microscaling data types. We demonstrate that UE5M3 achieves comparable performance to the conventional FP8 unsigned E4M3 scales while obviating the need of global scaling operations on weights and activations.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。