[Codegen][MXFP4] Add folding patterns for tensor.empty op that can bypass SwizzleHintOps#23084
Merged
Muzammiluddin-Syed-ECE merged 11 commits intoiree-org:mainfrom Jan 16, 2026
Merged
Conversation
Contributor
Author
|
Note we can eventually upstream this change to llvm-project once the SwizzleHintOp is more widely used. |
krzysz00
reviewed
Jan 14, 2026
Contributor
krzysz00
left a comment
There was a problem hiding this comment.
I don't see anything wrong here but I'd like to wait for more comments
kuhar
reviewed
Jan 14, 2026
Member
kuhar
left a comment
There was a problem hiding this comment.
Can you also add tests for the changes in gpu apply tiling level?
compiler/src/iree/compiler/Codegen/Dialect/GPU/Transforms/Transforms.cpp
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Dialect/GPU/Transforms/Transforms.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Dialect/GPU/Transforms/Transforms.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Dialect/GPU/Transforms/Transforms.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Dialect/GPU/Transforms/Transforms.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Dialect/GPU/Transforms/Transforms.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Dialect/GPU/Transforms/Transforms.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Dialect/GPU/Transforms/Transforms.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Common/GPU/test/gpu_fold_swizzle_hint_ops.mlir
Outdated
Show resolved
Hide resolved
kuhar
reviewed
Jan 15, 2026
compiler/src/iree/compiler/Codegen/Dialect/GPU/Transforms/Transforms.cpp
Outdated
Show resolved
Hide resolved
kuhar
reviewed
Jan 15, 2026
compiler/src/iree/compiler/Codegen/Dialect/GPU/Transforms/Transforms.cpp
Show resolved
Hide resolved
kuhar
reviewed
Jan 15, 2026
compiler/src/iree/compiler/Codegen/Dialect/GPU/Transforms/Transforms.cpp
Outdated
Show resolved
Hide resolved
Signed-off-by: Muzammiluddin Syed <muzasyed@amd.com>
Signed-off-by: Muzammiluddin Syed <muzasyed@amd.com>
Signed-off-by: Muzammiluddin Syed <muzasyed@amd.com>
Signed-off-by: Muzammiluddin Syed <muzasyed@amd.com>
Signed-off-by: Muzammiluddin Syed <muzasyed@amd.com>
Signed-off-by: Muzammiluddin Syed <muzasyed@amd.com>
d8287cc to
a1cdcc5
Compare
Signed-off-by: Muzammiluddin Syed <muzasyed@amd.com>
Signed-off-by: Muzammiluddin Syed <muzasyed@amd.com>
Signed-off-by: Muzammiluddin Syed <muzasyed@amd.com>
kuhar
reviewed
Jan 15, 2026
compiler/src/iree/compiler/Codegen/Dialect/GPU/Transforms/Transforms.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/Codegen/Dialect/GPU/Transforms/Transforms.cpp
Outdated
Show resolved
Hide resolved
Signed-off-by: Muzammiluddin Syed <muzasyed@amd.com>
kuhar
approved these changes
Jan 15, 2026
keshavvinayak01
pushed a commit
that referenced
this pull request
Jan 27, 2026
…pass SwizzleHintOps (#23084) This is the second of a series of PRs that together implement support in IREE for XOR swizzling through the SwizzleHintOp. There are four PRs that need to be merged: 1) Allow rank > 1 swizzle hint op operands and add a pass to flatten swizzle hint allocs. 2) Add patterns which can fold reshapes and `extract_slice` ops into empty ops through swizzle hint ops. 3) Add swizzle hint attribute to be set in `lowering_config` and consumed in `GPUPromoteMatmulOperandsPass`. 4) Update `LLVMGPUSelectLoweringStrategy` Pass to set xor swizzles for MXFP4 GEMMs. This is PR 2, which does two things: - duplicates folding patterns for tensor.empty op from upstream llvm-project in IREE, but with support for swizzle hint ops. - Adds these patterns to the `GPUApplyTilingPass`. --------- Signed-off-by: Muzammiluddin Syed <muzasyed@amd.com> Signed-off-by: Keshav Vinayak Jha <keshavvinayakjha@gmail.com>
MaheshRavishankar
pushed a commit
to MaheshRavishankar/iree
that referenced
this pull request
Feb 24, 2026
…pass SwizzleHintOps (iree-org#23084) This is the second of a series of PRs that together implement support in IREE for XOR swizzling through the SwizzleHintOp. There are four PRs that need to be merged: 1) Allow rank > 1 swizzle hint op operands and add a pass to flatten swizzle hint allocs. 2) Add patterns which can fold reshapes and `extract_slice` ops into empty ops through swizzle hint ops. 3) Add swizzle hint attribute to be set in `lowering_config` and consumed in `GPUPromoteMatmulOperandsPass`. 4) Update `LLVMGPUSelectLoweringStrategy` Pass to set xor swizzles for MXFP4 GEMMs. This is PR 2, which does two things: - duplicates folding patterns for tensor.empty op from upstream llvm-project in IREE, but with support for swizzle hint ops. - Adds these patterns to the `GPUApplyTilingPass`. --------- Signed-off-by: Muzammiluddin Syed <muzasyed@amd.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is the second of a series of PRs that together implement support in IREE for XOR swizzling through the SwizzleHintOp.
There are four PRs that need to be merged:
extract_sliceops into empty ops through swizzle hint ops.lowering_configand consumed inGPUPromoteMatmulOperandsPass.LLVMGPUSelectLoweringStrategyPass to set xor swizzles for MXFP4 GEMMs.This is PR 2, which does two things:
GPUApplyTilingPass.