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

Fix backwards compatibility tests, raise error for torch version mismatch #3252

Merged
merged 2 commits into from
May 3, 2024

Conversation

snarayan21
Copy link
Contributor

What does this PR do?

Fixes FSDP checkpoint backwards compatibility tests, and raises a helpful error for likely torch version mismatch on checkpoint load. For context, the test that was failing was when trying to load a checkpoint written with torch 2.3.0 when using torch < 2.3.0, since the older torch versions could not correctly read the new metadata file.

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
Copy link
Contributor Author

daily tests are passing too

@snarayan21 snarayan21 merged commit 2daa2b6 into dev May 3, 2024
15 checks passed
@snarayan21 snarayan21 deleted the saaketh/ckpt_save_debug branch May 3, 2024 23:57
'newer version of torch. Upgrade your torch version to load this checkpoint.',
)
else:
raise
Copy link
Contributor

Choose a reason for hiding this comment

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

Uhh this is a bug right? You need to have raise e?

Copy link
Contributor

Choose a reason for hiding this comment

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

you can also do raise like this to reraise the error

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nah
Screenshot 2024-05-06 at 2 38 43 PM

j316chuck pushed a commit that referenced this pull request May 16, 2024
…atch (#3252)

* fix daily tests, backwards compat

* raise only on particular error
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