Skip to content

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

Merged
cloneofsimo merged 2 commits intocloneofsimo:masterfrom
timh:fix-incorrect-global-steps
Dec 10, 2022
Merged

fix global steps tracking & --save_steps intermittent saves (#6, #8)#11
cloneofsimo merged 2 commits intocloneofsimo:masterfrom
timh:fix-incorrect-global-steps

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.

2 participants