Skip to content

[ONNX] Collate the external weights, speed up loading from the hub #610

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

Merged
merged 1 commit into from
Sep 21, 2022

Conversation

anton-l
Copy link
Member

@anton-l anton-l commented Sep 21, 2022

The 400+ external weight files for the UNet are now collated into one file, making StableDiffusionOnnxPipeline.from_pretrained orders of magnitude faster.
Also removing the conversion step from the ONNX test, speeding up our CI.

Comment on lines +1376 to +1378
sd_pipe = StableDiffusionOnnxPipeline.from_pretrained(
"CompVis/stable-diffusion-v1-4", revision="onnx", provider="CUDAExecutionProvider", use_auth_token=True
)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

9 minutes -> 10 seconds!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome - great work!

"numpy": "numpy",
"onnxruntime": "onnxruntime",
"onnxruntime-gpu": "onnxruntime-gpu",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

forgot to add onnxruntime-gpu for our CI, fixing that here

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Sep 21, 2022

The documentation is not available anymore as the PR was closed or merged.

@anton-l anton-l merged commit 6bd005e into main Sep 21, 2022
@pcuenca
Copy link
Member

pcuenca commented Sep 22, 2022

Awesome!

@kashif kashif deleted the collate-onnx branch September 22, 2022 15:05
PhaneeshB pushed a commit to nod-ai/diffusers that referenced this pull request Mar 1, 2023
yoonseokjin pushed a commit to yoonseokjin/diffusers that referenced this pull request Dec 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants