arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2206.09557cs.DCcs.CL
收藏

LUT-GEMM:基于查找表的量化矩阵乘法用于大规模生成式语言模型的高效推理

LUT-GEMM: Quantized Matrix Multiplication based on LUTs for Efficient Inference in Large-Scale Generative Language Models

Pohang University of Science and Technology(浦项科技大学);NAVER Cloud(NAVER云)

Gunho Park, Baeseong Park, Minsub Kim, Sungjae Lee, Jeonghoon Kim, Beomseok Kwon, Se Jung Kwon, Byeongwook Kim, Youngjoo Lee, Dongsoo Lee

AI总结:

本文提出LUT-GEMM内核,通过基于查找表的量化矩阵乘法消除反量化过程并降低计算成本,在OPT-175B模型3比特量化下实现单GPU上2.1倍的token生成加速。

摘要:

自监督学习和Transformer架构的最新进展显著提升了自然语言处理(NLP)的性能,实现了极低的困惑度。然而,NLP模型规模的不断增长在生成阶段引入了内存墙问题。为缓解这一问题,近期工作集中于将模型权重量化到低于4比特精度,同时保持激活值的全精度,从而在单GPU推理中实现实际加速。但这些改进主要源于减少内存移动,仍需资源密集型的反量化过程,而非真正的计算量降低。本文提出LUT-GEMM,一种用于量化矩阵乘法的高效内核,不仅消除了资源密集型的反量化过程,而且与以往仅权重量化的内核相比降低了计算成本。此外,我们提出了分组量化,以在压缩比和精度之间提供灵活的权衡。LUT-GEMM的效果通过低比特量化实现高压缩比以及基于查找表的高效运算得以体现。实验表明,当应用于OPT-175B模型并进行3比特量化时,LUT-GEMM显著加速了token生成延迟,在单GPU上与依赖昂贵反量化过程的OPTQ相比,实现了2.1倍的显著提升。

英文摘要:

Recent advances in self-supervised learning and the Transformer architecture have significantly improved natural language processing (NLP), achieving remarkably low perplexity. However, the growing size of NLP models introduces a memory wall problem during the generation phase. To mitigate this issue, recent efforts have focused on quantizing model weights to sub-4-bit precision while preserving full precision for activations, resulting in practical speed-ups during inference on a single GPU. However, these improvements primarily stem from reduced memory movement, which necessitates a resource-intensive dequantization process rather than actual computational reduction. In this paper, we introduce LUT-GEMM, an efficient kernel for quantized matrix multiplication, which not only eliminates the resource-intensive dequantization process but also reduces computational costs compared to previous kernels for weight-only quantization. Furthermore, we proposed group-wise quantization to offer a flexible trade-off between compression ratio and accuracy. The impact of LUT-GEMM is facilitated by implementing high compression ratios through low-bit quantization and efficient LUT-based operations. We show experimentally that when applied to the OPT-175B model with 3-bit quantization, LUT-GEMM substantially accelerates token generation latency, achieving a remarkable 2.1$\times$ improvement on a single GPU when compared to OPTQ, which relies on the costly dequantization process.

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

↑