-
Notifications
You must be signed in to change notification settings - Fork 631
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
[LLVMGPU] Support CastTypeToFitMMA on TransformDialect script. #17884
[LLVMGPU] Support CastTypeToFitMMA on TransformDialect script. #17884
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.
LGTM
|
||
if (scheduleAttr) { | ||
func.walk([&](vector::ContractionOp contract) { | ||
contract->setAttr("iree.amdgpu.mma", scheduleAttr.getIntrinsic()); |
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.
nit: I would check if the contract already has this attribute set and only set it if not present. Also maybe add a comment
// Import mma type from dispatch schedule attribute if present.
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.
That makes sense :)
…org#17884) Previously CastTypeToFitMMA relies on the `mma_schedule` attribute on the function's translationInfo to obtain information about `iree.amdgpu.mma`(intrnisic selected). While this is fine for C++ pipeline, the IR generated from TransformDialect script do not have such information. Instead IR generated in TD script typically annotate the `iree.amdgpu.mma`(intrnisic selected) directly on the vector.contractOps. This is a crucial part of enabling performant the latest attention compilation pipeline (with online attn + transpose fusion) which is based on TD scripts. --------- Co-authored-by: Kunwar Grover <[email protected]> Signed-off-by: Lubo Litchev <[email protected]>
Previously CastTypeToFitMMA relies on the
mma_schedule
attribute on the function's translationInfo to obtain information aboutiree.amdgpu.mma
(intrnisic selected).While this is fine for C++ pipeline, the IR generated from TransformDialect script do not have such information. Instead IR generated in TD script typically annotate the
iree.amdgpu.mma
(intrnisic selected) directly on the vector.contractOps.This is a crucial part of enabling performant the latest attention compilation pipeline (with online attn + transpose fusion) which is based on TD scripts.