arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2501.12956cs.LGcs.AImath.OC
收藏

GANQ:面向大语言模型的 GPU 自适应非均匀量化

GANQ: GPU-Adaptive Non-Uniform Quantization for Large Language Models

The University of Hong Kong(香港大学)

Pengxiang Zhao, Xiaoming Yuan

AI总结:

本文提出 GANQ,一种面向 GPU、基于查找表 mpGEMM 的逐层训练后非均匀量化框架,以无需训练的自适应优化降低量化误差,并在 3/4-bit 设置下改善困惑度、实现最高 2.57× 推理加速。

摘要:

大语言模型(LLM)因其巨大的资源需求而面临严峻的部署挑战。尽管低位量化权重能够降低内存使用并提升推理效率,但当前硬件缺乏对混合精度通用矩阵乘法(mpGEMM)的原生支持,导致基于反量化的实现效率低下。此外,均匀量化方法往往无法充分刻画权重分布,从而造成性能下降。我们提出 GANQ(GPU-Adaptive Non-Uniform Quantization,GPU 自适应非均匀量化),这是一种逐层的训练后非均匀量化框架,针对硬件高效、基于查找表的 mpGEMM 进行了优化。GANQ 通过采用无需训练且 GPU 自适应的优化算法来高效降低逐层量化误差,从而获得优异的量化性能。大量实验表明,在 3-bit 和 4-bit 量化下,与最先进方法相比,GANQ 能够缩小与 FP16 基线之间的困惑度差距。此外,在单张 NVIDIA RTX 4090 GPU 上部署时,GANQ 量化后的模型相对基线实现了最高 2.57× 的加速,推动了 LLM 部署中内存与推理效率的提升。

英文摘要:

Large Language Models (LLMs) face significant deployment challenges due to their substantial resource requirements. While low-bit quantized weights can reduce memory usage and improve inference efficiency, current hardware lacks native support for mixed-precision General Matrix Multiplication (mpGEMM), resulting in inefficient dequantization-based implementations. Moreover, uniform quantization methods often fail to capture weight distributions adequately, leading to performance degradation. We propose GANQ (GPU-Adaptive Non-Uniform Quantization), a layer-wise post-training non-uniform quantization framework optimized for hardware-efficient lookup table-based mpGEMM. GANQ achieves superior quantization performance by utilizing a training-free, GPU-adaptive optimization algorithm to efficiently reduce layer-wise quantization errors. Extensive experiments demonstrate GANQ's ability to reduce the perplexity gap from the FP16 baseline compared to state-of-the-art methods for both 3-bit and 4-bit quantization. Furthermore, when deployed on a single NVIDIA RTX 4090 GPU, GANQ's quantized models achieve up to 2.57$\times$ speedup over the baseline, advancing memory and inference efficiency in LLM deployment.

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

↑