mbs-octoml commented on a change in pull request #9483:
URL: https://github.com/apache/tvm/pull/9483#discussion_r759589257
##########
File path: src/relay/backend/te_compiler.cc
##########
@@ -224,23 +271,28 @@ class TECompilerImpl : public TECompilerNode {
}
cur_ccache_key_ = key;
- // No need to lower external functions for now. We will invoke the external
- // codegen tool once and lower all functions together.
- if (key->source_func->GetAttr<String>(attr::kCompiler).defined()) {
- auto ir_module = IRModule();
- const auto name_node =
key->source_func->GetAttr<String>(tvm::attr::kGlobalSymbol);
- ICHECK(name_node.defined()) << "External function has not been attached
a name yet.";
- auto func_name = GetUniqueName(name_node.value(), &name_map_);
+ Optional<String> opt_compiler =
key->source_func->GetAttr<String>(attr::kCompiler);
+ if (opt_compiler.defined()) {
+ // Don't compile now since we don't have anywhere to put the resulting
runtime module.
+ // Instead place the original definition in the cache and wait for
LowerExternalFunctions.
+ IRModule ir_module;
+ // Note that the source_func may already be bound to a global function
in the module
Review comment:
I moved the comment down a bit -- it is really talking about that we are
using opt_global_symbol.value() as *the* global name and not attempting to
rename.
--
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]