Skip to content

Check tensor's dim order ambiguity in IR verifier #9942

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

Open
Gasoonjia opened this issue Apr 7, 2025 · 10 comments · May be fixed by #10272
Open

Check tensor's dim order ambiguity in IR verifier #9942

Gasoonjia opened this issue Apr 7, 2025 · 10 comments · May be fixed by #10272
Assignees
Labels
good first issue Good for newcomers module: exir Issues related to Export IR and the code under exir/ triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Comments

@Gasoonjia
Copy link
Contributor

Gasoonjia commented Apr 7, 2025

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

@Gasoonjia Gasoonjia added good first issue Good for newcomers module: exir Issues related to Export IR and the code under exir/ labels Apr 7, 2025
@github-project-automation github-project-automation bot moved this to To triage in ExecuTorch Core Apr 7, 2025
@digantdesai
Copy link
Contributor

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.

@lucylq lucylq added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label Apr 12, 2025
@patelvndn
Copy link

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.

@Gasoonjia
Copy link
Contributor Author

Thanks @patelvndn for your help! Have assigned you and please let me or @digantdesai know if anything we can help!

@patelvndn
Copy link

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?

@Gasoonjia
Copy link
Contributor Author

Yes assert_unambiguous_dim_order(https://github.com/pytorch/executorch/pull/9371/files#diff-e99d0611a6856d7bd793c25b5b6ddb0caa73d850aa6cd9c16de44e63f8fb44aeR109) is the utility function you can reuse in verifier.

@digantdesai
Copy link
Contributor

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.

@Gasoonjia
Copy link
Contributor Author

hey @patelvndn is the linked PR ready to be reviewed? Or still in draft?

@patelvndn
Copy link

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.

@digantdesai
Copy link
Contributor

PR?

@patelvndn
Copy link

PR is ready for review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers module: exir Issues related to Export IR and the code under exir/ triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
Status: To triage
Development

Successfully merging a pull request may close this issue.

4 participants