Free Bits: Latency Optimization of Mixed-Precision Quantized Neural Networks on the Edge

Georg Rutishauser, Francesco Conti, Luca Benini

Abstract

Mixed-precision quantization (MPQ) is a critical technique for deploying deep neural networks on resource-constrained edge devices. However, traditional optimization strategies often rely on theoretical metrics like binary operations (BOPs), which fail to account for real-world hardware overheads such as data unpacking and memory tiling. This paper introduces "Free Bits," a hardware-aware methodology that identifies layers where higher precision actually reduces latency. By combining differentiable search with a latency-aware heuristic, the authors achieve significant performance gains, including a 28.6% latency reduction for MobileNetV1 on RISC-V platforms with negligible accuracy loss.

Introduction

Deep learning on microcontrollers (MCUs) requires aggressive quantization to fit models into limited memory and meet real-time latency targets. Mixed-precision quantization (MPQ) allows for layer-wise bit-width assignment, theoretically balancing accuracy and efficiency. A common assumption in the field is that lower bit-widths monotonically lead to faster execution. However, this paper demonstrates that hardware-specific implementation details—such as the lack of native sub-byte support or specific memory tiling requirements—can make lower-precision layers slower than their higher-precision counterparts.

Hardware-Aware Latency Insights

The core observation of this work is the non-monotonic relationship between bit-width and wall-clock latency. On many edge platforms, mismatched activation and weight precisions (e.g., 4-bit weights with 8-bit activations) require software-based "unpacking" to feed SIMD units, introducing significant overhead.

Non-depthwise convolution layer performance across different precisions and ISAs, illustrating non-monotonic latency.

As shown in Figure 1, performance (measured in MACs/Cycle) varies significantly across different Instruction Set Architectures (ISAs) and precision combinations. For instance, on the XpulpNNv1 system, symmetric precisions (like 4b/4b) are often more efficient than asymmetric ones (like 4b/8b). Furthermore, memory tiling—the process of moving data between main memory and local scratchpads—can favor specific precisions that optimize buffer utilization, sometimes making 8-bit layers faster than 4-bit ones in specific configurations.

The "Free Bits" Methodology

To exploit these hardware "quirks," the authors propose a three-step hybrid search methodology:

  1. Differentiable Search: An initial MPQ configuration is found using Bayesian Bits, a hardware-agnostic algorithm that minimizes task loss and expected BOP count.
  2. Free Bits Heuristic: The network is iteratively refined by profiling the target hardware. If a higher precision for a specific layer results in lower or equal latency than the initial search result, the layer is "upgraded." These additional bits are "free" because they improve accuracy without a latency penalty.
  3. Fine-Tuning: The final model is trained using Trained Quantization Thresholds (TQT) to recover any accuracy lost during quantization.

Experimental Results

The researchers evaluated their approach on the ImageNet (ILSVRC2012) dataset using MobileNetV1 (0.75x width multiplier) and MobileNetV2 (1.0x width multiplier) architectures, deployed on the PULP RISC-V platform.

Accuracy vs. latency Pareto front for MobileNetV1, showing the improvements gained by the Free Bits (FB) heuristic.

As illustrated in the Pareto front for MobileNetV1 (Figure 2), the Free Bits (FB) heuristic consistently shifts configurations toward the optimal upper-left region. For MobileNetV1, the approach achieved a 28.6% reduction in end-to-end latency compared to a standard 8-bit model while maintaining full-precision equivalent accuracy (68.6% top-1). For MobileNetV2, the heuristic reduced the latency of a baseline 4-bit configuration by 46% while simultaneously improving classification accuracy by 0.6 percentage points.

Conclusion

The "Free Bits" methodology highlights the necessity of hardware-aware optimization for edge AI. By moving beyond theoretical complexity metrics and accounting for real-world execution costs, the proposed approach unlocks significant performance and accuracy gains. Future work includes extending this heuristic to hardware accelerators with fused layers and exploring finer-grained, channel-wise mixed-precision.

Summary updated

BibTeX
@inproceedings{rutishauser2023free,
  author = {Georg Rutishauser and Francesco Conti and Luca Benini},
  title = {{Free Bits: Latency Optimization of Mixed-Precision Quantized Neural Networks on the Edge}},
  booktitle = {AICAS},
  year = {2023},
  doi = {10.1109/aicas57966.2023.10168577},
}
Figure