The Next 700 ML-Enabled Compiler Optimizations
S. VenkataKeerthy, Siddharth Jain, Umesh Kalvakuntla, Pranav Sai Gorantla, Rajiv Shailesh Chitale, Eugene Brevdo, Albert Cohen, Mircea Trofin, Ramakrishna Upadrasta
TL;DR
This work addresses the challenge of integrating ML-based optimization strategies into traditional compilers without locking into a single ML framework. It introduces ML-Compiler-Bridge, a modular library that provides inter- and in-process model runners and multiple SerDes options to enable tight, framework-agnostic coupling between ML models and compilers like LLVM, Pluto, and MLIR. Through four ML-enabled LLVM optimizations (POSET-RL, RL-LoopDistribution, RL4ReAl, and Inliner), the paper demonstrates substantial reductions in deployment latency, training time, and round-trip communication overhead, while offering multi-language APIs and extensible extensions. The results indicate significant practical potential for production-ready ML-driven compiler optimizations, with measurable impact on compile time, binary size, and deployment complexity, and with pathways to broader adoption across domain-specific compilers and Gym-style environments.
Abstract
There is a growing interest in enhancing compiler optimizations with ML models, yet interactions between compilers and ML frameworks remain challenging. Some optimizations require tightly coupled models and compiler internals,raising issues with modularity, performance and framework independence. Practical deployment and transparency for the end-user are also important concerns. We propose ML-Compiler-Bridge to enable ML model development within a traditional Python framework while making end-to-end integration with an optimizing compiler possible and efficient. We evaluate it on both research and production use cases, for training and inference, over several optimization problems, multiple compilers and its versions, and gym infrastructures.
