arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2103.00194cs.ARcs.PL
收藏

HIR:一种基于MLIR的硬件加速器描述中间表示

HIR: An MLIR-based Intermediate Representation for Hardware Accelerator Description

Kingshuk Majumder, Uday Bondhugula

摘要:

边缘设备上机器学习、图像和音频处理的出现推动了对高能效定制硬件加速器的研究。虽然FPGA是节能自定义加速器的理想目标,但硬件设计的难度以及缺乏与供应商无关的标准化硬件编译基础设施阻碍了它们的采用。本文介绍了HIR,一个基于MLIR的中间表示(IR)来描述硬件加速器的设计。HIR将诸如循环和多维张量的高级语言特征与程序员定义的显式调度相结合,以提供适合于DSL编译器流水线的高级IR,而不损害对加速器的微架构的控制。HIR的显式调度允许它表达细粒度、无同步的并行性和优化,如重定时和流水线。作为MLIR的一种方言,它借鉴了从LLVM等社区学到的最佳IR实践。在提供丰富的优化机会和高级抽象的同时,HIR还支持与软件编译器基础设施共享优化、实用程序和传递。我们的实现表明,在一系列内核上,HIR代码生成器的代码生成时间平均比Xilinx Vivado HLS低1112倍,而不会影响生成硬件的质量。我们相信,这些都是重要的一步,在设计IR的硬件合成和装备领域特定的语言与生产力和执行编译路径自定义硬件加速。

英文摘要:

The emergence of machine learning, image and audio processing on edge devices has motivated research towards power efficient custom hardware accelerators. Though FPGAs are an ideal target for energy efficient custom accelerators, the difficulty of hardware design and the lack of vendor agnostic, standardized hardware compilation infrastructure has hindered their adoption. This paper introduces HIR, an MLIR-based intermediate representation (IR) to describe hardware accelerator designs. HIR combines high level language features, such as loops and multi-dimensional tensors, with programmer defined explicit scheduling, to provide a high-level IR suitable for DSL compiler pipelines without compromising control over the micro-architecture of the accelerator. HIR's explicit schedules allow it to express fine-grained, synchronization-free parallelism and optimizations such as retiming and pipelining. Built as a dialect in MLIR, it draws from best IR practices learnt from communities like those of LLVM. While offering rich optimization opportunities and a high level abstraction, HIR enables sharing of optimizations, utilities and passes with software compiler infrastructure. Our implementation shows that the code generation time of the HIR code generator is on average 1112x lower than that of Xilinx Vivado HLS on a range of kernels without a compromise on the quality of the generated hardware. We believe that these are significant steps forward in the design of IRs for hardware synthesis and in equipping domain-specific languages with a productive and performing compilation path to custom hardware acceleration.

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

↑