Skip to content

[LLVMGPU] Add relayout combination behind a flag - #21076

Merged
Max191 merged 1 commit into
iree-org:mainfrom
Max191-agents:add-relayout-combination-passes
Jun 13, 2025
Merged

Max191 merged 1 commit into
iree-org:mainfrom
Max191-agents:add-relayout-combination-passes

Conversation

@Max191

@Max191 Max191 commented Jun 11, 2025

Copy link
Copy Markdown
Contributor

Adds the BufferizeDispatchTensorLoadStorePass and the GPUCombineLayoutTransformationPass to the LLVMGPU configuration pipeline behind a new test flag, iree-llvmgpu-test-combine-layout-transformation. Also adds a pipeline test for the new configuration path.

This will allow for enabling e2e tests for the map_scatter op, and some more complex data tiling fusions, while work for supporting map_scatter on the LLVMGPUVectorDistribute pipeline is in progress. Once the LLVMGPUVectorDistribute supports map_scatter, and the LLVMGPUWarpReduction pipeline is deprecated, then the flag can be flipped on by default.

@Max191
Max191 force-pushed the add-relayout-combination-passes branch from 31d9583 to 09025e6 Compare June 11, 2025 16:01
@Max191
Max191 requested a review from hanhanW June 12, 2025 17:45
Max191 added a commit that referenced this pull request Jun 12, 2025
Enables the map_scatter op e2e tests for rocm, the
`iree-llvmgpu-test-combine-layout-transformation` flag (from
#21076) is not needed, since the
map_scatter op is present in the input IR.

Signed-off-by: Max Dawkins <[email protected]>
// CHECK-NEXT: arith.truncf
// CHECK: %[[MAP_SCATTER:.+]] = iree_linalg_ext.map_scatter %[[COMPUTE_OP]]
// CHECK: iree_codegen.store_to_buffer %[[MAP_SCATTER]], %[[DEST_BUFFER]]
// CHECK: scf.forall

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I am confused why there is an scf.forall after the store to buffer.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is for writing the padding values. It also needs to be distributed, so it gets distributed to workgroups and threads separately.

@qedawkins qedawkins left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approving because this change in and of itself looks fine to me, but agree that the lit checks look strange

@MaheshRavishankar MaheshRavishankar left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Clarified after offline discussion with Max.

@Max191
Max191 merged commit 925f2f1 into iree-org:main Jun 13, 2025
@Max191
Max191 deleted the add-relayout-combination-passes branch June 13, 2025 19:18
AWoloszyn pushed a commit that referenced this pull request Dec 1, 2025
Enables the map_scatter op e2e tests for rocm, the
`iree-llvmgpu-test-combine-layout-transformation` flag (from
#21076) is not needed, since the
map_scatter op is present in the input IR.

Signed-off-by: Max Dawkins <[email protected]>
AWoloszyn pushed a commit that referenced this pull request Dec 1, 2025
Adds the `BufferizeDispatchTensorLoadStorePass` and the
`GPUCombineLayoutTransformationPass` to the LLVMGPU configuration
pipeline behind a new test flag,
`iree-llvmgpu-test-combine-layout-transformation`. Also adds a pipeline
test for the new configuration path.

This will allow for enabling e2e tests for the map_scatter op, and some
more complex data tiling fusions, while work for supporting map_scatter
on the LLVMGPUVectorDistribute pipeline is in progress. Once the
`LLVMGPUVectorDistribute` supports map_scatter, and the
`LLVMGPUWarpReduction` pipeline is deprecated, then the flag can be
flipped on by default.

Signed-off-by: Max Dawkins <[email protected]>
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