masahi commented on a change in pull request #10578:
URL: https://github.com/apache/tvm/pull/10578#discussion_r826604250



##########
File path: src/relay/backend/te_compiler_cache.cc
##########
@@ -335,15 +336,14 @@ class ScheduleBuilder : public ExprVisitor {
         }
       }
       if (backend::IsMetaScheduleEnabled()) {
-        prim_func = tir::CreatePrimFunc(Concat(fn_inputs, tensor_outs));
-        Optional<ObjectRef> opt_mod_or_base_func =
-            meta_schedule::MetaScheduleContext::QueryInsideWithScope(
-                prim_fn_var->name_hint, IRModule({{prim_fn_var, relay_func}}), 
target_,
-                Array<IRModule>{IRModule({{prim_fn_var, prim_func}})});
-        if (const auto* result = opt_mod_or_base_func.as<tir::PrimFuncNode>()) 
{
-          prim_func = GetRef<tir::PrimFunc>(result);
-        } else {
-          prim_func = tir::PrimFunc(nullptr);
+        auto relay_mod = IRModule({{prim_fn_var, relay_func}});
+        auto tir_mod =
+            IRModule({{prim_fn_var, tir::CreatePrimFunc(Concat(fn_inputs, 
tensor_outs))}});
+        IRModule scheduled_mod = 
meta_schedule::MetaScheduleContext::QueryInsideWithScope(
+            prim_fn_var->name_hint, relay_mod, target_, 
Array<IRModule>{tir_mod});
+        if (scheduled_mod.defined()) {

Review comment:
       ok done in 
https://github.com/apache/tvm/pull/10578/commits/c163af17cde9b2290172de1549cea72c4359f474




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


Reply via email to