CompilerGym: Robust, Performant Compiler Optimization Environments for AI Research

Chris Cummins, Bram Wasti, Jiadong Guo, Brandon Cui, Jason Ansel +7 more
9/17/2021
cs.PLcs.AIcs.LG

Official code: facebookresearch/CompilerGym (1,019 stars, Python, MIT, last commit 2026-04-14).

Abstract

Interest in applying Artificial Intelligence (AI) techniques to compiler optimizations is increasing rapidly, but compiler research has a high entry barrier. Unlike in other domains, compiler and AI researchers do not have access to the datasets and frameworks that enable fast iteration and development of ideas, and getting started requires a significant engineering investment.

Show full abstract

What is needed is an easy, reusable experimental infrastructure for real world compiler optimization tasks that can serve as a common benchmark for comparing techniques, and as a platform to accelerate progress in the field. We introduce CompilerGym, a set of environments for real world compiler optimization tasks, and a toolkit for exposing new optimization tasks to compiler researchers. CompilerGym enables anyone to experiment on production compiler optimization problems through an easy-to-use package, regardless of their experience with compilers. We build upon the popular OpenAI Gym interface enabling researchers to interact with compilers using Python and a familiar API. We describe the CompilerGym architecture and implementation, characterize the optimization spaces and computational efficiencies of three included compiler environments, and provide extensive empirical evaluations. Compared to prior works, CompilerGym offers larger datasets and optimization spaces, is 27x more computationally efficient, is fault-tolerant, and capable of detecting reproducibility bugs in the underlying compilers. In making it easy for anyone to experiment with compilers - irrespective of their background - we aim to accelerate progress in the AI and compiler research domains.

View on arXivView PDF

Code Implementations(1)

MIT

Reinforcement learning environments for compiler and program optimization tasks

1,019135Python, C++Nov 11, 20207 months agoMIT

Similar Papers

Cite this paper

@article{cummins2021compilergym,
  title  = {CompilerGym: Robust, Performant Compiler Optimization Environments for AI Research},
  author = {Chris Cummins and Bram Wasti and Jiadong Guo and Brandon Cui and Jason Ansel and Sahir Gomez and Somya Jain and Jia Liu and Olivier Teytaud and Benoit Steiner and Yuandong Tian and Hugh Leather},
  year   = {2021},
  eprint = {2109.08267},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2109.08267}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2109.08267.svg)](https://codeofpaper.com/paper/2109.08267)

Discussion