-
Notifications
You must be signed in to change notification settings - Fork 611
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
[Im2col] Allow multiple batch, M, and K dimensions on im2col result #18593
Conversation
83997e3
to
3906d86
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.
First round of review comments, please take a look. I still need to ramp up context for a deeper review.
compiler/src/iree/compiler/Dialect/LinalgExt/IR/test/roundtrip.mlir
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Dialect/LinalgExt/Transforms/AggregatedOpInterfaceImpl.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Dialect/LinalgExt/Transforms/AggregatedOpInterfaceImpl.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Dialect/LinalgExt/Transforms/AggregatedOpInterfaceImpl.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Dialect/LinalgExt/Transforms/AggregatedOpInterfaceImpl.cpp
Show resolved
Hide resolved
compiler/src/iree/compiler/Dialect/LinalgExt/Transforms/TilingInterfaceImpl.cpp
Outdated
Show resolved
Hide resolved
3906d86
to
4d539e4
Compare
compiler/src/iree/compiler/Dialect/LinalgExt/IR/LinalgExtOps.td
Outdated
Show resolved
Hide resolved
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.
Ok this looks fine to me but I think we should keep an eye on this op and evaluate what it is giving us in the long run. It is starting to track a lot of state that might be better to model as a generic gather.
compiler/src/iree/compiler/Dialect/LinalgExt/Transforms/AggregatedOpInterfaceImpl.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Dialect/LinalgExt/Transforms/TilingInterfaceImpl.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Dialect/LinalgExt/Transforms/test/tiling.mlir
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Dialect/LinalgExt/Transforms/test/tiling.mlir
Show resolved
Hide resolved
compiler/src/iree/compiler/Dialect/LinalgExt/Transforms/test/tiling.mlir
Outdated
Show resolved
Hide resolved
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.
just one nit in verifier.
7a3733d
to
332a73e
Compare
Signed-off-by: Max Dawkins <max.dawkins@gmail.com>
Signed-off-by: Max Dawkins <max.dawkins@gmail.com>
Signed-off-by: Max Dawkins <max.dawkins@gmail.com>
Signed-off-by: Max Dawkins <max.dawkins@gmail.com>
Signed-off-by: Max Dawkins <max.dawkins@gmail.com>
Signed-off-by: Max Dawkins <max.dawkins@gmail.com>
332a73e
to
eda4108
Compare
This is following up on #18593, which enabled support for expanded result shapes in the im2col op. This PR changes the rewrite patterns for conv into IGEMM to use the expanded H and W dimensions, rather than inserting collapse_shape and expand_shape ops. --------- Signed-off-by: Max Dawkins <max.dawkins@gmail.com>
This PR adds support for multiple M and K dimensions in the result of the im2col op. New metadata is added for correctly tracking the offsets into the M and K dimensions along the multiple dimensions. New
m_basis
andk_basis
fields are added to the op, which represent a basis for linearizing them_offset
andk_offset
fields.The motivation for doing this is that flattening the M dimension can create an expand_shape op consumer of the resulting matmul. This can cause issues with fusion and distribution, so it is useful to be able to keep the multiple M dimensions intact. This PR does not change any behavior of Conv2DToIm2col pass, which will be done in a later PR.