Changes for transformers 5 weight conversion#3083
Open
BenjaminBossan wants to merge 15 commits intohuggingface:mainfrom
Open
Changes for transformers 5 weight conversion#3083BenjaminBossan wants to merge 15 commits intohuggingface:mainfrom
BenjaminBossan wants to merge 15 commits intohuggingface:mainfrom
Conversation
- better handling of swapped in and out features - move PEFT config update functions to PEFT
This allows the weight conversion to be correctly applied without going through transformer_model.load_adapter.
|
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. |
Member
Author
|
@githubnemo The PR should now be ready for review. |
- always apply in/out feature swapping for MoE params - add a test for this with Qwen3 MoE - expose swapping argument to provide escape hatch
jeejeelee
reviewed
Mar 19, 2026
src/peft/tuners/lora/config.py
Outdated
| Whether to tie weights or not after peft initialization. This will ensure that the adapters added to the | ||
| tied layers are also tied. This is only applicable for layers passed via `modules_to_save` and | ||
| `target_modules`. | ||
| param_wrapper_swap_in_out_features (`bool`, *optional) |
There was a problem hiding this comment.
Is this parameter used to resolve #3112? If so, maybe automatic detection would be better?
Member
Author
There was a problem hiding this comment.
In my latest commit, I changed the code to use module.is_transposed.
|
I tested your branch, the saved LoRA weights for qwen35-moe still have the same issues,see: #3112 |
Member
Author
Could you please show a small reproducer for that error? |
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.
See accompanying huggingface/transformers#44478.
Note that the newly added tests will fail until a new transformers release with the linked PR is out. This should be v5.4, so the corresponding tests only run with that transformers version. I locally tested with the current main branch and the tests pass.