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] New API stack: (Multi)RLModule overhaul vol 01 (some preparatory cleanups). #47884

Conversation

sven1977
Copy link
Contributor

@sven1977 sven1977 commented Oct 3, 2024

New API stack: (Multi)RLModule overhaul vol 01 (some preparatory cleanups).

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 <[email protected]>
@sven1977 sven1977 enabled auto-merge (squash) October 3, 2024 01:24
@github-actions github-actions bot added the go add ONLY when ready to merge, run all tests label Oct 3, 2024
@@ -685,7 +685,6 @@ def setup(self, config: AlgorithmConfig) -> None:
)
and self.config.input_ != "sampler"
and self.config.enable_rl_module_and_learner
and self.config.enable_env_runner_and_connector_v2
Copy link
Contributor Author

Choose a reason for hiding this comment

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

note: we don 't need these double checks anymore b/c the hybrid stack has been deprecated already (users will get error message in the config.validate() call).

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, let's remove it!

with self.metrics.log_time((TIMERS, ENV_RUNNER_SAMPLING_TIMER)):
if self.config.count_steps_by == "agent_steps":
train_batch, env_runner_results = synchronous_parallel_sample(
episodes, env_runner_results = synchronous_parallel_sample(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this was a bug

Copy link
Collaborator

@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. At some locations I have questions if some removed code is still needed by the old stack.

@@ -685,7 +685,6 @@ def setup(self, config: AlgorithmConfig) -> None:
)
and self.config.input_ != "sampler"
and self.config.enable_rl_module_and_learner
and self.config.enable_env_runner_and_connector_v2
Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, let's remove it!

# this information only needs to be kept in the Learner and not on the
# EnvRunners anymore.
if not self.config.enable_env_runner_and_connector_v2:
policies_to_train = self.config.policies_to_train or set(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Don't we need this still in the old stack?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The code will never get there anymore because users on the new API stack will call add_module and remove_module (instead of add_policy and remove_policy). But you are right, we should error out here directly if the config says otherwise. I'll add these exceptions ...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, these errors are already there.

Signed-off-by: sven1977 <[email protected]>
@github-actions github-actions bot disabled auto-merge October 3, 2024 17:31
@sven1977 sven1977 enabled auto-merge (squash) October 3, 2024 17:55
…odule_do_over_bc_default_module_01_preparation
Signed-off-by: sven1977 <[email protected]>
@github-actions github-actions bot disabled auto-merge October 3, 2024 19:36
@sven1977 sven1977 enabled auto-merge (squash) October 3, 2024 20:15
…odule_do_over_bc_default_module_01_preparation
@github-actions github-actions bot disabled auto-merge October 4, 2024 20:55
@sven1977 sven1977 enabled auto-merge (squash) October 4, 2024 22:19
@sven1977 sven1977 merged commit ede8246 into ray-project:master Oct 4, 2024
6 checks passed
@sven1977 sven1977 deleted the rl_module_do_over_bc_default_module_01_preparation branch October 4, 2024 23:05
ujjawal-khare pushed a commit to ujjawal-khare-27/ray that referenced this pull request Oct 15, 2024
ujjawal-khare pushed a commit to ujjawal-khare-27/ray that referenced this pull request Oct 15, 2024
ujjawal-khare pushed a commit to ujjawal-khare-27/ray that referenced this pull request Oct 15, 2024
ujjawal-khare pushed a commit to ujjawal-khare-27/ray that referenced this pull request Oct 15, 2024
ujjawal-khare pushed a commit to ujjawal-khare-27/ray that referenced this pull request Oct 15, 2024
ujjawal-khare pushed a commit to ujjawal-khare-27/ray that referenced this pull request Oct 15, 2024
ujjawal-khare pushed a commit to ujjawal-khare-27/ray that referenced this pull request Oct 15, 2024
ujjawal-khare pushed a commit to ujjawal-khare-27/ray that referenced this pull request Oct 15, 2024
ujjawal-khare pushed a commit to ujjawal-khare-27/ray that referenced this pull request Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
go add ONLY when ready to merge, run all tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants