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

面向INT4定点训练:探索梯度的量化误差

Toward INT4 Fixed-Point Training via Exploring Quantization Error for Gradients

Yonsei University(延世大学);Articron Inc.(Articron公司)

Dohyung Kim, Junghyup Lee, Jeimin Jeon, Jaehyeon Moon, Bumsub Ham

AI总结:

本文通过分析梯度量化误差,提出针对大幅值梯度优化量化区间的方法,并引入自适应区间更新算法,在INT4定点训练中显著提升性能,适用于图像分类、目标检测和超分辨率等任务。

摘要:

网络量化通常将全精度权重和/或激活值转换为低比特定点值,以加速推理过程。最近的网络量化方法进一步将梯度离散化为低比特定点值,从而实现高效训练。这些方法通常使用梯度的最小-最大范围来设置量化区间,或调整区间以最小化整个梯度的量化误差。本文分析了低比特定点训练中梯度的量化误差,并表明降低大幅值梯度的误差能显著提升量化性能。基于此,我们推导了大幅值梯度量化误差关于量化区间的上界,并获得了最小化大幅值梯度量化误差的最优区间条件。我们还引入了一种区间更新算法,该算法自适应地调整量化区间,以维持大幅值梯度的低量化误差。实验结果表明,我们的量化方法在多种网络架构与位宽组合以及多种任务(包括图像分类、目标检测和超分辨率)上的有效性。

英文摘要:

Network quantization generally converts full-precision weights and/or activations into low-bit fixed-point values in order to accelerate an inference process. Recent approaches to network quantization further discretize the gradients into low-bit fixed-point values, enabling an efficient training. They typically set a quantization interval using a min-max range of the gradients or adjust the interval such that the quantization error for entire gradients is minimized. In this paper, we analyze the quantization error of gradients for the low-bit fixed-point training, and show that lowering the error for large-magnitude gradients boosts the quantization performance significantly. Based on this, we derive an upper bound of quantization error for the large gradients in terms of the quantization interval, and obtain an optimal condition for the interval minimizing the quantization error for large gradients. We also introduce an interval update algorithm that adjusts the quantization interval adaptively to maintain a small quantization error for large gradients. Experimental results demonstrate the effectiveness of our quantization method for various combinations of network architectures and bit-widths on various tasks, including image classification, object detection, and super-resolution.

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

↑