Skip to content

[Codegen][MXFP4] Adding SwizzleHintOp alloc flattening pass#23083

Merged
Muzammiluddin-Syed-ECE merged 7 commits intoiree-org:mainfrom
Muzammiluddin-Syed-ECE:muzasyed/flattening
Jan 16, 2026
Merged

[Codegen][MXFP4] Adding SwizzleHintOp alloc flattening pass#23083
Muzammiluddin-Syed-ECE merged 7 commits intoiree-org:mainfrom
Muzammiluddin-Syed-ECE:muzasyed/flattening

Conversation

@Muzammiluddin-Syed-ECE
Copy link
Copy Markdown
Contributor

This is the first 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 1, which does three things:

  • Loosens the restriction on SwizzleHintOp inputs needing to be a Shaped type of rank 1. We do this because things are a lot simpler during tiling when you can fold arbitrary shapes into the swizzle hint op and then flatten later.
  • Introduces a pass to flatten allocs associated to SwizzleHintOps.
  • Moves the verification of flatness of swizzle hint ops to the ResolveSwizzleHintOps pass, prior to removal.

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>
Signed-off-by: Muzammiluddin Syed <muzasyed@amd.com>
Copy link
Copy Markdown
Contributor

@krzysz00 krzysz00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm mod the one outstanding comment of Jakub's

@Muzammiluddin-Syed-ECE Muzammiluddin-Syed-ECE merged commit c925743 into iree-org:main Jan 16, 2026
51 of 54 checks passed
keshavvinayak01 pushed a commit that referenced this pull request Jan 27, 2026
This is the first 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 1, which does three things:
- Loosens the restriction on SwizzleHintOp inputs needing to be a Shaped
type of rank 1. We do this because things are a lot simpler during
tiling when you can fold arbitrary shapes into the swizzle hint op and
then flatten later.
- Introduces a pass to flatten allocs associated to `SwizzleHintOps`.
- Moves the verification of flatness of swizzle hint ops to the
`ResolveSwizzleHintOps` pass, prior to removal.

---------

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
…#23083)

This is the first 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 1, which does three things:
- Loosens the restriction on SwizzleHintOp inputs needing to be a Shaped
type of rank 1. We do this because things are a lot simpler during
tiling when you can fold arbitrary shapes into the swizzle hint op and
then flatten later.
- Introduces a pass to flatten allocs associated to `SwizzleHintOps`.
- Moves the verification of flatness of swizzle hint ops to the
`ResolveSwizzleHintOps` pass, prior to removal.

---------

Signed-off-by: Muzammiluddin Syed <muzasyed@amd.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants