[Paper Review] CNN2Gate: Toward Designing a General Framework for Implementation of Convolutional Neural Networks on FPGA
CNN2Gate is an automated, OpenCL-based framework that compiles and optimizes CNN models for FPGA deployment using ONNX parsing, fixed-point quantization, and reinforcement learning-driven design-space exploration. It achieves 18ms inference latency for AlexNet and 205ms for VGG-16 on Intel Arria 10 FPGA, enabling efficient, scalable, and hardware-aware FPGA mapping without expert low-level design knowledge.
Convolutional Neural Networks (CNNs) have a major impact on our society because of the numerous services they provide. On the other hand, they require considerable computing power. To satisfy these requirements, it is possible to use graphic processing units (GPUs). However, high power consumption and limited external IOs constrain their usability and suitability in industrial and mission-critical scenarios. Recently, the number of researches that utilize FPGAs to implement CNNs are increasing rapidly. This is due to the lower power consumption and easy reconfigurability offered by these platforms. Because of the research efforts put into topics such as architecture, synthesis and optimization, some new challenges are arising to integrate such hardware solutions to high-level machine learning software libraries. This paper introduces an integrated framework (CNN2Gate) that supports compilation of a CNN model for an FPGA target. CNN2Gate exploits the OpenCL synthesis workflow for FPGAs offered by commercial vendors. CNN2Gate is capable of parsing CNN models from several popular high-level machine learning libraries such as Keras, Pytorch, Caffe2 etc. CNN2Gate extracts computation flow of layers, in addition to weights and biases and applies a "given" fixed-point quantization. Furthermore, it writes this information in the proper format for OpenCL synthesis tools that are then used to build and run the project on FPGA. CNN2Gate performs design-space exploration using a reinforcement learning agent and fits the design on different FPGAs with limited logic resources automatically. This paper reports results of automatic synthesis and design-space exploration of AlexNet and VGG-16 on various Intel FPGA platforms. CNN2Gate achieves a latency of 205 ms for VGG-16 and 18 ms for AlexNet on the FPGA.
Motivation & Objective
- To address the lack of integrated, automated tools for mapping high-level CNN models to FPGAs with minimal expert hardware knowledge.
- To enable efficient, low-latency inference on resource-constrained FPGAs by combining fixed-point quantization and hardware-aware optimization.
- To support scalable deployment across diverse FPGA platforms through automated design-space exploration and resource fitting.
- To bridge the gap between high-level machine learning frameworks (e.g., Keras, PyTorch) and FPGA hardware via a unified OpenCL-based synthesis pipeline.
Proposed method
- Parses trained CNN models from popular frameworks (Keras, PyTorch, Caffe2) using the ONNX format to extract layer computation flow, weights, and biases.
- Applies a predefined fixed-point quantization scheme to reduce model precision and improve hardware efficiency.
- Generates OpenCL-compatible code for FPGA synthesis using commercial vendor toolflows (e.g., Intel OpenCL SDK).
- Employs a reinforcement learning agent to perform automated design-space exploration and map CNNs to different FPGA targets based on resource constraints.
- Supports pipelined kernel execution where convolution and pooling layers are fused into single processing units to improve throughput.
- Uses hardware configuration parameters (e.g., number of CONV units, buffer sizes) to guide the synthesis and fitting process across varying FPGA resources.
Experimental results
Research questions
- RQ1Can an automated framework map diverse CNN architectures to FPGAs with minimal manual intervention?
- RQ2How effective is reinforcement learning in optimizing FPGA resource utilization and inference latency for CNNs?
- RQ3To what extent can fixed-point quantization maintain model accuracy while reducing hardware footprint and power consumption on FPGAs?
- RQ4How does the performance of an automated, high-level synthesis pipeline compare to hand-optimized RTL designs in terms of latency and resource efficiency?
Key findings
- CNN2Gate achieved 18ms inference latency for AlexNet and 205ms for VGG-16 on an Intel Arria 10 FPGA, demonstrating low-latency deployment via automation.
- The framework successfully synthesized both AlexNet and VGG-16 on larger FPGAs (e.g., Arria 10), but failed to fit on a small Cyclone V FPGA due to control logic overhead.
- VGG-16 required 8% more block RAMs than AlexNet in the same FPGA, reflecting the impact of deeper network architecture on memory usage.
- CNN2Gate achieved higher performance density (0.266 GOP/s/DSP) than a comparable design in [20], despite using more FPGA resources, indicating better efficiency per DSP.
- For VGG-16, CNN2Gate achieved 18% lower latency than [8] while using fewer DSPs, demonstrating superior optimization efficiency for larger networks.
- Although hand-optimized RTL designs like [10] outperform CNN2Gate in raw speed, CNN2Gate offers significantly greater scalability and automation, reducing the need for expert-level hardware tuning.
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.