通过重映射冗余零位,提升4比特大模型量化精度。
RaZeR: Pushing the Limits of NVFP4 Quantization with Redundant Zero Remapping
- 利用FP4和块缩放因子的冗余位,扩展有效量化值。
- 相比原NVFP4,平均困惑度损失降低34.6%(仅权重量化)。
- 适合追求高精度4比特推理的工程师与研究者。
最近提出的NVFP4格式在量化大语言模型推理中展现出优异性能与内存优势。然而我们发现其编码存在两类冗余:(1) 由于符号-幅度表示,FP4元素格式天然存在正负零两种未使用量化值;(2) FP8块缩放因子的符号位始终为正,造成冗余。此外,我们发现大模型权重对低精度块缩放因子更具容忍性。基于此,提出冗余零重映射(RaZeR),一种增强型数值格式,在相同内存开销下进一步提升4比特大模型量化精度。RaZeR将块缩放因子的冗余位用于自适应重映射冗余的FP4零至更多量化值,提升精度。为验证实用性,设计了高效的GPU内核支持RaZeR量化模型推理,并提出新型硬件原生支持。大量实验表明,相较于原生NVFP4,RaZeR在仅权重量化和权重量化激活条件下,平均困惑度损失分别降低34.6%和31.2%。代码已开源:https://github.com/yc2367/NVFP4-RaZeR。
原文摘要 · Abstract (English)
The recently introduced NVFP4 format demonstrates remarkable performance and memory benefits for quantized large language model (LLM) inference. However, we observe two types of redundancy in NVFP4 encoding: (1) The FP4 element format naturally exposes an unused quantization value due to its sign-magnitude representation that contains both positive and negative zeros. (2) The FP8 block scaling factor has an unused sign bit because it is always positive. Additionally, we find that LLM weights are more tolerant to a lower-precision block scaling factor. Based on these observations, we propose Redundant Zero Remapping (RaZeR), an enhanced numerical format that pushes the limits of NVFP4 for more accurate LLM quantization under the same memory footprint. RaZeR leverages the redundant bits of the block scaling factor to adaptively remap the redundant FP4 zero to additional quantization values with improved accuracy. To demonstrate the practicality of RaZeR, we design efficient GPU kernels for RaZeR-quantized LLM inference and propose novel hardware to natively support this. Extensive experiments validate RaZeR's superior performance for 4-bit LLM quantization. For example, relative to native NVFP4, RaZeR reduces the average perplexity loss by 34.6% and 31.2% under weight-only and weight-activation quantization, respectively. Code is available at: https://github.com/yc2367/NVFP4-RaZeR.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。