SDXL fine tuning#667
Conversation
also fixed dataset issue with moving bf16 related later and fix the buffer overflow issue with disable autocast.
also did 3 changes 1. removed autocase to avoid buffer overflow 2. change mixed precision model train /dataset process order to avoid dataset issue 3. val issue with input/weight dtype not matched
8b6df81 to
841b776
Compare
|
Additional updates:
|
|
Updates:
|
| https://github.com/huggingface/diffusers/blob/v0.23.1/examples/text_to_image/train_text_to_image_sdxl.py | ||
| https://github.com/huggingface/diffusers/blob/v0.23.1/examples/text_to_image/train_text_to_image_lora_sdxl.py |
There was a problem hiding this comment.
Maybe this script should be renamed to train_text_to_image_sdxl.py as I see that Diffusers also has an example called train_text_to_image.py.
There was a problem hiding this comment.
@regisss should we keep 1 script and use it to train both stable diffusion and stable diffusion xl with parameter?
There was a problem hiding this comment.
Ideally yes, if that doesn't make the script too complicated
|
@libinta any updates on this? |
|
Will update next week.
Thanks
Get Outlook for Android<https://aka.ms/AAb9ysg>
…________________________________
From: SM Iman Gohari ***@***.***>
Sent: Friday, February 9, 2024 11:12:59 AM
To: huggingface/optimum-habana ***@***.***>
Cc: Libin Tang ***@***.***>; Mention ***@***.***>
Subject: Re: [huggingface/optimum-habana] Sd sdxl fine tuning (PR #667)
@libinta<https://github.com/libinta> any updates on this?
—
Reply to this email directly, view it on GitHub<#667 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AGLGHZIKWE2RT2USGNFEY7DYSZYLXAVCNFSM6AAAAABCMTBITCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMZWGQ3DMNJVGE>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
|
@dsocek can you update to the latest?thx |
libinta
left a comment
There was a problem hiding this comment.
can you update the patch to latest?
6541186 to
56b06a5
Compare
|
@libinta I have just rebased to latest OH code |
|
Daniel,
Can you check one more time to see if it's easier to keep stable diffusion xl and stable diffusion as separate training script? Or combine them?
Thanks,
Libin
From: Daniel Socek ***@***.***>
Sent: Monday, February 12, 2024 3:36 PM
To: huggingface/optimum-habana ***@***.***>
Cc: Libin Tang ***@***.***>; Mention ***@***.***>
Subject: Re: [huggingface/optimum-habana] Sd sdxl fine tuning (PR #667)
@libinta<https://github.com/libinta> I have just rebased to latest OH code
-
Reply to this email directly, view it on GitHub<#667 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AGLGHZNYULHRFS4Y57XGOTDYTKROTAVCNFSM6AAAAABCMTBITCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMZZG44DKNBYGI>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
@libinta I think better would be to have separate train scripts for SDXL and SD. This would be easier to implement and also easier to maintain IMO. It also is more similar to how diffusers are arranged. So we would then have 2 scripts but each could cover multiple fine tunings approaches. |
| pipe = GaudiStableDiffusionXLPipeline.from_pretrained( | ||
| model_id, | ||
| scheduler=GaudiEulerDiscreteScheduler.from_pretrained(model_id, subfolder="scheduler"), | ||
| torch_dtype=torch.bfloat16, |
There was a problem hiding this comment.
can you change GaudiEulerDiscreteScheduler to DDPMScheduler like original script as we observed noise image with EulerDiscreteScheduler ?
There was a problem hiding this comment.
For this change, do we need to implement GaudiDDPMScheduler?
There was a problem hiding this comment.
I guess yes. Maybe it works well with GaudiDDIMScheduler?
|
Yes, please update to the latest one.thanks.
From: Akihiro Takahashi ***@***.***>
Sent: Tuesday, February 13, 2024 2:14 PM
To: huggingface/optimum-habana ***@***.***>
Cc: Libin Tang ***@***.***>; Mention ***@***.***>
Subject: Re: [huggingface/optimum-habana] Sd sdxl fine tuning (PR #667)
@libinta<https://github.com/libinta> and @dsocek<https://github.com/dsocek>
There is diffusers version dependency issue between driver 1.13 and 1.14.
driver 1.13 use diffusers 0.23.1 and driver 1.14 use diffusers 0.26.3. This 0.23.1 has "text_encoder_lora_state_dict" but 0.26.3 not. Do we support only 1.13 or 1.14 or both? I recommend go for 1.14.
-
Reply to this email directly, view it on GitHub<#667 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AGLGHZOBK5FN4CXGWZRKS6LYTPQTVAVCNFSM6AAAAABCMTBITCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBSG4ZDQOBYHE>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
b6226b6 to
204210d
Compare
|
|
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. |
| pipe = GaudiStableDiffusionXLPipeline.from_pretrained( | ||
| model_id, | ||
| scheduler=GaudiEulerDiscreteScheduler.from_pretrained(model_id, subfolder="scheduler"), | ||
| torch_dtype=torch.bfloat16, |
There was a problem hiding this comment.
I guess yes. Maybe it works well with GaudiDDIMScheduler?
204210d to
d376a16
Compare
Co-authored-by: Akihiro Takahashi <akihiro.takahashi@intel.com> Co-authored-by: Iman Gohari <s.m.iman.gohari@intel.com> Co-authored-by: Libin Tang <litang@habana.ai>
Co-authored-by: Akihiro Takahashi <akihiro.takahashi@intel.com> Co-authored-by: Iman Gohari <s.m.iman.gohari@intel.com> Co-authored-by: Libin Tang <litang@habana.ai>
Co-authored-by: Akihiro Takahashi <akihiro.takahashi@intel.com> Co-authored-by: Iman Gohari <s.m.iman.gohari@intel.com> Co-authored-by: Libin Tang <litang@habana.ai>
…face#667) Signed-off-by: Urszula <urszula.golowicz@intel.com> Co-authored-by: Urszula Golowicz <urszula.golowicz@intel.com>
What does this PR do?
This PR adds fine-tuning for SDXL on Gaudi