arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2308.09723cs.LGcs.CL
收藏

FineQuant:通过针对大语言模型的细粒度仅权重量化释放效率潜力

FineQuant: Unlocking Efficiency with Fine-Grained Weight-Only Quantization for LLMs

Microsoft(微软);NVIDIA(英伟达)

Young Jin Kim, Rawn Henry, Raffy Fahim, Hany Hassan Awadalla

AI总结:

针对大语言模型内存需求大、推理成本高的问题,提出仅权重细粒度量化方法FineQuant,自适应确定量化粒度,无需微调适配MoE与稠密模型,结合高效GPU GEMM实现,在极小精度损失下大幅提升推理吞吐量。

摘要:

大语言模型(LLM)已在各类语言任务上取得了当前最优性能,但由于其内存需求巨大,给实际部署带来了挑战。此外,最新的生成式模型在自回归解码过程中存在内存带宽瓶颈,导致推理成本高昂。为解决这些问题,我们提出了一种高效的仅权重量化方法,可降低大语言模型的内存消耗并加速推理。为确保质量下降最小化,我们引入了一种简单有效的启发式方法,该方法仅利用预训练模型的模型权重。这种方法既适用于混合专家(Mixture-of-Experts, MoE)模型,也适用于稠密模型,且无需额外的微调。为证明所提方法的有效性,我们首先分析了与大语言模型量化相关的挑战与问题。随后,我们介绍了我们的启发式方法,该方法可自适应地确定量化粒度,有效解决这些问题。此外,我们实现了高效的GPU通用矩阵乘法(GEMMs),可执行即时矩阵乘法与反量化,支持fp16或bf16激活与int8或int4权重的乘法运算。我们在OPT-175B等大规模开源模型以及内部MoE模型上评估了该方法,结果显示其精度损失极小,同时在相同GPU数量下吞吐量最高可提升3.65倍。

英文摘要:

Large Language Models (LLMs) have achieved state-of-the-art performance across various language tasks but pose challenges for practical deployment due to their substantial memory requirements. Furthermore, the latest generative models suffer from high inference costs caused by the memory bandwidth bottleneck in the auto-regressive decoding process. To address these issues, we propose an efficient weight-only quantization method that reduces memory consumption and accelerates inference for LLMs. To ensure minimal quality degradation, we introduce a simple and effective heuristic approach that utilizes only the model weights of a pre-trained model. This approach is applicable to both Mixture-of-Experts (MoE) and dense models without requiring additional fine-tuning. To demonstrate the effectiveness of our proposed method, we first analyze the challenges and issues associated with LLM quantization. Subsequently, we present our heuristic approach, which adaptively finds the granularity of quantization, effectively addressing these problems. Furthermore, we implement highly efficient GPU GEMMs that perform on-the-fly matrix multiplication and dequantization, supporting the multiplication of fp16 or bf16 activations with int8 or int4 weights. We evaluate our approach on large-scale open source models such as OPT-175B and internal MoE models, showcasing minimal accuracy loss while achieving up to 3.65 times higher throughput on the same number of GPUs.

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

↑