Skip to content

Conversation

@LeiWang1999
Copy link
Contributor

@LeiWang1999 LeiWang1999 commented Jan 16, 2024

This is a fix of LowerCrossThreadReduction: The pass will remove all the loops with thread bind under the inter thread reduction block, which will introduce some issues when we meet the case where there could be other non-reduction blocks under the reduction thread.

Before removing a thread-bound loop, check if the block(s) under this loop has reduction block var. If the block(s) under have reduction do not have any reduction block var, it means that block is not reduction, and therefore this thread-bound loop should be kept. Otherwise, we remove the thread-bound loop as usual.

related discussion: https://discuss.tvm.apache.org/t/missing-thread-bind-loops-under-block-reduction-when-transformed-with-tir/16232/6

Please CC @MasterJH5574

@LeiWang1999 LeiWang1999 changed the title [TIR] Fix of inter thread reduction with shared memory prefetch. [TIR] Fix of inter thread reduction with shared memory prefetch Jan 16, 2024
@LeiWang1999
Copy link
Contributor Author

@tvm-bot rerun

@MasterJH5574
Copy link
Contributor

Thank you @LeiWang1999 for the fix! Could you also add a regression test case here in this file? https://github.com/apache/tvm/blob/main/tests/python/tir-transform/test_tir_transform_lower_cross_thread_reduction.py

@LeiWang1999
Copy link
Contributor Author

Thank you @LeiWang1999 for the fix! Could you also add a regression test case here in this file? https://github.com/apache/tvm/blob/main/tests/python/tir-transform/test_tir_transform_lower_cross_thread_reduction.py

for sure, please check out the update.

@LeiWang1999
Copy link
Contributor Author

@tvm-bot rerun

Update lower_cross_thread_reduction.cc
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