GPU的域特定多级IR重写
Domain-Specific Multi-Level IR Rewriting for GPU
摘要:
传统的编译器在单个通用中间表示(IR)上操作。这些IR通常是低级别的,接近机器指令。因此,依赖于特定于域的信息的优化要么是不可能的,要么需要复杂的分析来恢复丢失的信息。相比之下,多级重写实例化方言(IR)的层次结构,逐级降低程序,并在最合适的级别执行代码转换。我们证明了这种方法在天气和气候领域的有效性。特别是,我们开发了一个原型编译器和设计模板和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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。