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



##########
File path: src/meta_schedule/integration.cc
##########
@@ -121,14 +113,18 @@ ApplyHistoryBest::ApplyHistoryBest(Database database) {
   data_ = n;
 }
 
-Optional<ObjectRef> ApplyHistoryBestNode::Query(runtime::String task_name, 
IRModule mod,
-                                                Target target,
-                                                Optional<Array<IRModule>> 
dispatched) {
+IRModule ApplyHistoryBestNode::Query(runtime::String task_name, IRModule mod, 
Target target,
+                                     Optional<Array<IRModule>> dispatched) {
   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;
+  // TODO(masahi): parse_mod below replaces the orginal function key with 
"main".
+  // This is necessary because some scheduling primitives requires the 
PrimFunc key be "main".

Review comment:
       Yeah interesting, didn't know that. But I don't think it is reasonable 
to require that every use of `get_block` be given the exact function name 
rather than `main`. So in practice, we had to use `Parse._mod` thing, which 
will simplify the use of `get_block` but make this function more complicated 
than necessary. I updated the TODO comment to be more precise. 
https://github.com/apache/tvm/pull/10578/commits/5c8800c8d32b27b12cf571e3a4e98767433e0345
   
   To remove `parse_mod` here, which I'd love to do, we also need to remove 
`Parse._mod` before tuning and require the exact function name to be passed to 
`get_block`. What do you think?   




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