You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2022/01/18 12:54:11 UTC

[GitHub] [tvm] wrongtest opened a new pull request #9958: [Fix] Fix flaky test of #9952

wrongtest opened a new pull request #9958:
URL: https://github.com/apache/tvm/pull/9958


   fix https://github.com/apache/tvm/issues/9952


-- 
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: commits-unsubscribe@tvm.apache.org

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



[GitHub] [tvm] wrongtest commented on a change in pull request #9958: [Fix] Fix flaky test of #9952

Posted by GitBox <gi...@apache.org>.
wrongtest commented on a change in pull request #9958:
URL: https://github.com/apache/tvm/pull/9958#discussion_r786751859



##########
File path: src/tir/transforms/ir_utils.cc
##########
@@ -278,7 +280,12 @@ Map<Var, Range> ConditionalBoundsContext::GetVarBoundsFromCondition() {
         }
       });
       if (is_simple && !cand_vars.empty()) {
-        for (const Var& var : cand_vars) var_set.insert(var);
+        for (const Var& var : cand_vars) {
+          if (!var_set.count(var)) {
+            vars.push_back(var);
+            var_set.insert(var);
+          }
+        }

Review comment:
       > std::find(vars.begin(), vars.end(), var) != vars.end()
   
   Thanks for the advice~ I would lchange to O(n) search and commit to retrigger CI again.
   

##########
File path: src/tir/transforms/ir_utils.cc
##########
@@ -278,7 +280,12 @@ Map<Var, Range> ConditionalBoundsContext::GetVarBoundsFromCondition() {
         }
       });
       if (is_simple && !cand_vars.empty()) {
-        for (const Var& var : cand_vars) var_set.insert(var);
+        for (const Var& var : cand_vars) {
+          if (!var_set.count(var)) {
+            vars.push_back(var);
+            var_set.insert(var);
+          }
+        }

Review comment:
       > std::find(vars.begin(), vars.end(), var) != vars.end()
   
   Thanks for the advice~ I would change to O(n) search and commit to retrigger CI again.
   




-- 
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: commits-unsubscribe@tvm.apache.org

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



[GitHub] [tvm] MasterJH5574 commented on pull request #9958: [Fix] Fix flaky test of #9952

Posted by GitBox <gi...@apache.org>.
MasterJH5574 commented on pull request #9958:
URL: https://github.com/apache/tvm/pull/9958#issuecomment-1015391918


   Thanks @wrongtest for the fix! If you can make sure the indeterminism doesn't happen again, please also kindly revert this hot fix PR (#9956) by removing the "skip" mark and the pytest import.
   
   cc @junrushao1994 @Hzfengsy 


-- 
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: commits-unsubscribe@tvm.apache.org

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



[GitHub] [tvm] MasterJH5574 commented on a change in pull request #9958: [Fix] Fix flaky test of #9952

Posted by GitBox <gi...@apache.org>.
MasterJH5574 commented on a change in pull request #9958:
URL: https://github.com/apache/tvm/pull/9958#discussion_r786740740



##########
File path: src/tir/transforms/ir_utils.cc
##########
@@ -278,7 +280,12 @@ Map<Var, Range> ConditionalBoundsContext::GetVarBoundsFromCondition() {
         }
       });
       if (is_simple && !cand_vars.empty()) {
-        for (const Var& var : cand_vars) var_set.insert(var);
+        for (const Var& var : cand_vars) {
+          if (!var_set.count(var)) {
+            vars.push_back(var);
+            var_set.insert(var);
+          }
+        }

Review comment:
       Personally I recommend using `std::find(vars.begin(), vars.end(), var) != vars.end()` instead of using a `var_set` for looking up, because usually we don't have few variables and the map doesn't bring performance improvement :-)




-- 
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: commits-unsubscribe@tvm.apache.org

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



[GitHub] [tvm] junrushao1994 merged pull request #9958: [Fix] Fix flaky test of #9952

Posted by GitBox <gi...@apache.org>.
junrushao1994 merged pull request #9958:
URL: https://github.com/apache/tvm/pull/9958


   


-- 
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: commits-unsubscribe@tvm.apache.org

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