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

UNet fusion and fp16 conversion for stable diffusion #14248

Merged
merged 5 commits into from
Jan 21, 2023

Conversation

tianleiwu
Copy link
Contributor

@tianleiwu tianleiwu commented Jan 12, 2023

Description

Add script to fuse nodes to optimized operators in stable diffusion 1.5 models, and a script to convert fp32 models to fp16 models. Tested with stable diffusion 1.5.

Note that the optimized model needs onnxruntime-gpu nightly package (or build source from main branch) or the coming v1.14 (release candidate will be available soon).

Note: We will update the script to work with latest diffusers and stable diffusion v2 and v2.1 models.

Motivation and Context

huggingface/diffusers#489

@tianleiwu tianleiwu requested a review from wangyems January 12, 2023 02:21
@tianleiwu tianleiwu marked this pull request as draft January 12, 2023 02:21
@@ -39,7 +39,7 @@
try:
if self.shape_infer_helper.infer(dynamic_axis_mapping):
return self.shape_infer_helper
except:
except: # noqa

Check notice

Code scanning / CodeQL

Except block handles 'BaseException'

Except block directly handles BaseException.
@tianleiwu tianleiwu marked this pull request as ready for review January 20, 2023 18:34
@tianleiwu tianleiwu merged commit a95fcb4 into main Jan 21, 2023
@tianleiwu tianleiwu deleted the tlwu/unet_graph_fusion branch January 21, 2023 18:16
@rui-ren rui-ren added release:1.14 triage:approved Approved for cherrypicks for release labels Feb 3, 2023
rui-ren pushed a commit that referenced this pull request Feb 3, 2023
Add script to fuse nodes to optimized operators in stable diffusion 1.5
models, and a script to convert fp32 models to fp16 models. Tested with
stable diffusion 1.5.

Note that the optimized model needs onnxruntime-gpu v1.14 (release candidate
will be available soon).

Note: We will update the script to work with latest diffusers and stable
diffusion v2 and v2.1 models.
rui-ren pushed a commit that referenced this pull request Feb 3, 2023
Add script to fuse nodes to optimized operators in stable diffusion 1.5
models, and a script to convert fp32 models to fp16 models. Tested with
stable diffusion 1.5.

Note that the optimized model needs onnxruntime-gpu v1.14 (release candidate
will be available soon).

Note: We will update the script to work with latest diffusers and stable
diffusion v2 and v2.1 models.
rui-ren pushed a commit that referenced this pull request Feb 3, 2023
Add script to fuse nodes to optimized operators in stable diffusion 1.5
models, and a script to convert fp32 models to fp16 models. Tested with
stable diffusion 1.5.

Note that the optimized model needs onnxruntime-gpu v1.14 (release candidate
will be available soon).

Note: We will update the script to work with latest diffusers and stable
diffusion v2 and v2.1 models.
@faxu faxu removed the release:1.14 label Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage:approved Approved for cherrypicks for release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants