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] Try to checkpoint a durable policy name #27016

Merged
merged 3 commits into from
Jul 27, 2022

Conversation

gjoliver
Copy link
Member

Why are these changes needed?

instead of the raw policy class.

Related issue number

Checks

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

@@ -102,21 +102,42 @@ def __eq__(self, other: "PolicySpec"):
)

def serialize(self) -> Dict:
from ray.rllib.algorithms.registry import get_policy_class_name
Copy link
Contributor

Choose a reason for hiding this comment

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

Add the import to the top of the file

Copy link
Member Author

Choose a reason for hiding this comment

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

I can't 😭
circular dependency somehow ...

Copy link
Contributor

@kouroshHakha kouroshHakha left a comment

Choose a reason for hiding this comment

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

left some comments.

if name not in POLICIES:
return None

path = POLICIES[name]
Copy link
Contributor

Choose a reason for hiding this comment

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

What if the name does not exist? e.g. custom policy?

Copy link
Member Author

Choose a reason for hiding this comment

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

return None above.
in this case, we will checkpoint the raw policy class for the user and print a warning message.
I feel like if you want to use custom policy, then you'd better handle compatibility yourself?

@richardliaw richardliaw merged commit 54df8bf into ray-project:master Jul 27, 2022
Rohan138 pushed a commit to Rohan138/ray that referenced this pull request Jul 28, 2022
franklsf95 pushed a commit to franklsf95/ray that referenced this pull request Aug 2, 2022
gramhagen pushed a commit to gramhagen/ray that referenced this pull request Aug 15, 2022
gramhagen pushed a commit to gramhagen/ray that referenced this pull request Aug 15, 2022
Chong-Li pushed a commit to alipay/ant-ray that referenced this pull request Aug 16, 2022
Stefan-1313 pushed a commit to Stefan-1313/ray_mod that referenced this pull request Aug 18, 2022
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.

3 participants