-
Notifications
You must be signed in to change notification settings - Fork 7
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
Fix DecomposeMultiDimSqueeze callback failure #52
base: main
Are you sure you want to change the base?
Fix DecomposeMultiDimSqueeze callback failure #52
Conversation
@@ -1883,6 +1883,8 @@ def __init__(self): | |||
def callback(self, pre, post, node_map): | |||
act = node_map[self.act][0] | |||
axis = post.attrs.axis | |||
if any([isinstance(dim, tvm.tir.expr.Any) for dim in pre.checked_type.shape]): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you give some context in PR why the change? What is it solving...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dgolubovicTT , this change fixes #642, the current status of this model is mentioned in the description here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I understand, if any dimension is tvm.tir.expr.Any
dimension size cannot be determined at compile-time. In that case we don't decompose multidimsqueeze? Am I right?
If that is true, shouldn't we give some warning? Also, I am curious what this multi-dim squeeze lowers later in the compiler? What is the last compile stage of this densenet model with this change included?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, in that case we skip removal of squeeze containing dynamic shapes, warning can be added. Squeeze op is supported in mlir as mentioned here.
Densenet model is failing with unsupported ops - argwhere and scatter_elements after this change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, can you add a single squeeze test that will test this case, just to be sure everything after tvm will work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But is any of them actually testing this code path where this condition is not satisfied:
if any([isinstance(dim, tvm.tir.expr.Any) for dim in pre.checked_type.shape]):
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will try this and let you know.
@meenakshiramanathan1 can you provide a bit more context to this PR. Here are few questions I'm interested in:
|
Here non_zero is mapped to argwhere which was one of the cases which was tried, so if we want to test this out further , argwhere op tvm decomposition should be brought in. Before fix , graps are dumped till relay passes.
|
Thanks for the details! We're pushing the effort on outlining what and how our indexing should work.
Can you send actually screenshot of the graph? I'm interested in graph structure changes, rather than compile depth. |
I will send this information. |
Fixes #642