arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2306.07629cs.CLcs.LG
收藏

SqueezeLLM:稠密与稀疏量化

SqueezeLLM: Dense-and-Sparse Quantization

UC Berkeley(加州大学伯克利分校);ICSI(国际计算机科学研究所);LBNL(劳伦斯伯克利国家实验室)

Sehoon Kim, Coleman Hooper, Amir Gholami, Zhen Dong, Xiuyu Li, Sheng Shen, Michael W. Mahoney, Kurt Keutzer

AI总结:

针对LLM推理受限于内存带宽的问题,提出训练后量化框架SqueezeLLM,通过基于敏感度的非均匀量化和稠密与稀疏分解技术,在3位超低精度下实现无损压缩,显著降低困惑度差距并提升推理速度。

摘要:

生成式大型语言模型(LLMs)在广泛任务中展现出卓越成果。然而,由于前所未有的资源需求,部署这些模型进行推理一直是一项重大挑战。这迫使现有部署框架使用通常复杂且昂贵的多GPU推理流水线,或使用更小且性能较低的模型。在本研究中,我们证明LLMs生成推理的主要瓶颈是内存带宽而非计算,特别是对于单批次推理。虽然量化通过以降低的精度表示权重而成为一种有前景的解决方案,但先前的努力通常导致显著的性能下降。为此,我们引入了SqueezeLLM,这是一个训练后量化框架,不仅能够实现高达3位超低精度的无损压缩,而且在相同内存约束下实现了更高的量化性能。我们的框架包含两个新理念:(i)基于敏感度的非均匀量化,基于二阶信息搜索最优位精度分配;(ii)稠密与稀疏分解,将异常值和敏感权重值以高效的稀疏格式存储。应用于LLaMA模型时,与相同内存需求的最先进方法相比,我们的3位量化将与FP16基线的困惑度差距显著降低了高达2.1倍。此外,在A6000 GPU上部署时,与基线相比,我们的量化模型实现了高达2.3倍的加速。代码可在 https://github.com/SqueezeAILab/SqueezeLLM 获取。

英文摘要:

Generative Large Language Models (LLMs) have demonstrated remarkable results for a wide range of tasks. However, deploying these models for inference has been a significant challenge due to their unprecedented resource requirements. This has forced existing deployment frameworks to use multi-GPU inference pipelines, which are often complex and costly, or to use smaller and less performant models. In this work, we demonstrate that the main bottleneck for generative inference with LLMs is memory bandwidth, rather than compute, specifically for single batch inference. While quantization has emerged as a promising solution by representing weights with reduced precision, previous efforts have often resulted in notable performance degradation. To address this, we introduce SqueezeLLM, a post-training quantization framework that not only enables lossless compression to ultra-low precisions of up to 3-bit, but also achieves higher quantization performance under the same memory constraint. Our framework incorporates two novel ideas: (i) sensitivity-based non-uniform quantization, which searches for the optimal bit precision assignment based on second-order information; and (ii) the Dense-and-Sparse decomposition that stores outliers and sensitive weight values in an efficient sparse format. When applied to the LLaMA models, our 3-bit quantization significantly reduces the perplexity gap from the FP16 baseline by up to 2.1x as compared to the state-of-the-art methods with the same memory requirement. Furthermore, when deployed on an A6000 GPU, our quantized models achieve up to 2.3x speedup compared to the baseline. Our code is available at https://github.com/SqueezeAILab/SqueezeLLM.

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

↑