-
Notifications
You must be signed in to change notification settings - Fork 364
Exploring Stable Diffusion in Torch Compile Path #2144
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
Comments
Different parts of the Stable Diffusion pipeline have different missing operators. For instance, the UNet is missing the following set:
(Aug 3 Torch Nightly)
Find decompositions for group norm and layer norm to transform it back into component ops. |
Next up:
|
Missing operators from text encoder
|
This issue has not seen activity for 90 days, Remove stale label or comment or this will be closed in 10 days |
When benchmarking Torch-TRT on Stable Diffusion via TorchBench (see tutorial here), and using the following command:
HUGGING_FACE_HUB_TOKEN={YOUR HF TOKEN} python run.py stable_diffusion --backend torch_trt --precision fp32 -d cuda -t eval --ir torch_compile
set_module
IssueThe above fails first due to this line, since the
set_module
attribute for Stable Diffusion seems to not be working.Missing ATen Operators
If we intercept the compilation above that line, the compilation succeeds, but is very slow with over 100 TRT engines generated. Below are the missing operators listed. Some of these may have since been implemented.
Accuracy Issue
Additionally, there is an accuracy issue where the outputs of the
trt_model
have a very low cosine similarity score (~0.14 on one test), relative to their PyTorch counterparts. This may be contributed to by the graph segmentation.The text was updated successfully, but these errors were encountered: