arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2306.00317cs.LGcs.AI
收藏

FlexRound:基于逐元素除法的可学习舍入方法用于训练后量化

FlexRound: Learnable Rounding based on Element-wise Division for Post-Training Quantization

NAVER Cloud(NAVER云)

Jung Hyun Lee, Jeonghoon Kim, Se Jung Kwon, Dongsoo Lee

AI总结:

提出基于逐元素除法的可学习舍入机制FlexRound,用于训练后量化,联合学习量化网格和权重缩放,在图像分类、自然语言理解与生成任务上验证,并首次实现大型语言模型的高效量化。

摘要:

训练后量化(PTQ)在资源受限设备上部署深度神经网络时越来越受欢迎,因为与量化感知训练不同,它完全不需要完整的训练数据集或端到端训练。基于逐层或逐块输出重构的PTQ方案已被证明能有效提升量化模型性能,因此近期工作开发了算法来设计并学习新的权重舍入方案,以更好地重构每层或每块的输出。在本工作中,我们提出了一种简单而有效的PTQ新权重舍入机制,称为FlexRound,它基于逐元素除法而非典型的逐元素加法,使得FlexRound能够联合学习一个公共量化网格大小以及每个预训练权重的不同缩放因子。得益于逐元素除法引入的导数倒数规则,FlexRound在更新对应缩放因子时天然能够利用预训练权重,从而根据其幅度灵活地量化预训练权重。我们在广泛的模型和任务上实证验证了FlexRound的有效性。据我们所知,我们的工作是首次不仅涵盖图像分类和自然语言理解,还涵盖自然语言生成的全面实验。此外,我们首次证明,通过逐块重构输出,大型语言模型可以被高效量化,与半精度基线相比,性能影响可忽略不计。我们的代码可在https://github.com/onliwad101/FlexRound_LRQ获取。

英文摘要:

Post-training quantization (PTQ) has been gaining popularity for the deployment of deep neural networks on resource-limited devices since unlike quantization-aware training, neither a full training dataset nor end-to-end training is required at all. As PTQ schemes based on reconstructing each layer or block output turn out to be effective to enhance quantized model performance, recent works have developed algorithms to devise and learn a new weight-rounding scheme so as to better reconstruct each layer or block output. In this work, we propose a simple yet effective new weight-rounding mechanism for PTQ, coined \emph{FlexRound}, based on element-wise division instead of typical element-wise addition such that FlexRound enables jointly learning a common quantization grid size as well as a different scale for each pre-trained weight. Thanks to the reciprocal rule of derivatives induced by element-wise division, FlexRound is inherently able to exploit pre-trained weights when updating their corresponding scales, and thus, flexibly quantize pre-trained weights depending on their magnitudes. We empirically validate the efficacy of FlexRound on a wide range of models and tasks. To the best of our knowledge, our work is the first to carry out comprehensive experiments on not only image classification and natural language understanding but also natural language generation. Moreover, we demonstrate, for the first time, that large language models can be efficiently quantized, with only a negligible impact on performance compared to half-precision baselines, achieved by reconstructing the output in a block-by-block manner. Our code is available at \url{https://github.com/onliwad101/FlexRound_LRQ}.

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

↑