Introduction
Quantization is a critical technique for deploying deep neural networks on resource-constrained edge devices. By reducing the precision of weights and activations from 32-bit floating point to lower bit-widths (e.g., 8-bit or 4-bit integers), significant gains in efficiency and power consumption can be achieved. However, standard "homogeneous" quantization, which applies the same bit-width to all layers, often leads to suboptimal performance because different layers exhibit varying sensitivities to quantization noise.
Mixed-precision quantization addresses this by assigning higher precision to sensitive layers and lower precision to robust ones. Despite its potential, existing mixed-precision algorithms often require full training datasets, extensive hyperparameter tuning, or computationally expensive Quantization-Aware Training (QAT). This paper introduces a practical, two-phase Post-Training Quantization (PTQ) algorithm that automates bit-width selection using minimal unlabeled data and respects hardware constraints.
Methodology
The proposed algorithm operates in two distinct phases without requiring labeled data or retraining.
Phase 1: Sensitivity Analysis via SQNR
The first phase involves generating a sensitivity list for the network's layers. Traditional methods often rely on task accuracy, which requires large, labeled datasets. Instead, the authors utilize the Signal-to-Quantization Noise Ratio (SQNR) measured at the network's output. SQNR serves as a "soft" proxy for accuracy, capturing the relative impact of quantization noise from each layer on the final output.
Phase 2: Finding the Configuration
Starting from a high-precision baseline, the algorithm iteratively reduces the bit-width of individual layers. It employs a greedy, Pareto frontier-based approach to identify the layer that offers the maximum efficiency gain (measured in Bit Operations or BOPs) for the minimum impact on SQNR. This process continues until the desired performance budget is reached.
Hardware-Aware Constraints and AdaRound
To ensure real-world deployability, the algorithm groups quantizers (e.g., weights and activations) that are tied together by hardware kernels. Furthermore, it integrates AdaRound, an advanced rounding mechanism, to optimize performance in ultra-low bit-width regimes.
Experimental Results
The algorithm was evaluated across various architectures, including ResNet, MobileNet, EfficientNet, ViT, and BERT, using benchmarks like ImageNet-1K and GLUE.
Robustness and Data Efficiency
A key finding is the stability of SQNR as a sensitivity metric. As shown in Figure 6, the correlation of the SQNR-based sensitivity list remains high even with a very small number of images, whereas accuracy-based metrics require significantly more data to become reliable.
The method proves highly efficient, reaching peak performance with as few as 256 unlabeled images. It also demonstrates robustness to "out-of-domain" data; for instance, using MS-COCO images to calibrate ImageNet models yielded results comparable to using task-specific data.
Performance Gains
The mixed-precision (MP) approach consistently outperformed fixed-precision baselines. For MobileNetV3, the MP version achieved 71.65% accuracy at a W8A8 budget, compared to 68.75% for the homogeneous version. In NLP tasks, a mixed-precision BERT model reached 82.97% accuracy on MNLI, significantly higher than the 74.13% achieved by standard 8-bit quantization.
Discussion and Conclusion
The proposed algorithm effectively handles models with significant activation outliers, such as MobileNetV3 and BERT, by selectively maintaining high precision for problematic layers. By utilizing "Quantizer Groups," the resulting models are optimized for immediate hardware deployment.
While the greedy search strategy is highly effective, future work could explore non-greedy optimization to find global optima. Additionally, while BOPs are a strong proxy for power, incorporating direct latency measurements for specific hardware architectures could further refine the optimization process. Overall, this method provides a robust and practical framework for deploying high-performance mixed-precision models in data-constrained environments.
Summary updated