-
Notifications
You must be signed in to change notification settings - Fork 645
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
Simplify GPUTileSwizzleUtils and avoid creating unit dims. #19105
Conversation
a89bc41
to
e5899d6
Compare
7c3f370
to
d0eb097
Compare
compiler/src/iree/compiler/Codegen/Dialect/GPU/IR/GPUTileSwizzleUtils.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Dialect/GPU/IR/GPUTileSwizzleUtils.cpp
Outdated
Show resolved
Hide resolved
// expected-remark @above {{layout of result #0 is #iree_vector_ext.layout<<[ BATCHX, LANEX], [1, 16]>, <[ BATCHY, VECTORX], [1, 16]>>}} | ||
%rhs = vector.transfer_read %b[%c0, %c0], %cst_0 {in_bounds = [true, true]} : memref<16x16xf16>, vector<16x16xf16> | ||
// expected-remark @above {{layout of result #0 is #iree_vector_ext.layout<<[ BATCHX, LANEX], [1, 16]>, <[ BATCHY, LANEY, VECTORX], [1, 1, 16]>>}} | ||
// expected-remark @above {{layout of result #0 is #iree_vector_ext.layout<<[ BATCHX, LANEX], [1, 16]>, <[ BATCHY, VECTORX], [1, 16]>>}} |
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.
I did not know that the patch would update the test. I thought that the TileSwizzle things are only used on data-tiling path. Is it used by other work today?
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.
Yes, as of #18953, it is also used to compute iree_vector_ext.layout
.
compiler/src/iree/compiler/Codegen/Dialect/GPU/IR/GPUTileSwizzleUtils.cpp
Outdated
Show resolved
Hide resolved
d0eb097
to
47232f2
Compare
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, thanks
Signed-off-by: Benoit Jacob <[email protected]>
47232f2
to
3081305
Compare
…19105) In `getIntrinsicSwizzle`, we had a slightly roundabout way of constructing the swizzle from the `SingleSubgroupLayout`. We started from the `thread` dims, which we used unconditionally even if they had the value 1, leading to unit dims; and then we inserted the `element` dims *on the inside*, which required custom manipulation of the `swizzle` field. Now we just start from the `element` dims and work our way outwards from there, which means we can reuse the same helper that used to be named `unroll` and that we rename here to `expand` in preparation for iree-org#19102, and which we also move to be a `static` helper since it's no longer used outside of this file. --------- Signed-off-by: Benoit Jacob <[email protected]>
…19105) In `getIntrinsicSwizzle`, we had a slightly roundabout way of constructing the swizzle from the `SingleSubgroupLayout`. We started from the `thread` dims, which we used unconditionally even if they had the value 1, leading to unit dims; and then we inserted the `element` dims *on the inside*, which required custom manipulation of the `swizzle` field. Now we just start from the `element` dims and work our way outwards from there, which means we can reuse the same helper that used to be named `unroll` and that we rename here to `expand` in preparation for iree-org#19102, and which we also move to be a `static` helper since it's no longer used outside of this file. --------- Signed-off-by: Benoit Jacob <[email protected]> Signed-off-by: Giacomo Serafini <[email protected]>
In
getIntrinsicSwizzle
, we had a slightly roundabout way of constructing the swizzle from theSingleSubgroupLayout
. We started from thethread
dims, which we used unconditionally even if they had the value 1, leading to unit dims; and then we inserted theelement
dims on the inside, which required custom manipulation of theswizzle
field. Now we just start from theelement
dims and work our way outwards from there, which means we can reuse the same helper that used to be namedunroll
and that we rename here toexpand
in preparation for #19102, and which we also move to be astatic
helper since it's no longer used outside of this file.