arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2203.04015cs.DCcs.ARcs.LG
收藏

基于FPGA的CNN推理加速器生成编译流程

A Compilation Flow for the Generation of CNN Inference Accelerators on FPGAs

University of Toronto(多伦多大学)

Seung-Hun Chung, Tarek S. Abdelrahman

摘要:

我们提出了在FPGA上生成CNN推理加速器的编译流程。该流程使用TVM编译器将冻结模型转换为OpenCL内核,并使用英特尔OpenCL SDK编译为FPGA比特流。我们通过对TVM生成的基础OpenCL内核进行优化来提高生成的硬件的质量。这些优化提高了并行性,减少了内存访问延迟,提高了并发性并节省了片上资源。我们在TVM中自动执行这些优化,并通过在Intel Stratix~ 10 SX上为LeNet-5、MobileNetV 1和ResNet-34生成加速器进行评估。我们表明,优化提高了性能的生成的加速器高达846倍以上的基础加速器。优化后的加速器在CPU上的性能比TensorFlow高出4.57倍,比单线程TVM高出3.83倍,比56线程TVM仅高出0.34倍。我们优化的内核也优于通过类似方法(也使用高级合成)生成的内核,同时提供更多的功能和灵活性。然而,它的性能不如使用手动优化设计的方法。因此,我们认为我们的方法在预生产环境中非常有用,可以从提高的性能和快速原型设计中受益,实现FPGA的优势,而无需硬件设计专业知识。

英文摘要:

We present a compilation flow for the generation of CNN inference accelerators on FPGAs. The flow translates a frozen model into OpenCL kernels with the TVM compiler and uses the Intel OpenCL SDK to compile to an FPGA bitstream. We improve the quality of the generated hardware with optimizations applied to the base OpenCL kernels generated by TVM. These optimizations increase parallelism, reduce memory access latency, increase concurrency and save on-chip resources. We automate these optimizations in TVM and evaluate them by generating accelerators for LeNet-5, MobileNetV1 and ResNet-34 on an Intel Stratix~10SX. We show that the optimizations improve the performance of the generated accelerators by up to 846X over the base accelerators. The performance of the optimized accelerators is up to 4.57X better than TensorFlow on CPU, 3.83X better than single-threaded TVM and is only 0.34X compared to TVM with 56 threads. Our optimized kernels also outperform ones generated by a similar approach (that also uses high-level synthesis) while providing more functionality and flexibility. However, it underperforms an approach that utilizes hand-optimized designs. Thus, we view our approach as useful in pre-production environments that benefit from increased performance and fast prototyping, realizing the benefits of FPGAs without hardware design expertise.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑