Repository navigation
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
What does this PR do?
Fixes #14938
Qwen-Image LoRAs using
lora_A/lora_Bweights could lose their per-module.alphavalues during conversion. Whenalphadiffered from the LoRA rank, the adapter was loaded at the wrong strength鈥攆or example, a rank-32 LoRA with alpha 83 loaded at approximately 1/2.6 of its intended strength.This change:
.alpha / rankduringlora_A/lora_Bconversion.ValueErrorwhen a matchinglora_Aorlora_Bweight is missing..alphametadata.lora_down/lora_upconversion behavior unchanged.Added tests cover alpha values of
None, 2, 4, and 8, unmatched A/B weights, stray alpha keys, and bfloat16 dtype preservation.Real-checkpoint verification with
e-n-v-y/Qwen-Image-2.1-Fix-v2.0showed:.alphakeys in the raw checkpoint..alphakeys after conversion.(alpha / rank) * (lora_B @ lora_A)with maximum absolute differences between5.6e-09and3.1e-05across three sampled modules.The existing
lora_down/lora_upconversion output was identical to the upstream output for a synthetic Qwen-Image-Lightning checkpoint.Before submitting
self-reviewskill? The skill was not installed in the environment; its checked-in rubric was applied manually instead.Validation
ruff check: passed.ruff format --check: passed.git diff --check: passed.Self-review notes
The checked-in self-review rubric was applied manually because the
self-reviewCLI skill was unavailable. No blocking correctness, dead-code, copied-code, or documentation issues were found.AI assistance was used for implementation, testing, verification, and drafting this description. Please review and edit the wording before submitting.