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/04/08 08:34:28 UTC

[GitHub] [tvm] masahi commented on a diff in pull request #10937: [Metaschedule] Enable continuing tuning after schedule application failure

masahi commented on code in PR #10937:
URL: https://github.com/apache/tvm/pull/10937#discussion_r845874702


##########
src/meta_schedule/task_scheduler/task_scheduler.cc:
##########
@@ -127,7 +128,20 @@ void TaskSchedulerNode::Tune() {
     ICHECK(!task->is_terminated);
     ICHECK(!task->runner_futures.defined());
     SearchStrategy strategy = task->search_strategy.value();
-    if ((task->measure_candidates = strategy->GenerateMeasureCandidates()).defined()) {
+    Optional<Array<MeasureCandidate>> candidates = strategy->GenerateMeasureCandidates();
+    if (candidates.defined()) {
+      // Filter out invalid candidates.
+      // An invalid candidate can arise due to a schedule application failure (e.g. tensorize).
+      Array<MeasureCandidate> valid_candidates;
+      for (MeasureCandidate candidate : candidates.value()) {
+        if (candidate.defined()) {
+          valid_candidates.push_back(candidate);
+        }
+      }
+
+      if (valid_candidates.size() == 0) continue;

Review Comment:
   I'm not sure (1) if this case happens in practice, and (2) `continue` is the right thing to do here. 



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