masahi commented on a change in pull request #10578:
URL: https://github.com/apache/tvm/pull/10578#discussion_r826596234
##########
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:
@zxybazh right, now that task extraction is decoupled from VM with this
PR, we can revisit this problem (we don't have `vm_mod ` prefix in task name
anymore). I think, the key is to make the following two `GlobalVar` identical:
https://github.com/apache/tvm/blob/f30d2bbd643863c3e00b3490c2ef77cbbcbe0da7/src/relay/backend/te_compiler_cache.cc#L310
https://github.com/apache/tvm/blob/f30d2bbd643863c3e00b3490c2ef77cbbcbe0da7/src/relay/backend/task_extraction.cc#L64
Right now, they are not. I thought about this for a bit, making sure they
are identical and stay in sync is probably doable but tricky. `Parse._mod` is a
bit of hack bit it does simplify the situation.
--
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]