tvm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-tvm] wpan11nv commented on a change in pull request #5551: [Reduction] Fix cross thread reduction
Date Thu, 14 May 2020 16:29:42 GMT

wpan11nv commented on a change in pull request #5551:
URL: https://github.com/apache/incubator-tvm/pull/5551#discussion_r425272357



##########
File path: src/te/operation/cross_thread_reduction.cc
##########
@@ -48,9 +97,18 @@ Stmt MakeCrossThreadReduction(const ComputeOpNode* self, const Stage&
stage,
     CHECK(reduce);
     reduces[i] = reduce;
   }
-  PrimExpr cond = reduces[0]->condition;
-  for (PrimExpr v : conds) {
-    cond = cond && v;
+
+  // This computes the bound checking predicates in normal reduction.
+  auto normal_preds =
+      MakeBoundCheck(stage, dom_map, value_map, false, std::unordered_set<IterVar>());
+
+  // The existing reduction predicate (only from the first one one?)
+  PrimExpr input_pred = reduces[0]->condition;
+
+  // normal_pred = input_pred && normal_pred
+  normal_preds.push_back(input_pred);
+  for (PrimExpr v : normal_preds) {
+    if (v.defined()) normal_preds.push_back(v);
   }

Review comment:
       Yes, this looks odd. I saw null predicates in this vector. So this is to remove them.
Let me add a comment. 




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



Mime
View raw message