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

LeanQuant: 一种准确且可扩展的大型语言模型量化方法,具有损失误差感知的网格

LeanQuant: Accurate and Scalable Large Language Model Quantization with Loss-error-aware Grid

Dept. of Computer Science, Rice University(计算机科学系, Rice大学);ThirdAI Corp.(ThirdAI公司);Ken Kennedy Institute(肯尼迪研究所)

Tianyi Zhang, Anshumali Shrivastava

AI总结:

LeanQuant通过学习损失误差感知的网格,实现了准确且可扩展的大型语言模型量化,适用于多种量化类型并兼容更多框架。

摘要:

大型语言模型(LLMs)在各种领域中展现了巨大的潜力,但它们的高内存需求和推理成本仍然是部署中的关键挑战。后训练量化(PTQ)已成为一种有前途的技术,用于减少内存需求和解码延迟。然而,最近的准确量化方法往往依赖于专门的计算或定制的数据格式来实现更好的模型质量,这限制了它们与流行框架的兼容性,因为它们需要专门的推理内核,专门针对特定的硬件和软件平台,阻碍了更广泛的应用。此外,许多竞争方法在量化模型时有较高的资源需求和计算开销,使它们难以扩展到数十亿参数的规模。针对这些挑战,我们提出了LeanQuant(Loss-Error-Aware Network Quantization),一种新的量化方法,它准确、通用且可扩展。在现有的流行迭代损失误差基于量化框架中,我们发现先前方法的一个关键局限性:在逆Hessian对角线中的异常值导致min-max仿射量化网格无法保持模型质量。为克服这一根本问题,我们提出了学习损失误差感知的网格,而不是使用非自适应的min-max仿射网格。我们的方法不仅产生了更准确的量化模型,还能够推广到更广泛的量化类型,包括仿射和非均匀量化,增强了与更多框架的兼容性。对最近LLMs的大量实验表明,LeanQuant非常准确,在模型质量上与竞争基线相比表现良好,并且可扩展,使用两个Quadro RTX 8000-48GB GPU在21小时内实现了Llama-3.1 405B,迄今为止最大的开源LLM的非常准确的量化。

英文摘要:

Large language models (LLMs) have shown immense potential across various domains, but their high memory requirements and inference costs remain critical challenges for deployment. Post-training quantization (PTQ) has emerged as a promising technique to reduce memory requirements and decoding latency. However, recent accurate quantization methods often depend on specialized computations or custom data formats to achieve better model quality, which limits their compatibility with popular frameworks, as they require dedicated inference kernels tailored to specific hardware and software platforms, hindering wider adoption. Furthermore, many competitive methods have high resource requirements and computational overhead for quantizing models, making it challenging to scale them to hundreds of billions of parameters. In response to these challenges, we propose LeanQuant (Loss-Error-Aware Network Quantization), a novel quantization method that is accurate, versatile, and scalable. In the existing popular iterative loss-error-based quantization framework, we identify a critical limitation in prior methods: the min-max affine quantization grid fails to preserve model quality due to outliers in inverse Hessian diagonals. To overcome this fundamental issue, we propose learning loss-error-aware grids, instead of using non-adaptive min-max affine grids. Our approach not only produces quantized models that are more accurate but also generalizes to a wider range of quantization types, including affine and non-uniform quantization, enhancing compatibility with more frameworks. Extensive experiments with recent LLMs demonstrate that LeanQuant is highly accurate, comparing favorably against competitive baselines in model quality, and scalable, achieving very accurate quantization of Llama-3.1 405B, one of the largest open-source LLMs to date, using two Quadro RTX 8000-48GB GPUs in 21 hours.

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

↑