Towards Unified INT8 Training for Convolutional Neural Network
arXiv:1912.12607
Abstract
Recently low-bit (e.g., 8-bit) network quantization has been extensively studied to accelerate the inference. Besides inference, low-bit training with quantized gradients can further bring more considerable acceleration, since the backward process is often computation-intensive. Unfortunately, the inappropriate quantization of backward propagation usually makes the training unstable and even crash. There lacks a successful unified low-bit training framework that can support diverse networks on various tasks. In this paper, we give an attempt to build a unified 8-bit (INT8) training framework for common convolutional neural networks from the aspects of both accuracy and speed. First, we empirically find the four distinctive characteristics of gradients, which provide us insightful clues for gradient quantization. Then, we theoretically give an in-depth analysis of the convergence bound and derive two principles for stable INT8 training. Finally, we propose two universal techniques, including Direction Sensitive Gradient Clipping that reduces the direction deviation of gradients and Deviation Counteractive Learning Rate Scaling that avoids illegal gradient update along the wrong direction. The experiments show that our unified solution promises accurate and efficient INT8 training for a variety of networks and tasks, including MobileNetV2, InceptionV3 and object detection that prior studies have never succeeded. Moreover, it enjoys a strong flexibility to run on off-the-shelf hardware, and reduces the training time by 22% on Pascal GPU without too much optimization effort. We believe that this pioneering study will help lead the community towards a fully unified INT8 training for convolutional neural networks.
References in corpus (19)
- Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks
- R-FCN: Object Detection via Region-based Fully Convolutional Networks
- BinaryConnect: Training Deep Neural Networks with binary weights during propagations
- On the Convergence of Adam and Beyond
- QSGD: Communication-Efficient SGD via Gradient Quantization and Encoding
- Quantizing deep convolutional networks for efficient inference: A whitepaper
- PACT: Parameterized Clipping Activation for Quantized Neural Networks
- Incremental Network Quantization: Towards Lossless CNNs with Low-Precision Weights
- Learned Step Size Quantization
- Training Deep Neural Networks with 8-bit Floating Point Numbers
- Adaptive Gradient Methods with Dynamic Bound of Learning Rate
- Apprentice: Using Knowledge Distillation Techniques To Improve Low-Precision Network Accuracy
- Post-training 4-bit quantization of convolution networks for rapid-deployment
- Deep Learning with Low Precision by Half-wave Gaussian Quantization
- Differentiable Soft Quantization: Bridging Full-Precision and Low-Bit Neural Networks
- HAQ: Hardware-Aware Automated Quantization with Mixed Precision
- Discovering Low-Precision Networks Close to Full-Precision Networks for Efficient Embedded Inference
- LQ-Nets: Learned Quantization for Highly Accurate and Compact Deep Neural Networks
- Training High-Performance and Large-Scale Deep Neural Networks with Full 8-bit Integers