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 tied weights load #1204

Merged
merged 2 commits into from Mar 16, 2023
Merged

Fix tied weights load #1204

merged 2 commits into from Mar 16, 2023

Conversation

sgugger
Copy link
Collaborator

@sgugger sgugger commented Mar 16, 2023

This PR fixes the tied weights load. Since loading a checkpoint in a model that was instantiated on the meta device recreates the tensors, it breaks the connection between tied weights. This PR fixes that and also fixes the example in the doc to make sure weights are tied.

Fixes #1197

@sgugger sgugger requested a review from muellerzr March 16, 2023 14:26
@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Mar 16, 2023

The documentation is not available anymore as the PR was closed or merged.

Copy link
Collaborator

@muellerzr muellerzr left a comment

Choose a reason for hiding this comment

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

Thanks!

@sgugger sgugger merged commit 780e4aa into main Mar 16, 2023
@sgugger sgugger deleted the fix_tied_weights_load branch March 16, 2023 15:29
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.

[Big model inference] ValueError: weight is on the meta device, we need a value to put in on 3.
3 participants