-
Notifications
You must be signed in to change notification settings - Fork 668
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
[codegen][gpu] Adding support to generic op and flexible layout to pad_to_intrinsics on convolution #20073
Conversation
Signed-off-by: jerryyin <[email protected]>
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.
LGTM!
Signed-off-by: jerryyin <[email protected]>
Interesting regression : https://github.com/iree-org/iree/actions/runs/13503269777/job/37727576624?pr=20073#step:9:209 I guess we could land this and #19974 together, but I am not able to come up with a hypothesis on why this by itself is so bad, any thoughts? EDIT : Just thought of a hypothesis, if its padding more convs now and thats causing a slow down, I dont think merging with #19974 will help either. |
Actually I see this on main, so might not be anything in this PR, |
Yes, I agree with you the culprit must be in that I've made this path too flexible and now it can handle any type of convolution (versus in the past it only deal with linalg.conv2d hwcf variant). I'll try to reproduce locally and see what's going on.
Oh wow, thanks for point that out. Let me take a second look at main's CI record too. |
Per discord discussion, the perf degradation is caused by mi300 switching to cpx mode and irrelevant with this PR. I'll leave this PR open till tomorrow to merge it in case there's other feedbacks. |
@jerryyin Since this is an optional (and experimental pass) it is okay the way it is but one thing to consider is if we should have these two cases where we dont do the padding |
On a second look, those scenarios has already been blocked by below. Since I preserved this conditional, I don't have to do anything here. iree/compiler/src/iree/compiler/Preprocessing/Common/PadToIntrinsics.cpp Lines 192 to 198 in e87dd2e
I was imprecise when mentioned that this PR will allow any type of convolution. |
The
pad_to_intrinsics
pass only supportlinalg.conv2d
op withnhwc_hwcf
layout of convolution. This has created inconvenience around taking advantage of other convolution variants for their performance potentials. Once such scenario is the IR fromconv_filter_to_channels_last
will populateconv2d_nhwc_fhwc
represented bylinalg.generic
.This PR extend support of the
pad_to_intrinsics
pass such that other convolution variants including:linalg.generic
fhwc
fchw
This PR will unblock #19974, and allow us to continue to use
pad_to_intrinsics
as igemm padding kernel catch up in performance.