在Flang中利用基于MLIR的领域特定抽象实现Fortran性能优化与自动并行化
Fortran performance optimisation and auto-parallelisation by leveraging MLIR-based domain specific abstractions in Flang
AI总结:
本研究将Flang MLIR通用编译器与Open Earth Compiler的MLIR stencil方言结合,开发Fortran模板提取转换与自动并行化方法,在Cray超算上实现2-10倍性能提升,支持多线程、分布式并行与GPU优化且无需修改串行源码。
摘要:
MLIR自2019年开源以来已得到广泛应用。作为LLVM的子项目,MLIR提供了将中间表示(IR)以不同抽象层级的方言(dialect)形式表示、混合这些方言以及利用各方言间转换的灵活性,为自动化程序优化与并行化提供了机遇。除了基于MLIR构建的通用编译器外,领域特定抽象也已被开发出来。\n 本文中,我们探索将Flang MLIR通用编译器与领域特定的Open Earth Compiler的MLIR stencil(模板)方言相结合,对其进行补充。我们开发了从Fortran代码中发现并提取模板的转换方法,在Cray超级计算机上的基准测试中,与单独使用Flang相比,这种特化实现了2到10倍的性能提升。此外,通过利用现有MLIR转换,我们开发了一种面向多线程与分布式内存并行、以及GPU上优化执行的自动并行化方法,且无需对串行Fortran源代码做任何修改。
英文摘要:
MLIR has become popular since it was open sourced in 2019. A sub-project of LLVM, the flexibility provided by MLIR to represent Intermediate Representations (IR) as dialects at different abstraction levels, to mix these, and to leverage transformations between dialects provides opportunities for automated program optimisation and parallelisation. In addition to general purpose compilers built upon MLIR, domain specific abstractions have also been developed. In this paper we explore complimenting the Flang MLIR general purpose compiler by combining with the domain specific Open Earth Compiler's MLIR stencil dialect. Developing transformations to discover and extracts stencils from Fortran, this specialisation delivers between a 2 and 10 times performance improvement for our benchmarks on a Cray supercomputer compared to using Flang alone. Furthermore, by leveraging existing MLIR transformations we develop an auto-parallelisation approach targeting multi-threaded and distributed memory parallelism, and optimised execution on GPUs, without any modifications to the serial Fortran source code.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。