CompilerGym favicon

CompilerGym

CompilerGym screenshot
Click to visit website
Feature this AI

About

CompilerGym is a library of easy-to-use and performant reinforcement learning environments for compiler tasks. It lets ML researchers interact with compiler optimization problems and provides tools for systems developers to expose new compiler tasks for ML research. It aims to make compilers faster using machine learning. CompilerGym allows granular control over compiler decisions, providing a platform for experimentation without requiring compiler expertise and enabling comparison of different optimization techniques.

Platform
Web
Task
compiler optimizing

Features

open-source

reinforcement learning environments for compiler tasks

easy-to-use and performant

allows control over compiler optimization decisions

provides a toolkit for systems developers

supports llvm, gcc, and cuda compilers

FAQs

What can I do with this?

CompilerGym lets you control compiler decisions when optimizing a program. It currently supports LLVM, GCC, and CUDA. The goal is to produce better compiled programs based on a reward signal (e.g., code size, execution time).

Do I have to use reinforcement learning?

No, you can use any technique to explore the optimization space; search techniques, genetic algorithms, supervised learning, unsupervised learning, deep reinforcement learning, etc.

Why does my environment's step() function return “done”?

An episode is 'done' when a terminal state is reached (no more decisions) or an unrecoverable error occurs (compiler crash, timeout, out-of-memory). Error details are in the `info` dict.

Where does CompilerGym store files?

CompilerGym uses several locations: `~/.local/cache/compiler_gym`, `~/.local/share/compiler_gym`, `/dev/shm/compiler_gym_${USER}`, and `~/logs/compiler_gym`. Environment variables can override defaults. It's safe to delete these directories if no CompilerGym processes are active.

Do I need to call env.close()?

Yes! Call `env.close()` or use a `with` statement to ensure resources are released properly after using an environment. Failing to do this may cause subprocesses or temporary files to not be cleaned up.

How do I debug crashes or errors?

First, create a minimal, reproducible example. Then, enable verbose logging (set `COMPILER_GYM_DEBUG` to 4 and adjust `logging.basicConfig`). Inspect the logs and report issues on GitHub.

I found a bug. How do I report it?

Report it using the GitHub issue tracker. See Contributing for details.

What features are going to be added in the future?

See the roadmap on the About page.

I want to modify one of the environments, where do I start?

Wrappers offer many modifications. For deeper changes, fork the project, build from source, modify the service implementation, and send a pull request.

I want to add a new compiler environment, where do I start?

Implement the `CompilationSession` interface to provide a new compilation service and register it with the CompilerGym frontend. Examples are available in the examples directory. Then send a pull request.

I updated with “git pull” and now it doesn’t work

Re-run `make init` and `make distclean`. The development branch is bleeding edge; use the stable branch for more stable builds. If problems persist, file a GitHub issue.

Job Opportunities

There are currently no job postings for this AI tool.

Explore AI Career Opportunities

Social Media

Ratings & Reviews

No ratings available yet. Be the first to rate this tool!

Alternatives

CompilerAI favicon
CompilerAI

CompilerAI is a research-based startup commercializing a translation validator, focusing on compiler design, formal methods, and AI algorithms.

View Details

Featured Tools

Songmeaning favicon
Songmeaning

Songmeaning is an AI-powered tool that helps users uncover the hidden stories and meanings behind song lyrics, enhancing their musical understanding.

View Details
PropLytics favicon
PropLytics

PropLytics is an AI-powered platform for real estate investors, providing data-backed ROI insights to help make smarter, faster investment decisions.

View Details
GitGab favicon
GitGab

GitGab is an AI tool that contextualizes top AI models like ChatGPT, Claude, and Gemini with your GitHub repositories and local code for enhanced development.

View Details
nuptials.ai favicon
nuptials.ai

nuptials.ai is an AI wedding planning partner, offering timeline planning, budget optimization, vendor matching, and a 24/7 planning assistant to help plan your perfect day.

View Details
Smart Cookie Trivia favicon
Smart Cookie Trivia

Smart Cookie Trivia is a platform offering a wide variety of trivia questions across numerous categories to help users play trivia, explore different topics, and expand their knowledge.

View Details
Swiftspeed App Builder favicon
Swiftspeed App Builder

Swiftspeed App Builder is a no-code AI app builder that allows users to create Android and iOS mobile applications from websites or from scratch without coding.

View Details

Latest AI News

View All News
Meta Raids OpenAI, Snaring Elite AI Trio in Escalating Talent War
Meta Raids OpenAI, Snaring Elite AI Trio in Escalating Talent War

Meta's $100M talent drive secures a key OpenAI trio, signaling an intensifying AI 'arms race' for top minds.

Jun 26, 2025
Read More →
OpenAI's API unlocks powerful AI agents with real-time web and code
OpenAI's API unlocks powerful AI agents with real-time web and code

OpenAI unlocks powerful new tools, including real-time web search and code execution, to build truly capable AI agents.

Jun 26, 2025
Read More →
Pulitzer Winner Leads Authors Suing Microsoft Over AI's Pirated Training
Pulitzer Winner Leads Authors Suing Microsoft Over AI's Pirated Training

A landmark lawsuit claims Microsoft's powerful AI was built on 200,000 pirated books, igniting a crucial copyright battle.

Jun 26, 2025
Read More →