@@ -189,7 +189,7 @@ class GraphExecutorCodegen : public backend::MemoizedExprTranslator<std::vector<
189189 targets_ = targets;
190190 }
191191
192- /* !
192+ /* !
193193 * \brief Update the "main" control function's metadata
194194 *
195195 * \param func The main function that contains calls to relay primitive functions
@@ -273,6 +273,9 @@ class GraphExecutorCodegen : public backend::MemoizedExprTranslator<std::vector<
273273 }
274274
275275 function_metadata_.Set (String (runtime::symbol::tvm_module_main), FunctionInfo (fi_node));
276+ }
277+
278+
276279 StorageInfo GetStorageInfo (const Expr& e) {
277280 size_t count = memory_plan_->expr_to_storage_info .count (e);
278281 ICHECK_GT (count, 0 ) << " Expr is not existing in storage plan" ;
@@ -466,16 +469,18 @@ class GraphExecutorCodegen : public backend::MemoizedExprTranslator<std::vector<
466469 return fields;
467470 }
468471
469- std::vector<GraphNodeRef> GraphAddCallNode (const CallNode* op, const std::string& op_name,
470- const std::string& func_name, GraphAttrs attrs) {
472+ std::vector<GraphNodeRef> GraphAddCallNode (const CallNode* op, const std::string& func_name, GraphAttrs op_attrs) {
471473 std::vector<GraphNodeRef> inputs;
472474 for (auto arg : op->args ) {
473475 auto res = VisitExpr (arg);
474476 for (auto nr : res) {
475477 inputs.push_back (nr);
476478 }
477479 }
478- auto node = GraphOpNode::make_node_ptr (op_name, GraphAttrs (), func_name, inputs, attrs);
480+
481+ // Compute the operator name, because we used the get unique name when generating the kernel.
482+ auto op_name =_GetUniqueName (func_name);
483+ auto node = GraphOpNode::make_node_ptr (op_name, GraphAttrs (), func_name, inputs, op_attrs);
479484 return AddNode (node, GetRef<Expr>(op));
480485 }
481486
@@ -484,8 +489,8 @@ class GraphExecutorCodegen : public backend::MemoizedExprTranslator<std::vector<
484489 if (auto global_node = call->op .as <GlobalVarNode>()) {
485490 auto prim_fn_name = global_node->name_hint ;
486491
487-
488- return GraphAddCallNode (call_node, _GetUniqueName ( prim_fn_name), prim_fn_name );
492+ // TODO(@jroesch): attach attributes somehow
493+ return GraphAddCallNode (call_node, prim_fn_name, GraphAttrs () );
489494 } else {
490495 ICHECK (false ) << " Non-primitive-call nodes should have been transformed away.\n "
491496 << " The graph executor code generator expects all calls to have their callee "
0 commit comments