question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ONNX compatibility issues

See original GitHub issue

Thanks for the great library!

I’m looking into generating ONNX version of the stable diffusion models.

I had to make few changes to unet_2d_condition.py to get it to work. You can find some of the changes here… https://github.com/harishanand95/diffusers/commit/8dd4e822f87e1b4259755a2181218797ceecc410 Let me know if you prefer a PR for this and if there exist any implementations for return non dict that I can refer to. Thanks!

  1. reason for removing broadcast_to :
torch.onnx.symbolic_registry.UnsupportedOperatorError: Exporting the operator ::broadcast_to to ONNX opset version 16 is not supported. Please feel free to request support or submit a pull request on PyTorch GitHub.
  1. reason for dict changes:
RuntimeError: Encountering a dict at the output of the tracer might cause the trace to be incorrect, this is only valid if the container structure does not change based on the module's inputs. Consider using a constant container instead (e.g. for list, use a tuple instead. for dict, use a NamedTuple instead). If you absolutely need this and know the side effects, pass strict=False to trace() to allow this behavior. 

I was able to generate images with onnxruntime and DirectML, there are some more issues to be fixed.

Let me know if you have further concerns or ideas, thanks!

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
pcuencacommented, Sep 1, 2022

You are right, @harishanand95, tile does not work with ONNX. I’ll open a PR with your approach then. Thanks a lot!

0reactions
harishanand95commented, Sep 1, 2022

Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

ONNX Runtime compatibility
Backwards compatibility. Newer versions of ONNX Runtime support all models that worked with prior versions, so updates should not break integrations.
Read more >
ONNX Opset 3 is under development and not supported?
rui-ren opened this issue on Jun 17 · 4 comments ... before next ONNX release and in this case ONNX Runtime will not...
Read more >
ONNX Runtime Performance Tuning
Which Execution Provider will provide the best performance? Tips for tuning performance; Troubleshooting performance issues. Performance Tuning Tools. ONNX GO ...
Read more >
Operationalizing PyTorch Models Using ONNX and ... - Nvidia
Problem - Training frameworks x Deployment targets ... ONNX: an open and interoperable format for ML models ... choice compatible with ONNX.
Read more >
ONNX Runtime Deployment — mmcv 1.5.1 documentation
Known Issues ; cummax or ; cummin is exportable to ONNX as long as the torch version >= 1.5.0, since ; torch.cummax is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found