基於Xilinx嵌入式FPGA平台的高硬體利用率CNN加速器系統設計與實現
High Hardware Utilization Rate CNN Accelerator System Design and Implementation based on Xilinx Embedded FPGA Platform
摘要
本論文通過分析卷積運算的輸入資料矩陣維度,提出了一個能夠支援混合型卷積神經網路的Hybrid CNN硬體加速器。本作品之硬體加速器使用了638 KB的SRAM,配備了高資料重複使用率的資料流以及Ping-pong 資料緩衝器的預存機制。在計算單元的配置上採用了6x16大小的PE Array,並且提供了彈性的PE Array配置方式,讓常見的CNN Layer都能夠有效地配置到硬體加速器上執行運算。加速器時脈運作於200MHz時,處理8-bit feature map/8-bit weight卷積運算之最高效能 (Peak performance)可以達到921.6 GOPS,而若是進行1-bit feature map/1-bit weight運算時,其Peak performance則可達到7.37 TOPS。
我們將設計好的加速器集成在了Xilinx ZCU-102異構嵌入式FPGA平臺上,並對軟、硬體運算結果進行了同步,使其可以達到bit accurate準確度(即軟體模擬結果與硬體執行結果完全相同),不會因為模型從FP32的運算平臺移植到定點數運算平臺而造成運算結果不同而導致其準確度下降。系統運算效能方面,在加速器使用150 MHz的運算時脈下,使用Tiny YOLOv2模型進行推斷可以達到每秒30張畫面(416x416)的即時處理速度。
我們將設計好的加速器集成在了Xilinx ZCU-102異構嵌入式FPGA平臺上,並對軟、硬體運算結果進行了同步,使其可以達到bit accurate準確度(即軟體模擬結果與硬體執行結果完全相同),不會因為模型從FP32的運算平臺移植到定點數運算平臺而造成運算結果不同而導致其準確度下降。系統運算效能方面,在加速器使用150 MHz的運算時脈下,使用Tiny YOLOv2模型進行推斷可以達到每秒30張畫面(416x416)的即時處理速度。
This paper proposes a Hybrid CNN hardware accelerator that can support a hybrid convolutional neural network by analyzing the input data matrix dimensions of the convolution operation. The proposed hardware accelerator uses 638KB of on-chip SRAM, having dataflow with high data reuse rate and the ping-pong buffer pre-storage mechanism. As for computing units, this work equips 6x16 PE array and a flexible PE Array configuration method, such that the standard operations of the CNN layer can be efficiently mapped to the hardware accelerator. If we use 200MHz as clock rate, it can offer 921.6 GOPS peak performance when calculating 8-bit feature map/8-bit kernel convolution and 7.37 TOPS peak performance when calculating 1-bit feature map/1-bit kernel convolution.
We have integrated the designed accelerator on the Xilinx ZCU-102 heterogeneous embedded FPGA platform and synchronized the software and hardware calculation results so that it can achieve bit-level accuracy (that is, software inference results and hardware inference results are precisely the same). The accuracy will not be degraded when the CNN model is ported from the floating-point32 data type training framework to the fixed-point data type hardware accelerators. In terms of overall system performance, when the accelerator uses a 150 MHz clock input, the inference of the Tiny YOLOv2 model can achieve 416x416 video@30 frames per second.
We have integrated the designed accelerator on the Xilinx ZCU-102 heterogeneous embedded FPGA platform and synchronized the software and hardware calculation results so that it can achieve bit-level accuracy (that is, software inference results and hardware inference results are precisely the same). The accuracy will not be degraded when the CNN model is ported from the floating-point32 data type training framework to the fixed-point data type hardware accelerators. In terms of overall system performance, when the accelerator uses a 150 MHz clock input, the inference of the Tiny YOLOv2 model can achieve 416x416 video@30 frames per second.