Learning Compiler Pass Orders using Coreset and Normalized Value Prediction
Finding the optimal pass sequence of compilation can lead to a significant reduction in program size and/or improvement in program efficiency. Prior works on compilation pass ordering have two major drawbacks. They either require an excessive budget (in terms of compilation steps) at compile time or fail to generalize to unseen programs. In this paper, for code-size reduction tasks, we propose a novel pipeline to find program-dependent pass sequences within 45 compilation calls. It first identifies a coreset of 50 pass sequences via greedy optimization of a submodular function, and then learns a policy with Graph Neural Network (GNN) to pick the optimal sequence by predicting the normalized values of the pass sequences in the coreset. Despite its simplicity, our pipeline outperforms the default -Oz flag by an average of 4.7% over a large collection (4683) of unseen code repositories from diverse domains across 14 datasets. In comparison, previous approaches like reinforcement learning on the raw pass sequence space may take days to train due to sparse reward, and may not generalize well in held-out ones from different domains. Our results demonstrate that existing human-designed compiler flags can be improved with a simple yet effective technique that transforms the raw action space into a small one with denser rewards.
Code (0)
등록된 구현이 없습니다.
Tasks
Compiler OptimizationGraph LearningGraph Neural NetworkValue predictionMethods 이 논문이 사용한 방법론
Similar Papers 제목 키워드 기반
AutoPhase: Compiler Phase-Ordering for High Level Synthesis with Deep Reinforcement Learning
The performance of the code generated by a compiler depends on the order in which the optimization passes are applied. In high-level synthesis, the quality of the generated circuit relates directly to the code generated …
Deep Reinforcement LearningHigh-Level Synthesisreinforcement-learningReinforcement Learning+1CompilerDream: Learning a Compiler World Model for General Code Optimization
Effective code optimization in compilers is crucial for computer and software engineering. The success of these optimizations primarily depends on the selection and ordering of the optimization passes applied to the code…
DiversityModel-based Reinforcement Learningreinforcement-learningValue prediction+1Small coresets via negative dependence: DPPs, linear statistics, and concentration
Determinantal point processes (DPPs) are random configurations of points with tunable negative dependence. Because sampling is tractable, DPPs are natural candidates for subsampling tasks, such as minibatch selection or …
Point ProcessesBayesian Coreset Construction via Greedy Iterative Geodesic Ascent
Coherent uncertainty quantification is a key strength of Bayesian methods. But modern algorithms for approximate Bayesian posterior inference often sacrifice accurate posterior uncertainty estimation in the pursuit of sc…
Uncertainty QuantificationCoresets for Minimum Enclosing Balls over Sliding Windows
\emph{Coresets} are important tools to generate concise summaries of massive datasets for approximate analysis. A coreset is a small subset of points extracted from the original point set such that certain geometric prop…