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] AlgorithmConfig.update_from_dict needs to work for MultiCallbacks. #33796

Merged
merged 4 commits into from
Mar 28, 2023

Conversation

gjoliver
Copy link
Member

@gjoliver gjoliver commented Mar 28, 2023

Why are these changes needed?

This breaks existing users who use MultiCallbacks instances.

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: Jun Gong <jungong@anyscale.com>
Signed-off-by: Jun Gong <jungong@anyscale.com>
value = deserialize_type(value, error=True)
# For backward compatibility reasons, only resolve possible
# classpath if value is a str type.
if isinstance(value, str):
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we just do error=False here instead of the if block?
This way, if value is already a class, nothing will happen.

Signed-off-by: sven1977 <svenmika1977@gmail.com>
@sven1977 sven1977 changed the title AlgorithmConfig.update_from_dict needs to work for MultiCallbacks. [RLlib] AlgorithmConfig.update_from_dict needs to work for MultiCallbacks. Mar 28, 2023
Copy link
Contributor

@sven1977 sven1977 left a comment

Choose a reason for hiding this comment

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

LGTM now. Thanks for the fix @gjoliver . We should generally discuss, whether - instead of the current __call__-hack for MultiCallbacks, we should force users to write a light sub-class wrapper around MultiCallbacks with baked-in sub-callbacks (instead of handing the sub-callbacks as classes to the constructor).

@zhe-thoughts zhe-thoughts self-requested a review March 28, 2023 15:39
Copy link
Collaborator

@zhe-thoughts zhe-thoughts left a comment

Choose a reason for hiding this comment

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

Approved for merging into master (we are under feature freeze now but this is critical fix)

@gjoliver gjoliver merged commit bb1909c into ray-project:master Mar 28, 2023
elliottower pushed a commit to elliottower/ray that referenced this pull request Apr 22, 2023
…lbacks. (ray-project#33796)

Signed-off-by: Jun Gong <jungong@anyscale.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Co-authored-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: elliottower <elliot@elliottower.com>
ProjectsByJackHe pushed a commit to ProjectsByJackHe/ray that referenced this pull request May 4, 2023
…lbacks. (ray-project#33796)

Signed-off-by: Jun Gong <jungong@anyscale.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Co-authored-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: Jack He <jackhe2345@gmail.com>
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.

4 participants