论文标题

针对GPU的特定域特异性IR重写

Domain-Specific Multi-Level IR Rewriting for GPU

论文作者

Gysi, Tobias, Müller, Christoph, Zinenko, Oleksandr, Herhut, Stephan, Davis, Eddie, Wicky, Tobias, Fuhrer, Oliver, Hoefler, Torsten, Grosser, Tobias

论文摘要

传统编译器在单个通用中间表示(IR)上运行。这些IRS通常是低级且靠近机器说明。结果,依靠特定于域信息的优化要么是不可能的,要么需要复杂的分析才能恢复丢失的信息。相比之下,多层重写实例化了方言层次结构(IRS),降低程序逐级,并以最合适的级别执行代码转换。我们证明了这种方法对天气和气候领域的有效性。特别是,我们根据一组新引入的设计原理开发了一个原型编译器和设计模板和特定于GPU的方言。我们发现,在LLVM的可扩展MLIR编译器基础架构之上实现的两个特定域特异性优化(500行代码)足以超越最先进的解决方案。从本质上讲,多层次的重写有望预示着由共享基础架构之后实施的域和特定于目标方言组成的专业编译器时代。

Traditional compilers operate on a single generic intermediate representation (IR). These IRs are usually low-level and close to machine instructions. As a result, optimizations relying on domain-specific information are either not possible or require complex analysis to recover the missing information. In contrast, multi-level rewriting instantiates a hierarchy of dialects (IRs), lowers programs level-by-level, and performs code transformations at the most suitable level. We demonstrate the effectiveness of this approach for the weather and climate domain. In particular, we develop a prototype compiler and design stencil- and GPU-specific dialects based on a set of newly introduced design principles. We find that two domain-specific optimizations (500 lines of code) realized on top of LLVM's extensible MLIR compiler infrastructure suffice to outperform state-of-the-art solutions. In essence, multi-level rewriting promises to herald the age of specialized compilers composed from domain- and target-specific dialects implemented on top of a shared infrastructure.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源