-
Notifications
You must be signed in to change notification settings - Fork 795
NXP backend: Add edge dialect pass to remove useless as_strided_copy nodes.
#16489
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
base: main
Are you sure you want to change the base?
NXP backend: Add edge dialect pass to remove useless as_strided_copy nodes.
#16489
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/16489
Note: Links to docs will display an error until the docs builds have been completed. ❌ 4 New Failures, 1 Unrelated FailureAs of commit 276e961 with merge base e847384 ( NEW FAILURES - The following jobs have failed:
UNSTABLE - The following job is marked as unstable, possibly due to flakiness on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
| passes: list[NeutronEdgePass] = passes or [ | ||
| MoveLeadingAuxiliaryOperatorIntoSeparateQDQClusterPass(), | ||
| MoveTrailingAuxiliaryOperatorIntoSeparateQDQClusterPass(), | ||
| RemoveUselessOpPass(), |
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.
@MartinPavella , you mentioned the RemoveUselessOpPass handled specifically the case of mean followed by the as_strided_copy, but seems it handles more "useless" op cases - https://github.com/pytorch/executorch/blob/main/backends/samsung/_passes/remove_useless_ops.py#L15
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.
Now that you mention it, I thought about it a bit more. For our use case we actually mustn't remove the other "useless ops". Since we need to run this pass before partitioning, some of the ops (like dim_order_ops._to_dim_order_copy) are not useless at all, and are actually vital in case they don't get delegated.
Therefore, I will create our own pass based on this one, to only remove the as_strided_copy for now.
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.
Done
|
@Jiseong-oh, we also need a pass to remove the |
@Jiseong-oh , based on the feedback from Martin, the question is not anymore relevant. |
7321573 to
cf43233
Compare
robert-kalmar
left a comment
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.
Code looks fine to me.
Let the CI's finish.
cf43233 to
276e961
Compare
Summary
This PR integrates the
RemoveUselessOpPassedge dialect pass from the Samsung backend into the NXP backend. This feature is required to support an internal model.Test plan
Tested internally by NXP on a private model.
cc @robert-kalmar