You are viewing a plain text version of this content. The canonical link for it is here.
Posted to discuss-archive@tvm.apache.org by "cbalint13 (via GitHub)" <gi...@apache.org> on 2026/06/14 17:17:00 UTC

[PR] [MetaScheduler] Improve print info about builder/runner state [tvm]

cbalint13 opened a new pull request, #19767:
URL: https://github.com/apache/tvm/pull/19767

   
   Adds on-screen info about samples that failed to build, that may happen in early stages.
   
   ----------
   
   #### Before:
   ```
   2026-06-14 18:36:30 [INFO] [task_scheduler.cc:196] TaskScheduler picks Task #0: "dense"
   2026-06-14 18:36:32 [INFO] [task_scheduler.cc:209] Sending 64 sample(s) to builder
   2026-06-14 18:38:47 [INFO] [task_scheduler.cc:211] Sending 64 sample(s) to runner
   
   ```
   
   #### After:
   ```
   2026-06-14 19:53:23 [INFO] [task_scheduler.cc:193] TaskScheduler picks Task #0: "dense"
   2026-06-14 19:53:25 [INFO] [task_scheduler.cc:206] Sending 64 sample(s) to builder
   2026-06-14 19:55:39 [INFO] [task_scheduler.cc:215] Build errors: 64 sample(s)
   2026-06-14 19:55:39 [INFO] [task_scheduler.cc:217] Sending 0 valid sample(s) to runner
   ```
   


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

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


---------------------------------------------------------------------
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For additional commands, e-mail: discuss-archive-help@tvm.apache.org


Re: [PR] [MetaScheduler] Improve print info about builder/runner state [tvm]

Posted by "gemini-code-assist[bot] (via GitHub)" <gi...@apache.org>.
gemini-code-assist[bot] commented on code in PR #19767:
URL: https://github.com/apache/tvm/pull/19767#discussion_r3409927575


##########
src/s_tir/meta_schedule/task_scheduler/task_scheduler.cc:
##########
@@ -205,7 +205,18 @@ void TaskSchedulerNode::Tune(ffi::Array<TuneContext> ctxs, ffi::Array<FloatImm>
       num_trials_already += num_candidates;
       TVM_PY_LOG(INFO, this->logger) << "Sending " << num_candidates << " sample(s) to builder";
       SendToBuilder(task, builder);
-      TVM_PY_LOG(INFO, this->logger) << "Sending " << num_candidates << " sample(s) to runner";
+      int n_build_errs = 0;
+      const int n_build_size = task->builder_results.value().size();
+      for (int i = 0; i < n_build_size; i++) {
+        if (task->builder_results.value()[i]->error_msg.has_value())
+          ++n_build_errs;
+      }

Review Comment:
   ![medium](https://www.gstatic.com/codereviewagent/medium-priority.svg)
   
   Calling `task->builder_results.value()` inside the loop is inefficient because it repeatedly unwraps the `Optional` and potentially copies or increments/decrements the reference count of the `ffi::Array` on every iteration. It is much more efficient to retrieve the array once before the loop.
   
   ```c
         int n_build_errs = 0;
         const ffi::Array<BuilderResult>& builder_results = task->builder_results.value();
         const int n_build_size = builder_results.size();
         for (int i = 0; i < n_build_size; i++) {
           if (builder_results[i]->error_msg.has_value())
             ++n_build_errs;
         }
   ```



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

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


---------------------------------------------------------------------
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For additional commands, e-mail: discuss-archive-help@tvm.apache.org


Re: [PR] [MetaScheduler] Improve print info about builder/runner state [tvm]

Posted by "tqchen (via GitHub)" <gi...@apache.org>.
tqchen merged PR #19767:
URL: https://github.com/apache/tvm/pull/19767


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

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


---------------------------------------------------------------------
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For additional commands, e-mail: discuss-archive-help@tvm.apache.org