[TIRx][Schedule] Support rfactor for arg reducers selecting last index#19909
[TIRx][Schedule] Support rfactor for arg reducers selecting last index#19909ZephyrLi-pro wants to merge 1 commit into
Conversation
4fcb683 to
590577a
Compare
There was a problem hiding this comment.
Code Review
This pull request introduces support for argmax and argmin reducers with select_last_index=True (preferring the last occurrence) in the TIR schedule reduction primitive. It adds the corresponding reducer implementations in reduction.cc and includes comprehensive unit tests in test_tir_schedule_rfactor.py to verify the correctness of rfactor scheduling on these new reducers. There are no review comments, so we have no additional feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
@tvm-bot rerun |
This PR extends
rfactorreducer pattern matching to support TOPIargmax/argminwithselect_last_index=True.For
select_last_index=True, ties should be resolved by choosing the larger index. The added reducer patterns preserve the existing value comparison semantics, then uselhs_idx > rhs_idxas the tie-break condition.Tests are added for applying
rfactortotopi.argmaxandtopi.argminwithselect_last_index=True.