Skip to content

[RLlib] on_environment_created callback called with incorrect arg names by EnvRunners.#43871

Merged
sven1977 merged 1 commit intoray-project:masterfrom
sven1977:fix_env_ctx_vs_env_config_in_multi_callbacks
Mar 11, 2024
Merged

[RLlib] on_environment_created callback called with incorrect arg names by EnvRunners.#43871
sven1977 merged 1 commit intoray-project:masterfrom
sven1977:fix_env_ctx_vs_env_config_in_multi_callbacks

Conversation

@sven1977
Copy link
Contributor

Bug fix:
RLlib's new EnvRunners (SingleAgentEnvRunner and MultiAgentEnvRunner) both call the on_environment_created callback with a wrong set of args: env_context should be used instead of env_config and env_index should not be used b/c on the new stack, the gym.env (or gym.vector.Env) is only created once and without a particular vector index for the individual sub-envs.

Why are these changes needed?

Related issue number

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 added any new APIs to the API Reference. For example, if I added a
      method in Tune, I've added it in doc/source/tune/api/ under the
      corresponding .rst file.
  • 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 :(

Signed-off-by: sven1977 <svenmika1977@gmail.com>
Copy link
Contributor

@simonsays1980 simonsays1980 left a comment

Choose a reason for hiding this comment

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

LGTM.

@sven1977 sven1977 merged commit 78fc1f6 into ray-project:master Mar 11, 2024
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.

2 participants