-
Notifications
You must be signed in to change notification settings - Fork 6k
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] Cleanup examples folder vol. 41: Add new example on async gym vector env. #49527
[RLlib] Cleanup examples folder vol. 41: Add new example on async gym vector env. #49527
Conversation
…nup_examples_folder_41_async_vector_env
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. Just two small nits for readability
if self.config.remote_worker_envs | ||
else VectorizeMode.SYNC | ||
vectorize_mode | ||
if isinstance(vectorize_mode, gym.envs.registration.VectorizeMode) |
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.
Isn't this already validated in AlgorithmConfig
? Imo we need to validate only once. Either here or in the AlgorithmConfig
.
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.
True, but an AlgorithmConfig only gets validated in the algo, not when it enters an EnvRunner. So - in theory - users could still run into this if they instantiate an EnvRunner in isolation with some config that has this defined as a string (e.g. "SYNC").
---------------------- | ||
`python [script file name].py --enable-new-api-stack ` | ||
|
||
Use the `--vectorize-mode=BOTH` option to run both modes (SYNC and ASYNC) |
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.
Awesome!
|
||
tune.register_env("slow-env", _env_creator) | ||
|
||
if args.vectorize_mode == "BOTH" and args.no_tune: |
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.
Why not just setting no_tune=False
if vectorize_mode="BOTH"
?
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.
Good catch. Added an error, instead and simplified the if-statement.
@@ -1087,9 +1087,11 @@ def run_rllib_example_script_experiment( | |||
enable_env_runner_and_connector_v2=False, | |||
) | |||
|
|||
# Define EnvRunner/RolloutWorker scaling and behavior. |
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.
And ... gone :D
… vector env. (ray-project#49527) Signed-off-by: Roshan Kathawate <roshankathawate@gmail.com>
Cleanup examples folder vol. 41: Add new example on async gym vector env.
vale
).Why are these changes needed?
Related issue number
Checks
git commit -s
) in this PR.scripts/format.sh
to lint the changes in this PR.method in Tune, I've added it in
doc/source/tune/api/
under thecorresponding
.rst
file.