Skip to content

ValueError: For the given accelerator, there seems to be an unexpected problem in type-casting. Please file an issue on the PyTorch GitHub repository. #7529

@christopher5106

Description

@christopher5106

Describe the bug

Running the script examples/text_to_image/train_text_to_image_lora_sdxl.py
Not working anymore on mixed_precision fp16, bf16

Traceback (most recent call last):0%|██████████████████████████████████████████████████████████████| 7/7 [00:00<00:00, 67.30it/s]
File "train_text_to_image_lora_sdxl.py", line 1350, in
main(args)
File "train_text_to_image_lora_sdxl.py", line 1229, in main
images = [
File "train_text_to_image_lora_sdxl.py", line 1230, in
pipeline(**pipeline_args, generator=generator).images[0]
File "/home/ubuntu/360-training-preprocess/venv/lib/python3.8/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "/home/ubuntu/360-training-preprocess/venv/lib/python3.8/site-packages/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl.py", line 1203, in call
raise ValueError(
ValueError: For the given accelerator, there seems to be an unexpected problem in type-casting. Please file an issue on the PyTorch GitHub repository. See also: https://github.com//pull/7446/.

Reproduction

To me, the regression comes from recent commit 544710e

#7446

I've never experiment this issue before.

Of course latents are in mixed precision before, and they are in float32 after passing through scheduler.

Logs

No response

System Info

Ubuntu, A10G, NVIDIA-SMI 550.54.14, Driver Version: 550.54.14, CUDA Version: 12.4
diffusers==0.28.0.dev0

Who can help?

@bghira @sayakpaul

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions