Introduction
Deep Neural Networks (DNNs) have achieved remarkable success across various domains, yet their deployment on resource-constrained edge devices remains a significant challenge due to high computational and memory requirements. Quantization, which reduces the bit-width of weights and activations from 32-bit floating-point to lower precisions like 4-bit or 8-bit, is a primary technique to address this. However, traditional quantization methods often face a trade-off between accuracy and hardware efficiency. Linear quantization (Fixed-point) maintains high accuracy but requires power-intensive multipliers. Conversely, non-linear quantization, such as Power-of-Two (PoT), offers high speed by replacing multiplications with simple bit-shifts but often suffers from significant accuracy degradation due to its rigid resolution.
The RMSMP Framework
The Row-wise Mixed-Scheme and Multi-Precision (RMSMP) framework introduces a novel approach to break this trade-off. Instead of applying a uniform quantization scheme to an entire layer, RMSMP assigns different schemes and precisions to individual rows (filters) within the weight matrix.
As illustrated in Figure 1, the weight tensor is transformed into a weight matrix where different rows are quantized using 4-bit PoT, 4-bit Fixed-point, or 8-bit Fixed-point schemes. This row-wise granularity allows the model to capture the diverse sensitivity of different filters while maintaining a hardware-friendly structure that avoids the bottlenecks typical of layer-wise mixed-precision approaches.
Methodology and Hardware-Informative Strategy
A key innovation of RMSMP is its "hardware-informative" strategy. By maintaining a consistent ratio of quantization schemes across all layers (e.g., a fixed percentage of PoT vs. Fixed-point rows), the framework ensures that hardware resources on an FPGA, such as Look-Up Tables (LUTs) and Digital Signal Processing (DSP) blocks, are utilized concurrently and efficiently. This avoids the idle time often associated with layer-wise mixed-precision methods that require hardware reconfiguration between layers.
The assignment of schemes is determined by two main criteria:
- Hessian-based Selection: Filters that are highly sensitive to quantization error, identified using the second-order derivative (Hessian) of the loss function, are assigned 8-bit Fixed-point precision. Typically, keeping only about 5% of filters at this higher precision is sufficient to significantly mitigate overall network error.
- Variance-based Selection: For the remaining filters, weight variance is used as a proxy for distribution complexity. Filters with low variance are well-suited for the PoT scheme, while high-variance filters are assigned to 4-bit Fixed-point to preserve accuracy.
The models are trained using the Straight-Through Estimator (STE) to facilitate gradient flow through the non-differentiable quantization functions.
Experimental Results
The RMSMP framework was evaluated on standard benchmarks including CIFAR-10, CIFAR-100, and ImageNet using popular architectures like ResNet-18, ResNet-50, and MobileNet-v2.
As shown in the results table, RMSMP consistently outperforms state-of-the-art quantization methods. For instance, on ImageNet with ResNet-18, RMSMP achieved a top-1 accuracy of 70.73%, surpassing methods like APoT and HAWQ at comparable bit-widths. Beyond image classification, the framework also demonstrated robustness on NLP tasks, achieving 92.87% accuracy on the SST-2 task with a quantized BERT model.
Crucially, the hardware benefits are substantial. When deployed on a Xilinx XC7Z045 FPGA, RMSMP achieved an end-to-end inference speedup of 3.65× compared to a standard 4-bit Fixed-point baseline, effectively utilizing the heterogeneous computing capabilities of the chip by running PoT and Fixed-point operations in parallel.
Conclusion
RMSMP presents a compelling solution for efficient DNN deployment by leveraging row-wise mixed schemes and multiple precisions. By balancing the high speed of PoT with the accuracy of Fixed-point math in a hardware-aware manner, it achieves superior performance across diverse models and datasets. Future work may explore even lower bit-widths and further automated optimization of scheme ratios for specific hardware architectures.
Summary updated