-
Notifications
You must be signed in to change notification settings - Fork 24.9k
[inductor] skip bmm when converting channel last #159459
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?
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/159459
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 217eaff with merge base 1e8e9f7 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
130e41a
to
217eaff
Compare
@pytorchbot label "topic: not user facing" |
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.
Looks good, but can you compare perf with requiring a dense [-1] or [-2] dimension for bmm?
@@ -800,12 +800,17 @@ def find_nodes_prefer_channels_last(self) -> OrderedSet[Node]: | |||
With rule 2, we makes sure all the tensors in the chain uses channels last layout. So both copies | |||
can be saved. | |||
""" | |||
last_conv = None | |||
nodes_cannot_propagate = [torch.ops.aten.bmm.default] |
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.
How does the perf compare if we do a copy inside of aten.bmm.default
if the dense dimension dim 0 ?
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.
The current behavior in aten bmm is to add a clone to do the transpose for both cuda and xpu. I don't know where I can add something like require_stride_order
to make bmm dim[-1] dense, but this seems to add another transpose.
Workaround of #159458 by remove some nodes output channel last set
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @chenyang78 @kadeng @muchulee8 @amjames @chauhang @aakhundov @coconutruben