当前位置: X-MOL 学术arXiv.cs.PL › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
Domain-Specific Multi-Level IR Rewriting for GPU
arXiv - CS - Programming Languages Pub Date : 2020-05-26 , DOI: arxiv-2005.13014
Tobias Gysi, Christoph M\"uller, Oleksandr Zinenko, Stephan Herhut, Eddie Davis, Tobias Wicky, Oliver Fuhrer, Torsten Hoefler, Tobias Grosser

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.

中文翻译:

针对 GPU 的特定领域多级 IR 重写

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