Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation fault (core dumped) when sdxl-turbo inference with torch 2.2.1+cu118 #9889

Open
rickyxie2004 opened this issue Nov 8, 2024 · 4 comments
Labels
bug Something isn't working stale Issues that haven't received updates

Comments

@rickyxie2004
Copy link

Describe the bug

When sdxl-turbo inferencing, I encountered Segmentation fault (core dumped) after loading the model. And this will happen with torch 2.2.1+cu118(xformers0.0.25+cu118), and it will not happen with torch 2.0.1+cu118(xformers0.0.20+cu118). However, I need to run under torch 2.2.1, so could anyone help me to solve this issue? Thanx!

Reproduction

code:
pipe = AutoPipelineForText2Image.from_pretrained( cache_dir, torch_dtype=torch.float16, variant="fp16")

pipe.to("cuda")

prompt = "A cinematic shot of a baby racoon wearing an intricate italian priest robe."

image = pipe(prompt=prompt, num_inference_steps=1, guidance_scale=0.0).images[0]

Logs

Loading pipeline components...: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 7/7 [00:01<00:00,  4.47it/s]
  0%|                                                                                                                                                                           | 0/1 [00:00<?, ?it/s]Segmentation fault (core dumped)

System Info

python==3.10
torch==2.2.1+cu118
diffusers==0.26.3
accelerate==1.0.1

Who can help?

@yiyixuxu @sayakpaul @DN6

@rickyxie2004 rickyxie2004 added the bug Something isn't working label Nov 8, 2024
@sayakpaul
Copy link
Member

Easiest is to update your PyTorch version and see if this error goes away.

Maybe this is some setup related bug? I.e., the 2.2.1 installation isn't compatible with the CUDA setup you have locally?

@rickyxie2004
Copy link
Author

Easiest is to update your PyTorch version and see if this error goes away.

Maybe this is some setup related bug? I.e., the 2.2.1 installation isn't compatible with the CUDA setup you have locally?

Thanks for your reply! I find out this might be some problems with xformers==0.0.25, when I downgrade xformers to 0.0.20, the problem solved. But I still wonder the reason.

@sayakpaul
Copy link
Member

Well, when using PyTorch 2.0 or greater and unless explicitly specified, we always use SDPA (i.e., F.scaled_dot_product_attention()), so, I don't that is an issue here. Am I missing something else?

Copy link
Contributor

github-actions bot commented Dec 8, 2024

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

@github-actions github-actions bot added the stale Issues that haven't received updates label Dec 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale Issues that haven't received updates
Projects
None yet
Development

No branches or pull requests

2 participants