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

fix global steps tracking & --save_steps intermittent saves (#6, #8) #11

Merged
merged 2 commits into from
Dec 10, 2022

Conversation

timh
Copy link
Contributor

@timh timh commented Dec 9, 2022

Underlying bug was that "global_steps" was only incrementing (by 1) at the end of each epoch. This lead to behavior where train_lora_dreambooth would compute twice as many steps as requested (which I & others on Reddit have seen).

I chose to use "--save_steps" as a hint, and only have it save at the end of epochs. So if an epoch is 120 steps, and you ask for "--save_steps 100", you'll get a save at step=120, 240, etc...

@timh
Copy link
Contributor Author

timh commented Dec 9, 2022

I accidentally included the fix for #10 in this PR, too.
This is the same bug I reported/PR'ed in upstream diffusers: huggingface/diffusers#1566

…r versions of accelerate (which don't support it)
@cloneofsimo
Copy link
Owner

Thanks for the fix! Interesting though, because this wasn't a problem for me. Was it still the case with accumulate_gradient size 1?

@cloneofsimo cloneofsimo merged commit 59e122a into cloneofsimo:master Dec 10, 2022
@cloneofsimo cloneofsimo mentioned this pull request Dec 10, 2022
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.

None yet

2 participants