-
Notifications
You must be signed in to change notification settings - Fork 27.4k
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 tf shared embedding #17730
Fix tf shared embedding #17730
Conversation
All the TF weights of OPT will need to be updated if this is approved. I think I can handle that along with #17713. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing!
@@ -281,14 +281,14 @@ def test_inference_no_head(self): | |||
|
|||
|
|||
@require_tf | |||
@slow | |||
# @slow |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will need to be uncommented before merging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Think it's already fixed in the new commit
The documentation is not available anymore as the PR was closed or merged. |
* fix the naming * from pt in test for now * make style * slow test and removed from_pt
What does this PR do?
A hack was used to properly import the shared embedding weights, but it can be removed (removing it also is convenient for the sharding PR)
Found this while testing #17713. In HF's
save_pretrained
andload_pretrained
the layer name is changed usingname = "/".join(weight_name.split("/")[1:])
. This was breaking for OPT as the layer name was'decoder.embed_tokens/model.decoder.embed_tokens/weight:0'
instead of'tfopt_model/model/decoder/embed_tokens/weight:0'
. The naming is strange and had to use a scope hack. The hack comes fromBART