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

OutlierTune:面向大型语言模型的高效逐通道量化

OutlierTune: Efficient Channel-Wise Quantization for Large Language Models

Beijing University of Posts and Telecommunications(北京邮电大学);PengCheng Laboratory(鹏城实验室)

Jinguang Wang, Yuexi Yin, Haifeng Sun, Qi Qi, Jingyu Wang, Zirui Zhuang, Tingting Yang, Jianxin Liao

AI总结:

针对LLMs激活值量化中结构化离群值导致的准确性与硬件效率难以兼顾问题,提出高效逐通道PTQ方法OutlierTune,通过反量化预执行与对称化减少计算开销和量化差异,在多任务上优于现有方法,实现1.48倍推理加速与约2倍内存节省。

摘要:

由于存在结构化离群值,对大型语言模型(LLMs)的激活值进行量化一直是一项重大挑战。现有大多数方法侧重于对激活值进行逐token或逐张量量化,难以同时兼顾准确性与硬件效率。为解决此问题,我们提出了OutlierTune,一种针对LLMs激活值的高效逐通道训练后量化(PTQ)方法。OutlierTune包含两个组件:反量化的预执行与对称化。反量化的预执行通过激活缩放因子更新模型权重,避免了逐通道激活量化带来的内部缩放及高昂的额外计算开销。对称化则通过确保不同激活通道间数值范围的平衡,进一步减少了由权重更新引起的量化差异。OutlierTune易于实现且硬件高效,在推理期间几乎不引入额外计算开销。大量实验表明,所提框架在多个不同任务上均优于现有方法。该框架展现出更好的泛化能力,将指令微调LLMs(如OPT-IML)的Int6量化提升至与半精度(FP16)同等的水平。此外,我们还证明了所提框架比FP16实现快1.48倍,同时将内存使用量减少约2倍。

英文摘要:

Quantizing the activations of large language models (LLMs) has been a significant challenge due to the presence of structured outliers. Most existing methods focus on the per-token or per-tensor quantization of activations, making it difficult to achieve both accuracy and hardware efficiency. To address this problem, we propose OutlierTune, an efficient per-channel post-training quantization (PTQ) method for the activations of LLMs. OutlierTune consists of two components: pre-execution of dequantization and symmetrization. The pre-execution of dequantization updates the model weights by the activation scaling factors, avoiding the internal scaling and costly additional computational overheads brought by the per-channel activation quantization. The symmetrization further reduces the quantization differences arising from the weight updates by ensuring the balanced numerical ranges across different activation channels. OutlierTune is easy to implement and hardware-efficient, introducing almost no additional computational overheads during the inference. Extensive experiments show that the proposed framework outperforms existing methods across multiple different tasks. Demonstrating better generalization, this framework improves the Int6 quantization of the instruction-tuning LLMs, such as OPT-IML, to the same level as half-precision (FP16). Moreover, we have shown that the proposed framework is 1.48x faster than the FP16 implementation while reducing approximately 2x memory usage.

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

↑