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

[train] Storage: Change class trainable save_checkpoint implementations #38554

Merged
merged 7 commits into from
Aug 21, 2023

Conversation

krfricke
Copy link
Contributor

Why are these changes needed?

Some of our (internal) class trainables return a subpath in save_checkpoint. This path has been deprecated with the new storage refactor. This PR updates the implementations to reconstruct the checkpoint path in load_checkpoint and return None in save_checkpoint so adhere to the new API.

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: Kai Fricke <[email protected]>
Kai Fricke added 2 commits August 17, 2023 13:16
Signed-off-by: Kai Fricke <[email protected]>
Signed-off-by: Kai Fricke <[email protected]>
Copy link
Contributor

@justinvyu justinvyu left a comment

Choose a reason for hiding this comment

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

Thanks for following up on this one - looks good!

@@ -1395,7 +1396,7 @@ def save_checkpoint(self, checkpoint_dir: str) -> Optional[Union[str, Dict]]:

Returns:
A dict or string. If string, the return value is expected to be
prefixed by `checkpoint_dir`. If dict, the return value will
the `checkpoint_dir`. If dict, the return value will
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we should just make the return type Optional[Dict] since we already have the string

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea, will update

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.

stamp
looks good to me.
Thanks @krfricke !

@krfricke krfricke merged commit f2a9ca8 into ray-project:master Aug 21, 2023
66 of 72 checks passed
@krfricke krfricke deleted the tune/storage-pbt branch August 21, 2023 14:00
arvind-chandra pushed a commit to lmco/ray that referenced this pull request Aug 31, 2023
…ns (ray-project#38554)

Some of our (internal) class trainables return a subpath in `save_checkpoint`. This path has been deprecated with the new storage refactor. This PR updates the implementations to reconstruct the checkpoint path in `load_checkpoint` and return None in `save_checkpoint` so adhere to the new API.

Signed-off-by: Kai Fricke <[email protected]>
Signed-off-by: e428265 <[email protected]>
vymao pushed a commit to vymao/ray that referenced this pull request Oct 11, 2023
…ns (ray-project#38554)

Some of our (internal) class trainables return a subpath in `save_checkpoint`. This path has been deprecated with the new storage refactor. This PR updates the implementations to reconstruct the checkpoint path in `load_checkpoint` and return None in `save_checkpoint` so adhere to the new API.

Signed-off-by: Kai Fricke <[email protected]>
Signed-off-by: Victor <[email protected]>
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.

None yet

3 participants