arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2408.08554cs.LG

ABQ-LLM:面向大语言模型的任意比特量化推理加速

ABQ-LLM: Arbitrary-Bit Quantized Inference Acceleration for Large Language Models

Project Leader(项目负责人)

Chao Zeng, Songwei Liu, Yusheng Xie, Hong Liu, Xiaojian Wang, Miao Wei, Shu Yang, Fangmin Chen, Xing Mei

AI总结:

本文提出 ABQ-LLM 任意比特量化算法与 GPU 推理框架,通过分布校正、比特平衡及基于 BTC 等价单元的矩阵乘重构,解决低比特性能下降和精度受限问题。

摘要:

大语言模型(LLM)已经为自然语言处理任务带来了革命性变化。然而,其实际应用受到巨大内存和计算需求的限制。训练后量化(PTQ)被认为是加速 LLM 推理的一种有效方法。尽管 PTQ 在 LLM 模型压缩中日益普及,但其部署面临两大挑战。第一,低比特量化会导致性能下降。第二,受 GPU 上有限的整数计算单元类型限制,不同精度的量化矩阵运算无法得到有效加速。为解决这些问题,我们提出了一种新颖的任意比特量化算法与推理框架 ABQ-LLM。它在多种量化设置下均取得优异性能,并能够在 GPU 上实现高效的任意精度量化推理。ABQ-LLM 引入了若干关键创新:(1)面向 transformer 块的分布校正方法,用于缓解权重和激活完全量化所导致的分布差异,提升低比特宽度下的性能。(2)比特平衡策略,用于抵消极低比特宽度(例如 2 比特)下非对称分布问题造成的性能下降。(3)创新的量化加速框架,基于 BTC(Binary TensorCore)等价单元重构任意精度组合的量化矩阵乘法,摆脱 INT4/INT8 计算单元的限制。ABQ-LLM 能够将每个组件的比特宽度收益转化为实际加速收益,在混合精度(例如 W6A6、W2A8)下最大化性能。在 LLaMA-7B 模型上基于 W2*A8 量化配置,其在 WikiText2 上取得了 7.59 的困惑度(相比 AffineQuant 的 9.76 降低 2.17)。与 SmoothQuant 相比,我们实现了 1.6 倍的加速提升和 2.7 倍的内存压缩收益。

英文摘要:

Large Language Models (LLMs) have revolutionized natural language processing tasks. However, their practical application is constrained by substantial memory and computational demands. Post-training quantization (PTQ) is considered an effective method to accelerate LLM inference. Despite its growing popularity in LLM model compression, PTQ deployment faces two major challenges. First, low-bit quantization leads to performance degradation. Second, restricted by the limited integer computing unit type on GPUs, quantized matrix operations with different precisions cannot be effectively accelerated. To address these issues, we introduce a novel arbitrary-bit quantization algorithm and inference framework, ABQ-LLM. It achieves superior performance across various quantization settings and enables efficient arbitrary-precision quantized inference on the GPU. ABQ-LLM introduces several key innovations: (1) a distribution correction method for transformer blocks to mitigate distribution differences caused by full quantization of weights and activations, improving performance at low bit-widths. (2) the bit balance strategy to counteract performance degradation from asymmetric distribution issues at very low bit-widths (e.g., 2-bit). (3) an innovative quantization acceleration framework that reconstructs the quantization matrix multiplication of arbitrary precision combinations based on BTC (Binary TensorCore) equivalents, gets rid of the limitations of INT4/INT8 computing units. ABQ-LLM can convert each component bit width gain into actual acceleration gain, maximizing performance under mixed precision(e.g., W6A6, W2A8). Based on W2*A8 quantization configuration on LLaMA-7B model, it achieved a WikiText2 perplexity of 7.59 (2.17$\downarrow $ vs 9.76 in AffineQuant). Compared to SmoothQuant, we realized 1.6$\times$ acceleration improvement and 2.7$\times$ memory compression gain.

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

↑