Skip to content

Conversation

@hhkit
Copy link
Contributor

@hhkit hhkit commented Nov 27, 2025

Implementing this pass came up as a result of discussions in #22561, while we were implementing ExpReduction's implementation of AggregatedOpInterface. AggregatedOpInterface exposes decomposeOp which is called as part of a Transform dialect transformation (transform.structured.decompose, transform.iree.decompose_aggregate_op). However, we also call AggregatedOpInterface::decomposeOp as a step in many pipelines.

Therefore, in this PR we:

  • Add DecomposeAggregatedOpPass, which calls AggregatedOpInterface::decomposeOp and replaces original uses with the decomposed ops.
  • Added tests based on tests in the Transform dialect equivalent

For discussion:

  • Should we replace DecomposeAttention with this implementation? I noticed not every AggregatedOp fits into this neatly, as some decompositions (eg. decompose im2col) have custom options to take into account.
  • I have asked in Discord and grepped the upstream MLIR code base, because it can't be that something so common doesn't have an upstream equivalent (eg. a pass that invokes a Transform operation?) Happy to close this if anyone knows if there's one!

Signed-off-by: Ivan Ho <[email protected]>
@hhkit hhkit force-pushed the hhkit/decompose_aggregated_op_pass branch from 6f83753 to c29b07f Compare November 28, 2025 10:28
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.

1 participant