This is an automated email from the ASF dual-hosted git repository.
junrushao pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git
The following commit(s) were added to refs/heads/main by this push:
new b0b8d3eda0 [MeteSchedule] Bugfix: Add checks for nullable `run_secs`
(#13790)
b0b8d3eda0 is described below
commit b0b8d3eda08768eec339e5f43ad3b737a0fdba97
Author: Bohan Hou <[email protected]>
AuthorDate: Sun Jan 15 22:45:58 2023 -0500
[MeteSchedule] Bugfix: Add checks for nullable `run_secs` (#13790)
Runner sec is an Optional ObjectRef, so we need to check it's defined
before we access its value.
---
src/meta_schedule/measure_callback/update_cost_model.cc | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/meta_schedule/measure_callback/update_cost_model.cc
b/src/meta_schedule/measure_callback/update_cost_model.cc
index 6c217a6c4d..63c32b189e 100644
--- a/src/meta_schedule/measure_callback/update_cost_model.cc
+++ b/src/meta_schedule/measure_callback/update_cost_model.cc
@@ -44,7 +44,8 @@ class UpdateCostModelNode : public MeasureCallbackNode {
for (int i = 0; i < n; i++) {
if (!builder_results[i]->error_msg.defined() && //
(runner_results[i]->error_msg.defined() || //
- Sum(runner_results[i]->run_secs.value()) > 0)) {
+ (runner_results[i]->run_secs.defined() &&
+ Sum(runner_results[i]->run_secs.value()) > 0))) {
pruned_candidate.push_back(measure_candidates[i]);
pruned_runner_result.push_back(runner_results[i]);
}