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

PyTorch 2.0 and ONNX converter #2878

Closed
ForserX opened this issue Mar 28, 2023 · 13 comments
Closed

PyTorch 2.0 and ONNX converter #2878

ForserX opened this issue Mar 28, 2023 · 13 comments
Labels
stale Issues that haven't received updates

Comments

@ForserX
Copy link
Contributor

ForserX commented Mar 28, 2023

UnsupportedOperatorError: Exporting the operator 'aten::scaled_dot_product_attention' to ONNX opset version 14 is not supported.

More info: pytorch/pytorch#97262

ForserX added a commit to ForserX/StableDiffusionUI that referenced this issue Mar 28, 2023
@justinchuby
Copy link
Contributor

@abock

@BowenBao
Copy link
Contributor

cc @titaiwangms using atenlib for ts exporter

ForserX added a commit to ForserX/StableDiffusionUI that referenced this issue Mar 29, 2023
@patrickvonplaten
Copy link
Contributor

cc @anton-l and @echarlaix here as well

@justinchuby
Copy link
Contributor

For reference pytorch/pytorch#97262 is a transitional workaround until we expose the new dynamo interface

@echarlaix
Copy link
Contributor

Was temporarily fixed in optimum : huggingface/optimum#888 (cc @fxmarty)

@ForserX
Copy link
Contributor Author

ForserX commented Mar 31, 2023

Isn't it better to fix the converter script?

ForserX/StableDiffusionUI@195e21f

@fxmarty
Copy link
Contributor

fxmarty commented Apr 3, 2023

@justinchuby Out of curiosity, what do you mean by

expose the new dynamo interface

?

@justinchuby
Copy link
Contributor

We are working on a new torch.onnx.dynamo_export API which will use dynamo for graph capturing instead of torch.jit. pytorch/pytorch#97920

@github-actions
Copy link

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 Apr 28, 2023
@titaiwangms
Copy link

Fixed by pytorch/pytorch#99658

@ForserX
Copy link
Contributor Author

ForserX commented Apr 28, 2023

It remains to wait for the release of PyTorch 2.1.0

@github-actions
Copy link

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.

@ashimatyuk
Copy link

ashimatyuk commented Jun 5, 2023

Hi,
I'm facing "torch.onnx.errors.UnsupportedOperatorError: Exporting the operator 'aten::scaled_dot_product_attention' to ONNX opset version 14 is not supported" when using convert_stable_diffusion_checkpoint_to_onnx.py for converting sd-v1-5-inpainting.ckpt to onnx. As I can see it was fixed (as @titaiwangms mentioned above) but it still doesn't work. Am I doing smth wrong? The error is raised on the unet stage, text_encoder has been converted successfully.

Upd.: now on the VAE stage. On the unet 'pipeline.unet.set_attn_processor(CrossAttnProcessor())' helped, but same is not working for VAE.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Issues that haven't received updates
Projects
None yet
Development

No branches or pull requests

8 participants