diffusers
[train_lcm_distill_lora_sdxl.py] Fix the LR schedulers when num_train_epochs is passed in a distributed training env
#8446
Merged

[train_lcm_distill_lora_sdxl.py] Fix the LR schedulers when num_train_epochs is passed in a distributed training env #8446

rootonchair
rootonchair1 year ago

What does this PR do?

Part of #8384

Test script

export MODEL_NAME="stabilityai/stable-diffusion-xl-base-1.0"
export OUTPUT_DIR="sdxl_lcm"

accelerate launch train_lcm_distill_lora_sdxl.py \
    --pretrained_teacher_model=$MODEL_NAME \
    --output_dir=$OUTPUT_DIR \
    --mixed_precision=fp16 \
    --resolution=512 \
    --lora_rank=64 \
    --learning_rate=1e-4 --loss_type="huber" --adam_weight_decay=0.0 \
    --num_train_epochs=100 \
    --dataloader_num_workers=8 \
    --dataset_name="lambdalabs/naruto-blip-captions" \
    --validation_steps=200 \
    --checkpointing_steps=200 --checkpoints_total_limit=10 \
    --train_batch_size=2 \
    --gradient_checkpointing --enable_xformers_memory_efficient_attention \
    --gradient_accumulation_steps=1 \
    --use_8bit_adam \
    --resume_from_checkpoint=latest \
    --report_to=tensorboard \
    --seed=453645634

Before submitting

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

rootonchair fix num_train_epochs
7c061392
sayakpaul
sayakpaul approved these changes on 2024-06-10
sayakpaul1 year ago

Thank you!

sayakpaul Merge branch 'main' into lcm_num_train_epochs_patch
f45bf467
HuggingFaceDocBuilderDev
HuggingFaceDocBuilderDev1 year ago

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.

Bhavay-2001
Bhavay-20011 year ago

Hi @rootonchair, did you try to run this test script on google colab first?

rootonchair
rootonchair1 year ago

Hi @Bhavay-2001 , I haven't ran with Cobal yet but I did run on my machine's GPU

sayakpaul sayakpaul merged b9d52fca into main 1 year ago

Login to write a write a comment.

Login via GitHub

Reviewers
Assignees
No one assigned
Labels
Milestone