Skip to content

Commit

Permalink
cache_ -> cache, suppres "Cannot find workdload" warning
Browse files Browse the repository at this point in the history
  • Loading branch information
masahi committed Mar 13, 2022
1 parent 4e60bae commit 840ed47
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/meta_schedule/integration.cc
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ IRModule ApplyHistoryBestNode::Query(runtime::String task_name, IRModule mod, Ta
return IRModule({{gv, func}});
}
}
LOG(WARNING) << "Cannot find workload: " << task_name << "\n" << tir::AsTVMScript(prim_mod);
LOG(WARNING) << "Cannot find workload: " << task_name;
DLOG(INFO) << tir::AsTVMScript(prim_mod);
return IRModule{nullptr};
}

Expand Down
8 changes: 4 additions & 4 deletions src/relay/backend/task_extraction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ Array<ExtractedTask> ExtractTask(IRModule mod, Target target, Map<String, Consta
auto opt_mod = seq(std::move(mod));

Array<ExtractedTask> tasks;
std::unordered_set<tec::CCacheKey> cache_;
std::unordered_set<tec::CCacheKey> cache;
std::unordered_map<std::string, int> name_map;

PostOrderVisit(opt_mod->Lookup("main"), [target, &tasks, &cache_, &name_map](const Expr& exp) {
PostOrderVisit(opt_mod->Lookup("main"), [target, &tasks, &cache, &name_map](const Expr& exp) {
if (exp->IsInstance<FunctionNode>()) {
Function relay_func = Downcast<Function>(exp);
tec::CCacheKey cache_key(relay_func, target);
if (relay_func->HasNonzeroAttr(attr::kPrimitive) && cache_.find(cache_key) == cache_.end()) {
if (relay_func->HasNonzeroAttr(attr::kPrimitive) && cache.find(cache_key) == cache.end()) {
Array<te::Tensor> outputs;
std::string fused_name;
std::tie(outputs, fused_name) =
Expand All @@ -64,7 +64,7 @@ Array<ExtractedTask> ExtractTask(IRModule mod, Target target, Map<String, Consta
auto tir_mod = IRModule({{prim_fn_var, prim_func}});
auto task_name = tec::GetUniqueName(fused_name, &name_map);
tasks.push_back(ExtractedTask(task_name, relay_mod, target, {tir_mod}));
cache_.insert(cache_key);
cache.insert(cache_key);
}
}
});
Expand Down

0 comments on commit 840ed47

Please sign in to comment.