ACPO: AI驱动的编译器框架
ACPO: AI-Enabled Compiler Framework
AI总结:
针对编译器优化遍决策难题,本文提出AI驱动的编译器框架ACPO,为LLVM提供机器学习优化工具,在循环展开、函数内联等优化上实现了优于原生O3的性能提升。
摘要:
程序性能优化的关键在于正确判断编译器何时应当应用某项特定变换。这是应用机器学习模型加速调优过程的理想契机;尽管这一认知早在20世纪90年代末就已出现,但直到近期机器学习领域的进展,才使得机器学习作为端到端框架在编译器中的实际应用成为可能。\n 本文提出ACPO: An AI-Enabled Compiler Framework(AI驱动的编译器框架),这一全新框架为LLVM提供了简单完备的工具,使其能在不同优化遍中应用机器学习模型并获益。我们首先展示ACPO的高层视图、类层次结构与功能,随后通过为LLVM O3优化级中的循环展开(Loop Unroll)和函数内联(Function Inlining)遍赋予机器学习能力,演示ACPO的若干用例,最后说明如何利用ACPO优化其他优化遍。实验结果显示,ACPO的循环展开模型部署在Polybench、Coral-2、CoreMark和Graph-500上时,相较于LLVM原生O3优化,平均分别获得4%、3%、5.4%和0.2%的性能提升。此外,同时集成函数内联和循环展开模型后,ACPO在Polybench和Cbench上相较于LLVM O3分别能带来4.5%和2.4%的综合加速比。
英文摘要:
The key to performance optimization of a program is to decide correctly when a certain transformation should be applied by a compiler. This is an ideal opportunity to apply machine-learning models to speed up the tuning process; while this realization has been around since the late 90s, only recent advancements in ML enabled a practical application of ML to compilers as an end-to-end framework. This paper presents ACPO: An AI-Enabled Compiler Framework, a novel framework that provides LLVM with simple and comprehensive tools to benefit from employing ML models for different optimization passes. We first showcase the high-level view, class hierarchy, and functionalities of ACPO and subsequently, demonstrate \taco{a couple of use cases of ACPO by ML-enabling the Loop Unroll and Function Inlining passes used in LLVM's O3. and finally, describe how ACPO can be leveraged to optimize other passes. Experimental results reveal that the ACPO model for Loop Unroll can gain on average 4%, 3%, 5.4%, and 0.2% compared to LLVM's vanilla O3 optimization when deployed on Polybench, Coral-2, CoreMark, and Graph-500, respectively. Furthermore, by including both Function Inlining and Loop Unroll models, ACPO can provide a combined speedup of 4.5% on Polybench and 2.4% on Cbench when compared with LLVM's O3, respectively.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。