Skip to content

Remove exception fall back on checkpoint loading #9660

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

Merged
merged 2 commits into from
Mar 27, 2025
Merged

Conversation

jackzhxng
Copy link
Contributor

@jackzhxng jackzhxng commented Mar 26, 2025

Summary

Remove the crutch of initializing with 0 weights when the checkpoint loading goes wrong (e.g. in most cases when the checkpoint keys don't match the parameters of the model).

Test plan

See if CI passes

@jackzhxng jackzhxng requested a review from lucylq as a code owner March 26, 2025 21:23
Copy link

pytorch-bot bot commented Mar 26, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/9660

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit aea9736 with merge base 07266f9 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 26, 2025
@jackzhxng jackzhxng added ciflow/trunk and removed CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. labels Mar 26, 2025
@jackzhxng jackzhxng requested a review from mcr229 March 26, 2025 21:23
# Also, the checkpoint is loaded and dtype promoted to the transformer's dtype, which is
# by default initialized to fp32. This is fine because every other supported type
# losslessly converts to fp32, so we don't lose precision here.
if checkpoint:
Copy link
Contributor

Choose a reason for hiding this comment

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

yea i like this. If the user gives a checkpoint that doesn't work, we should fail, and not hide it under the rug and give them uninitialized model

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 26, 2025
@facebook-github-bot
Copy link
Contributor

@jackzhxng has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@jackzhxng has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@jackzhxng jackzhxng merged commit 5098808 into main Mar 27, 2025
255 of 256 checks passed
@jackzhxng jackzhxng deleted the jz/remove-ckpt-ci branch March 27, 2025 12:55
kirklandsign pushed a commit that referenced this pull request Apr 11, 2025
### Summary
Remove the crutch of initializing with 0 weights when the checkpoint
loading goes wrong (e.g. in most cases when the checkpoint keys don't
match the parameters of the model).

### Test plan
See if CI passes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ciflow/trunk CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. topic: not user facing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants