Research on Efficient CNN Acceleration Through Mixed Precision Quantization: A Comprehensive Methodology

Yizhi He, Wenlong Liu, Muhammad Tahir, Zhao Li, Shaoshuang Zhang, Hussain Bux AmurInternational Journal of Advanced Computer Science and Applications 2023

Abstract

Deploying Convolutional Neural Networks (CNNs) on resource-constrained edge devices necessitates efficient computation and memory management. This paper proposes a collaborative software-hardware co-design for mixed-precision CNN acceleration on Field Programmable Gate Arrays (FPGAs). We introduce a bit-width strategy search algorithm that assigns optimal precision to individual layers based on their sensitivity to quantization-induced loss. Complementing this, we present a hardware architecture featuring shared Processing Elements (PEs) through a folding design and a register set buffer to optimize data throughput. Evaluated on the CIFAR-10 dataset with ResNet20, our approach achieves 91.68% accuracy—a minimal 1.21% drop from full precision—while delivering a 4.27x speedup over a CPU and an 89x improvement over unified 16-bit FPGA designs.

Introduction

The proliferation of CNNs in edge computing applications, such as IoT and mobile devices, is hindered by the high computational and memory demands of these models. While quantization is a common technique to reduce model size and complexity, uniform quantization often leads to significant accuracy degradation. This research addresses these challenges through a mixed-precision approach that balances efficiency and precision.

Methodology

A critical component of our methodology is the Quantization Bit-Width Policy Search algorithm. Rather than applying a uniform bit-width across all layers, we analyze the sensitivity of each layer to quantization using Hessian-based loss variation analysis (Taylor expansion).

Layers exhibiting high sensitivity to precision loss are assigned higher bit-widths, while more resilient layers are compressed more aggressively. This strategic allocation ensures that the model's critical features are preserved. Following quantization, the model undergoes retraining to recover any lost inference accuracy.

Algorithm 1: The proposed bit-width policy search algorithm iteratively optimizes layer precision to maintain accuracy.

Hardware: Optimized FPGA Accelerator

The hardware design is specifically engineered to support the varying bit-widths determined by the software policy. Key innovations include:

  • PE Folding: To maximize resource efficiency, we implement a folding design where multiple network layers share the same Processing Elements (PEs). This significantly reduces the overall FPGA resource footprint.
  • Operation Fusion: Convolution, Batch Normalization, and Quantization are fused into a single hardware operation. This eliminates the need for frequent off-chip memory access for intermediate results, reducing latency and power consumption.
  • Register Set Buffer: To bridge the gap between memory bandwidth and compute speed, a register buffer "packs" low-bit data into wider words, ensuring a continuous data stream to the PEs.
The overall FPGA accelerator architecture, highlighting the interaction between the FSM, PEs, and off-chip memory.

Experimental Results

The proposed methodology was implemented on a Xilinx Kintex-7 FPGA and validated using the ResNet20 model on the CIFAR-10 dataset.

  • Performance: The accelerator achieved a computing speed 4.27 times faster than a standard CPU (Intel Core i5-12400). Compared to a traditional unified 16-bit FPGA implementation, our mixed-precision design demonstrated an 89-fold increase in speed.
  • Accuracy: The final model reached an inference accuracy of 91.68%, representing only a 1.21% drop compared to the 32-bit floating-point baseline.
  • Power Efficiency: The FPGA solution proved highly efficient, consuming only 5% of the power required by the CPU and approximately 6.2% of the power used by a high-end GPU (NVIDIA RTX 2070 Super).

Conclusion

This research demonstrates that a synergistic software-hardware co-design is essential for efficient CNN deployment on edge devices. By leveraging mixed-precision quantization and optimized hardware architectures like PE folding, we can achieve significant performance gains and power savings with minimal impact on model accuracy. Future work will explore the scalability of this approach to larger models and more complex datasets.

Summary updated

BibTeX
@article{he2023research,
  author = {Yizhi He and Wenlong Liu and Muhammad Tahir and Zhao Li and Shaoshuang Zhang and Hussain Bux Amur},
  title = {{Research on Efficient CNN Acceleration Through Mixed Precision Quantization: A Comprehensive Methodology}},
  journal = {International Journal of Advanced Computer Science and Applications},
  year = {2023},
  doi = {10.14569/ijacsa.2023.0141282},
}
Figure