arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2311.16442cs.LGcs.DC
收藏

GPU上快速高效的2比特大语言模型推理:权重矩阵中的2/4/16比特混合精度与异步反量化

Fast and Efficient 2-bit LLM Inference on GPU: 2/4/16-bit in a Weight Matrix with Asynchronous Dequantization

Shanghai Jiao Tong University(上海交通大学);Tsinghua University(清华大学);Infinigence-AI(智源人工智能)

Jinhao Li, Jiaming Xu, Shiyao Li, Shan Huang, Jun Liu, Yaoxiu Lian, Guohao Dai

AI总结:

提出权重内混合精度量化、独家2比特稀疏异常值及异步反量化技术,在GPU上实现快速高效的2比特LLM推理,显著加速并降低成本。

摘要:

大语言模型(LLMs)在多个领域展现了惊人的能力,但其推理成本高昂。许多先前的研究利用量化方法通过降低延迟和内存消耗来减少LLM推理成本。应用2比特单精度权重量化会带来超过3%的精度损失,因此最先进的方法采用混合精度方法(例如Llama2-7b等)来提升精度。然而,挑战依然存在:(1)权重矩阵中分布不均匀。(2)添加稀疏异常值导致速度大幅下降。(3)GPU上耗时的反量化操作。为了应对这些挑战并在GPU上实现快速高效的LLM推理,本文提出了以下技术:(1)权重内混合精度量化。(2)具有最小速度下降的独家2比特稀疏异常值。(3)异步反量化。我们在不同模型家族(如Llama3等)和模型规模上进行了广泛实验。考虑到不同模型的所有尺度和零点,我们实现了每个权重2.91比特,且损失可忽略不计。因此,通过我们对每个权重矩阵的2/4/16混合精度量化以及推理过程中的异步反量化,我们的设计在Llama2-7b上实现了相对于原始模型1.74倍的端到端加速,并在减少GPU需求的同时,将运行时成本和总成本分别降低了高达2.53倍和2.29倍。

英文摘要:

Large language models (LLMs) have demonstrated impressive abilities in various domains while the inference cost is expensive. Many previous studies exploit quantization methods to reduce LLM inference cost by reducing latency and memory consumption. Applying 2-bit single-precision weight quantization brings >3% accuracy loss, so the state-of-the-art methods use mixed-precision methods for LLMs (e.g. Llama2-7b, etc.) to improve the accuracy. However, challenges still exist: (1) Uneven distribution in weight matrix. (2) Large speed degradation by adding sparse outliers. (3) Time-consuming dequantization operations on GPUs. To tackle these challenges and enable fast and efficient LLM inference on GPUs, we propose the following techniques in this paper. (1) Intra-weight mixed-precision quantization. (2) Exclusive 2-bit sparse outlier with minimum speed degradation. (3) Asynchronous dequantization. We conduct extensive experiments on different model families (e.g. Llama3, etc.) and model sizes. We achieve 2.91-bit for each weight considering all scales/zeros for different models with negligible loss. As a result, with our 2/4/16 mixed-precision quantization for each weight matrix and asynchronous dequantization during inference, our design achieves an end-to-end speedup for Llama2-7b is 1.74x over the original model, and we reduce both runtime cost and total cost by up to 2.53x and 2.29x with less GPU requirements.

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

↑