arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2501.01144cs.CLcs.LG
收藏

BlockDialect:面向节能 LLM 推理的分块细粒度混合格式量化

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

Department of Electrical Engineering, Stanford University, CA, USA(电气工程系,斯坦福大学)

Wonsuk Jang, Thierry Tambe

AI总结:

本文提出 BlockDialect 分块混合格式量化及 DialectFP4 格式簿,通过逐块选择最优 FP4 变体,在更低比特开销下显著提升 LLM 全路径量化推理的准确率与能效。

摘要:

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

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑