MasterJH5574 commented on code in PR #15327:
URL: https://github.com/apache/tvm/pull/15327#discussion_r1264621628
##########
src/tir/transforms/lower_thread_allreduce.cc:
##########
@@ -676,8 +747,10 @@ class ThreadAllreduceBuilder final : public
StmtExprMutator {
if (reduce_extent == 1) {
return false; // no need to warp reduce
} else {
- if (warp_size_ % reduce_extent == 0) {
- return true; // warp size is multiple of reduce extent
+ if (warp_size_ % reduce_extent == 0 ||
+ (max_num_threads_ != -1 && max_num_threads_ <= warp_size_ *
warp_size_ &&
Review Comment:
To make the behavior for `-1` consistent with the behavior prior to this
pass, I think it’s fine not to throw.
If unknown number of threads is now allowed, it must be reported at
somewhere else.
##########
src/tir/transforms/lower_thread_allreduce.cc:
##########
@@ -676,8 +747,10 @@ class ThreadAllreduceBuilder final : public
StmtExprMutator {
if (reduce_extent == 1) {
return false; // no need to warp reduce
} else {
- if (warp_size_ % reduce_extent == 0) {
- return true; // warp size is multiple of reduce extent
+ if (warp_size_ % reduce_extent == 0 ||
+ (max_num_threads_ != -1 && max_num_threads_ <= warp_size_ *
warp_size_ &&
Review Comment:
To make the behavior for `-1` consistent with the behavior prior to this
pass, I think it’s fine not to throw.
If unknown number of threads is now allowed, it must be reported at
somewhere else.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]