
CompilerGym

Click to visit website
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
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.
Ratings & Reviews
No ratings available yet. Be the first to rate this tool!
Featured Tools
Songmeaning
Songmeaning uses AI to reveal the stories and meanings behind song lyrics. It offers lyric translation and AI music generation.
View DetailsWhisper Notes
Offline AI speech-to-text transcription app using Whisper AI. Supports 80+ languages, audio file import, and offers lifetime access with a one-time purchase. Available for iOS and macOS.
View DetailsGitGab
Connects Github repos and local files to AI models (ChatGPT, Claude, Gemini) for coding tasks like implementing features, finding bugs, writing docs, and optimization.
View Details
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 DetailsMake-A-Craft
Make-A-Craft helps you discover craft ideas tailored to your child's age and interests, using materials you already have at home.
View Details
Pixelfox AI
Free online AI photo editor with comprehensive tools for image, face/body, and text. Features include background/object removal, upscaling, face swap, and AI image generation. No sign-up needed, unlimited use for free, fast results.
View Details
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
Code2Docs
AI-powered code documentation generator. Integrates with GitHub. Automates creation of usage guides, API docs, and testing instructions.
View Details