arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2212.07048cs.CVeess.IV
收藏

PD-Quant:基于预测差异度量的后训练Quantization

PD-Quant: Post-Training Quantization based on Prediction Difference Metric

Huazhong University of Science & Technology(华中科技大学);Houmo AI(后摩智能)

Jiawei Liu, Lin Niu, Zhihang Yuan, Dawei Yang, Xinggang Wang, Wenyu Liu

摘要:

后训练量化(PTQ)是一种神经网络压缩技术,它使用较低精度的数据类型将全精度模型转换为量化模型。虽然它可以帮助减少深度神经网络的大小和计算成本,但它也会引入量化噪声并降低预测精度,特别是在极低比特设置中。如何确定适当的量化参数(例如,比例因子和权重舍入)是目前面临的主要问题。现有的方法试图通过最小化量化前后特征之间的距离来确定这些参数,但这种方法只考虑局部信息,可能不会得到最优的量化参数。我们分析了这个问题,并提出了PD-Quant,一种通过考虑全局信息来解决这个限制的方法。该算法利用网络预测量化前后的差异信息来确定量化参数。此外,PD-Quant可以通过调整激活的分布来缓解PTQ中由少量校准集引起的过拟合问题。实验结果表明,PD-Quant算法可以获得更好的量化参数,提高量化模型的预测精度,尤其是在低比特率下。例如,PD-Quant将ResNet-18的准确率提高到53.14%,RegNetX-600 MF的准确率提高到40.67%。代码发布于https://github.com/hustvl/PD-Quant。

英文摘要:

Post-training quantization (PTQ) is a neural network compression technique that converts a full-precision model into a quantized model using lower-precision data types. Although it can help reduce the size and computational cost of deep neural networks, it can also introduce quantization noise and reduce prediction accuracy, especially in extremely low-bit settings. How to determine the appropriate quantization parameters (e.g., scaling factors and rounding of weights) is the main problem facing now. Existing methods attempt to determine these parameters by minimize the distance between features before and after quantization, but such an approach only considers local information and may not result in the most optimal quantization parameters. We analyze this issue and ropose PD-Quant, a method that addresses this limitation by considering global information. It determines the quantization parameters by using the information of differences between network prediction before and after quantization. In addition, PD-Quant can alleviate the overfitting problem in PTQ caused by the small number of calibration sets by adjusting the distribution of activations. Experiments show that PD-Quant leads to better quantization parameters and improves the prediction accuracy of quantized models, especially in low-bit settings. For example, PD-Quant pushes the accuracy of ResNet-18 up to 53.14% and RegNetX-600MF up to 40.67% in weight 2-bit activation 2-bit. The code is released at https://github.com/hustvl/PD-Quant.

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

↑