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; docs] Docs do-over (new API stack): RLModules vol 02; Major cleanups, SAC/DQN default RLModules, QNetAPI, remove noisy nets from DQN. #49368

Merged
merged 25 commits into from
Dec 20, 2024

Conversation

sven1977
Copy link
Contributor

@sven1977 sven1977 commented Dec 19, 2024

Docs do-over (new API stack): RLModules vol 02

  • Move all algo-specific RLModules into the "DefaultRLModule" pattern. Users don't have to subclass these default RLModules anymore as superclasses, but can write arbitrary custom RLModule as long as the custom RLModule implements the algo-required RLModule APIs. E.g. for training w/ PPO, the user's RLModule must implement the ValueFunctionAPI, BUT does not have to subclass anymore from PPORLModule!
  • Major cleanups as a consequence of the above change in example scripts and elsewhere.
  • Add new QNetAPI (for both DQN- and SACRLModules), requiring the user to implement the compute_q_values and (optionally) compute_advantage_distribution methods (for dueling-Q).
  • Remove all code related to noisy nets in DQN. Having this exploration method was somewhat a relic from the old API stack's ParameterNoise Exploration component.

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

…edo_rl_module_002

# Conflicts:
#	rllib/algorithms/appo/torch/appo_torch_rl_module.py
@sven1977 sven1977 changed the title [WIP; RLlib] Docs do-over (new API stack): RLModules vol 02. [RLlib] Docs do-over (new API stack): RLModules vol 02; Major cleanups, SAC/DQN default RLModules, QNetAPI, remove noisy nets from DQN. Dec 20, 2024
@sven1977 sven1977 enabled auto-merge (squash) December 20, 2024 11:04
@github-actions github-actions bot added the go add ONLY when ready to merge, run all tests label Dec 20, 2024
@github-actions github-actions bot disabled auto-merge December 20, 2024 11:40
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. Great PR. As we do not name DQN anymore RainbowDQN gthe removal of NoisyNets looks good.


@num_cpus_for_local_worker.setter
def num_cpus_for_local_worker(self, value):
deprecation_warning(
old="AlgorithmConfig.num_cpus_for_local_worker",
new="AlgorithmConfig.num_cpus_for_main_process",
error=False,
error=True,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Awesome! So much cleanup!



@PublicAPI(stability="alpha")
class QNetAPI(abc.ABC):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Great! This API was missing, yet.

@sven1977 sven1977 enabled auto-merge (squash) December 20, 2024 14:27
@github-actions github-actions bot disabled auto-merge December 20, 2024 15:23
@sven1977 sven1977 changed the title [RLlib] Docs do-over (new API stack): RLModules vol 02; Major cleanups, SAC/DQN default RLModules, QNetAPI, remove noisy nets from DQN. [RLlib; docs] Docs do-over (new API stack): RLModules vol 02; Major cleanups, SAC/DQN default RLModules, QNetAPI, remove noisy nets from DQN. Dec 20, 2024
@sven1977 sven1977 added rllib RLlib related issues rllib-models An issue related to RLlib (default or custom) Models. rllib-docs-or-examples Issues related to RLlib documentation or rllib/examples rllib-newstack rllib-oldstack-cleanup Issues related to cleaning up classes, utilities on the old API stack labels Dec 20, 2024
@sven1977 sven1977 enabled auto-merge (squash) December 20, 2024 18:09
@sven1977 sven1977 merged commit 0809ed8 into ray-project:master Dec 20, 2024
6 checks passed
@sven1977 sven1977 deleted the docs_redo_rl_module_002 branch December 20, 2024 19:04
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 rllib RLlib related issues rllib-docs-or-examples Issues related to RLlib documentation or rllib/examples rllib-models An issue related to RLlib (default or custom) Models. rllib-newstack rllib-oldstack-cleanup Issues related to cleaning up classes, utilities on the old API stack
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants