You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expect the observations and rewards of the forked environment the same as those of the original environment when the same action is applied, but they could be different.
To Reproduce
Run the tests below to reproduce
importgymimportrandomimportnumpyasnpimportcompiler_gymimportcopydeftest1():
# Expect the observations and rewards of the forked env the same as those of the original env,# but they could be differentprint("------test1------")
benchmark="benchmark://opencv-v0/108"#"benchmark://cbench-v1/qsort"withgym.make("llvm-autophase-ic-v0", benchmark=benchmark) asenv:
env.reset()
features= ["Programl", "IrInstructionCountOz", "IrInstructionCount", "IrSha1"]
obs_space= [ env.observation.spaces[feature_name] forfeature_nameinfeatures ]
rewards_space= [
env.reward.spaces["IrInstructionCountOz"],
env.reward.spaces["IrInstructionCountO3"],
env.reward.spaces["IrInstructionCount"],
]
observations, rewards, done, info=env.step(action=[], observation_spaces=obs_space, reward_spaces=rewards_space)
assertinfo['action_had_no_effect']
i=0whilenotdone:
forked_env=env.fork()
action=env.action_space.sample()
observations, rewards, done, info=env.step(action=action, observation_spaces=obs_space, reward_spaces=rewards_space)
print(observations[1:3], rewards, action)
obs_space2= [ forked_env.observation.spaces[feature_name] forfeature_nameinfeatures ]
rewards_space2= [
forked_env.reward.spaces["IrInstructionCountOz"],
forked_env.reward.spaces["IrInstructionCountO3"],
forked_env.reward.spaces["IrInstructionCount"],
]
observations2, rewards2, done2, info2=forked_env.step(action=action, observation_spaces=obs_space2, reward_spaces=rewards_space2)
print(observations2[1:3], rewards2, action)
iftuple(observations[1:3] +rewards) !=tuple(observations2[1:3] +rewards2):
print("Error ==========")
returni+=1ifi>10000:
breakif__name__=="__main__":
test1()
Expected behavior
The forked environment should produce the same observations/rewards as the original environment when the same action is applied.
Environment
Please fill in this checklist:
CompilerGym: 0.2.4
How you installed CompilerGym (pip, source): following CompilerGymExperiments
OS: Ubuntu 20.04.2 LTS
Python version: 3.8.13
Build command you used (if compiling from source): following CompilerGymExperiments
GCC/clang version (if compiling from source):
Versions of any other relevant libraries:
You may use the environment collection script
to generate most of this information. You can get the script and run it with:
wget https://raw.githubusercontent.com/facebookresearch/CompilerGym/stable/build_tools/collect_env.py
# For security purposes, please check the contents of collect_env.py before running it.
python collect_env.py
Additional context
The text was updated successfully, but these errors were encountered:
This wrote a simple routine minimize_fork_regression_testcase() that
takes as input a forked regression test and iteratively attempts to
remove each of the actions that do not prevent the test from failing.
Running this on the five known regression tests simplifies them
dratically. In all but one case, they are simplified to a single
pre-fork and single post-fork action.
I'll dig more into the details of what's going on in later.
Issue facebookresearch#749.
This wrote a simple routine minimize_fork_regression_testcase() that
takes as input a forked regression test and iteratively attempts to
remove each of the actions that do not prevent the test from failing.
Running this on the five known regression tests simplifies them
dratically. In all but one case, they are simplified to a single
pre-fork and single post-fork action.
I'll dig more into the details of what's going on in later.
Issue facebookresearch#749.
🐛 Bug
Expect the observations and rewards of the forked environment the same as those of the original environment when the same action is applied, but they could be different.
To Reproduce
Run the tests below to reproduce
Expected behavior
The forked environment should produce the same observations/rewards as the original environment when the same action is applied.
Environment
Please fill in this checklist:
You may use the
environment collection script
to generate most of this information. You can get the script and run it with:
wget https://raw.githubusercontent.com/facebookresearch/CompilerGym/stable/build_tools/collect_env.py # For security purposes, please check the contents of collect_env.py before running it. python collect_env.py
Additional context
The text was updated successfully, but these errors were encountered: