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

多样化的样本生成,实现精确的无数据Quantization

Diversifying Sample Generation for Accurate Data-Free Quantization

Beihang University(北京航空航天大学);Yale University(耶鲁大学);SenseTime Research(商汤科技研究院);Shanghai AI Laboratory(上海人工智能实验室);Shen Yuan Honors College, Beihang University(北京航空航天大学沈元荣誉学院)

Xiangguo Zhang, Haotong Qin, Yifu Ding, Ruihao Gong, Qinghua Yan, Renshuai Tao, Yuhang Li, Fengwei Yu, Xianglong Liu

摘要:

量化已经成为压缩和加速神经网络的最流行的方法之一。最近,无数据量化作为一种实用且有前途的解决方案得到了广泛的研究。该方法根据FP32量化模型的批量归一化(BN)统计量合成数据进行量化模型的标定,大大减轻了传统量化方法对真实训练数据的严重依赖。不幸的是,我们发现,在实践中,合成数据相同约束BN统计遭受严重的均匀化在分布水平和样本水平,并进一步导致量化模型的性能显着下降。我们提出了多样的样本生成(DSG)计划,以减轻均匀化所造成的不利影响。具体来说,我们放松BN层中特征统计的对齐,以放松分布级别的约束,并设计逐层增强,以针对不同的数据样本增强特定的层。我们的DSG方案是通用的,甚至能够应用于最先进的后训练量化方法,如AdaRound。我们在大规模图像分类任务上评估了DSG方案,并在各种网络架构和量化方法上始终如一地获得了显着改进,特别是当量化到较低比特时(例如,在W4A4上提高22%)。此外,受益于增强的多样性,由合成数据校准的模型的性能接近由真实数据校准的模型,甚至在W4A4上优于它们。

英文摘要:

Quantization has emerged as one of the most prevalent approaches to compress and accelerate neural networks. Recently, data-free quantization has been widely studied as a practical and promising solution. It synthesizes data for calibrating the quantized model according to the batch normalization (BN) statistics of FP32 ones and significantly relieves the heavy dependency on real training data in traditional quantization methods. Unfortunately, we find that in practice, the synthetic data identically constrained by BN statistics suffers serious homogenization at both distribution level and sample level and further causes a significant performance drop of the quantized model. We propose Diverse Sample Generation (DSG) scheme to mitigate the adverse effects caused by homogenization. Specifically, we slack the alignment of feature statistics in the BN layer to relax the constraint at the distribution level and design a layerwise enhancement to reinforce specific layers for different data samples. Our DSG scheme is versatile and even able to be applied to the state-of-the-art post-training quantization method like AdaRound. We evaluate the DSG scheme on the large-scale image classification task and consistently obtain significant improvements over various network architectures and quantization methods, especially when quantized to lower bits (e.g., up to 22% improvement on W4A4). Moreover, benefiting from the enhanced diversity, models calibrated by synthetic data perform close to those calibrated by real data and even outperform them on W4A4.

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

↑