arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2406.06385cs.LGcs.AIcs.CL
收藏

面向大语言模型的低秩量化感知训练

Low-Rank Quantization-Aware Training for LLMs

Qualcomm AI Research(高通人工智能研究中心)

Yelysei Bondarenko, Riccardo Del Chiaro, Markus Nagel

AI总结:

本文提出轻量级低秩量化感知训练算法 LR-QAT,通过低秩辅助权重、定点下转换和检查点机制,在单张 24GB 消费级 GPU 上以极低内存开销实现与全模型 QAT 相当的量化性能。

摘要:

大语言模型(LLMs)无处不在,然而由于其对计算和内存的需求持续增长,实际部署面临挑战。量化是提升计算和内存效率的最有效方法之一。量化感知训练(QAT)方法通常能获得最佳的量化性能,但其代价是可能较长的训练时间和过高的内存占用,这使得将其应用于大语言模型时不切实际。受参数高效微调(PEFT)和低秩适应(LoRA)文献的启发,我们提出了 LR-QAT——一种面向大语言模型的轻量级且内存高效的 QAT 算法。LR-QAT 采用多个组件在不牺牲预测性能的前提下节省内存:(a)感知量化网格的低秩辅助权重;(b)使用定点或双压缩整数的下转换算子;以及(c)检查点机制。与大多数相关工作不同,我们的方法(i)具有推理高效性,与传统的训练后量化(PTQ)相比不会引入额外开销;(ii)可被视为一种通用的扩展预训练框架,意味着所得模型之后仍可用于任何下游任务;(iii)可应用于广泛的量化设置,例如不同的量化粒度选择、激活量化,并能与许多 PTQ 技术无缝结合。我们将 LR-QAT 应用于 LLaMA-1/2/3 和 Mistral 模型系列,并在多个下游任务上验证了其有效性。我们的方法优于常见的训练后量化(PTQ)方法,并在仅占用全模型 QAT 一小部分内存的情况下达到了相同的模型性能。具体而言,我们可以在单个具有 24GB 内存的消费级 GPU 上训练一个 7B 大语言模型。我们的源代码可在 https://github.com/qualcomm-ai-research/LR-QAT 获取。

英文摘要:

Large language models (LLMs) are omnipresent, however their practical deployment is challenging due to their ever increasing computational and memory demands. Quantization is one of the most effective ways to make them more compute and memory efficient. Quantization-aware training (QAT) methods, generally produce the best quantized performance, however it comes at the cost of potentially long training time and excessive memory usage, making it impractical when applying for LLMs. Inspired by parameter-efficient fine-tuning (PEFT) and low-rank adaptation (LoRA) literature, we propose LR-QAT -- a lightweight and memory-efficient QAT algorithm for LLMs. LR-QAT employs several components to save memory without sacrificing predictive performance: (a) low-rank auxiliary weights that are aware of the quantization grid; (b) a downcasting operator using fixed-point or double-packed integers and (c) checkpointing. Unlike most related work, our method (i) is inference-efficient, leading to no additional overhead compared to traditional PTQ; (ii) can be seen as a general extended pretraining framework, meaning that the resulting model can still be utilized for any downstream task afterwards; (iii) can be applied across a wide range of quantization settings, such as different choices quantization granularity, activation quantization, and seamlessly combined with many PTQ techniques. We apply LR-QAT to LLaMA-1/2/3 and Mistral model families and validate its effectiveness on several downstream tasks. Our method outperforms common post-training quantization (PTQ) approaches and reaches the same model performance as full-model QAT at the fraction of its memory usage. Specifically, we can train a 7B LLM on a single consumer grade GPU with 24GB of memory. Our source code is available at https://github.com/qualcomm-ai-research/LR-QAT

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

↑