Is running CompilerGym intended to leave cache directories behind?
See original GitHub issue❓ Questions and Help
Not sure if this is a bug or not, so submitting as a question. Running a CompilerGym experiment leaves behind many cache directories. When running a large experiment, this can create problems through the sheer number of directories in COMPILER_GYM_CACHE
. I expected the COMPILER_GYM_CACHE
to not have anything after the experiment exited cleanly.
Is there a way to avoid the experiments leaving the directories behind?
Steps to reproduce
Running the following on my machine leaves behind about 270 cache directories.
import compiler_gym
import compiler_gym.wrappers
from ray import tune
from ray.rllib.agents.ppo import PPOTrainer
def make_env(env_config):
env = compiler_gym.make(env_config['cgym_id'])
env = compiler_gym.wrappers.TimeLimit(env, env_config['timelimit'])
dataset = env.datasets[env_config['dataset']]
env = compiler_gym.wrappers.CycleOverBenchmarks(
env, dataset.benchmarks())
return env
config = {
"env_config": {
"cgym_id": "llvm-autophase-ic-v0",
"timelimit": 45,
"dataset": "benchmark://cbench-v1",
},
"env": "CompilerGym",
}
stop = {
"timesteps_total": 10_000,
}
tune.register_env("CompilerGym", make_env)
tune.run(
PPOTrainer,
config=config,
stop=stop,
name='cgym_cache_dir_demo',
)
Environment
Please fill in this checklist:
- CompilerGym: 0.2.2
- How you installed CompilerGym (conda, pip, source): pip
- OS: Ubuntu 20.04.1 LTS (x86_64)
- Python version: 3.9.7
- Build command you used (if compiling from source): N/A
- GCC/clang version (if compiling from source): N/A
- Bazel version (if compiling from source): N/A
- Versions of any other relevant libraries: ray: 1.10.0, gym: 0.20.0
Issue Analytics
- State:
- Created 2 years ago
- Comments:16 (9 by maintainers)
Top Results From Across the Web
compiler_gym — CompilerGym 0.2.5 documentation
Files in this directory are intended to be long lived (this is not a cache), but it is safe to delete this directory,...
Read more >CompilerGym: Robust, Performant Compiler Optimization ...
CompilerGym enables anyone to experiment on production compiler optimiza- tion problems through an easy-to-use package, regardless of their experience with ...
Read more >facebookresearch/CompilerGym: Reinforcement learning ...
CompilerGym is a library of easy to use and performant reinforcement learning environments for compiler tasks. It allows ML researchers to interact with ......
Read more >(PDF) NeuroVectorizer: end-to-end vectorization with deep ...
This survey summarizes and classifies the recent advances in using machine learning for the compiler optimization field, particularly on the two major problems ......
Read more >2021 October 03
Most GNU/Linux distributions put the /tmp folder (where all sorts of ... The memory caching software is a free, open-source project that ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for reporting the issue @vuoristo, it was a fun bug to hunt 🙂
Cheers, Chris
That’s a good question. To be honest, I don’t know. In the logs you posted, it looks like the shutdown routine is running on your system, which leads me to believe it’s likely a race condition. This would also explain the randomness.
Cheers, Chris