YuchenJin commented on a change in pull request #8501:
URL: https://github.com/apache/tvm/pull/8501#discussion_r683599565



##########
File path: src/relay/backend/te_compiler.cc
##########
@@ -349,6 +350,9 @@ class LowerTensorExpr : public ExprMutator {
       Map<GlobalVar, tir::PrimFunc> prim_fns;
 
       for (auto prim_fn : ext_func->funcs->functions) {
+        if (prim_fn.second->GetAttr<String>(attr::kCompiler).defined()) {

Review comment:
       Hi @Mousius, After calling `TECompilerImpl::Lower()` on an external 
function, the TECompiler will just encapsulate it into `CachedFunc` and return, 
and the external function is not lowered. It will be lowered by the external 
codegen with the `TECompilerNode::LowerExternalFunctions()` later. I added a 
line `ir_module->Add(global_var, key->source_func);` to `LowerInternal`, so 
this is untrue when some function in the `funcs` of the `CachedFuncNode` is not 
lowered yet.




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