facebookresearch / CompilerGym

Reinforcement learning environments for compiler and program optimization tasks
https://compilergym.ai/
MIT License
885 stars 123 forks source link

[llvm] Fix the number of runtime observations in reward reset. #761

Closed ChrisCummins closed 1 year ago

ChrisCummins commented 1 year ago

This adds a resend_on_reset flag to the send_params() method that enables parameters to be resent immediately after a service is reset. This is required by the LLVM environment to ensure that the runtime observation parameters are sent before the reward space is reset.

Fixes https://github.com/facebookresearch/CompilerGym/issues/756.

codecov-commenter commented 1 year ago

Codecov Report

Merging #761 (a364852) into development (1c40e5b) will decrease coverage by 33.55%. The diff coverage is 50.00%.

Impacted file tree graph

@@               Coverage Diff                @@
##           development     #761       +/-   ##
================================================
- Coverage        89.28%   55.72%   -33.56%     
================================================
  Files              130      130               
  Lines             7912     7917        +5     
================================================
- Hits              7064     4412     -2652     
- Misses             848     3505     +2657     
Impacted Files Coverage Δ
compiler_gym/envs/llvm/llvm_env.py 46.10% <22.22%> (-45.56%) :arrow_down:
...ompiler_gym/service/client_service_compiler_env.py 74.42% <77.77%> (-16.45%) :arrow_down:
compiler_gym/util/permutation.py 0.00% <0.00%> (-100.00%) :arrow_down:
compiler_gym/leaderboard/__init__.py 0.00% <0.00%> (-100.00%) :arrow_down:
compiler_gym/service/runtime/__init__.py 0.00% <0.00%> (-100.00%) :arrow_down:
compiler_gym/service/runtime/benchmark_cache.py 0.00% <0.00%> (-100.00%) :arrow_down:
...mpiler_gym/service/runtime/compiler_gym_service.py 0.00% <0.00%> (-100.00%) :arrow_down:
...ice/runtime/create_and_run_compiler_gym_service.py 0.00% <0.00%> (-100.00%) :arrow_down:
compiler_gym/envs/gcc/service/gcc_service.py 0.00% <0.00%> (-95.98%) :arrow_down:
compiler_gym/leaderboard/llvm_instcount.py 0.00% <0.00%> (-92.79%) :arrow_down:
... and 81 more
ChrisCummins commented 1 year ago

cc @lqwk, patch posted. I'll merge once tests pass.

Cheers, Chris

lqwk commented 1 year ago

@ChrisCummins thanks for the fix!

ChrisCummins commented 1 year ago

Merged via #767.