Skip to content

[RLlib] Remove local EnvRunner (optional).#52091

Merged
sven1977 merged 25 commits intoray-project:masterfrom
sven1977:remove_local_env_runner
Apr 11, 2025
Merged

[RLlib] Remove local EnvRunner (optional).#52091
sven1977 merged 25 commits intoray-project:masterfrom
sven1977:remove_local_env_runner

Conversation

@sven1977
Copy link
Copy Markdown
Contributor

@sven1977 sven1977 commented Apr 8, 2025

Remove local EnvRunner (optional).

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 :(

sven1977 added 4 commits April 7, 2025 18:36
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
sven1977 added 3 commits April 8, 2025 14:29
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
@sven1977 sven1977 enabled auto-merge (squash) April 8, 2025 14:03
@github-actions github-actions bot added the go add ONLY when ready to merge, run all tests label Apr 8, 2025
Copy link
Copy Markdown
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. Great work @sven1977! The only dumb question I have is: do we then - for new stack - even still need the case with create_local_env_runner=True?

if self.env_runner_group:
self.env_runner.set_state(rl_module_state)
# if self.env_runner is not None:
# self.env_runner.set_state(rl_module_state)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remove?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

# new states back to all EnvRunners.
with self.metrics.log_time((TIMERS, SYNCH_ENV_CONNECTOR_STATES_TIMER)):
self.env_runner_group.sync_env_runner_states(config=self.config)
self.env_runner_group.sync_env_runner_states(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Don't we need a merge anywhere?

because it doesn't have to sample (done by remote_workers;
worker_indices > 0) nor evaluate (done by evaluation workers;
see below).
create_local_env_runner: If True, create a local EnvRunner instance, besides
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Dumb question: Do we need the local EnvRunner anyways then anymore?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Trying to get rid of it for good. But for now leaving this still as optional ...

sven1977 added 2 commits April 9, 2025 15:44
Signed-off-by: sven1977 <svenmika1977@gmail.com>
auto-merge was automatically disabled April 9, 2025 14:00

Pull Request is not mergeable

sven1977 added 14 commits April 9, 2025 16:14
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
@sven1977 sven1977 enabled auto-merge (squash) April 11, 2025 08:25
Signed-off-by: sven1977 <svenmika1977@gmail.com>
@github-actions github-actions bot disabled auto-merge April 11, 2025 10:14
Signed-off-by: sven1977 <svenmika1977@gmail.com>
@sven1977 sven1977 enabled auto-merge (squash) April 11, 2025 13:07
@sven1977 sven1977 merged commit 62f9f1a into ray-project:master Apr 11, 2025
6 checks passed
han-steve pushed a commit to han-steve/ray that referenced this pull request Apr 11, 2025
Signed-off-by: Steve Han <stevehan2001@gmail.com>
simonsays1980 pushed a commit to simonsays1980/ray that referenced this pull request Dec 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-backlog go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants