[Paper Review] Integer Quantization for Deep Learning Inference: Principles and Empirical Evaluation
This paper analyzes the mathematics of uniform integer quantization for DL inference and evaluates PTQ and QAT across vision, language, and speech models, achieving accuracy within 1% of FP32 with an 8-bit quantization workflow.
Quantization techniques can reduce the size of Deep Neural Networks and improve inference latency and throughput by taking advantage of high throughput integer instructions. In this paper we review the mathematical aspects of quantization parameters and evaluate their choices on a wide range of neural network models for different application domains, including vision, speech, and language. We focus on quantization techniques that are amenable to acceleration by processors with high-throughput integer math pipelines. We also present a workflow for 8-bit quantization that is able to maintain accuracy within 1% of the floating-point baseline on all networks studied, including models that are more difficult to quantize, such as MobileNets and BERT-large.
Motivation & Objective
- Clarify the mathematical foundations of uniform integer quantization for weights and activations.
- Evaluate how quantization granularity and calibration affect accuracy across diverse models.
- Provide a practical workflow and guidance for post-training quantization (PTQ) and quantization-aware training (QAT).
- Assess techniques to recover accuracy when quantization degrades performance (partial quantization, training-based methods).
- Demonstrate the trade-offs between affine and scale quantization for inference efficiency.
Proposed method
- Formulates uniform quantization as affine or scale mapping between real ranges and integer ranges.
- Analyzes quantization granularity (per-tensor, per-row/column, per-channel) and its impact on integer GEMM feasibility and accuracy.
- Compares calibration methods (max, entropy/KL, percentile) for activations and weights.
- Evaluates post-training quantization (PTQ) and quantization-aware training (QAT) across multiple models and tasks.
- Proposes partial quantization to leave sensitive layers in floating point to recover accuracy.
- Discusses learning quantization parameters and learning activation ranges during training (PACT).
Experimental results
Research questions
- RQ1How do affine and scale quantization compare in terms of computational efficiency and accuracy for DL inference?
- RQ2What is the impact of quantization granularity on model accuracy and hardware performance?
- RQ3Can post-training quantization (PTQ) achieve near-floating-point accuracy across diverse architectures, and when is QAT beneficial?
- RQ4Which calibration strategies best preserve accuracy for weights and activations across models?
- RQ5What practical workflow enables maintaining accuracy within 1% of FP32 for 8-bit inference?
Key findings
- Uniform scale quantization enables efficient integer GEMMs with minimal overhead, unlike affine quantization which incurs extra computations.
- Per-channel weight quantization with max calibration maintains accuracy across networks, even after BN folding; per-tensor quantization can cause notable losses on several models.
- Activation calibration using entropy or high-percentile (e.g., 99.99%) yields best PTQ accuracy for many networks; max calibration often underperforms for networks with outliers.
- PTQ can preserve accuracy within 1% for many models; some networks (e.g., MobileNet, EfficientNet, Transformer, BERT) require additional techniques like partial quantization or QAT to maintain accuracy.
- Quantization-aware training (QAT) further improves accuracy and can match or exceed PTQ results, with most networks staying within 1% of the FP32 baseline after fine-tuning.
- Partial quantization can recover accuracy by skipping quantization on the most sensitive layers; QAT with learned ranges (PACT) offers further gains in some cases.
- learned ranges for activations during training can improve post-training quantization outcomes for several models.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.