dreambooth: fix #1566: maintain fp32 wrapper when saving a checkpoint to avoid crash when running fp16#1618
Merged
patrickvonplaten merged 4 commits intohuggingface:mainfrom Dec 10, 2022
Conversation
|
The documentation is not available anymore as the PR was closed or merged. |
… checkpoint to avoid crash when running fp16
…ions of accelerate. part of fix for huggingface#1566
053e6b7 to
ebfd8bf
Compare
pcuenca
approved these changes
Dec 10, 2022
Member
There was a problem hiding this comment.
This was already reviewed by @patil-suraj in #1567, and it looks good to me! I just suggested a minor rewording of the comment.
Co-authored-by: Pedro Cuenca <pedro@huggingface.co>
Contributor
|
Thanks @timh! @patil-suraj @pcuenca @williamberman let's not forgot to remove this when accelerate is forced to be a newer version |
tcapelle
pushed a commit
to tcapelle/diffusers
that referenced
this pull request
Dec 12, 2022
… checkpoint to avoid crash when running fp16 (huggingface#1618) * dreambooth: fix huggingface#1566: maintain fp32 wrapper when saving a checkpoint to avoid crash when running fp16 * dreambooth: guard against passing keep_fp32_wrapper arg to older versions of accelerate. part of fix for huggingface#1566 * Apply suggestions from code review Co-authored-by: Pedro Cuenca <pedro@huggingface.co> * Update examples/dreambooth/train_dreambooth.py Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com> Co-authored-by: Pedro Cuenca <pedro@huggingface.co>
sliard
pushed a commit
to sliard/diffusers
that referenced
this pull request
Dec 21, 2022
… checkpoint to avoid crash when running fp16 (huggingface#1618) * dreambooth: fix huggingface#1566: maintain fp32 wrapper when saving a checkpoint to avoid crash when running fp16 * dreambooth: guard against passing keep_fp32_wrapper arg to older versions of accelerate. part of fix for huggingface#1566 * Apply suggestions from code review Co-authored-by: Pedro Cuenca <pedro@huggingface.co> * Update examples/dreambooth/train_dreambooth.py Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com> Co-authored-by: Pedro Cuenca <pedro@huggingface.co>
rafaelgm
referenced
this pull request
in ShivamShrirao/diffusers
Jan 6, 2023
When using mixed precision and trying to save weights every N steps I was getting this error after the first save step: RuntimeError: Input type (struct c10::Half) and bias type (float) should be the same Adding keep_fp32_wrapper=True to the two unwrap_model calls on save_weights seems to fix the issue.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
same code changes as PR #1567, but with a proper branch name now, so the merge commit is nicer :)