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] TorchCheckpoint: Specifying pickle_protocol in torch.save() #35615

Merged

Conversation

woshiyyya
Copy link
Member

@woshiyyya woshiyyya commented May 22, 2023

Why are these changes needed?

TorchCheckpoint failed to serialize large model (>4GiB) and throw serialization error. Specifying pickle_protocol=5 to resolve this issue.

Details in #35611

Related issue number

Close #35611

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

@woshiyyya woshiyyya marked this pull request as ready for review May 22, 2023 17:46
Copy link
Contributor

@krfricke krfricke 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 fixing this! Agree with @matthewdeng, let's use DEFAULT_PROTOCOL here

python/ray/train/torch/torch_checkpoint.py Outdated Show resolved Hide resolved
@ArturNiederfahrenhorst
Copy link
Contributor

@woshiyyya Please make sure to also create the cherry pick PR yourself after this is merged!

@woshiyyya woshiyyya force-pushed the train/torch_ckpt_dump_with_pickle_5 branch from 6c00a3c to b600ded Compare May 24, 2023 08:56
Copy link
Contributor

@matthewdeng matthewdeng left a comment

Choose a reason for hiding this comment

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

Can you fix the conflict and ping me when tests pass?

@woshiyyya woshiyyya changed the title [Train] TorchCheckpoint: Specifying pickle_protocol=5 in torch.save() [Train] TorchCheckpoint: Specifying pickle_protocol in torch.save() May 24, 2023
@woshiyyya
Copy link
Member Author

@matthewdeng Conflicts resolved! Will ping you after CI passed.

@woshiyyya woshiyyya force-pushed the train/torch_ckpt_dump_with_pickle_5 branch from f5870d8 to 374a4d7 Compare May 24, 2023 23:00
@woshiyyya woshiyyya added the tests-ok The tagger certifies test failures are unrelated and assumes personal liability. label May 25, 2023
@matthewdeng matthewdeng merged commit 08bb5a0 into ray-project:master May 25, 2023
woshiyyya added a commit to woshiyyya/ray that referenced this pull request May 25, 2023
scv119 pushed a commit to scv119/ray that referenced this pull request Jun 16, 2023
arvind-chandra pushed a commit to lmco/ray that referenced this pull request Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests-ok The tagger certifies test failures are unrelated and assumes personal liability.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[AIR] torch_checkpoint cannot serialize string larger than 4 GiB with ray.cloudpickle
5 participants