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

Make sharded checkpoint loading backwards-compatible #3240

Merged
merged 6 commits into from
May 1, 2024

Conversation

snarayan21
Copy link
Contributor

What does this PR do?

Loads metadata before loading sharded checkpoint state to check if 'optimizers' is a root-level key. This is for backwards compatability with older torch/composer versions, where the recommended sharded checkpoint loading/saving required us to put 'optimizers' as a top-level key. With newer torch (>=2.3.0), we don't do this anymore, but we still need checkpoints to be backwards compatible.

What issue(s) does this change relate to?

Before submitting

  • Have you read the contributor guidelines?
  • Is this change a documentation change or typo fix? If so, skip the rest of this checklist.
  • Was this change discussed/approved in a GitHub issue first? It is much more likely to be merged if so.
  • Did you update any related docs and document your change?
  • Did you update any related tests and add any new tests related to your change? (see testing)
  • Did you run the tests locally to make sure they pass?
  • Did you run pre-commit on your change? (see the pre-commit section of prerequisites)

@snarayan21 snarayan21 requested a review from dakinggg May 1, 2024 03:00
@dakinggg dakinggg merged commit 5eddaf3 into dev May 1, 2024
15 checks passed
@dakinggg dakinggg deleted the saaketh/bc_sharded_ckpt_load branch May 1, 2024 10:53
j316chuck pushed a commit that referenced this pull request May 16, 2024
* backwards compatible

* fix fsdp old tests

---------

Co-authored-by: Daniel King <43149077+dakinggg@users.noreply.github.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.

2 participants