Repository navigation
Conversation
Signed-off-by: Subodh Bansode <subodh171011@gmail.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.
Description
Fixes the missing prior-preservation weighting split in the advanced DreamBooth LoRA training scripts.
When prior preservation is enabled,
model_predandtargetare split into instance and prior batches, butweightingwas left unsplit. The prior loss therefore attempted to apply a weighting tensor covering both batches to the prior batch only, resulting in a shape mismatch.This change splits
weightingin the same way asmodel_predandtargetand usesweighting_priorfor the prior loss.Changes
weightinginto instance and prior portions in the advanced Flux DreamBooth LoRA script.weightinginto instance and prior portions in the advanced SDXL DreamBooth LoRA script.weighting_priorwhen calculating prior-preservation loss.Scope
This PR is intentionally limited to the missing weighting chunking described in #11489.
Testing
python -m py_compile examples/advanced_diffusion_training/train_dreambooth_lora_flux_advanced.py examples/advanced_diffusion_training/train_dreambooth_lora_sdxl_advanced.pyruff check examples/advanced_diffusion_training/train_dreambooth_lora_flux_advanced.py examples/advanced_diffusion_training/train_dreambooth_lora_sdxl_advanced.pygit diff --checkThe full prior-preservation training regression path could not be isolated into a dedicated test because the existing advanced Flux script has a separate pre-existing
text_idsissue that occurs earlier in the training path. That unrelated issue is intentionally not modified by this PR.Fixes #11489