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

Add an info cast to prims.squeeze decomposition #3844

Merged
merged 1 commit into from
Nov 1, 2024

Conversation

zjgarvey
Copy link
Collaborator

The onnx ingest sometimes has poorly propagated shape information. E.g.:

...
    %9020 = torch.prims.squeeze %9010#1, %9019 : !torch.vtensor<[?,384,1],f32>, !torch.list<int> -> !torch.vtensor<[1,384],f32>
    return %9015, %9020 : !torch.vtensor<[1,384],f32>, !torch.vtensor<[1,384],f32>
  }
}

This occurred at the boundary of the onnx model migraphx_bert__bert-large-uncased. Evidently, the output value tensor info had more information than could be propagated forward. The PrimsSqueeze lowering was returning a !torch.vtensor<[?,384],f32> which was causing a type mismatch with the func.return.

Copy link
Contributor

@vinayakdsci vinayakdsci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

zjgarvey added a commit to nod-ai/SHARK-TestSuite that referenced this pull request Nov 1, 2024
With a fix in <llvm/torch-mlir#3844> for the
model compilation issue, this test will pass with the change present
here.
@zjgarvey zjgarvey merged commit 3cfb7c8 into llvm:main Nov 1, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants