HAQ: Hardware-Aware Automated Quantization with Mixed Precision

Kuan Wang, Zhijian Liu, Yujun Lin, Ji Lin, Song Han
11/21/2018
1,217 citations
cs.CV
rl

No official code found. Best implementation: mit-han-lab/haq (411 stars). 1 more below.

Abstract

Model quantization is a widely used technique to compress and accelerate deep neural network (DNN) inference. Emergent DNN hardware accelerators begin to support mixed precision (1-8 bits) to further improve the computation efficiency, which raises a great challenge to find the optimal bitwidth for each layer: it requires domain experts to explore the vast design space trading off among accuracy, latency, energy, and model size, which is both time-consuming and sub-optimal.

Show full abstract

Conventional quantization algorithm ignores the different hardware architectures and quantizes all the layers in a uniform way. In this paper, we introduce the Hardware-Aware Automated Quantization (HAQ) framework which leverages the reinforcement learning to automatically determine the quantization policy, and we take the hardware accelerator's feedback in the design loop. Rather than relying on proxy signals such as FLOPs and model size, we employ a hardware simulator to generate direct feedback signals (latency and energy) to the RL agent. Compared with conventional methods, our framework is fully automated and can specialize the quantization policy for different neural network architectures and hardware architectures. Our framework effectively reduced the latency by 1.4-1.95x and the energy consumption by 1.9x with negligible loss of accuracy compared with the fixed bitwidth (8 bits) quantization. Our framework reveals that the optimal policies on different hardware architectures (i.e., edge and cloud architectures) under different resource constraints (i.e., latency, energy and model size) are drastically different. We interpreted the implication of different quantization policies, which offer insights for both neural network architecture design and hardware architecture design.

View on arXivView PDF

Code Implementations(2)

Code implementations of this paper
RepositoryTypeStarsLanguageLicenseLast commit
mit-han-lab/haqCommunity411–––
Sharpiless/HAQ-for-Mobilenetv3-QuantizationCommunity20–––
mit-han-lab/haqCommunity25%

[CVPR 2019, Oral] HAQ: Hardware-Aware Automated Quantization with Mixed Precision

41187

用于 MobileNetV3 在自定义数据集上的量化,模型压缩90%而精度几乎不受影响,论文:HAQ: Hardware-Aware Automated Quantization with Mixed Precision

202

Similar Papers

Cite this paper

@article{wang2018haq,
  title  = {HAQ: Hardware-Aware Automated Quantization with Mixed Precision},
  author = {Kuan Wang and Zhijian Liu and Yujun Lin and Ji Lin and Song Han},
  year   = {2018},
  eprint = {1811.08886},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/1811.08886}
}

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/1811.08886.svg)](https://codeofpaper.com/paper/1811.08886)

Discussion