junrushao1994 commented on a change in pull request #10578:
URL: https://github.com/apache/tvm/pull/10578#discussion_r826593480
##########
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:
It's indeed weird but true that different global var names lead to
failure of structural equality:
https://github.com/apache/tvm/blob/b5f1dabce45e4d4a68a2ecadeee811bac93b1c3c/src/ir/module.cc#L79-L82
, and thus if it isn't taken care of, name mismatches could happen at
BaseFunc-level.
On the bright side, if we are able to find an IRModule in the database,
where equality is defined as structural equality, this means that we do have
the fact that names of the global vars match exactly according to the
definition, which means the `func_name` parameter of `GetBlock` should work as
it is supposed to be.
--
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]