Repository navigation
fix: derive text-encoder alpha_pattern keys from the LoRA module name - #14972
Open
akhil9tiet wants to merge 3 commits into
Open
akhil9tiet wants to merge 3 commits into
akhil9tiet wants to merge 3 commits into
Conversation
|
Thanks for the quick fix, @akhil9tiet! I checked this PR (at e1e02ab) against the reproduction from #14970 on diffusers 0.41.0, transformers 5.16.1 and peft 0.20.0:
|
This branch has not been deployed
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.
Fixes #14970
In
get_peft_kwargs, the text-encoderalpha_patternkey derivation dropped the LoRA module segment (to_k_lora), producing the parent block (...self_attn) instead of the module (...self_attn.k_proj). Since PEFT matchesalpha_patternkeys against the end of module names, the key never matched and every text-encoder module fell back to the most common alpha. The derivation now translates the diffusers LoRA weight suffix (.to_{q,k,v,out}_lora,.lora_linear_layer) to the PEFT module name, and drops thetext_model.prefix so the key matches whether or not the loader stripped it for flattened text encoders. Adds two regression tests totests/lora/test_peft_utils.py.