Skip to content

[LinalgExt] add TilingInterface support for ArgCompareOp - #21077

Merged
bangtianliu merged 4 commits into
iree-org:mainfrom
bangtianliu:argmax_tiling
Jun 26, 2025
Merged

bangtianliu merged 4 commits into
iree-org:mainfrom
bangtianliu:argmax_tiling

Conversation

@bangtianliu

@bangtianliu bangtianliu commented Jun 11, 2025 •

Copy link
Copy Markdown
Contributor

This PR adds tiling support for the iree_linalg_ext.argmax operation by implementing the tiling interface. The following methods are introduced:

  • getLoopIteratorTypes
  • getResultTilePosition
  • getTiledImplementation
  • generateResultTileValue

Additionally, corresponding test cases are provided to verify the tiling behavior for both tensor and memref cases.

@bangtianliu
bangtianliu marked this pull request as draft June 11, 2025 16:10
@bangtianliu
bangtianliu force-pushed the argmax_tiling branch 2 times, most recently from babdd5c to 4003960 Compare June 12, 2025 20:54
@bangtianliu
bangtianliu requested review from IanWood1 and kuhar June 12, 2025 21:00
@bangtianliu
bangtianliu marked this pull request as ready for review June 12, 2025 21:00
@bangtianliu
bangtianliu requested a review from Max191 June 12, 2025 21:02
@kuhar
kuhar requested review from Groverkss June 12, 2025 21:03

@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.

Yeah, I am not sure the current op definition allows you to tile appropriately. See #21021 (comment) . Let me know if you want to chat more offline.

@bangtianliu

bangtianliu commented Jun 13, 2025 •

Copy link
Copy Markdown
Contributor Author

Yeah, I am not sure the current op definition allows you to tile appropriately. See #21021 (comment) . Let me know if you want to chat more offline.

Yes, the operation is tileable. I plan to add support for regions and the global start index in a follow-up PR. My mindset with was to keep the initial implementation simple to make it easier to review (I sent a detailed reply below your comment). Happy to discuss more offline whenever it is convenient for you.

Signed-off-by: Bangtian Liu <[email protected]>
@bangtianliu
bangtianliu requested a review from IanWood1 June 25, 2025 22:36

@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.

Nice! Thanks!

@bangtianliu
bangtianliu merged commit 3078d3f into iree-org:main Jun 26, 2025
@bangtianliu bangtianliu changed the title [LinalgExt] add TilingInterface support for ArgmaxOp [LinalgExt] add TilingInterface support for ArgCompareOp Jun 26, 2025
AWoloszyn pushed a commit that referenced this pull request Dec 1, 2025
This PR adds tiling support for the `iree_linalg_ext.argmax` operation
by implementing the tiling interface. The following methods are
introduced:
- `getLoopIteratorTypes`
- `getResultTilePosition`
- `getTiledImplementation`
- `generateResultTileValue`

Additionally, corresponding test cases are provided to verify the tiling
behavior for both tensor and memref cases.

---------

Signed-off-by: Bangtian Liu <[email protected]>
bangtianliu added a commit that referenced this pull request Jan 19, 2026
…de (#23193)

This PR extends the tiling interface implementation for `ArgCompareOp`
to support explicit-index mode (2 inputs: value + pre-computed indices),
which was introduced in PR #23153.

 **Key changes:**
- Extended `getTiledImplementation` (introduced in PR #21077) to slice
both value and index inputs in explicit-index mode
- Extended `generateScalarImplementation` (convert_to_loops) (introduced
in PR #21138) to load indices from input instead of computing from
iteration variables in explicit-index mode

Signed-off-by: Bangtian Liu <[email protected]>
keshavvinayak01 pushed a commit that referenced this pull request Jan 27, 2026
…de (#23193)

This PR extends the tiling interface implementation for `ArgCompareOp`
to support explicit-index mode (2 inputs: value + pre-computed indices),
which was introduced in PR #23153.

 **Key changes:**
- Extended `getTiledImplementation` (introduced in PR #21077) to slice
both value and index inputs in explicit-index mode
- Extended `generateScalarImplementation` (convert_to_loops) (introduced
in PR #21138) to load indices from input instead of computing from
iteration variables in explicit-index mode

Signed-off-by: Bangtian Liu <[email protected]>
Signed-off-by: Keshav Vinayak Jha <[email protected]>
MaheshRavishankar pushed a commit to MaheshRavishankar/iree that referenced this pull request Feb 24, 2026
…de (iree-org#23193)

This PR extends the tiling interface implementation for `ArgCompareOp`
to support explicit-index mode (2 inputs: value + pre-computed indices),
which was introduced in PR iree-org#23153.

 **Key changes:**
- Extended `getTiledImplementation` (introduced in PR iree-org#21077) to slice
both value and index inputs in explicit-index mode
- Extended `generateScalarImplementation` (convert_to_loops) (introduced
in PR iree-org#21138) to load indices from input instead of computing from
iteration variables in explicit-index mode

Signed-off-by: Bangtian Liu <[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.

5 participants