Leveraging machine-learning (ML) techniques for compiler optimizations has been widely studied and explored in academia. However, the adoption of ML in general-purpose, industry strength compilers has yet to happen. We propose MLGO, a framework for integrating ML techniques systematically in an industrial compiler -- LLVM. As a case study, we present the details and results of replacing the heuristics-based inlining-for-size optimization in LLVM with machine learned models. To the best of our knowledge, this work is the first full integration of ML in a complex compiler pass in a real-world setting. It is available in the main LLVM repository. We use two different ML algorithms: Policy Gradient and Evolution Strategies, to train the inlining-for-size model, and achieve up to 7\% size reduction, when compared to state of the art LLVM -Oz. The same model, trained on one corpus, generalizes well to a diversity of real-world targets, as well as to the same set of targets after months of active development. This property of the trained models is beneficial to deploy ML techniques in real-world settings.
MLGOPerf: An ML Guided Inliner to Optimize Performance
Huawei Technologies(华为技术有限公司)
在过去的25年里,我们见证了机器学习在选择和相位排序问题中的广泛应用。然而,有限的作品已被上传到最先进的编译器,即,LLVM,将前者无缝集成到编译器的优化管道中,以便用户轻松部署。MLGO是第一个这样的项目之一,它只致力于使用强化学习来减少基于ML的Inliner的二进制代码的大小。本文介绍了MLGOPerf;第一个能够使用LLVM的ML-Inliner优化性能的端到端框架。它采用二级ML模型来生成用于训练重定向强化学习代理的奖励,该代理先前被MLGO用作主要模型。它通过预测被分析函数的内联后加速来实现这一点,并且它为主要模型提供了一个快速训练框架,否则这将是不实用的。实验结果表明,MLGOPerf是能够获得高达1.8%和2.2%,相对于LLVM的优化在O3时,训练的性能在SPEC CPU 2006和Cbench基准,分别。此外,所提出的方法为我们的基准测试提供了高达26%的自动调优代码区域的机会,这可以转化为额外的3.7%的加速值。
MQSS-Selector: RL-Guided Pass Selection for an MLIR Compilation Pipeline
Leibniz Supercomputing Centre (LRZ)(莱布尼茨超级计算中心);Technical University of Munich (TUM)(慕尼黑工业大学);Munich Quantum Valley (MQV)(慕尼黑量子谷);Argonne National Laboratory (ANL)(阿贡国家实验室)
Compiler-Guided Inference-Time Adaptation: Improving GPT-5 Programming Performance in Idris
Ming Hsieh Department of Electrical and Computer Engineering(明希斯部门电子与计算机工程系);Viterbi School of Engineering, University of Southern California(维特比工程学院,南加州大学)
Pattern-Guided Graph Synthesis for Suppressing Known Defects in DL Compiler Fuzzing
School of Computer Science and Engineering, Nanjing University of Science and Technology(南京理工大学计算机科学与工程学院);Department of Computer Science, Xidian University(西安电子科技大学计算机科学与技术学院);School of Computer Science, Wuhan University(武汉大学计算机学院)