针对大模型推理内存瓶颈,提出按通道自适应分配精度的量化方法。
Channel-Wise Mixed-Precision Quantization for Large Language Models
- 按通道分配不同精度,支持任意低比特平均位宽
- 在2-4比特范围内实现比固定精度更高的性能
- 适合资源受限设备部署,尤其对边缘计算友好
大语言模型(LLMs)在多种语言任务中表现卓越,但其庞大的参数量使其在边缘设备上的部署面临巨大内存挑战。仅量化权重是一种有前景的减小内存占用的方法。然而,现有方法主要聚焦于整数位量化,限制了对分数位量化任务的适应性,且无法充分利用设备存储空间。本文提出一种新型混合精度量化方法——通道级混合精度量化(CMPQ),根据激活分布按通道分配不同量化精度。通过为不同权重通道分配不同精度,CMPQ 支持低比特范围内的任意平均位宽(如2至4比特)。该方法采用非均匀量化策略,并结合两种异常值提取技术,协同保留关键信息,从而最小化量化损失。在九种不同大语言模型上的实验表明,CMPQ 不仅在整数位量化任务中提升性能,还在以小幅增加内存使用为代价的混合精度模式下取得显著性能提升。CMPQ 是一种自适应、高效的 LLM 量化方法,在不同设备能力下均具显著优势。
原文摘要 · Abstract (English)
Large Language Models (LLMs) have demonstrated remarkable success across a wide range of language tasks, but their deployment on edge devices remains challenging due to the substantial memory requirements imposed by their large parameter sizes. Weight-only quantization presents a promising solution to reduce the memory footprint of LLMs. However, existing approaches primarily focus on integer-bit quantization, limiting their adaptability to fractional-bit quantization tasks and preventing the full utilization of available storage space on devices. In this paper, we introduce Channel-Wise Mixed-Precision Quantization (CMPQ), a novel mixed-precision quantization method that allocates quantization precision in a channel-wise pattern based on activation distributions. By assigning different precision levels to different weight channels, CMPQ supports arbitrary average bit-widths in the low-bit regime (e.g., between 2 and 4 bits). CMPQ employs a non-uniform quantization strategy and incorporates two outlier extraction techniques that collaboratively preserve the critical information, thereby minimizing the quantization loss. Experiments on nine different LLMs demonstrate that CMPQ not only enhances performance in integer-bit quantization tasks but also achieves significant performance gains with a modest increase in memory usage by performing in a mixed-precision way. CMPQ represents an adaptive and effective approach to LLM quantization, offering substantial benefits across diverse device capabilities.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。