Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Advanced LoRA v1.5] fix: gradient unscaling problem #7018

Merged
merged 8 commits into from
Nov 8, 2024

Conversation

sayakpaul
Copy link
Member

@sayakpaul sayakpaul commented Feb 19, 2024

What does this PR do?

Part of #6552.

@linoytsaban I couldn't find instructions to run this script in the README. Would appreciate some help in verifying it.

@HuggingFaceDocBuilderDev

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.

@sayakpaul
Copy link
Member Author

@linoytsaban a gentle ping here.

@sayakpaul
Copy link
Member Author

@linoytsaban sorry about the repeated pings here.

@linoytsaban
Copy link
Collaborator

sorry missed this!

Copy link
Collaborator

@linoytsaban linoytsaban left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@sayakpaul
Copy link
Member Author

Would you be able to test it as well? I don;t have the training commands for v1.5 to test.

@linoytsaban
Copy link
Collaborator

Apologies for the delay, tested with ⬇️ and it works good! we can ship :) Thanks a lot!

#!/usr/bin/env bash
!accelerate launch train_dreambooth_lora_sd15_advanced.py \
  --pretrained_model_name_or_path="runwayml/stable-diffusion-v1-5" \
  --dataset_name="./linoy_face" \
  --instance_prompt="a TOK woman"\
  --validation_prompt="watercolor painting of a TOK woman with pink hair in New York"\
  --train_text_encoder_ti\
  --output_dir="linoy_lora_v1_sd15" \
  --caption_column="prompt" \
  --mixed_precision="fp16" \
  --resolution=1024 \
  --train_batch_size=3 \
  --repeats=1\
  --report_to="wandb"\
  --gradient_accumulation_steps=1 \
  --gradient_checkpointing \
  --learning_rate=1.0 \
  --text_encoder_lr=1.0 \
  --optimizer="prodigy"\
  --lr_scheduler="constant" \
  --lr_warmup_steps=0 \
  --rank=32 \
  --max_train_steps=1000 \
  --checkpointing_steps=2000 \
  --seed="0" \
  --push_to_hub

@sayakpaul
Copy link
Member Author

@linoytsaban thanks but we need to check if it can successfully resumed as well. Refer to #6514 (comment) for more details.

Copy link

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

@github-actions github-actions bot added the stale Issues that haven't received updates label Apr 20, 2024
@sayakpaul
Copy link
Member Author

Friendly ping here @linoytsaban

@linoytsaban linoytsaban removed the stale Issues that haven't received updates label May 30, 2024
Copy link

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

@github-actions github-actions bot added the stale Issues that haven't received updates label Sep 14, 2024
@yiyixuxu yiyixuxu removed the stale Issues that haven't received updates label Sep 17, 2024
Copy link

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

@github-actions github-actions bot added the stale Issues that haven't received updates label Oct 12, 2024
@yiyixuxu yiyixuxu removed the stale Issues that haven't received updates label Oct 15, 2024
Copy link

github-actions bot commented Nov 8, 2024

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

@github-actions github-actions bot added the stale Issues that haven't received updates label Nov 8, 2024
@sayakpaul sayakpaul merged commit d720b21 into main Nov 8, 2024
10 of 11 checks passed
@sayakpaul sayakpaul deleted the gradient-unscaling-t2i-lora branch November 8, 2024 23:31
sayakpaul added a commit that referenced this pull request Dec 23, 2024
fix: gradient unscaling problem

Co-authored-by: Linoy Tsaban <57615435+linoytsaban@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Issues that haven't received updates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants