Check tensor's dim order ambiguity in IR verifier
Description
It is crucial to maintain dimensional order consistency (dim-order-unambiguity) for tensors within our computational graph. We have developed a tool to check this, as introduced in PR #9371. However, this tool has not yet been integrated into our dimension order verifier.
Action Required
Integrate the dim-order checking tool into the existing dimension order verifier located in the file: verifier.py.
cc @JacobSzwejbka @angelayi @digantdesai @larryliu0820
This is good, thanks @Gasoonjia. Let's make sure if this is very noisy we can allow users to make forward progress by disabling it temporarily, kind of like draft mode for export.
Hello, this seems like an interesting first problem to solve. Would I be able to take a shot at it? Also, not sure how to assign myself to the issue... If someone could help with that, it would be much appreciated.
Thanks @patelvndn for your help! Have assigned you and please let me or @digantdesai know if anything we can help!
I noticed a function to check a tensor's dim order ambiguity in PR#9371. Would it make sense to use the same function in verifier.py? Is this the tool the issue description is referring to?
Yes assert_unambiguous_dim_order(https://github.com/pytorch/executorch/pull/9371/files#diff-e99d0611a6856d7bd793c25b5b6ddb0caa73d850aa6cd9c16de44e63f8fb44aeR109) is the utility function you can reuse in verifier.
We may wrap this check around a specific dim_order_ops pass (instead of ExampleNoOp pass in that test) or we can literally run this for all/any passes by extending ExportPass, or something similar. The latter is the most conservative but can also be intrusive. Let's start with the former and then we will see if we need to extend this more.
hey @patelvndn is the linked PR ready to be reviewed? Or still in draft?
Hey @Gasoonjia, sorry for the late reply, I have my final exams this week. The PR is still in draft but I have been failing some label checks. I wanted to add in a few test cases (if applicable) as well. I added the check in the verifier.py file (in the PR draft) and that itself won't be changed.
PR?
PR is ready for review