Most systems we regularly interact with, such as computer operating systems, are faced with the challenge of providing good performance, while managing limited resources like computational time and memory. Since it is challenging to optimally manage these resources, there is increasing interest in the use of machine learning (ML) to make this decision-making data driven rather than heuristic. In compiler optimization, inlining is the process of replacing a call to a function in a program with the body of that function. Inlining for size aims to minimize the size of the final binary file by removing redundant code.
Size is a constraining factor for many applications, such as on-device products, where an increase can hinder performance or even prevent the updating and use of some products. Inlining decisions are a key component that a compiler can optimize, with changes in this decision resulting in a final software binary of significantly different size. Prior work has successfully applied reinforcement learning (RL) algorithms to train effective inlining policies, which have been deployed in several systems. However, most RL algorithms are sensitive to reward signals and require careful hyperparameter tuning to avoid instability and poor performance. Consequently, as the underlying system changes, the RL algorithms must be run again, which is both costly and unreliable in deployment.
To that end, in “Offline Imitation Learning from Multiple Baselines with Applications to Compiler Optimization”, to be presented at the ML For Systems workshop at NeurIPS 2024, we introduce Iterative BC-Max, a novel technique that aims to reduce the size of the compiled binary files by improving inlining decisions. Iterative BC-Max produces a decision-making policy by solving carefully designed supervised learning problems instead of using unstable and computationally demanding RL algorithms. We describe several benefits to using this approach, including fewer compiler interactions, robustness to unreliable reward signals, and only solving binary classification problems instead of more cumbersome RL problems.