[transformers_modeling_backend] Upgrade transformers from 4.57.1 to 5.0.0rc0#2154
Open
3outeille wants to merge 14 commits intopytorch:mainfrom
Open
[transformers_modeling_backend] Upgrade transformers from 4.57.1 to 5.0.0rc0#21543outeille wants to merge 14 commits intopytorch:mainfrom
3outeille wants to merge 14 commits intopytorch:mainfrom
Conversation
tianyu-l
reviewed
Dec 15, 2025
34285a5 to
b6bad9a
Compare
Contributor
Author
|
Upgrading to transformers v5 fixes it as it no longer uses |
Contributor
Author
|
fixed linting |
tianyu-l
reviewed
Dec 16, 2025
| if module.padding_idx is not None: | ||
| module.weight.data[module.padding_idx].zero_() | ||
| if isinstance(module.weight.data, DTensor): | ||
| module.weight.data._local_tensor[module.padding_idx].zero_() |
Contributor
There was a problem hiding this comment.
sorry I probably didn't what you are doing here.
If the padding is on the "global tensor", we should just do the same thing module.weight.data[module.padding_idx].zero_()
The code here is doing local modification, which may or may not be correct depending on if the padding_idx is meant to be local or global.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes: huggingface#6
Thanks to do that we can do
torch.compile+ 4D-//ism on HF model (cf huggingface#5)