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

Yuhang Li, Ruihao Gong, Xu Tan, Yang Yang, Peng Hu +4 more
2/10/2021
cs.LGcs.CV

Official code: yhhhli/BRECQ (303 stars, MIT, last commit 2021-08-01).

Abstract

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.

View on arXivView PDF

Code Implementations(1)

yhhhli/BRECQOfficial100%
MIT

Pytorch implementation of BRECQ, ICLR 2021

30362PythonFeb 10, 20215 years agoMIT

Similar Papers

Cite this paper

@article{li2021brecq,
  title  = {BRECQ: Pushing the Limit of Post-Training Quantization by Block Reconstruction},
  author = {Yuhang Li and Ruihao Gong and Xu Tan and Yang Yang and Peng Hu and Qi Zhang and Fengwei Yu and Wei Wang and Shi Gu},
  year   = {2021},
  eprint = {2102.05426},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2102.05426}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2102.05426.svg)](https://codeofpaper.com/paper/2102.05426)

Discussion