NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

MLComp: A Methodology for Machine Learning-based Performance Estimation and Adaptive Selection of Pareto-Optimal Compiler Optimization Sequences

Alessio Colucci, Dávid Juhász, Martin Mosbeck, Alberto Marchisio, Semeen Rehman, Manfred Kreutzer, Guenther Nadbath, Axel Jantsch, Muhammad Shafique · DOI

Abstract

The selection and ordering of compiler optimization phases, known as the Phase Ordering Problem, significantly impacts software performance, energy consumption, and code size. Traditional heuristics like -O3 often fail to provide optimal results for specific hardware-application pairs. This paper introduces MLComp, a novel framework that decouples performance estimation from phase selection. By utilizing a high-accuracy supervised learning model for performance prediction and a reinforcement learning agent for sequence selection, MLComp achieves up to 12% performance improvement over standard LLVM optimizations while reducing training time from weeks to days.

Introduction

Modern compilers such as LLVM and GCC offer hundreds of optimization phases. The astronomical number of possible permutations makes manual optimization impossible. While existing machine learning approaches attempt to automate this, they are often bottlenecked by the need for slow dynamic profiling during the training loop or focus solely on a single metric like execution speed. MLComp addresses these challenges by providing a fast, multi-objective optimization framework that balances performance and energy efficiency.

Methodology

The MLComp framework consists of a two-stage pipeline designed to navigate the complex search space of compiler optimizations efficiently.

Overview of the MLComp methodology, illustrating the four main stages: Data Extraction, Performance Estimator Training, Phase Selection Policy Training, and Deployment.

Performance Estimator (PE)

To avoid the overhead of physical execution during training, MLComp employs a Performance Estimator. This supervised learning model predicts execution time, energy consumption, and code size based on 63 features extracted from the LLVM Intermediate Representation (IR). A heuristic search automatically selects the optimal ML model and preprocessing steps for the target architecture.

Phase Sequence Selector (PSS)

The PSS is a Reinforcement Learning (RL) agent that treats optimization as a sequential decision process. The agent receives the current IR features as its state and selects an optimization phase as an action. The reward is calculated using the PE's predictions, enabling the agent to explore thousands of sequences in seconds. This decoupling allows for a "Quasi-Pareto" optimization that penalizes speed gains that excessively increase energy consumption.

Experimental Setup and Results

The framework was evaluated using the PARSEC benchmark suite on x86 (Intel Core i7) and the BEEBS suite on a simulated RISC-V platform.

Accuracy and Performance

The Performance Estimator achieved a relative error of less than 2%, significantly outperforming prior state-of-the-art models. As shown in the figure below, the distributions of performance metrics predicted by MLComp closely match those obtained through traditional profiling, validating the model's reliability.

Comparison of performance metrics (instructions, cycles, energy, power) between MLComp predictions and actual profiling, demonstrating high estimation accuracy.

Key results include:

  • Performance Gains: Up to 12% improvement in execution time and 6% reduction in energy consumption compared to standard LLVM flags.
  • Efficiency: Training for a new platform was completed in just 2 days, a massive reduction compared to the 15-108 days required by previous methods.
  • Code Size: MLComp maintained or slightly improved binary size, avoiding the "bloat" common in speed-centric optimizers.

Conclusion

MLComp demonstrates that decoupling performance estimation from phase selection is a viable and highly efficient strategy for solving the Phase Ordering Problem. By providing accurate, multi-objective feedback to an RL agent, the framework enables the discovery of Pareto-optimal optimization sequences across diverse hardware architectures in a fraction of the time required by traditional methods.

Summary updated

BibTeX
@inproceedings{colucci2020mlcomp,
  author = {Alessio Colucci and Dávid Juhász and Martin Mosbeck and Alberto Marchisio and Semeen Rehman and Manfred Kreutzer and Guenther Nadbath and Axel Jantsch and Muhammad Shafique},
  title = {{MLComp: A Methodology for Machine Learning-based Performance Estimation and Adaptive Selection of Pareto-Optimal Compiler Optimization Sequences}},
  booktitle = {DATE},
  year = {2020},
  doi = {10.23919/date51398.2021.9474158},
}
Figure