zxybazh commented on a change in pull request #10049:
URL: https://github.com/apache/tvm/pull/10049#discussion_r791241498
##########
File path: src/meta_schedule/integration.cc
##########
@@ -112,7 +114,21 @@ ApplyHistoryBest::ApplyHistoryBest(Database database) {
Optional<ObjectRef> ApplyHistoryBestNode::Query(runtime::String task_name,
IRModule mod,
Optional<Array<IRModule>>
dispatched) {
- throw;
+ ICHECK(dispatched.defined());
+ ICHECK_EQ(dispatched.value().size(), 1);
+ ICHECK(HasOnlyOneFunction<relay::Function>(mod)) << mod;
+ IRModule prim_mod = dispatched.value()[0];
+ ICHECK(HasOnlyOneFunction<tir::PrimFunc>(prim_mod)) << prim_mod;
+ // Unify func name to make sure it can be found in database
+ prim_mod = UnifyFuncName(prim_mod);
+ if (database->HasWorkload(prim_mod)) {
+ Array<TuningRecord> records =
database->GetTopK(database->CommitWorkload(prim_mod), 1);
+ if (records.size() == 1) {
Review comment:
Good question. Here I don't think we need to do the check because
`HasWorkload` implies the workload is in the workload registery but does not
imply we have a valid tuning record with workload inside of the database.
Therefore, I removed such check 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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]