mlirSynth: 利用程序综合在多级IR中实现自动、可重定向的程序提升
mlirSynth: Automatic, Retargetable Program Raising in Multi-Level IR using Program Synthesis
AI总结:
针对MLIR现有低级方言自动提升依赖手动规则的问题,提出mlirSynth方法,利用方言定义与类型约束等搜索程序空间实现自动提升,在多平台取得显著加速效果且支持加速器重定向。
摘要:
MLIR是一种面向现代硬件的新兴编译器基础设施,但现有程序若以较低级通用语言编写,就无法利用MLIR的高性能编译能力。因此,为避免手动重写程序,学界已开展将MLIR中较低级方言自动提升为较高级方言的研究。然而,现有方法依赖手动定义的提升规则,这限制了其适用性,且随着MLIR方言演进,维护难度较大。\n 我们提出mlirSynth——一种无需手动定义规则即可将程序从较低级MLIR方言转换为较高级方言的新方法。该方法利用现有方言定义构建程序空间,并通过类型约束与等价关系实现高效搜索。我们通过将C程序提升为两种不同的高级MLIR方言验证了其有效性,这使我们能够使用现有的高级方言专属编译流程。在Polybench基准测试上,我们的方法覆盖率优于现有方法,相较于C语言的最优编译流程,在Intel平台上实现了2.5倍的几何平均加速比,在AMD平台上为3.4倍。mlirSynth还支持面向领域专用加速器的重定向,在TPU上实现了21.6倍的几何平均加速比。
英文摘要:
MLIR is an emerging compiler infrastructure for modern hardware, but existing programs cannot take advantage of MLIR's high-performance compilation if they are described in lower-level general purpose languages. Consequently, to avoid programs needing to be rewritten manually, this has led to efforts to automatically raise lower-level to higher-level dialects in MLIR. However, current methods rely on manually-defined raising rules, which limit their applicability and make them challenging to maintain as MLIR dialects evolve. We present mlirSynth -- a novel approach which translates programs from lower-level MLIR dialects to high-level ones without manually defined rules. Instead, it uses available dialect definitions to construct a program space and searches it effectively using type constraints and equivalences. We demonstrate its effectiveness \revi{by raising C programs} to two distinct high-level MLIR dialects, which enables us to use existing high-level dialect specific compilation flows. On Polybench, we show a greater coverage than previous approaches, resulting in geomean speedups of 2.5x (Intel) and 3.4x (AMD) over state-of-the-art compilation flows for the C programming language. mlirSynth also enables retargetability to domain-specific accelerators, resulting in a geomean speedup of 21.6x on a TPU.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。