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 afa0870  [MetaSchedule] bug fix ApplyHistoryBest. Previously, 
ApplyHistoryBest returned the incoming module without applying the tuning 
history. (#10183)
afa0870 is described below

commit afa0870e11c1bec2fff773c0f05e1a65d0ca08d6
Author: Sunghyun Park <[email protected]>
AuthorDate: Mon Feb 7 23:23:23 2022 -0800

    [MetaSchedule] bug fix ApplyHistoryBest. Previously, ApplyHistoryBest 
returned the incoming module without applying the tuning history. (#10183)
---
 src/meta_schedule/integration.cc | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/meta_schedule/integration.cc b/src/meta_schedule/integration.cc
index cc26b56..1ecb537 100644
--- a/src/meta_schedule/integration.cc
+++ b/src/meta_schedule/integration.cc
@@ -130,7 +130,11 @@ Optional<ObjectRef> 
ApplyHistoryBestNode::Query(runtime::String task_name, IRMod
     Array<TuningRecord> records = 
database->GetTopK(database->CommitWorkload(prim_mod), 1);
     if (records.size() == 1) {
       LOG(INFO) << "Applied history best for " << task_name << ".";
-      return records[0]->workload->mod;
+      tir::Schedule sch =
+          tir::Schedule::Traced(records[0]->workload->mod, /*seed=*/-1, 
/*debug_mask=*/0,
+                                
/*error_render_level=*/tir::ScheduleErrorRenderLevel::kNone);
+      records[0]->trace->ApplyToSchedule(sch, false);
+      return sch->mod();
     }
   }
   return NullOpt;

Reply via email to