-
Notifications
You must be signed in to change notification settings - Fork 274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BugFix] RewardSum
key check
#1718
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/rl/1718
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (8 Unrelated Failures)As of commit 290ba1e with merge base 07fcfb1 ( FLAKY - The following jobs failed but were likely due to flakiness present on trunk:
BROKEN TRUNK - The following jobs failed but were present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
Is this needed? If we look at the message in the error, we specifically tell the user that we cannot retrieve them automatically and hence the user should pass them. |
I think having both checks is useful and at worst it cannot hurt. The checks are run just once |
The current check makes sure that the root of in_keys has a similar root for resets. If resets are passed manually, they could be located anywhere IMO, not at the sample place as in_keys. I guess we want manual resets to be as flexible as possible. If we restrict them as we do for automatically gathered reset entries, what do we gain with the manual version? |
I thought the manual version was just for when the auto does not work, but i see the point. |
ee81111
to
b935c89
Compare
At this point we need a better set of tests for these error messages! It isn't easy to make sure we get them right just by looking at the code |
I have added a test that would fail on main that checks all the errors related to the length of keys in rewardsum |
What do you mean "that would fail on main"? In the sense that they test the new feature or that the feature is bc breaking? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM thanks
They test that where before there was a silent error, now there is an explicit exeption. |
In the
RewardSum
transform, reset keys where checked to be valid only when not directly provided by the user.rl/torchrl/envs/transforms/transforms.py
Line 4773 in 07fcfb1
This led to silent errors when the users provides reset keys manually but there are not as many as the in_keys gathered automatically from the reward_spec.
This PR runs the key check in both the case of user provided or autoimatically gathered reset keys, making the function more resilient.