arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2409.03864cs.PL
收藏

MLIR Transform Dialect:你的编译器比你想象的更强大

The MLIR Transform Dialect. Your compiler is more powerful than you think

Martin Paul Lücke, Oleksandr Zinenko, William S. Moses, Michel Steuwer, Albert Cohen

AI总结:

本文提出 MLIR 中的 Transform dialect,使性能工程师无需编写新 pass 即可细粒度组合并复用编译器转换,从而精确优化不同计算负载。

摘要:

为了充分利用特定硬件目标,性能工程师需要获得对编译器的控制,以便运用其关于程序和硬件的领域知识。然而,现代编译器的可控性较差,通常只能通过配置一系列粗粒度、单体式的黑盒 pass,或借助预定义的编译器注解/编译指示来控制。这些方式可能有效,但往往无法让用户针对其不断变化的计算负载进行精确优化。因此,性能工程师不得不为特定优化启发式规则实现自定义 pass,而这需要编译器工程方面的专业知识。在本文中,我们提出一种技术,通过引入 Transform dialect 来提供对通用编译器的细粒度控制;Transform dialect 是在 MLIR 中实现的、可控的、基于 IR 的转换系统。Transform dialect 使性能工程师能够通过组合和复用现有但目前处于隐藏状态的编译器功能来优化其各种计算负载,而无需实现新的 pass,甚至无需重新构建编译器。我们通过五个案例研究证明,Transform dialect 能够实现精确、安全的编译器转换组合,并可与最先进的搜索方法直接集成。

英文摘要:

To take full advantage of a specific hardware target, performance engineers need to gain control on compilers in order to leverage their domain knowledge about the program and hardware. Yet, modern compilers are poorly controlled, usually by configuring a sequence of coarse-grained monolithic black-box passes, or by means of predefined compiler annotations/pragmas. These can be effective, but often do not let users precisely optimize their varying compute loads. As a consequence, performance engineers have to resort to implementing custom passes for a specific optimization heuristic, requiring compiler engineering expert knowledge. In this paper, we present a technique that provides fine-grained control of general-purpose compilers by introducing the Transform dialect, a controllable IR-based transformation system implemented in MLIR. The Transform dialect empowers performance engineers to optimize their various compute loads by composing and reusing existing - but currently hidden - compiler features without the need to implement new passes or even rebuilding the compiler. We demonstrate in five case studies that the Transform dialect enables precise, safe composition of compiler transformations and allows for straightforward integration with state-of-the-art search methods.

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

↑