Skip to content
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

[RLlib] DatasetReader action normalization #27356

Merged

Conversation

charlesjsun
Copy link
Contributor

Why are these changes needed?

DatasetReader didn't normalize actions when actions_in_input_normalized was False, which meant CRR was using unnormalized actions during training.

Added normalization to DatasetReader (same as JsonReader)

Related issue number

Closes #27335

Checks

  • I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

@charlesjsun charlesjsun changed the title dataset reader normalization and test [RLlib] DatasetReader action normalization Aug 2, 2022
@charlesjsun charlesjsun force-pushed the datasetreader_normalization branch from 39583cf to 317f0e4 Compare August 2, 2022 01:24
Signed-off-by: Charles Sun <charlesjsun@gmail.com>
Signed-off-by: Charles Sun <charlesjsun@gmail.com>
@charlesjsun charlesjsun force-pushed the datasetreader_normalization branch from 317f0e4 to d43d279 Compare August 2, 2022 04:52
Copy link
Member

@avnishn avnishn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks good to me. I think one thing is that if there isn't a test for this already, we should make the test you added apply not just to offline datasets but also to other regular environments.

If you think im wrong lmk :)

@@ -8,7 +8,7 @@
import ray.data
from ray.rllib.offline.input_reader import InputReader
from ray.rllib.offline.io_context import IOContext
from ray.rllib.offline.json_reader import from_json_data
from ray.rllib.offline.json_reader import from_json_data, postprocess_actions
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

@charlesjsun
Copy link
Contributor Author

charlesjsun commented Aug 4, 2022

this looks good to me. I think one thing is that if there isn't a test for this already, we should make the test you added apply not just to offline datasets but also to other regular environments.

If you think im wrong lmk :)

This PR doesn't apply in the online case because this just normalizes actions from dataset (i.e. DatasetReader). Online action normalization is handled elsewhere (somewhere in env runner).

Copy link
Member

@avnishn avnishn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only other thing I would test if I were you is that if you set any other flag combination of actions_in_input_normalized and normalize_actions that the actions won't be normalized by dataset if they aren't supposed to be

Signed-off-by: Charles Sun <charlesjsun@gmail.com>
Signed-off-by: Charles Sun <charlesjsun@gmail.com>
@charlesjsun
Copy link
Contributor Author

charlesjsun commented Aug 8, 2022

The only other thing I would test if I were you is that if you set any other flag combination of actions_in_input_normalized and normalize_actions that the actions won't be normalized by dataset if they aren't supposed to be

Addressed! Added all combinations of actions_in_input_normalized and normalize_actions

@sven1977 sven1977 merged commit c358305 into ray-project:master Aug 9, 2022
Stefan-1313 pushed a commit to Stefan-1313/ray_mod that referenced this pull request Aug 18, 2022
Signed-off-by: Stefan van der Kleij <s.vanderkleij@viroteq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[RLlib] DatasetReader not normalizing
3 participants