Repository navigation
Support FLUX OneTrainer LoRA formats (incl. DoRA) - #7590
Merged
Merged
Conversation
RyanJDick
force-pushed
the
ryan/flux-dora-one-trainer-concatenated
branch
from
January 24, 2025 19:50
14c5f31 to
5085a8c
Compare
RyanJDick
marked this pull request as ready for review
January 24, 2025 20:24
RyanJDick
requested review from
blessedcoolant,
brandonrising,
hipsterusername,
lstein,
maryhipp and
psychedelicious
as code owners
January 24, 2025 20:24
hipsterusername
approved these changes
Jan 26, 2025
…sers_state_dict(). Previously, it only supported PEFT-style LoRA keys.
…t it can be re-used for OneTrainer LoRAs.
… it can work with more LoRA variants (e.g. hada)
…oRALayer to CustomModuleMixin.
…ies alpha scaling to delta_v, and 2) warns if the base model is incompatible.
…y the T5 encoder weights.
RyanJDick
force-pushed
the
ryan/flux-dora-one-trainer-concatenated
branch
from
January 28, 2025 15:11
07d83b7 to
229834a
Compare
3 of 4 tasks
1 task done
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.
Summary
This PR adds support for the FLUX LoRA model format produced by OneTrainer.
Specifically, this PR adds:
Known limitations
bitsandbytes. The DoRA algorithm requires accessing the original model weight in order to compute the patch diff, and the bitsandbytes quantization layers make this difficult. DoRA patches can be applied to non-quantized and GGUF-quantized layers without issue.MergedLayerPatch). Now that more LoRA formats are using theMergedLayerPatch, it was becoming too much work to maintain this optimization. Regression from ~1.7 it/s to ~1.4 it/s.Future Notes
autocast_linear_forward_sidecar_patches(...)(and its sub-calls). Optimizing this is left for future work.Related Issues / Discussions
envy*LoRAs).QA Instructions
OneTrainer test models:
The following tests were repeated with each of the OneTrainer test models:
Other regression test:
Merge Plan
No special instructions.
Checklist
What's Newcopy (if doing a release after this PR)