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

Multi env seed #18110

Merged
merged 3 commits into from
Aug 26, 2021
Merged

Multi env seed #18110

merged 3 commits into from
Aug 26, 2021

Conversation

gjoliver
Copy link
Member

Why are these changes needed?

Deterministic rollout sampling does not work if a worker runs more than 1 environments.

Related issue number

Closes #17900

Checks

  • [*] 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 :(

@gjoliver gjoliver requested a review from sven1977 August 26, 2021 07:22
@gjoliver
Copy link
Member Author

I moved the actual seed setting logics out of the constructor into a couple of global util functions to clean things a little bit and reduce the size of the constructor.

I have to update CartPoleWithRemoteParamServer env, because if I read it correctly, this env was hardcoded to be deterministric. So the example test would run deterministically regardless of how we set the seed.

I also have a couple of questions I am not sure about (2 TODOS in the function _update_env_seed). Hope to discuss during the review process.

Thanks for all the helps :)

@sven1977 sven1977 self-assigned this Aug 26, 2021
@sven1977
Copy link
Contributor

Looks great! Thanks for the fix and cleaning up a little :), @gjoliver !

Copy link
Contributor

@sven1977 sven1977 left a comment

Choose a reason for hiding this comment

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

Nice!

@sven1977 sven1977 merged commit a881367 into ray-project:master Aug 26, 2021
@gjoliver gjoliver deleted the multi-env-seed branch September 3, 2021 21:11
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] Non-reproducible rollout sampling if num_envs_per_worker > 1.
2 participants