A Reinforcement Learning Environment for Automatic Code Optimization in the MLIR Compiler
Not on the map. Why?
Abstract (arXiv)
Code optimization is a crucial task that aims to enhance code performance. However, this process is often tedious and complex, highlighting the necessity for automatic code optimization techniques. Reinforcement Learning (RL) has emerged as a promising approach for tackling such complex optimization problems. In this project, we introduce MLIR RL, an RL environment for the MLIR compiler, dedicated to facilitating MLIR compiler research and enabling automatic code optimization. We propose a multi-discrete formulation of the action space where the action space is the Cartesian product of simpler action subspaces. We also propose a new method, called level pointers, to reduce the size of the action space related to the loop interchange transformation. This enables more efficient and effective learning of the policy. To demonstrate the effectiveness of MLIR RL, we train an RL agent to optimize MLIR Linalg code, targeting CPU. The code is generated from two domain-specific frameworks: deep-learning models generated from PyTorch, and LQCD (Lattice Quantum Chromodynamics) code generated from an LQCD compiler. The result of this work is a research environment that allows the community to experiment with novel ideas in RL-driven loop-nest optimization.
Key facts. Cited by 3 papers in the map (data through 7 Oct 2026). Builds on 20 of its 69 references that are in the map. First posted on arXiv 17 Sep 2024.
Builds on
20 of 69 references.
References · 20
- 2019PyTorch: An Imperative Style, High-Performance Deep Learning Librarycited by 20,160
- 2017Proximal Policy Optimization Algorithmscited by 14,441
- 2015High-Dimensional Continuous Control Using Generalized Advantage Estimationcited by 1,916
- 2015Pointer Networkscited by 882
- 2020Ansor: Generating High-Performance Tensor Programs for Deep Learningcited by 199
- 2018Learning to Optimize Tensor Programscited by 138
- 2018Tensor Comprehensions: Framework-Agnostic High-Performance Machine Learning Abstractionscited by 84
- 2018Tiramisu: A Polyhedral Compiler for Expressing Fast and Portable Codecited by 53
- 2018Ithemal: Accurate, Portable and Fast Basic Block Throughput Estimation using Deep Neural Networkscited by 43
- 2021CompilerGym: Robust, Performant Compiler Optimization Environments for AI Researchcited by 41
- 2021A Deep Learning Based Cost Model for Automatic Code Optimizationcited by 33
- 2020Chameleon: Adaptive Code Optimization for Expedited Deep Neural Network Compilationcited by 29
8 more
- 2020AutoPhase: Juggling HLS Phase Orderings in Random Forests with Deep Reinforcement Learningcited by 24
- 2020Compiling ONNX Neural Network Models Using MLIRcited by 18
- 2019Reinforced Genetic Algorithm Learning for Optimizing Computation Graphscited by 17
- 2019AutoPhase: Compiler Phase-Ordering for High Level Synthesis with Deep Reinforcement Learningcited by 12
- 2022MLGOPerf: An ML Guided Inliner to Optimize Performancecited by 9
- 2020TIRAMISU: A Polyhedral Compiler for Dense and Sparse Deep Learningcited by 7
- 2024LOOPer: A Learned Automatic Code Optimizer For Polyhedral Compilerscited by 7
- 2023X-RLflow: Graph Reinforcement Learning for Neural Network Subgraphs Transformationcited by 2
Built on by
Citing papers per year: 2024: 1; 2025: 2.
3 papers.