arXiv:2501.01144cs.CLcs.LG2025-01ICML被引 12

按块精细混合量化,提升大模型推理能效与精度。

BlockDialect: Block-wise Fine-grained Mixed Format Quantization for Energy-Efficient LLM Inference

  • 按块分配最优数据格式,动态适配不同数据分布。
  • 在更低比特下实现比MXFP4高7.48%~10.78%的准确率提升。
  • 适合追求低功耗、高效率的大模型部署场景。

大型语言模型(LLMs)规模快速增大,带来内存占用和计算成本的显著挑战。量化权重和激活可缓解此问题,硬件支持的细粒度缩放成为有前景的解决方案,但现有方法难以捕捉块级数据分布的细微差异。本文提出BlockDialect,一种基于块的细粒度混合格式量化方法,从格式库中为每个块选择最优数制以实现更优的数据表示。同时引入DialectFP4,一个类似方言的FP4变体格式库,适应多样化的数据分布。为高效利用,我们设计了两阶段在线激活量化方案。重要的是,DialectFP4通过选择与低精度整数运算兼容的可表示值,确保能效。BlockDialect在LLaMA3-8B上相较MXFP4实现10.78%的准确率提升,在LLaMA2-7B上提升7.48%,且比特使用更低;即使对全路径矩阵乘法进行量化,精度也仅比全精度低5.45%(LLaMA3-8B)和2.69%(LLaMA2-7B)。本工作聚焦于如何表示数据而非如何缩放,为高效能大模型推理提供新路径。

原文摘要 · Abstract (English)

The rapidly increasing size of large language models (LLMs) presents significant challenges in memory usage and computational costs. Quantizing both weights and activations can address these issues, with hardware-supported fine-grained scaling emerging as a promising solution to mitigate outliers. However, existing methods struggle to capture nuanced block data distributions. We propose BlockDialect, a block-wise fine-grained mixed format technique that assigns a per-block optimal number format from a formatbook for better data representation. Additionally, we introduce DialectFP4, a formatbook of FP4 variants (akin to dialects) that adapt to diverse data distributions. To leverage this efficiently, we propose a two-stage approach for online DialectFP4 activation quantization. Importantly, DialectFP4 ensures energy efficiency by selecting representable values as scaled integers compatible with low-precision integer arithmetic. BlockDialect achieves 10.78% (7.48%) accuracy gain on the LLaMA3-8B (LLaMA2-7B) model compared to MXFP4 format with lower bit usage per data, while being only 5.45% (2.69%) below full precision even when quantizing full-path matrix multiplication. Focusing on how to represent over how to scale, our work presents a promising path for energy-efficient LLM inference.

量化大模型能效

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。