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

Failed to legalize torch.operator "onnx.Expand" #17802

Open
vitreo12 opened this issue Jul 3, 2024 · 2 comments
Open

Failed to legalize torch.operator "onnx.Expand" #17802

vitreo12 opened this issue Jul 3, 2024 · 2 comments
Labels
bug 🐞 Something isn't working integrations/onnx ONNX integration work integrations/pytorch PyTorch integration work

Comments

@vitreo12
Copy link

vitreo12 commented Jul 3, 2024

What happened?

Hello!

I have been trying to iree-compile a converted onnx model, but I hit this error:

error: failed to legalize operation 'torch.operator' that was explicitly marked illegal
    %1806 = torch.operator "onnx.Expand"(%1804, %1805) : (!torch.vtensor<[],f32>, !torch.vtensor<[?],si64>) -> !torch.vtensor<[],f32> 

Looking at nod-ai/SHARK-ModelDev#215, it looks like Expand should be supported, since it's marked as completed. Is this the case? I tried with both the latest stable release and the most recent release candidate.

Steps to reproduce your issue

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

What component(s) does this issue relate to?

No response

Version information

No response

Additional context

No response

@vitreo12 vitreo12 added the bug 🐞 Something isn't working label Jul 3, 2024
@ScottTodd ScottTodd added the integrations/pytorch PyTorch integration work label Jul 3, 2024
@ScottTodd
Copy link
Member

We have two tests (from the upstream ONNX test suite) for onnx.Expand:

Both are passing on all in-tree backends. If that specific op is the problem, the dynamic dimension (the ? in the shape of the second arg, %1805) might be unsupported.

More context about the compilation would help:

  • The source program as a .mlir file (if you can share it)
  • Which pass failed (either by looking at the --mlir-print-ir-before-all output, --mlir-print-ir-after-failure output, or some other mechanism)

@vitreo12
Copy link
Author

vitreo12 commented Jul 4, 2024

The entire mlir file is 1.5gb, including the weights. Perhaps it's enough that I share the graph though? It's still quite a big graph, generated from an onnx file. Here it is: https://pastebin.com/FqJWwhaA

@ScottTodd ScottTodd added the integrations/onnx ONNX integration work label Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐞 Something isn't working integrations/onnx ONNX integration work integrations/pytorch PyTorch integration work
Projects
None yet
Development

No branches or pull requests

2 participants