Skip to content

PyTorch 2.3.0 Incompatibility with Current Diffusers Library #7950

@JethroChow

Description

@JethroChow

Describe the bug

When running the StableDiffusionXLPipeline with a specific model file (Clay_SDXL.safetensors), inference works correctly on CPU but results in a segmentation fault when run on GPU. Below are the specific steps and configurations that lead to this issue.

Reproduction

import torch
from diffusers import StableDiffusionXLPipeline

pipeline = StableDiffusionXLPipeline.from_single_file('/data1/tides/sd/SDXL.safetensors', torch_dtype=torch.float16)
pipeline.to('cuda:2')

result_image = pipeline(prompt='girl')

Logs

/home/tides/miniconda3/envs/diffusers/lib/python3.9/site-packages/huggingface_hub/file_download.py:1132: FutureWarning: `resume_download` is deprecated and will be removed in version 1.0.0. Downloads always resume when possible. If you want to force a new download, use `force_download=True`.
  warnings.warn(
Some weights of the model checkpoint were not used when initializing CLIPTextModel: 
 ['text_model.embeddings.position_ids']
Some weights of the model checkpoint were not used when initializing CLIPTextModelWithProjection: 
 ['text_model.embeddings.position_ids']

Segmentation fault (core dumped)

System Info

Python Version: 3.9.19
PyTorch Version: 2.3.0+cu118
CUDA Version: 11.8
Diffusers Version: 0.27.2
Operating System: Ubuntu

Who can help?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions