FIX Transformers weight conversion regression#3197
Conversation
After a change in huggingface/transformers#45448, weight conversion tests started failing. Transformers provided a fix in huggingface/transformers#45622 but it needs to be ported to PEFT too. This PR, together with the Transformers fix, resolves the issue.
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
|
@Cyrilvallez please review. |
Cyrilvallez
left a comment
There was a problem hiding this comment.
LGTM, it matches the transformers's PR!
| for pat in list(orig_conversion.source_patterns): | ||
| for pat in list(orig_conversion._original_source_patterns): |
There was a problem hiding this comment.
If orig_conversion stems from transformers then I think it might be a breaking change? Because if someone is using an older transformers version, then it could be problematic? If not, then it's okay.
There was a problem hiding this comment.
@Cyrilvallez Would this change work with older Transformers versions?
There was a problem hiding this comment.
It was added in huggingface/transformers#45340, so indeed will not be fully compatible with all previous versions - for your use case you could simply use source_patterns/target_patterns instead of their counterpart _original_xxx to avoid checking versions
There was a problem hiding this comment.
Got it, I reverted the argument names back. I tested locally with transformers v5.4.0, v5.5.4, and the latest main, and the test passed.
What I wonder about: If we can use source_patterns/target_patterns, why the change to _original_xxx in the first place?
|
Tests are now passing (except the ones from Transformers side, which require a new Transformers release). |
|
Transformers release is out, so we just need this PR for tests to pass again. I'll go ahead and merge it. |
After a change in huggingface/transformers#45448, weight conversion tests started failing. Transformers provided a fix in huggingface/transformers#45622 but it needs to be ported to PEFT too. The PR also ports the fix from huggingface/transformers#45428.
This PR fixes the issue from the PEFT side. For the transformers side (
model.load_adapter), we need to wait for huggingface/transformers#45622 to land and be released.