MixLLM通过全局混合精度量化提升大模型压缩效率与精度
MixLLM: LLM Quantization with Global Mixed-precision between Output-features and Highly-efficient System Design
- 按输出特征重要性分配不同精度,全局优化量化策略
- 仅多用10%比特,困惑度降低至0.2,评测损失降至0.99
- 双阶段反量化+流水线设计,实现系统级高效推理
量化是压缩大语言模型的有效方法,但现有方案仍存在精度下降或系统效率低的问题。本文提出MixLLM,基于不同输出特征对模型重要性不同的洞察,从全局视角识别关键输出特征,为最需要的特征分配更高比特宽度,在保证高精度的同时降低内存占用。通过算法-系统协同设计,找到量化配置的最优平衡点。为解决系统瓶颈,设计两步反量化以充分利用Tensor Core,并通过快速数据类型转换减少反量化开销;同时构建软件流水线,最大程度重叠内存访问、反量化与矩阵乘法。大量实验表明,仅增加10%比特,Llama 3.1 70B的困惑度提升可从约0.5降至0.2,MMLU-Pro损失从1.92降至0.99,覆盖三类主流模型。除精度领先外,系统效率也达当前最优。代码已开源:https://github.com/microsoft/MixLLM。
原文摘要 · Abstract (English)
Quantization has become one of the most effective methodologies to compress LLMs into smaller size. However, the existing quantization solutions still show limitations of either non-negligible accuracy drop or low system efficiency. In this paper, we propose MixLLM that explores the optimization space of mixed-precision quantization between output features, based on the insight that different features matter differently in the model. MixLLM identifies the important output features in the global view rather than within each single layer, effectively assigning larger bit-width to output features that need it the most to achieve high accuracy and low memory usage. We present the sweet spot of quantization configuration of algorithm-system co-design with high accuracy and system efficiency. To address the system challenge, we design the two-step dequantization to make use of the Tensor Core easily and fast data type conversion to reduce dequantization overhead, and present the software pipeline to overlap the memory access, dequantization and the MatMul to the best. Extensive experiments show that with only 10\% more bits, the perplexity increase can be reduced from about 0.5 in SOTA to within 0.2 for Llama 3.1 70B, while MMLU-Pro loss can be reduced from 1.92 to 0.99 over the SOTA of three popular models. Besides its superior accuracy, MixLLM also achieves state-of-the-art system efficiency. Code is released at https://github.com/microsoft/MixLLM.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。