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

BRECQ:通过块重构突破后训练Quantization的极限

BRECQ: Pushing the Limit of Post-Training Quantization by Block Reconstruction

SenseTime Research(商汤科技研究院);University of Electronic Science and Technology of China(电子科技大学)

Yuhang Li, Ruihao Gong, Xu Tan, Yang Yang, Peng Hu, Qi Zhang, Fengwei Yu, Wei Wang, Shi Gu

摘要:

我们研究了神经网络量化的挑战性任务,而无需端到端的再训练,称为后训练量化(PTQ)。PTQ通常需要一小部分训练数据,但产生的量化模型不如量化感知训练(QAT)强大。在这项工作中,我们提出了一种新的PTQ框架,被称为BRECQ,它首次将PTQ中的位宽限制推低到INT2。BRECQ利用神经网络中的基本构建块并逐个重建它们。在一个全面的理论研究的二阶误差,我们表明,BRECQ实现了跨层依赖和泛化误差之间的良好平衡。为了进一步利用量化的能力,通过近似层间和层内灵敏度,将混合精度技术并入我们的框架中。对各种手工制作和搜索的神经架构进行了广泛的实验,用于图像分类和目标检测任务。我们第一次证明,在没有额外功能的情况下,PTQ可以实现与QAT相当的4位ResNet和MobileNetV2,并且量化模型的生成速度快240倍。代码可在https://github.com/yhhhli/BRECQ上获得。

英文摘要:

We study the challenging task of neural network quantization without end-to-end retraining, called Post-training Quantization (PTQ). PTQ usually requires a small subset of training data but produces less powerful quantized models than Quantization-Aware Training (QAT). In this work, we propose a novel PTQ framework, dubbed BRECQ, which pushes the limits of bitwidth in PTQ down to INT2 for the first time. BRECQ leverages the basic building blocks in neural networks and reconstructs them one-by-one. In a comprehensive theoretical study of the second-order error, we show that BRECQ achieves a good balance between cross-layer dependency and generalization error. To further employ the power of quantization, the mixed precision technique is incorporated in our framework by approximating the inter-layer and intra-layer sensitivity. Extensive experiments on various handcrafted and searched neural architectures are conducted for both image classification and object detection tasks. And for the first time we prove that, without bells and whistles, PTQ can attain 4-bit ResNet and MobileNetV2 comparable with QAT and enjoy 240 times faster production of quantized models. Codes are available at https://github.com/yhhhli/BRECQ.

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

↑