-
Notifications
You must be signed in to change notification settings - Fork 663
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
[DT] Unify encoding materialization pass into a single pass. #19454
Conversation
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.
Very nice reorganization!
@@ -161,6 +161,11 @@ const char *getIreeArchNameForTargetTriple(llvm::Triple triple) { | |||
return "unknown"; | |||
} | |||
|
|||
bool isLLVMCPUBackend(IREE::HAL::ExecutableTargetAttr targetAttr) { | |||
return targetAttr && | |||
targetAttr.getBackend().getValue().starts_with("llvm-cpu"); |
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.
Can't you just check equality ? Why starts_with? If that was copying the vmvx case below, I might have done that out of ignorance in the past.
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.
Oh, yes. Thanks for pointing it out! I'm mainly following the other cases, but can definitely check equality.
Signed-off-by: hanhanW <hanhan0912@gmail.com>
also update cpu targets in llvmcpu_materialize_encoding.mlir Signed-off-by: hanhanW <hanhan0912@gmail.com>
Signed-off-by: hanhanW <hanhan0912@gmail.com>
Signed-off-by: hanhanW <hanhan0912@gmail.com>
…rns.cpp Signed-off-by: hanhanW <hanhan0912@gmail.com>
Signed-off-by: hanhanW <hanhan0912@gmail.com>
9005f5a
to
0f6ac93
Compare
Signed-off-by: hanhanW <hanhan0912@gmail.com>
Signed-off-by: hanhanW <hanhan0912@gmail.com>
1a13342
to
5224968
Compare
The revision creates a generic materialization pass and uses it for backends that implement data-tiling. After months of development, we identify that the needs of GPU is a superset of the needs of CPU. To be more specific, it has the additional "swizzle" field in terms of layout. It means that the GPU set_encoding/unset_encoding lowering patterns cover the needs of CPU path. The lowering of contraction ops is different. CPU lowers it to mmt4d ops, while GPU lowers it to multi_mma op. However, the lowering of contraction is implemented through attribute interface. Thus, we can have a generic pattern to lower contraction ops.
To make the review process much easier, the revision is created by 5 commits.
Common/[CPU|GPU]/test
toCommon/test
.MaterializeEncodingPatterns.cpp
.The revision retains the MaterializeEncodingIntoNop pass, and add a TODO item. Because it is still used by MaterializeHomogeneousEncoding pass. It can be deleted once we deprecate the early materialization path.