Automatic Generation of Multi-Precision Multi-Arithmetic CNN Accelerators for FPGAs

Yiren Zhao, Xitong Gao, Xuan Guo, Junyi Liu, Erwei Wang, Robert Mullins, Peter Y. K. Cheung, George A. Constantinides, Cheng-Zhong Xu

Introduction

Deep Convolutional Neural Networks (CNNs) are computationally expensive, making them difficult to deploy on edge devices or in low-latency cloud environments. While FPGAs are excellent for this task due to their reconfigurability, most existing designs use a "one-size-fits-all" approach: they apply the same precision (e.g., 8-bit fixed-point) to every layer and use a large, shared "systolic array" compute core.

This paper argues that such uniformity is inefficient. Different layers in a CNN have varying sensitivities to quantization and distinct computational needs. A single large core often sits idle when processing layers that do not fit its dimensions perfectly. The challenge lies in automating the complex task of choosing the right arithmetic and hardware layout for every single layer to maximize performance without compromising accuracy.

The Tomato Framework

Tomato is an automated framework that generates CNN accelerators using "hybrid quantization"—mixing different arithmetics (fixed-point and powers-of-2) and precisions on a per-layer basis. It bridges the gap between software optimization and hardware generation through three key innovations:

  1. Hybrid Quantization: Instead of uniform precision, Tomato uses a greedy search algorithm to decide, layer-by-layer, whether to use standard fixed-point arithmetic or shift quantization (where weights are powers-of-2). Shift quantization replaces expensive multipliers with simple bit-shifters, providing a significant hardware advantage.
  2. Flattened Streaming Architecture: Unlike traditional designs that reuse one large core for every layer, Tomato generates a dedicated, smaller compute engine for every layer in the network. These engines are connected in a pipeline, allowing activations to stream through the entire network without needing to store intermediate results in slow off-chip memory (DRAM).
  3. Throughput Matching (Roll-Unrolling): To prevent bottlenecks, Tomato automatically calculates "unroll factors" for each layer. If a layer is naturally faster than the one before it, Tomato "rolls" the computation to save hardware space while maintaining the required throughput.
Comparison between traditional Homogenous Core and the proposed Flattened Streaming architecture.

Automated Workflow

The framework operates through a dual-stack approach. The software stack performs a greedy search for quantization parameters and estimates resources, while the hardware stack handles the generation of Verilog files and final bitstream synthesis. This automation allows for rapid design space exploration that would be prohibitive if done manually.

The Tomato framework workflow, integrating software-level quantization search with hardware-level generation.

Evaluation and Key Results

The framework was evaluated on three distinct benchmarks: ImageNet (with MobileNet-V1), CIFAR-10 (with CifarNet), and Fashion MNIST (with a customized 5-layer FashionNet).

  • MobileNet-V1 Performance: On an Intel Stratix 10 FPGA, the generated accelerator achieved 3109 FPS with a latency of just 0.32 ms.
  • Efficiency: This outperforms the closest FPGA competitors by 2.44× in latency and 3.52× in throughput.
  • Hardware Utilization: The design achieved a high compute unit utilization of 84%, demonstrating that very little of the generated hardware sits idle.
  • Scalability: The authors demonstrated that the design can be easily partitioned across multiple FPGAs using SFP+ interfaces with negligible latency overhead.

Key Insights

By isolating layers into their own hardware blocks, designers gain the freedom to optimize each one's arithmetic. A layer robust to noise can be squeezed into 3-bit shift weights, while a sensitive layer can remain at 7-bit fixed-point. Furthermore, by shrinking the model enough to fit entirely on-chip, Tomato eliminates the latency and power penalties of accessing external memory. This marks the first time a complete ImageNet-scale network has been packed onto a single FPGA in this manner.

Limitations and Future Work

While highly effective, the current greedy search algorithm makes local choices at each step and might miss a globally optimal combination of precisions. Additionally, the "flattened streaming" approach requires the entire model to fit in the FPGA's on-chip memory. For extremely large models, this would require either massive FPGAs or multi-FPGA clusters. Future work may extend this automated flow to newer, more complex layer types beyond standard and depthwise convolutions.

Summary updated

BibTeX
@inproceedings{zhao2019automatic,
  author = {Yiren Zhao and Xitong Gao and Xuan Guo and Junyi Liu and Erwei Wang and Robert Mullins and Peter Y. K. Cheung and George A. Constantinides and Cheng-Zhong Xu},
  title = {{Automatic Generation of Multi-Precision Multi-Arithmetic CNN Accelerators for FPGAs}},
  booktitle = {FPT},
  year = {2019},
  doi = {10.1109/icfpt47387.2019.00014},
}
Figure