HackerPapers

arXiv:2207.08389cs.PL

MLGOPerf: An ML Guided Inliner to Optimize Performance

Amir H. Ashouri, Mostafa Elhoushi, Yuzhe Hua, Xiang Wang, Muhammad Asif Manzoor, Bryan Chan, Yaoqing Gao

Early discovery. Linked by one identifiable commenter. This paper is outside the main ranking; a mention is not an endorsement.

Abstract

For the past 25 years, we have witnessed an extensive application of Machine Learning to the Compiler space; the selection and the phase-ordering problem. However, limited works have been upstreamed into the state-of-the-art compilers, i.e., LLVM, to seamlessly integrate the former into the optimization pipeline of a compiler to be readily deployed by the user. MLGO was among the first of such projects and it only strives to reduce the code size of a binary with an ML-based Inliner using Reinforcement Learning. This paper presents MLGOPerf; the first end-to-end framework capable of optimizing performance using LLVM's ML-Inliner. It employs a secondary ML model to generate rewards used for training a retargeted Reinforcement learning agent, previously used as the primary model by MLGO. It does so by predicting the post-inlining speedup of a function under analysis and it enables a fast training framework for the primary model which otherwise wouldn't be practical. The experimental results show MLGOPerf is able to gain up to 1.8% and 2.2% with respect to LLVM's optimization at O3 when trained for performance on SPEC CPU2006 and Cbench benchmarks, respectively. Furthermore, the proposed approach provides up to 26% increased opportunities to autotune code regions for our benchmarks which can be translated into an additional 3.7% speedup value.

arXiv comments
Version 2: Added the missing Table 6. The short version of this work is accepted at ACM/IEEE CASES 2022
Journal reference
DOI
doi:10.1109/CASES55004.2022.00008
Subjects
cs.PLProgramming Languages cs.AIArtificial Intelligence cs.LGMachine Learning cs.NENeural and Evolutionary Computing cs.PFPerformance

On Hacker News

Linked by 1 identifiable commenter in 1 comment across 1 thread, from Sep 2023 to Sep 2023.

Comments linking this paper, per year.

Discussed in comments1 thread

    • What's the benefit of having an LLM do those things in a way that guesstimates? There are big wins to be had in code-size and some wins to be had in performance related to inlining [1][2], but I think the implementation in the references directly tied into the compiler's…

      boomanaiden154View on HNParent context

Submitted to Hacker News

Connected through shared HN threads, not inferred similarity or a recommendation.