Skip to content

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

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

Merged
merged 2 commits into from
Jun 24, 2024

Conversation

rootonchair
Copy link
Contributor

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.

Copy link
Member

@sayakpaul sayakpaul left a comment

Choose a reason for hiding this comment

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

Thank you!

@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.

@Bhavay-2001
Copy link
Contributor

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

@rootonchair
Copy link
Contributor Author

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

@sayakpaul sayakpaul merged commit b9d52fc into huggingface:main Jun 24, 2024
8 checks passed
sayakpaul added a commit that referenced this pull request Dec 23, 2024
…_epochs is passed in a distributed training env (#8446)

fix num_train_epochs

Co-authored-by: Sayak Paul <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants