diff --git a/ge/graph/optimize/graph_optimize.cc b/ge/graph/optimize/graph_optimize.cc index 10ce3df3..3f1a64cc 100644 --- a/ge/graph/optimize/graph_optimize.cc +++ b/ge/graph/optimize/graph_optimize.cc @@ -38,7 +38,7 @@ GraphOptimize::GraphOptimize() void AddNodeInputProperty(ComputeGraphPtr &compute_graph) { if (compute_graph == nullptr) { REPORT_INNER_ERROR("E19999", "Param compute_graph is nullptr, check invalid"); - GELOGE(GE_GRAPH_OPTIMIZE_COMPUTE_GRAPH_NULL, "[AddNodeInputProperty]: compute_graph is nullptr."); + GELOGE(GE_GRAPH_OPTIMIZE_COMPUTE_GRAPH_NULL, "[Check][Param] compute_graph is nullptr."); return; } for (ge::NodePtr &node : compute_graph->GetDirectNode()) { @@ -80,7 +80,7 @@ void AddNodeInputProperty(ComputeGraphPtr &compute_graph) { Status GraphOptimize::OptimizeSubGraph(ComputeGraphPtr &compute_graph, const std::string &engine_name) { if (compute_graph == nullptr) { REPORT_INNER_ERROR("E19999", "Param compute_graph is nullptr, check invalid"); - GELOGE(GE_GRAPH_OPTIMIZE_COMPUTE_GRAPH_NULL, "[OptimizeSubGraph]: compute_graph is nullptr."); + GELOGE(GE_GRAPH_OPTIMIZE_COMPUTE_GRAPH_NULL, "[Check][Param] compute_graph is nullptr."); return GE_GRAPH_OPTIMIZE_COMPUTE_GRAPH_NULL; } @@ -89,8 +89,10 @@ Status GraphOptimize::OptimizeSubGraph(ComputeGraphPtr &compute_graph, const std std::shared_ptr instance_ptr = ge::GELib::GetInstance(); if (instance_ptr == nullptr || !instance_ptr->InitFlag()) { - REPORT_INNER_ERROR("E19999", "Gelib not init before, check invalid"); - GELOGE(GE_CLI_GE_NOT_INITIALIZED, "GraphOptimzer: GE is not initialized"); + REPORT_INNER_ERROR("E19999", "Gelib not init before, check invalid, graph:%s", + compute_graph->GetName().c_str()); + GELOGE(GE_CLI_GE_NOT_INITIALIZED, "[Get][GELib] Gelib not init before, graph:%s", + compute_graph->GetName().c_str()); return GE_CLI_GE_NOT_INITIALIZED; } @@ -111,7 +113,8 @@ Status GraphOptimize::OptimizeSubGraph(ComputeGraphPtr &compute_graph, const std REPORT_INNER_ERROR("E19999", "Call OptimizeFusedGraphAfterGraphSlice failed, ret:%d, engine_name:%s, " "graph_name:%s", ret, engine_name.c_str(), compute_graph->GetName().c_str()); - GELOGE(ret, "[OptimizeSubGraph][OptimizeFusedGraphAfterGraphSlice]: graph optimize failed, ret:%d", ret); + GELOGE(ret, "[Call][OptimizeFusedGraphAfterGraphSlice] failed, ret:%d, engine_name:%s, graph_name:%s", + ret, engine_name.c_str(), compute_graph->GetName().c_str()); return ret; } } @@ -124,7 +127,8 @@ Status GraphOptimize::OptimizeSubGraph(ComputeGraphPtr &compute_graph, const std REPORT_INNER_ERROR("E19999", "Call OptimizeFusedGraph failed, ret:%d, engine_name:%s, " "graph_name:%s", ret, engine_name.c_str(), compute_graph->GetName().c_str()); - GELOGE(ret, "[OptimizeSubGraph][OptimizeFusedGraph]: graph optimize failed, ret:%d", ret); + GELOGE(ret, "[Optimize][FusedGraph] failed, ret:%d, engine_name:%s, graph_name:%s", + ret, engine_name.c_str(), compute_graph->GetName().c_str()); return ret; } } @@ -142,15 +146,17 @@ Status GraphOptimize::OptimizeOriginalGraph(ComputeGraphPtr &compute_graph) { } if (compute_graph == nullptr) { REPORT_INNER_ERROR("E19999", "Param compute_graph is nullptr, check invalid"); - GELOGE(GE_GRAPH_OPTIMIZE_COMPUTE_GRAPH_NULL, "[OptimizeOriginalGraph]: compute_graph is nullptr."); + GELOGE(GE_GRAPH_OPTIMIZE_COMPUTE_GRAPH_NULL, "[Check][Param] compute_graph is nullptr."); return GE_GRAPH_OPTIMIZE_COMPUTE_GRAPH_NULL; } Status ret = SUCCESS; std::shared_ptr instance_ptr = ge::GELib::GetInstance(); if (instance_ptr == nullptr || !instance_ptr->InitFlag()) { - REPORT_INNER_ERROR("E19999", "Gelib not init before, check invalid"); - GELOGE(GE_CLI_GE_NOT_INITIALIZED, "OptimizeOriginalGraph failed."); + REPORT_INNER_ERROR("E19999", "Gelib not init before, check invalid, graph:%s.", + compute_graph->GetName().c_str()); + GELOGE(GE_CLI_GE_NOT_INITIALIZED, "[Get][GELib] Gelib not init before, graph:%s.", + compute_graph->GetName().c_str()); return GE_CLI_GE_NOT_INITIALIZED; } @@ -169,7 +175,8 @@ Status GraphOptimize::OptimizeOriginalGraph(ComputeGraphPtr &compute_graph) { REPORT_INNER_ERROR("E19999", "Call OptimizeOriginalGraph failed, ret:%d, engine_name:%s, " "graph_name:%s", ret, iter->first.c_str(), compute_graph->GetName().c_str()); - GELOGE(ret, "[OptimizeOriginalGraph]: graph optimize failed, ret:%d", ret); + GELOGE(ret, "[Optimize][OriginalGraph] failed, ret:%d, engine_name:%s, graph_name:%s", + ret, iter->first.c_str(), compute_graph->GetName().c_str()); return ret; } } @@ -188,8 +195,10 @@ Status GraphOptimize::OptimizeOriginalGraphJudgeInsert(ComputeGraphPtr &compute_ Status ret = SUCCESS; std::shared_ptr instance_ptr = ge::GELib::GetInstance(); if (instance_ptr == nullptr || !instance_ptr->InitFlag()) { - REPORT_INNER_ERROR("E19999", "Gelib not init before, check invalid"); - GELOGE(GE_CLI_GE_NOT_INITIALIZED, "OptimizeOriginalGraph failed."); + REPORT_INNER_ERROR("E19999", "Gelib not init before, check invalid, graph:%s", + compute_graph->GetName().c_str()); + GELOGE(GE_CLI_GE_NOT_INITIALIZED, "[Get][GELib] Gelib not init before, graph:%s", + compute_graph->GetName().c_str()); return GE_CLI_GE_NOT_INITIALIZED; } @@ -209,7 +218,8 @@ Status GraphOptimize::OptimizeOriginalGraphJudgeInsert(ComputeGraphPtr &compute_ REPORT_INNER_ERROR("E19999", "Call OptimizeOriginalGraphJudgeInsert failed, ret:%d, engine_name:%s, " "graph_name:%s", ret, iter->first.c_str(), compute_graph->GetName().c_str()); - GELOGE(ret, "[OptimizeOriginalGraphJudgeInsert]: graph optimize failed, ret:%d", ret); + GELOGE(ret, "[Call][OptimizeOriginalGraphJudgeInsert] failed, ret:%d, engine_name:%s, graph_name:%s", + ret, iter->first.c_str(), compute_graph->GetName().c_str()); return ret; } } @@ -220,14 +230,16 @@ Status GraphOptimize::OptimizeOriginalGraphJudgeInsert(ComputeGraphPtr &compute_ Status GraphOptimize::OptimizeOriginalGraphForQuantize(ComputeGraphPtr &compute_graph) { if (compute_graph == nullptr) { REPORT_INNER_ERROR("E19999", "Param compute_graph is nullptr, check invalid"); - GELOGE(GE_GRAPH_OPTIMIZE_COMPUTE_GRAPH_NULL, "[OptimizeOriginalGraph]: compute_graph is nullptr."); + GELOGE(GE_GRAPH_OPTIMIZE_COMPUTE_GRAPH_NULL, "[Check][Param] compute_graph is nullptr."); return GE_GRAPH_OPTIMIZE_COMPUTE_GRAPH_NULL; } std::shared_ptr instance_ptr = ge::GELib::GetInstance(); if (instance_ptr == nullptr || !instance_ptr->InitFlag()) { - REPORT_INNER_ERROR("E19999", "Gelib not init before, check invalid"); - GELOGE(GE_CLI_GE_NOT_INITIALIZED, "OptimizeOriginalGraph failed."); + REPORT_INNER_ERROR("E19999", "Gelib not init before, check invalid, graph:%s.", + compute_graph->GetName().c_str()); + GELOGE(GE_CLI_GE_NOT_INITIALIZED, "[Get][Gelib] Gelib not init before, graph:%s.", + compute_graph->GetName().c_str()); return GE_CLI_GE_NOT_INITIALIZED; } @@ -247,7 +259,8 @@ Status GraphOptimize::OptimizeOriginalGraphForQuantize(ComputeGraphPtr &compute_ REPORT_INNER_ERROR("E19999", "Call OptimizeGraphPrepare failed, ret:%d, engine_name:%s, " "graph_name:%s", ret, iter->first.c_str(), compute_graph->GetName().c_str()); - GELOGE(ret, "[OptimizeOriginalGraphForQuantize]: graph optimize failed, ret:%u", ret); + GELOGE(ret, "[Call][OptimizeGraphPrepare] failed, ret:%d, engine_name:%s, graph_name:%s", + ret, iter->first.c_str(), compute_graph->GetName().c_str()); return ret; } } @@ -258,14 +271,16 @@ Status GraphOptimize::OptimizeOriginalGraphForQuantize(ComputeGraphPtr &compute_ Status GraphOptimize::OptimizeGraphBeforeBuildForRts(ComputeGraphPtr &compute_graph) { if (compute_graph == nullptr) { REPORT_INNER_ERROR("E19999", "Param compute_graph is nullptr, check invalid"); - GELOGE(GE_GRAPH_OPTIMIZE_COMPUTE_GRAPH_NULL, "[OptimizeGraphBeforeBuildForRts]: compute_graph is nullptr."); + GELOGE(GE_GRAPH_OPTIMIZE_COMPUTE_GRAPH_NULL, "[Check][Param] compute_graph is nullptr."); return GE_GRAPH_OPTIMIZE_COMPUTE_GRAPH_NULL; } std::shared_ptr instance_ptr = ge::GELib::GetInstance(); if (instance_ptr == nullptr || !instance_ptr->InitFlag()) { - REPORT_INNER_ERROR("E19999", "Gelib not init before, check invalid"); - GELOGE(GE_CLI_GE_NOT_INITIALIZED, "OptimizeGraphBeforeBuildForRts failed."); + REPORT_INNER_ERROR("E19999", "Gelib not init before, check invalid, graph:%s.", + compute_graph->GetName().c_str()); + GELOGE(GE_CLI_GE_NOT_INITIALIZED, "[Get][GELib] Gelib not init before, graph:%s.", + compute_graph->GetName().c_str()); return GE_CLI_GE_NOT_INITIALIZED; } @@ -286,7 +301,8 @@ Status GraphOptimize::OptimizeGraphBeforeBuildForRts(ComputeGraphPtr &compute_gr REPORT_INNER_ERROR("E19999", "Call OptimizeGraphBeforeBuild failed, ret:%d, engine_name:%s, " "graph_name:%s", ret, iter->first.c_str(), compute_graph->GetName().c_str()); - GELOGE(ret, "[OptimizeGraphBeforeBuildForRts]: graph optimize failed, ret:%u", ret); + GELOGE(ret, "[Call][OptimizeGraphBeforeBuild] failed, ret:%d, engine_name:%s, graph_name:%s", + ret, iter->first.c_str(), compute_graph->GetName().c_str()); return ret; } } @@ -413,14 +429,16 @@ Status GraphOptimize::IdentifyReference(ComputeGraphPtr &compute_graph) { Status GraphOptimize::OptimizeWholeGraph(ComputeGraphPtr &compute_graph) { if (compute_graph == nullptr) { REPORT_INNER_ERROR("E19999", "Param compute_graph is nullptr, check invalid"); - GELOGE(GE_GRAPH_OPTIMIZE_COMPUTE_GRAPH_NULL, "[OptimizeWholeGraph]: compute_graph is nullptr."); + GELOGE(GE_GRAPH_OPTIMIZE_COMPUTE_GRAPH_NULL, "[Check][Param] compute_graph is nullptr."); return GE_GRAPH_OPTIMIZE_COMPUTE_GRAPH_NULL; } std::shared_ptr instance_ptr = ge::GELib::GetInstance(); if (instance_ptr == nullptr || !instance_ptr->InitFlag()) { - REPORT_INNER_ERROR("E19999", "Gelib not init before, check invalid"); - GELOGE(GE_CLI_GE_NOT_INITIALIZED, "OptimizeWholeGraph failed."); + REPORT_INNER_ERROR("E19999", "Gelib not init before, check invalid, graph:%s.", + compute_graph->GetName().c_str()); + GELOGE(GE_CLI_GE_NOT_INITIALIZED, "[Get][GELib] Gelib not init before, graph:%s.", + compute_graph->GetName().c_str()); return GE_CLI_GE_NOT_INITIALIZED; } @@ -441,7 +459,8 @@ Status GraphOptimize::OptimizeWholeGraph(ComputeGraphPtr &compute_graph) { REPORT_INNER_ERROR("E19999", "Call OptimizeWholeGraph failed, ret:%d, engine_name:%s, " "graph_name:%s", ret, iter.first.c_str(), compute_graph->GetName().c_str()); - GELOGE(ret, "[OptimizeWholeGraph]: graph optimize failed, ret:%u", ret); + GELOGE(ret, "[Call][OptimizeWholeGraph] failed, ret:%d, engine_name:%s, graph_name:%s", + ret, iter.first.c_str(), compute_graph->GetName().c_str()); return ret; } } diff --git a/ge/graph/optimize/mem_rw_conflict_optimize.cc b/ge/graph/optimize/mem_rw_conflict_optimize.cc index 7c1fc4ab..6ffd099d 100644 --- a/ge/graph/optimize/mem_rw_conflict_optimize.cc +++ b/ge/graph/optimize/mem_rw_conflict_optimize.cc @@ -159,6 +159,8 @@ bool IsSubgraphOutputNode(const NodePtr &node) { NodePtr AddIdentityToGraph(const Node &src_node, int out_anchor_idx) { if (src_node.GetOpDesc() == nullptr) { + REPORT_INNER_ERROR("E19999", "Param src_node is invalid, which has no opdesc"); + GELOGE(GRAPH_PARAM_INVALID, "[Get][OpDesc] failed, Param src_node opdesc is nullptr."); return nullptr; } static std::atomic_long identity_num(0); @@ -174,7 +176,9 @@ NodePtr AddIdentityToGraph(const Node &src_node, int out_anchor_idx) { GELOGI("Insert new Identity node %s.", identity_name.c_str()); auto graph = src_node.GetOwnerComputeGraph(); if (graph == nullptr) { - GELOGE(GRAPH_PARAM_INVALID, "Node %s owner compute graph is null.", src_node.GetName().c_str()); + REPORT_INNER_ERROR("E19999", "Node %s owner compute graph is nullptr.", src_node.GetName().c_str()); + GELOGE(GRAPH_PARAM_INVALID, "[Get][OwnerComputeGraph] failed, as Node %s owner compute graph is nullptr.", + src_node.GetName().c_str()); return nullptr; } return graph->AddNode(identity_op_desc); @@ -345,7 +349,7 @@ Status MarkRWTypeForSubgraph(const ComputeGraphPtr &sub_graph) { pre_node->GetType().c_str(), node->GetName().c_str(), node->GetType().c_str()); - GELOGE(FAILED, "Insert Identity node %s(%s) between %s(%s) -> %s(%s) failed.", + GELOGE(FAILED, "[Insert][IdentityNode] %s(%s) between %s(%s) -> %s(%s) failed.", identity_node->GetName().c_str(), identity_node->GetType().c_str(), pre_node->GetName().c_str(), @@ -486,12 +490,14 @@ Status RemoveNoUseIdentity(const NodePtr &node) { GELOGI("No need insert Identity. Node %s need to remove.", node->GetName().c_str()); auto ret = GraphUtils::IsolateNode(node, {0}); if (ret != SUCCESS) { - GELOGE(ret, "Fail to isolate node %s.", node->GetName().c_str()); + REPORT_CALL_ERROR("E19999", "Isolate Node:%s failed", node->GetName().c_str()); + GELOGE(ret, "[Isolate][Node] %s failed.", node->GetName().c_str()); return ret; } ret = GraphUtils::RemoveNodeWithoutRelink(node->GetOwnerComputeGraph(), node); if (ret != SUCCESS) { - GELOGE(ret, "Fail to isolate node %s.", node->GetName().c_str()); + REPORT_CALL_ERROR("E19999", "Call RemoveNodeWithoutRelink failed, node:%s", node->GetName().c_str()); + GELOGE(ret, "[Call][RemoveNodeWithoutRelink] failed for node %s.", node->GetName().c_str()); return ret; } GELOGI("Pre node is %s and %dth output rw type is %s. Isolate and remove Identity node %s.", @@ -514,7 +520,7 @@ Status SplitIdentityAlongAnchor(const OutDataAnchorPtr &out_data_anchor, const I auto ret = GraphUtils::InsertNodeBefore(peer_in_data_anchor, new_identity, kIdentityAnchorIndex, kIdentityAnchorIndex); if (ret != SUCCESS) { - GELOGE(ret, "Failed to insert Identity %s before %s %dth input.", + GELOGE(ret, "[Insert][Identity] %s before %s %dth input failed.", new_identity->GetName().c_str(), peer_in_data_anchor->GetOwnerNode()->GetName().c_str(), peer_in_data_anchor->GetIdx()); @@ -560,7 +566,8 @@ Status SplitIdentity(const NodePtr &node) { for (const auto &peer_in_data_anchor : out_data_anchor->GetPeerInDataAnchors()) { Status ret = SplitIdentityAlongAnchor(out_data_anchor, peer_in_data_anchor, pre_out_data_anchor, pre_node); if (ret != SUCCESS) { - GELOGE(ret, "Split identity node along anchor failed."); + GELOGE(ret, "[Call][SplitIdentityAlongAnchor] failed, ret:%d, node:%s, pre_node:%s.", + ret, node->GetName().c_str(), pre_node->GetName().c_str()); return ret; } } @@ -568,12 +575,15 @@ Status SplitIdentity(const NodePtr &node) { if (node->GetOutDataNodesSize() == 0) { Status ret = GraphUtils::IsolateNode(node, {}); if (ret != SUCCESS) { - GELOGE(FAILED, "IsolateAndDelete identity node %s.", node->GetName().c_str()); + REPORT_CALL_ERROR("E19999", "IsolateNode %s failed, ret:%d", node->GetName().c_str(), ret); + GELOGE(FAILED, "[Isolate][Node] %s failed, ret:%d", node->GetName().c_str(), ret); return FAILED; } ret = GraphUtils::RemoveNodeWithoutRelink(node->GetOwnerComputeGraph(), node); if (ret != SUCCESS) { - GELOGE(FAILED, "IsolateAndDelete identity node %s.", node->GetName().c_str()); + REPORT_CALL_ERROR("E19999", "Call RemoveNodeWithoutRelink failed, node:%s", node->GetName().c_str()); + GELOGE(FAILED, "[Call][RemoveNodeWithoutRelink] IsolateAndDelete identity node %s failed.", + node->GetName().c_str()); return FAILED; } GELOGI("IsolateAndDelete identity node %s.", node->GetName().c_str()); @@ -610,7 +620,7 @@ Status InsertIdentityAsNeeded(const NodePtr &node) { auto ret = GraphUtils::InsertNodeBefore(peer_in_data_anchor, identity_node, kIdentityAnchorIndex, kIdentityAnchorIndex); if (ret != SUCCESS) { - GELOGE(ret, "Fail to insert %s before %s %dth input.", identity_node->GetName().c_str(), + GELOGE(ret, "[Insert][Node] %s before %s %dth input failed.", identity_node->GetName().c_str(), peer_in_data_anchor->GetOwnerNode()->GetName().c_str(), peer_in_data_anchor->GetIdx()); return ret; } @@ -643,7 +653,7 @@ Status HandleAllreduceDuplicateInput(ComputeGraphPtr &compute_graph) { auto ret = GraphUtils::InsertNodeBefore(in_data_anchor, identity_node, kIdentityAnchorIndex, kIdentityAnchorIndex); if (ret != SUCCESS) { - GELOGE(ret, "Failed to insert node %s before %s %dth input.", identity_node->GetName().c_str(), + GELOGE(ret, "[Insert][Node] %s before %s %dth input failed.", identity_node->GetName().c_str(), node->GetName().c_str(), in_data_anchor->GetIdx()); return ret; } @@ -666,7 +676,7 @@ Status GraphOptimize::CheckRWConflict(ComputeGraphPtr &compute_graph, bool &has_ // 1.loop all subgraph, mark rw type from inside to outside Status ret = MarkRWTypeForAllSubgraph(sub_graph_vec); if (ret != SUCCESS) { - GELOGE(ret, "Fail to mark rw type for subgraph."); + GELOGE(ret, "[Call][MarkRWTypeForAllSubgraph] failed for %s.", compute_graph->GetName().c_str()); return ret; } has_conflict = false; @@ -722,7 +732,7 @@ Status GraphOptimize::HandleMemoryRWConflict(ComputeGraphPtr &compute_graph) { // 1.loop all subgraph, mark rw type from inside to outside Status ret = MarkRWTypeForAllSubgraph(sub_graph_vec); if (ret != SUCCESS) { - GELOGE(ret, "Fail to mark rw type for subgraph."); + GELOGE(ret, "[Call][MarkRWTypeForAllSubgraph] failed for %s.", compute_graph->GetName().c_str()); return ret; } // 2.loop all node, including node in subgraph and handle memory rw conflict @@ -749,20 +759,20 @@ Status GraphOptimize::HandleMemoryRWConflict(ComputeGraphPtr &compute_graph) { // split identity ret = SplitIdentity(node); if (ret != SUCCESS) { - GELOGE(ret, "Fail to split identity node %s.", node->GetName().c_str()); + GELOGE(ret, "[Split][Identity] %s failed.", node->GetName().c_str()); return ret; } // remove no use identity ret = RemoveNoUseIdentity(node); if (ret != SUCCESS) { - GELOGE(ret, "Fail to remove useless identity node %s.", node->GetName().c_str()); + GELOGE(ret, "[Remove][Identity] %s failed.", node->GetName().c_str()); return ret; } } // insert Identity ret = InsertIdentityAsNeeded(node); if (ret != SUCCESS) { - GELOGE(ret, "Fail to insert Identity node."); + GELOGE(ret, "[Insert][Identity] %s failed.", node->GetName().c_str()); return ret; } } diff --git a/ge/graph/optimize/summary_optimize.cc b/ge/graph/optimize/summary_optimize.cc index 077ab1b0..d3c02d3e 100644 --- a/ge/graph/optimize/summary_optimize.cc +++ b/ge/graph/optimize/summary_optimize.cc @@ -32,16 +32,19 @@ namespace ge { Status GraphOptimize::HandleSummaryOp(ComputeGraphPtr &compute_graph) { GELOGI("[HandleSummaryOp] HandleSummaryOp start!"); if (summary_output_indexes_.size() >= kMaxMapSize) { - GELOGE(FAILED, "Map size out of range."); + REPORT_INNER_ERROR("E19999", "Map size:%zu out of range:%d, check invalid.", + summary_output_indexes_.size(), kMaxMapSize); + GELOGE(FAILED, "[Check][Param] Map size:%zu out of range:%d.", summary_output_indexes_.size(), kMaxMapSize); return FAILED; } - if (summary_output_indexes_.find(compute_graph->GetGraphID()) != summary_output_indexes_.end()) { - return SUCCESS; - } if (compute_graph == nullptr) { - GELOGE(GE_GRAPH_PARAM_NULLPTR, "compute_graph is nullptr."); + REPORT_INNER_ERROR("E19999", "Param compute_graph is nullptr, check invalid."); + GELOGE(GE_GRAPH_PARAM_NULLPTR, "[Check][Param] compute_graph is nullptr."); return GE_GRAPH_PARAM_NULLPTR; } + if (summary_output_indexes_.find(compute_graph->GetGraphID()) != summary_output_indexes_.end()) { + return SUCCESS; + } vector del_nodes; vector front_nodes; vector out_index; @@ -56,12 +59,18 @@ Status GraphOptimize::HandleSummaryOp(ComputeGraphPtr &compute_graph) { compute_graph->SetSummaryFlag(true); auto in = node_ptr->GetInDataAnchor(0); if (in == nullptr) { - GELOGE(GE_GRAPH_PARAM_NULLPTR, "in is nullptr."); + REPORT_INNER_ERROR("E19999", "In data anchor(index:0) of node:%s is nullptr", node_ptr->GetName().c_str()); + GELOGE(GE_GRAPH_PARAM_NULLPTR, "[Get][InDataAnchor] of node:%s is nullptr, index:0", + node_ptr->GetName().c_str()); return GE_GRAPH_PARAM_NULLPTR; } auto peerin = in->GetPeerOutAnchor(); - GE_IF_BOOL_EXEC(peerin == nullptr, GELOGE(GE_GRAPH_PARAM_NULLPTR, "peerin is nullptr."); + GE_IF_BOOL_EXEC(peerin == nullptr, + REPORT_INNER_ERROR("E19999", "peer out anchor is nullptr, node:%s, in anchor index:0", + node_ptr->GetName().c_str()); + GELOGE(GE_GRAPH_PARAM_NULLPTR, "[Get][PeerOutAnchor] of node:%s is nullptr, in anchor index:0", + node_ptr->GetName().c_str()); return GE_GRAPH_PARAM_NULLPTR); auto ret = GraphUtils::RemoveEdge(peerin, in); @@ -94,7 +103,10 @@ Status GraphOptimize::HandleSummaryOp(ComputeGraphPtr &compute_graph) { for (auto &node_ptr : del_nodes) { auto ret = GraphUtils::RemoveNodeWithoutRelink(compute_graph, node_ptr); if (ret != SUCCESS) { - GELOGE(ret, "GraphUtils::RemoveNodeWithoutRelink failed."); + REPORT_CALL_ERROR("E19999", "Call RemoveNodeWithoutRelink failed, node:%s, graph:%s", + node_ptr->GetName().c_str(), compute_graph->GetName().c_str()); + GELOGE(ret, "[Call][RemoveNodeWithoutRelink] failed, node:%s, graph:%s", + node_ptr->GetName().c_str(), compute_graph->GetName().c_str()); return ret; } // update Target list diff --git a/ge/graph/partition/dynamic_shape_partition.cc b/ge/graph/partition/dynamic_shape_partition.cc index 5a441b86..055b2aa4 100755 --- a/ge/graph/partition/dynamic_shape_partition.cc +++ b/ge/graph/partition/dynamic_shape_partition.cc @@ -36,6 +36,7 @@ #define REQUIRE(cond, ...) \ do { \ if (!(cond)) { \ + REPORT_INNER_ERROR("E19999", __VA_ARGS__); \ GELOGE(FAILED, "[Dynamic shape partition]" __VA_ARGS__); \ return FAILED; \ } \ @@ -63,32 +64,32 @@ static bool IsSingleOpScene(const ComputeGraphPtr &root_graph) { } Status DynamicShapePartitioner::Partition() { - REQUIRE_NOT_NULL(root_graph_, "Graph is nullptr."); + REQUIRE_NOT_NULL(root_graph_, "[Check][Param] Graph is nullptr."); if (IsSingleOpScene(root_graph_)) { GELOGD("Skip dynamic shape partition as in single op scene."); REQUIRE(AttrUtils::SetBool(*root_graph_, ATTR_NAME_DYNAMIC_SHAPE_PARTITIONED, false), - "Failed set dynamic shape partitioned flag on root graph."); + "[Set][Attr] dynamic shape partitioned flag on root graph:%s failed.", root_graph_->GetName().c_str()); return SUCCESS; } GELOGD("Start dynamic shape partition graph %s.", root_graph_->GetName().c_str()); - REQUIRE_SUCCESS(MarkUnknownShapeNodes(), "Failed mark unknown shape nodes, root grah name:%s.", + REQUIRE_SUCCESS(MarkUnknownShapeNodes(), "[Call][MarkUnknownShapeNodes] failed, root grah name:%s.", root_graph_->GetName().c_str()); if (unknown_shape_nodes_.empty()) { GELOGD("Skip dynamic shape partition of graph %s as all nodes are known shape.", root_graph_->GetName().c_str()); REQUIRE(AttrUtils::SetBool(*root_graph_, ATTR_NAME_DYNAMIC_SHAPE_PARTITIONED, false), - "Failed set dynamic shape partitioned flag on root graph %s.", root_graph_->GetName().c_str()); + "[Set][Attr] dynamic shape partitioned flag on root graph %s failed.", root_graph_->GetName().c_str()); return SUCCESS; } REQUIRE(AttrUtils::SetBool(*root_graph_, ATTR_NAME_DYNAMIC_SHAPE_PARTITIONED, true), - "Failed set dynamic shape partitioned flag on root graph %s.", root_graph_->GetName().c_str()); - REQUIRE_SUCCESS(CtrlEdgeTransfer(), "Failed do ctrl edge transfer!"); + "[Set][Attr] dynamic shape partitioned flag on root graph %s failed.", root_graph_->GetName().c_str()); + REQUIRE_SUCCESS(CtrlEdgeTransfer(), "[Call][CtrlEdgeTransfer] failed, graph:%s.", root_graph_->GetName().c_str()); DumpGraph("_Before_DSP"); auto status = PartitionImpl(); GELOGD("%s.", DebugString().c_str()); if (status != SUCCESS) { - GELOGE(status, "Failed dynamic shape partition graph: %s, status:\n %s", root_graph_->GetName().c_str(), - DebugString().c_str()); + GELOGE(status, "[Call][PartitionImpl] Failed dynamic shape partition graph:%s, ret:%s", + root_graph_->GetName().c_str(), DebugString().c_str()); } DumpGraph("_After_DSP"); GELOGD("Finish dynamic shape partition graph %s.", root_graph_->GetName().c_str()); @@ -123,13 +124,19 @@ Status DynamicShapePartitioner::CtrlEdgeTransfer() { for (auto &in_control_node : n->GetInControlNodes()) { GE_CHECK_NOTNULL(in_control_node); GE_CHK_STATUS_RET(ge::GraphUtils::RemoveEdge(in_control_node->GetOutControlAnchor(), - n->GetInControlAnchor()), "remove edge failed"); + n->GetInControlAnchor()), + "[Remove][Edge] between %s and %s failed", + in_control_node->GetOutControlAnchor()->GetOwnerNode()->GetName().c_str(), + n->GetName().c_str()); for (auto &out_node : n->GetOutNodes()) { if (out_node == nullptr) { continue; } GE_CHK_STATUS_RET(ge::GraphUtils::AddEdge(in_control_node->GetOutControlAnchor(), - out_node->GetInControlAnchor()), "add edge failed."); + out_node->GetInControlAnchor()), + "[Add][Edge] between %s and %s failed.", + in_control_node->GetOutControlAnchor()->GetOwnerNode()->GetName().c_str(), + out_node->GetName().c_str()); } } } @@ -141,13 +148,16 @@ Status DynamicShapePartitioner::CtrlEdgeTransfer() { } Status DynamicShapePartitioner::PartitionImpl() { - REQUIRE_SUCCESS(root_graph_->TopologicalSorting(), "Graph topological sort failed."); - REQUIRE_SUCCESS(InitClusters(), "Failed init cluster nodes."); - REQUIRE_SUCCESS(MergeClusters(), "Failed merge clusters."); + REQUIRE_SUCCESS(root_graph_->TopologicalSorting(), + "[Call][TopologicalSorting] failed, graph:%s.", root_graph_->GetName().c_str()); + REQUIRE_SUCCESS(InitClusters(), "[Init][Clusters] failed, graph:%s.", root_graph_->GetName().c_str()); + REQUIRE_SUCCESS(MergeClusters(), "[Merge][Clusters] failed, graph:%s.", root_graph_->GetName().c_str()); PruneUniqueClusters(); - REQUIRE_SUCCESS(BuildPartitionFrame(), "Failed build cluster partition frame."); - REQUIRE_SUCCESS(CombinePartitionFrame(), "Failed combine cluster partition frame."); - REQUIRE_SUCCESS(BuildPartitionSubgraph(), "Failed build cluster partition subgraph."); + REQUIRE_SUCCESS(BuildPartitionFrame(), "[Build][PartitionFrame] failed, graph:%s.", root_graph_->GetName().c_str()); + REQUIRE_SUCCESS(CombinePartitionFrame(), + "[Combine][PartitionFrame] failed, graph:%s.", root_graph_->GetName().c_str()); + REQUIRE_SUCCESS(BuildPartitionSubgraph(), + "[Build][PartitionSubgraph] failed, graph:%s.", root_graph_->GetName().c_str()); return SUCCESS; } @@ -169,21 +179,21 @@ void DynamicShapePartitioner::PruneUniqueClusters() { Status DynamicShapePartitioner::BuildPartitionFrame() { for (const auto &cluster : sorted_unique_clusters_) { - REQUIRE_SUCCESS(cluster->BuildFrame(), "Failed build frame of cluster[%lu].", cluster->Id()); + REQUIRE_SUCCESS(cluster->BuildFrame(), "[Build][Frame] of cluster[%lu] failed.", cluster->Id()); } return SUCCESS; } Status DynamicShapePartitioner::CombinePartitionFrame() { for (const auto &cluster : sorted_unique_clusters_) { - REQUIRE_SUCCESS(cluster->CombinePartitionFrame(), "Failed combine frame of cluster[%lu].", cluster->Id()); + REQUIRE_SUCCESS(cluster->CombinePartitionFrame(), "[Combine][Frame] of cluster[%lu] failed.", cluster->Id()); } return SUCCESS; } Status DynamicShapePartitioner::BuildPartitionSubgraph() { for (const auto &cluster : sorted_unique_clusters_) { - REQUIRE_SUCCESS(cluster->BuildPartitionSubgraph(), "Failed build subgraph of cluster[%lu].", cluster->Id()); + REQUIRE_SUCCESS(cluster->BuildPartitionSubgraph(), "[Build][SubGraph] of cluster[%lu] failed.", cluster->Id()); } return SUCCESS; } @@ -245,8 +255,8 @@ void DynamicShapePartitioner::ClearResource() { Status DynamicShapePartitioner::MarkUnknownShapeNodes() { for (auto &node : root_graph_->GetDirectNode()) { - REQUIRE_SUCCESS(CollectSpreadUnknownShapeNodes(node), "Failed collect spread unknown shape nodes %s.", - node->GetName().c_str()); + REQUIRE_SUCCESS(CollectSpreadUnknownShapeNodes(node), + "[Call][CollectSpreadUnknownShapeNodes] for node:%s failed.", node->GetName().c_str()); } return SUCCESS; } @@ -257,7 +267,7 @@ Status DynamicShapePartitioner::InitClusters() { for (const auto &node : graph->GetDirectNode()) { Cluster::Type type = Cluster::DATA; bool is_input = ((node->GetType() == CONSTANT) || (node->GetType() == CONSTANTOP)) && node->GetInNodes().empty(); - REQUIRE_NOT_NULL(node->GetOpDesc(), "op_desc is null"); + REQUIRE_NOT_NULL(node->GetOpDesc(), "[Get][OpDesc] op_desc is null, graph:%s", graph->GetName().c_str()); if (node->GetType() == DATA) { type = Cluster::DATA; } else if (is_input) { @@ -272,7 +282,7 @@ Status DynamicShapePartitioner::InitClusters() { type = Cluster::KNOWN_SHAPE; } auto cluster = MakeShared(rank++, type, node, this); - REQUIRE_NOT_NULL(cluster, "Failed new memory for cluster."); + REQUIRE_NOT_NULL(cluster, "[New][Memory] for cluster failed."); node_2_cluster_[node] = cluster; if (cluster->IsUnknownShape()) { ordered_cluster_.push_back(cluster); @@ -451,7 +461,7 @@ void DynamicShapePartitioner::MergeClustersInputData() { Status DynamicShapePartitioner::MergeClusters() { MergeClustersControlFlow(); MergeClustersUnknownShape(); - REQUIRE_SUCCESS(TopologicalSortClusters(), "Failed topological sort clusters after merge unknown shape clusters."); + REQUIRE_SUCCESS(TopologicalSortClusters(), "[TopologicalSort][Clusters] after merge unknown shape clusters failed."); MergeClustersKnownShape(); MergeClustersInputData(); return SUCCESS; @@ -477,7 +487,7 @@ Status DynamicShapePartitioner::CollectSpreadUnknownShapeNodes(NodePtr node) { return SUCCESS; } auto opdesc = node->GetOpDesc(); - REQUIRE_NOT_NULL(opdesc, "Opdesc is nullptr."); + REQUIRE_NOT_NULL(opdesc, "[Get][OpDesc] Opdesc is nullptr."); // One can set 'ATTR_NAME_IS_UNKNOWN_SHAPE=true' on node so as to forcing the node flow into the unknown subgraph, // ignore the actual shape. if (JudgeUnknowShapeWithAttr(opdesc)) { @@ -523,10 +533,11 @@ Status DynamicShapePartitioner::CollectSpreadUnknownShapeNodes(NodePtr node) { auto graph = root_graph_; for (const auto &subgraph_name : opdesc->GetSubgraphInstanceNames()) { auto subgraph = graph->GetSubgraph(subgraph_name); - REQUIRE_NOT_NULL(subgraph, "Failed get subgraph %s of node %s on root graph.", subgraph_name.c_str(), + REQUIRE_NOT_NULL(subgraph, "[Get][Subgraph] %s of node %s on root graph failed.", subgraph_name.c_str(), node->GetName().c_str()); bool is_graph_unknow = false; - REQUIRE_SUCCESS(IsUnknownShapeGraph(subgraph, is_graph_unknow), "Failed check subgraph %s shape of node %s.", + REQUIRE_SUCCESS(IsUnknownShapeGraph(subgraph, is_graph_unknow), + "[Call][IsUnknownShapeGraph] Failed check subgraph %s shape of node %s.", subgraph_name.c_str(), node->GetName().c_str()); if (is_graph_unknow) { GELOGD("Collect node %s as its subgraph %s is unknown.", node->GetName().c_str(), subgraph->GetName().c_str()); @@ -557,9 +568,10 @@ Status DynamicShapePartitioner::IsUnknownShapeNode(NodePtr node, bool &is_unknow } for (auto &subgraph_name : opdesc->GetSubgraphInstanceNames()) { auto subgraph = graph->GetSubgraph(subgraph_name); - REQUIRE_NOT_NULL(subgraph, "Failed get subgraph %s of node %s on root graph.", subgraph_name.c_str(), + REQUIRE_NOT_NULL(subgraph, "[Get][Subgraph] %s of node %s on root graph failed.", subgraph_name.c_str(), node->GetName().c_str()); - REQUIRE_SUCCESS(IsUnknownShapeGraph(subgraph, is_unknown), "Failed check subgraph %s shape of node %s.", + REQUIRE_SUCCESS(IsUnknownShapeGraph(subgraph, is_unknown), + "[Call][IsUnknownShapeGraph] Failed check subgraph %s shape of node %s.", subgraph_name.c_str(), node->GetName().c_str()); if (is_unknown) { GELOGD("Mark node %s unknown as unknown subgraph.", node->GetName().c_str()); @@ -572,7 +584,8 @@ Status DynamicShapePartitioner::IsUnknownShapeNode(NodePtr node, bool &is_unknow Status DynamicShapePartitioner::IsUnknownShapeGraph(ComputeGraphPtr graph, bool &is_unknown) { for (auto &node : graph->GetDirectNode()) { - REQUIRE_SUCCESS(IsUnknownShapeNode(node, is_unknown), "Failed check node %s shape on graph %s.", + REQUIRE_SUCCESS(IsUnknownShapeNode(node, is_unknown), + "[Call][IsUnknownShapeNode]Failed check node %s shape on graph %s.", node->GetName().c_str(), graph->GetName().c_str()); if (is_unknown) { GELOGD("Mark graph %s unknown as contains unknown node %s.", graph->GetName().c_str(), node->GetName().c_str()); @@ -793,7 +806,7 @@ Status Cluster::BuildFrame() { if (src_cluster->id_ != id_) { REQUIRE_GRAPH_SUCCESS( GraphUtils::RemoveEdge(peer_out_control_anchor, in_control_anchor), - "Failed remove edge from node %s index %d to node %s index %d.", + "[Remove][Edge] from node %s index %d to node %s failed, index %d.", peer_out_control_anchor->GetOwnerNode()->GetName().c_str(), AnchorUtils::GetIdx(peer_out_control_anchor), in_control_anchor->GetOwnerNode()->GetName().c_str(), AnchorUtils::GetIdx(in_control_anchor)); control_inputs_.insert(src_cluster); @@ -823,20 +836,28 @@ Status Cluster::BuildPartitionFrame() { string sub_graph_name_patten = (is_input ? "_input" : known_name); std::string sub_graph_name = graph->GetName() + "_sub_" + std::to_string(unique_id_) + sub_graph_name_patten; subgraph_ = MakeShared(sub_graph_name); - REQUIRE_NOT_NULL(subgraph_, "Failed new memory for subgraph."); + REQUIRE_NOT_NULL(subgraph_, "[New][Memory] for subgraph failed, name:%s.", sub_graph_name.c_str()); auto partition_op = MakeShared("PartitionedCall_" + std::to_string(unique_id_++), "PartitionedCall"); - REQUIRE_NOT_NULL(partition_op, "Failed new memory for partition op."); + REQUIRE_NOT_NULL(partition_op, "[New][Memory] for partition op failed."); REQUIRE(AttrUtils::SetBool(partition_op, ATTR_NAME_IS_UNKNOWN_SHAPE, is_unknown_shape), - "Failed set _is_unknown_shape flag on partitioned op %s.", partition_op->GetName().c_str()); - REQUIRE_GRAPH_SUCCESS(partition_op->AddSubgraphName(subgraph_->GetName()), "Failed add subgraph name."); + "[Set][Attr] _is_unknown_shape flag on partitioned op %s failed.", partition_op->GetName().c_str()); + REQUIRE_GRAPH_SUCCESS(partition_op->AddSubgraphName(subgraph_->GetName()), + "[Add][SubgraphName] %s for op:%s.", + subgraph_->GetName().c_str(), partition_op->GetName().c_str()); REQUIRE_GRAPH_SUCCESS(partition_op->SetSubgraphInstanceName(0, subgraph_->GetName()), - "Failed set subgraph instance name."); + "[Call][SetSubgraphInstanceName] for op:%s failed, index:0, name:%s.", + partition_op->GetName().c_str(), subgraph_->GetName().c_str()); for (auto &node : nodes_) { - REQUIRE_NOT_NULL(subgraph_->AddNode(node), "Failed add node to subgraph."); + REQUIRE_NOT_NULL(subgraph_->AddNode(node), + "[Add][Node] %s to subgraph:%s failed.", node->GetName().c_str(), subgraph_->GetName().c_str()); REQUIRE(AttrUtils::SetBool(node->GetOpDesc(), ATTR_NAME_IS_UNKNOWN_SHAPE, is_unknown_shape), - "Failed set shape flag."); - REQUIRE_GRAPH_SUCCESS(GraphUtils::RemoveJustNode(graph, node), "Failed remove root graph node."); - REQUIRE_GRAPH_SUCCESS(node->SetOwnerComputeGraph(subgraph_), "Failed set owner graph."); + "[Set][Attr] %s to op:%s failed.", ATTR_NAME_IS_UNKNOWN_SHAPE.c_str(), node->GetName().c_str()); + REQUIRE_GRAPH_SUCCESS(GraphUtils::RemoveJustNode(graph, node), + "[Remove][JustNode] failed, graph:%s, node:%s.", + graph->GetName().c_str(), node->GetName().c_str()); + REQUIRE_GRAPH_SUCCESS(node->SetOwnerComputeGraph(subgraph_), + "[Set][OwnerComputeGraph] %s for node:%s failed.", + subgraph_->GetName().c_str(), node->GetName().c_str()); for (const auto &anchor : node->GetAllInDataAnchors()) { auto peer_out_anchor = anchor->GetPeerOutAnchor(); if (peer_out_anchor == nullptr) { @@ -846,7 +867,7 @@ Status Cluster::BuildPartitionFrame() { if (src_cluster->id_ != id_) { AddFrameInput(anchor); REQUIRE_GRAPH_SUCCESS(partition_op->AddInputDesc(node->GetOpDesc()->GetInputDesc(anchor->GetIdx())), - "Failed add input desc."); + "[Add][InputDesc] to op:%s failed.", partition_op->GetName().c_str()); } } auto in_control_anchor = node->GetInControlAnchor(); @@ -859,7 +880,7 @@ Status Cluster::BuildPartitionFrame() { if (src_cluster->id_ != id_) { REQUIRE_GRAPH_SUCCESS( GraphUtils::RemoveEdge(peer_out_control_anchor, in_control_anchor), - "Failed remove edge from %s:%d to %s:%d.", peer_out_control_anchor->GetOwnerNode()->GetName().c_str(), + "[Remove][Edge] from %s:%d to %s:%d failed.", peer_out_control_anchor->GetOwnerNode()->GetName().c_str(), peer_out_control_anchor->GetIdx(), node->GetName().c_str(), in_control_anchor->GetIdx()); control_inputs_.insert(src_cluster); src_cluster->control_outputs_.insert(peer_out_control_anchor); @@ -873,23 +894,28 @@ Status Cluster::BuildPartitionFrame() { if (src_cluster->id_ != id_) { AddFrameOutput(anchor); REQUIRE_GRAPH_SUCCESS(partition_op->AddOutputDesc(node->GetOpDesc()->GetOutputDesc(anchor->GetIdx())), - "Failed add output desc."); + "[Add][OutputDesc] to op:%s failed.", partition_op->GetName().c_str()); break; } } } } partition_node_ = graph->AddNode(partition_op); - REQUIRE_NOT_NULL(partition_node_, "Failed add partition node."); - REQUIRE_GRAPH_SUCCESS(partition_node_->SetOwnerComputeGraph(graph), "Failed set owner graph."); + REQUIRE_NOT_NULL(partition_node_, + "[Add][Node] %s to graph:%s failed.", partition_op->GetName().c_str(), graph->GetName().c_str()); + REQUIRE_GRAPH_SUCCESS(partition_node_->SetOwnerComputeGraph(graph), + "[Set][OwnerComputeGraph] %s for node:%s failed.", + graph->GetName().c_str(), partition_op->GetName().c_str()); subgraph_->SetParentNode(partition_node_); subgraph_->SetParentGraph(graph); - REQUIRE_GRAPH_SUCCESS(graph->AddSubgraph(subgraph_), "Failed add subgraph to root graph."); + REQUIRE_GRAPH_SUCCESS(graph->AddSubgraph(subgraph_), + "[Add][Subgraph] %s to root graph:%s failed.", + subgraph_->GetName().c_str(), graph->GetName().c_str()); std::string session_graph_id; REQUIRE(AttrUtils::GetStr(*graph, ATTR_NAME_SESSION_GRAPH_ID, session_graph_id), - "Failed get ATTR_NAME_SESSION_GRAPH_ID on root graph."); + "[Get][Attr] %s on root graph:%s failed.", ATTR_NAME_SESSION_GRAPH_ID.c_str(), graph->GetName().c_str()); REQUIRE(AttrUtils::SetStr(*subgraph_, ATTR_NAME_SESSION_GRAPH_ID, session_graph_id), - "Failed set ATTR_NAME_SESSION_GRAPH_ID on subgraph."); + "[Set][Attr] %s on subgraph:%s failed.", ATTR_NAME_SESSION_GRAPH_ID.c_str(), subgraph_->GetName().c_str()); return SUCCESS; } @@ -899,17 +925,17 @@ Status Cluster::CombinePartitionFrame() { auto src_cluster = partitioner_->node_2_cluster_[peer_out_anchor->GetOwnerNode()]; auto src_anchor = src_cluster->GetFrameOutDataAnchor(peer_out_anchor); auto dst_anchor = GetFrameInDataAnchor(anchor); - REQUIRE_GRAPH_SUCCESS(GraphUtils::RemoveEdge(peer_out_anchor, anchor), "Failed remove edge from %s:%d to %s:%d.", + REQUIRE_GRAPH_SUCCESS(GraphUtils::RemoveEdge(peer_out_anchor, anchor), "[Remove][Edge] from %s:%d to %s:%d fail.", peer_out_anchor->GetOwnerNode()->GetName().c_str(), peer_out_anchor->GetIdx(), anchor->GetOwnerNode()->GetName().c_str(), anchor->GetIdx()); - REQUIRE_GRAPH_SUCCESS(GraphUtils::AddEdge(src_anchor, dst_anchor), "Failed add edge from %s:%d to %s:%d.", + REQUIRE_GRAPH_SUCCESS(GraphUtils::AddEdge(src_anchor, dst_anchor), "[Add][Edge] from %s:%d to %s:%d failed.", src_anchor->GetOwnerNode()->GetName().c_str(), src_anchor->GetIdx(), dst_anchor->GetOwnerNode()->GetName().c_str(), dst_anchor->GetIdx()); } for (const auto &src_cluster : control_inputs_) { auto src_anchor = src_cluster->GetFrameOutControlAnchor(); auto dst_anchor = GetFrameInControlAnchor(); - REQUIRE_GRAPH_SUCCESS(GraphUtils::AddEdge(src_anchor, dst_anchor), "Failed add edge from %s:%d to %s:%d.", + REQUIRE_GRAPH_SUCCESS(GraphUtils::AddEdge(src_anchor, dst_anchor), "[Add][Edge] from %s:%d to %s:%d failed.", src_anchor->GetOwnerNode()->GetName().c_str(), src_anchor->GetIdx(), dst_anchor->GetOwnerNode()->GetName().c_str(), dst_anchor->GetIdx()); } @@ -924,55 +950,69 @@ Status Cluster::BuildPartitionSubgraph() { for (auto anchor : inputs_) { auto data_op = MakeShared(subgraph_->GetName() + std::string("Data_") + std::to_string(parent_node_index), ge::DATA); - REQUIRE_NOT_NULL(data_op, "Failed new memory for data op."); + REQUIRE_NOT_NULL(data_op, "[New][Memory] for data op failed."); auto input_desc = anchor->GetOwnerNode()->GetOpDesc()->GetInputDesc(anchor->GetIdx()); - REQUIRE_GRAPH_SUCCESS(data_op->AddInputDesc(input_desc), "Failed add input desc."); - REQUIRE_GRAPH_SUCCESS(data_op->AddOutputDesc(input_desc), "Failed add output desc."); + REQUIRE_GRAPH_SUCCESS(data_op->AddInputDesc(input_desc), + "[Add][InputDesc] to op:%s failed.", data_op->GetName().c_str()); + REQUIRE_GRAPH_SUCCESS(data_op->AddOutputDesc(input_desc), + "[Add][OutputDesc] to op:%s failed.", data_op->GetName().c_str()); REQUIRE(AttrUtils::SetInt(data_op, ATTR_NAME_PARENT_NODE_INDEX, parent_node_index), - "Failed set parent_node_index on subgraph data node."); + "[Set][Attr] %s on subgraph data node:%s failed.", + ATTR_NAME_PARENT_NODE_INDEX.c_str(), data_op->GetName().c_str()); bool is_unknown_shape = IsUnknownShape(); REQUIRE(AttrUtils::SetBool(data_op, ATTR_NAME_IS_UNKNOWN_SHAPE, is_unknown_shape), - "Failed set _is_unknown_shape flag on data op %s.", data_op->GetName().c_str()); + "[Set][Attr] %s on data op %s failed.", ATTR_NAME_IS_UNKNOWN_SHAPE.c_str(), data_op->GetName().c_str()); auto data_node = subgraph_->AddNode(data_op); - REQUIRE_NOT_NULL(data_node, "Failed add data node to subgraph."); - REQUIRE_GRAPH_SUCCESS(data_node->SetOwnerComputeGraph(subgraph_), "Failed set owner graph of data node."); + REQUIRE_NOT_NULL(data_node, + "[Add][Node] %s to subgraph:%s failed.", data_op->GetName().c_str(), subgraph_->GetName().c_str()); + REQUIRE_GRAPH_SUCCESS(data_node->SetOwnerComputeGraph(subgraph_), + "[Set][OwnerGraph] %s of data node:%s failed.", + subgraph_->GetName().c_str(), data_op->GetName().c_str()); REQUIRE_GRAPH_SUCCESS(GraphUtils::AddEdge(data_node->GetOutDataAnchor(0), anchor), - "Faile add data input edge to %s:%d", anchor->GetOwnerNode()->GetName().c_str(), - anchor->GetIdx()); + "[Call][AddEdge] Failed add data input edge to %s:%d", + anchor->GetOwnerNode()->GetName().c_str(), anchor->GetIdx()); parent_node_index++; } if (outputs_.empty() && control_outputs_.empty()) { return SUCCESS; } auto net_output_op = MakeShared(subgraph_->GetName() + "_" + NODE_NAME_NET_OUTPUT, ge::NETOUTPUT); - REQUIRE_NOT_NULL(net_output_op, "Failed new memory for netoutput op."); + REQUIRE_NOT_NULL(net_output_op, "[New][Memory] for netoutput op failed."); bool is_unknown_shape = IsUnknownShape(); REQUIRE(AttrUtils::SetBool(net_output_op, ATTR_NAME_IS_UNKNOWN_SHAPE, is_unknown_shape), - "Failed set _is_unknown_shape flag on net_output_op %s.", net_output_op->GetName().c_str()); + "[Set][Attr] %s on op:%s failed.", ATTR_NAME_IS_UNKNOWN_SHAPE.c_str(), net_output_op->GetName().c_str()); for (size_t i = 0; i < outputs_.size(); ++i) { GeTensorDesc input_desc; - REQUIRE_GRAPH_SUCCESS(net_output_op->AddInputDesc(input_desc), "Failed add input desc."); + REQUIRE_GRAPH_SUCCESS(net_output_op->AddInputDesc(input_desc), + "[Add][InputDesc] to op:%s failed.", net_output_op->GetName().c_str()); } auto net_output_node = subgraph_->AddNode(net_output_op); - REQUIRE_NOT_NULL(net_output_node, "Failed add netoutput node to subgraph."); - REQUIRE_GRAPH_SUCCESS(net_output_node->SetOwnerComputeGraph(subgraph_), "Failed set owner graph of netoutput node."); + REQUIRE_NOT_NULL(net_output_node, + "[Call][AddNode] Failed add netoutput node:%s to subgraph:%s.", + net_output_op->GetName().c_str(), subgraph_->GetName().c_str()); + REQUIRE_GRAPH_SUCCESS(net_output_node->SetOwnerComputeGraph(subgraph_), + "[Set][OwnerGraph] %s of netoutput node:%s failed.", + subgraph_->GetName().c_str(), net_output_node->GetName().c_str()); parent_node_index = 0; for (const auto &anchor : outputs_) { auto output_desc = anchor->GetOwnerNode()->GetOpDesc()->GetOutputDesc(static_cast(anchor->GetIdx())); REQUIRE(AttrUtils::SetInt(output_desc, ATTR_NAME_PARENT_NODE_INDEX, parent_node_index), - "Failed set parent_node_index on subgraph netoutput's input."); + "[Set][Attr] parent_node_index on subgraph node:%s netoutput's input failed.", + anchor->GetOwnerNode()->GetName().c_str()); REQUIRE_GRAPH_SUCCESS(net_output_op->UpdateInputDesc(parent_node_index, output_desc), - "Failed update input desc of netoutput node."); + "[Update][InputDesc] of netoutput node:%s failed.", net_output_op->GetName().c_str()); REQUIRE_GRAPH_SUCCESS(GraphUtils::AddEdge(anchor, net_output_node->GetInDataAnchor(parent_node_index)), - "Faile add edge from %s:%d to netoutput node.", anchor->GetOwnerNode()->GetName().c_str(), - anchor->GetIdx()); + "[Add][Edge] from %s:%d to netoutput node:%s failed.", + anchor->GetOwnerNode()->GetName().c_str(), anchor->GetIdx(), + net_output_op->GetName().c_str()); parent_node_index++; } for (const auto &anchor : control_outputs_) { REQUIRE_GRAPH_SUCCESS(GraphUtils::AddEdge(anchor, net_output_node->GetInControlAnchor()), - "Faile add control edge from %s:%d to netoutput node.", - anchor->GetOwnerNode()->GetName().c_str(), anchor->GetIdx()); + "[Add][ControlEdge] from %s:%d to netoutput node:%s failed.", + anchor->GetOwnerNode()->GetName().c_str(), anchor->GetIdx(), + net_output_op->GetName().c_str()); } return SUCCESS; } diff --git a/ge/graph/partition/engine_place.cc b/ge/graph/partition/engine_place.cc index f4ebbdca..93cc3e61 100755 --- a/ge/graph/partition/engine_place.cc +++ b/ge/graph/partition/engine_place.cc @@ -36,12 +36,14 @@ std::mutex check_support_cost_mutex; } Status EnginePlacer::Check() const { if (compute_graph_ == nullptr) { - GELOGE(GE_GRAPH_NULL_INPUT, "compute_graph_ is null."); + REPORT_INNER_ERROR("E19999", "compute_graph_ is nullptr, check invalid."); + GELOGE(GE_GRAPH_NULL_INPUT, "[Check][Param] compute_graph_ is nullptr."); return FAILED; } std::shared_ptr instance_ptr = ge::GELib::GetInstance(); if ((instance_ptr == nullptr) || (!instance_ptr->InitFlag())) { - GELOGE(GE_CLI_GE_NOT_INITIALIZED, "Run enginePlacer failed"); + REPORT_INNER_ERROR("E19999", "GELib instance is nullptr or it is not InitFlag, check invalid."); + GELOGE(GE_CLI_GE_NOT_INITIALIZED, "[Get][GELib] Run enginePlacer failed, because GELib is invalid."); return FAILED; } return SUCCESS; @@ -87,13 +89,13 @@ Status EnginePlacer::Run() { is_check_support_success = false; ErrorManager::GetInstance().ATCReportErrMessage( "E13003", {"opname", "optype"}, {op_desc->GetName(), op_desc->GetType()}); - GELOGE(GE_CLI_GE_NOT_INITIALIZED, "Can not find engine of op type %s", - node_ptr->GetOpDesc()->GetType().c_str()); + GELOGE(GE_CLI_GE_NOT_INITIALIZED, "[Check][Param] Can not find engine of op name %s type %s", + op_desc->GetName().c_str(), op_desc->GetType().c_str()); continue; } } if (AssignEngineAndLog(node_ptr, engine_name) != SUCCESS) { - GELOGE(GE_GRAPH_ASSIGN_ENGINE_FAILED, "[GraphPartitioner]: AssignEngineAndLog FAILED"); + GELOGE(GE_GRAPH_ASSIGN_ENGINE_FAILED, "[Call][AssignEngineAndLog] FAILED, node:%s", op_desc->GetName().c_str()); return FAILED; } } @@ -107,7 +109,8 @@ Status EnginePlacer::Run() { Status EnginePlacer::AssignEngineAndLog(ge::ConstNodePtr node_ptr, const std::string &engine_name) { if ((node_ptr == nullptr) || (node_ptr->GetOpDesc() == nullptr)) { - GELOGE(FAILED, "node_ptr is null."); + REPORT_INNER_ERROR("E19999", "Param node_ptr is nullptr or it's opdesc is nullptr, check invalid."); + GELOGE(FAILED, "[Check][Param] node_ptr is nullptr."); return FAILED; } diff --git a/ge/graph/partition/graph_partition.cc b/ge/graph/partition/graph_partition.cc index 1e6f6895..503979cb 100755 --- a/ge/graph/partition/graph_partition.cc +++ b/ge/graph/partition/graph_partition.cc @@ -49,13 +49,18 @@ Status ge::GraphPartitioner::CheckIfEnd2PldEmpty(ge::ComputeGraphPtr &output_mer if (graph_info_.partitions_.size() == kOneGraph) { auto partition = (*graph_info_.partitions_.begin()); if (partition.first == nullptr) { - GELOGE(GE_GRAPH_EMPTY_PARTITION, "[GraphPartitioner]: partition.first is null, engine name is %s", + REPORT_INNER_ERROR("E19999", "partition.first is nullptr, check invalid, engine name is %s", + partition.second.c_str()); + GELOGE(GE_GRAPH_EMPTY_PARTITION, "[Check][Param] partition.first is null, engine name is %s", partition.second.c_str()); return FAILED; } output_merged_compute_graph = partition.first; } else { // if placeholder to end map is empty, it should be an exception condition - GELOGE(GE_GRAPH_EMPTY_PARTITION, "[GraphPartitioner]: placeholder to end map is empty, partitions size is not 1."); + REPORT_INNER_ERROR("E19999", "partitions size:%zu is not 1, check invalid.", graph_info_.partitions_.size()); + GELOGE(GE_GRAPH_EMPTY_PARTITION, + "[Check][Param] placeholder to end map is empty, partitions size:%zu is not 1.", + graph_info_.partitions_.size()); return FAILED; } return SUCCESS; @@ -80,7 +85,8 @@ Status ge::GraphPartitioner::MergeAllSubGraph(ge::ComputeGraphPtr &output_merged (void)AttrUtils::SetStr(node->GetOpDesc(), ATTR_NAME_STREAM_LABEL, temp_stream); } if (node->SetOwnerComputeGraph(output_merged_compute_graph) != GRAPH_SUCCESS) { - GELOGE(GE_GRAPH_PARAM_NULLPTR, "SetownerComputeGraph failed, node %s", node->GetName().c_str()); + REPORT_CALL_ERROR("E19999", "SetOwnerComputeGraph for node:%s failed.", node->GetName().c_str()); + GELOGE(GE_GRAPH_PARAM_NULLPTR, "[Set][OwnerComputeGraph] failed, node %s", node->GetName().c_str()); return FAILED; } (void)output_merged_compute_graph->AddNode(node); @@ -111,7 +117,8 @@ Status ge::GraphPartitioner::RemoveNodeAndEdgeBetweenEndPld(ge::ComputeGraphPtr const std::vector &sub_graph_list) { if ((output_merged_compute_graph == nullptr) || (MergeAllSubGraph(output_merged_compute_graph, sub_graph_list) != SUCCESS)) { - GELOGE(GE_GRAPH_PARAM_NULLPTR, "[GraphPartitioner]: MergeAllSubGraph failed."); + REPORT_INNER_ERROR("E19999", "output_merged_compute_graph is nullptr or Call MergeAllSubGraph failed."); + GELOGE(GE_GRAPH_PARAM_NULLPTR, "[Merge][AllSubGraph] failed."); return FAILED; } for (const auto &it : graph_info_.index_2_end_) { @@ -127,19 +134,31 @@ Status ge::GraphPartitioner::RemoveNodeAndEdgeBetweenEndPld(ge::ComputeGraphPtr : Anchor::DynamicAnchorCast(pld->GetOutDataAnchor(0)); auto src_anchor = end_in_anchor->GetFirstPeerAnchor(); // src_anchor should be only 1 if (GraphUtils::RemoveEdge(src_anchor, end_in_anchor) != GRAPH_SUCCESS) { - GELOGE(GE_GRAPH_PARAM_NULLPTR, "[GraphPartitioner]: RemoveEdge failed. node_name:%s, graph_name:%s", + REPORT_CALL_ERROR("E19999", "RemoveEdge between %s and %s failed", + src_anchor->GetOwnerNode()->GetName().c_str(), + end_in_anchor->GetOwnerNode()->GetName().c_str()); + GELOGE(GE_GRAPH_PARAM_NULLPTR, "[Remove][Edge] between %s and %s failed. node_name:%s, graph_name:%s", + src_anchor->GetOwnerNode()->GetName().c_str(), end_in_anchor->GetOwnerNode()->GetName().c_str(), end->GetName().c_str(), end->GetOwnerComputeGraph()->GetName().c_str()); return FAILED; } GE_CHECK_NOTNULL(pld_out_anchor); for (const auto &peer_in_anchor : pld_out_anchor->GetPeerAnchors()) { if (GraphUtils::RemoveEdge(pld_out_anchor, peer_in_anchor) != GRAPH_SUCCESS) { - GELOGE(GE_GRAPH_PARAM_NULLPTR, "[GraphPartitioner]: RemoveEdge failed. node_name:%s, graph_name:%s", + REPORT_CALL_ERROR("E19999", "RemoveEdge between %s and %s failed", + pld_out_anchor->GetOwnerNode()->GetName().c_str(), + peer_in_anchor->GetOwnerNode()->GetName().c_str()); + GELOGE(GE_GRAPH_PARAM_NULLPTR, "[Remove][Edge] between %s and %s failed. node_name:%s, graph_name:%s", + pld_out_anchor->GetOwnerNode()->GetName().c_str(), peer_in_anchor->GetOwnerNode()->GetName().c_str(), pld->GetName().c_str(), pld->GetOwnerComputeGraph()->GetName().c_str()); return FAILED; } if (GraphUtils::AddEdge(src_anchor, peer_in_anchor) != GRAPH_SUCCESS) { - GELOGE(GE_GRAPH_PARAM_NULLPTR, "merge two subgraph fail."); + REPORT_CALL_ERROR("E19999", "AddEdge from %s to %s failed.", + src_anchor->GetOwnerNode()->GetName().c_str(), + peer_in_anchor->GetOwnerNode()->GetName().c_str()); + GELOGE(GE_GRAPH_PARAM_NULLPTR, "[Add][Edge] from %s to %s failed.", + src_anchor->GetOwnerNode()->GetName().c_str(), peer_in_anchor->GetOwnerNode()->GetName().c_str()); return FAILED; } } @@ -157,7 +176,7 @@ Status ge::GraphPartitioner::MergeAfterSubGraphOptimization(ge::ComputeGraphPtr if (ret != SUCCESS) { // even though failed, ensure all op do finish check support real_ret = FAILED; - GELOGE(ret, "Graph merging Failed"); + GELOGE(ret, "[Merge][SubGraph] Failed, ret:%d", ret); } GE_CHECK_NOTNULL(original_compute_graph); // partition sub graph @@ -166,7 +185,7 @@ Status ge::GraphPartitioner::MergeAfterSubGraphOptimization(ge::ComputeGraphPtr ret = MergeSubGraph(merged_sub_graph, sub_graph); if (ret != SUCCESS) { real_ret = FAILED; - GELOGE(ret, "Sub graph merging Failed"); + GELOGE(ret, "[Merge][SubGraph] Failed, ret:%d", ret); continue; } // add sub graph @@ -176,19 +195,32 @@ Status ge::GraphPartitioner::MergeAfterSubGraphOptimization(ge::ComputeGraphPtr merged_sub_graph->SetOutputSize(sub_graph->GetOutputSize()); auto parent_node = sub_graph->GetParentNode(); GE_IF_BOOL_EXEC(parent_node == nullptr, - GELOGE(FAILED, "Parent node is null, graph name is %s", sub_graph->GetName().c_str()); + REPORT_INNER_ERROR("E19999", "Parent node of graph:%s is nullptr.", + sub_graph->GetName().c_str()); + GELOGE(FAILED, "[Check][Param] Parent node is null, graph name is %s", + sub_graph->GetName().c_str()); return FAILED;) auto original_graph = parent_node->GetOwnerComputeGraph(); GE_IF_BOOL_EXEC(graph_2_graph_partition_info_.find(original_graph) == graph_2_graph_partition_info_.end(), - GELOGE(FAILED, "Find graph info failed, graph name is %s", original_graph->GetName().c_str()); + REPORT_INNER_ERROR("E19999", "graph:%s not find in graph_2_graph_partition_info_, check invalid.", + original_graph->GetName().c_str()); + GELOGE(FAILED, "[Check][Param] Find graph info failed, graph name is %s", + original_graph->GetName().c_str()); return FAILED;) auto graph_info = graph_2_graph_partition_info_[original_graph]; GE_IF_BOOL_EXEC(graph_info.corresponding_node_in_partitions_.count(parent_node) == 0, - GELOGE(FAILED, "Find corresponding node failed, parent node name is %s", parent_node->GetName().c_str()); - return FAILED;) + REPORT_INNER_ERROR("E19999", "node:%s not find in corresponding_node_in_partitions_, " + "check invalid", parent_node->GetName().c_str()); + GELOGE(FAILED, "[Check][Param] Find corresponding node failed, parent node name is %s", + parent_node->GetName().c_str()); + return FAILED;) auto corresponding_node = graph_info.corresponding_node_in_partitions_[parent_node]; - GE_IF_BOOL_EXEC(corresponding_node == nullptr, GELOGE(FAILED, "Get null node, node name is %s", - parent_node->GetName().c_str()); return FAILED;); + GE_IF_BOOL_EXEC(corresponding_node == nullptr, + REPORT_INNER_ERROR("E19999", "Get null node in corresponding_node_in_partitions_, " + "first node name is %s", parent_node->GetName().c_str()); + GELOGE(FAILED, "[Check][Param] Get null node in corresponding_node_in_partitions_, " + "first node name is %s", parent_node->GetName().c_str()); + return FAILED;); merged_sub_graph->SetParentNode(corresponding_node); auto subgraph_parent_graph = corresponding_node->GetOwnerComputeGraph(); merged_sub_graph->SetParentGraph(subgraph_parent_graph); @@ -207,12 +239,17 @@ Status ge::GraphPartitioner::MergeAfterSubGraphOptimization(ge::ComputeGraphPtr Status ge::GraphPartitioner::MergeSubGraph(ge::ComputeGraphPtr &output_merged_compute_graph, const ge::ComputeGraphPtr &original_compute_graph) { if (original_compute_graph == nullptr) { - GELOGE(GE_GRAPH_NULL_INPUT, "[GraphPartitioner]: compute_graph is null."); + REPORT_INNER_ERROR("E19999", "Param original_compute_graph is nullptr, check invalid."); + GELOGE(GE_GRAPH_NULL_INPUT, "[Check][Param] original_compute_graph is nullptr."); return FAILED; } if ((graph_2_graph_partition_info_.find(original_compute_graph) == graph_2_graph_partition_info_.end()) || (graph_2_subgraph_list_.find(original_compute_graph) == graph_2_subgraph_list_.end())) { - GELOGE(GE_GRAPH_NULL_INPUT, "[GraphPartitioner]: compute_graph is error."); + REPORT_INNER_ERROR("E19999", "original_compute_graph:%s is not find in graph_2_graph_partition_info_.", + original_compute_graph->GetName().c_str()); + GELOGE(GE_GRAPH_NULL_INPUT, + "[Check][Param] original_compute_graph:%s is not find in graph_2_graph_partition_info_.", + original_compute_graph->GetName().c_str()); return FAILED; } GraphPartitionInfo &subgraph_info = graph_2_graph_partition_info_[original_compute_graph]; @@ -220,14 +257,16 @@ Status ge::GraphPartitioner::MergeSubGraph(ge::ComputeGraphPtr &output_merged_co graph_info_ = subgraph_info; if (graph_info_.mode_ != kMerging) { - GELOGE(GE_GRAPH_UNSUPPORTED, "Cannot call merging in partition mode"); + REPORT_INNER_ERROR("E19999", "Cannot call merging in partition mode, as mode != %d", kMerging); + GELOGE(GE_GRAPH_UNSUPPORTED, "[Check][Param] Cannot call merging in partition mode, as mode != %d", kMerging); return FAILED; } GELOGD("Graph merge starts."); // check input param for (const auto &it : sub_graph_list) { if (it == nullptr) { - GELOGE(GE_GRAPH_PARAM_NULLPTR, "[GraphPartitioner]: merging sub-graphs failed, sub-graph is null"); + REPORT_INNER_ERROR("E19999", "sub_graph is nullptr, check invalid."); + GELOGE(GE_GRAPH_PARAM_NULLPTR, "[Check][Param] merging sub-graphs failed, sub-graph is nullptr"); return FAILED; } } @@ -242,14 +281,16 @@ Status ge::GraphPartitioner::MergeSubGraph(ge::ComputeGraphPtr &output_merged_co output_merged_compute_graph = new_sub_graph; GE_TIMESTAMP_START(MergeSubGraphRemoveNode); if (RemoveNodeAndEdgeBetweenEndPld(output_merged_compute_graph, sub_graph_list) != ge::SUCCESS) { - GELOGE(GE_GRAPH_PARAM_NULLPTR, "[GraphPartitioner]: merging sub-graphs failed"); + GELOGE(GE_GRAPH_PARAM_NULLPTR, "[Call][RemoveNodeAndEdgeBetweenEndPld] failed, graph:%s", + output_merged_compute_graph->GetName().c_str()); return FAILED; } GE_TIMESTAMP_END(MergeSubGraphRemoveNode, "GraphPartitioner::MergeGraphRemoveNodeAndEdge"); GE_TIMESTAMP_START(MergeSubGraphTopologicalSorting); Status ret = output_merged_compute_graph->TopologicalSorting(); if (ret != SUCCESS) { - GELOGE(GE_GRAPH_TOPO_SORT_FAILED, "[GraphPartitioner]: output_merged_compute_graph->TopologicalSorting failed"); + GELOGE(GE_GRAPH_TOPO_SORT_FAILED, "[Call][TopologicalSorting] for output_merged_compute_graph:%s failed", + output_merged_compute_graph->GetName().c_str()); return FAILED; } GE_TIMESTAMP_END(MergeSubGraphTopologicalSorting, "GraphPartitioner::MergeGraphTopologicalSorting"); @@ -257,7 +298,8 @@ Status ge::GraphPartitioner::MergeSubGraph(ge::ComputeGraphPtr &output_merged_co GE_TIMESTAMP_START(MergeSubGraphEnginePlacerRun); graph_info_.engine_placer_.SetComputeGraph(output_merged_compute_graph); if (graph_info_.engine_placer_.Run() != SUCCESS) { - GELOGE(GE_GRAPH_INIT_FAILED, "[GraphPartitioner]: engine_placer run failed"); + GELOGE(GE_GRAPH_INIT_FAILED, "[Call][Run] engine_placer run failed, graph:%s", + output_merged_compute_graph->GetName().c_str()); return FAILED; } GE_TIMESTAMP_END(MergeSubGraphEnginePlacerRun, "GraphPartitioner::MergeGraphEnginePlacerRun"); @@ -267,17 +309,22 @@ Status ge::GraphPartitioner::MergeSubGraph(ge::ComputeGraphPtr &output_merged_co Status ge::GraphPartitioner::UpdatePldOpDesc(const NodePtr &dst_node, int input_index, OpDescPtr &pld_op_desc) { if ((dst_node == nullptr) || (pld_op_desc == nullptr) || (dst_node->GetOpDesc() == nullptr)) { - GELOGE(FAILED, "parameter ptr is null."); + REPORT_INNER_ERROR("E19999", "Param dst_node or pld_op_desc or op of dst_node is nullptr, check invalid"); + GELOGE(FAILED, "[Check][Param] parameter ptr is null."); return FAILED; } const auto &input_desc = dst_node->GetOpDesc()->GetInputDesc(static_cast(input_index)); - GE_IF_BOOL_EXEC(pld_op_desc->AddOutputDesc(input_desc) != GRAPH_SUCCESS, GELOGE(FAILED, "AddOutputDesc failed"); - return FAILED;) + GE_IF_BOOL_EXEC(pld_op_desc->AddOutputDesc(input_desc) != GRAPH_SUCCESS, + REPORT_CALL_ERROR("E19999", "AddOutputDesc to op:%s failed", pld_op_desc->GetName().c_str()); + GELOGE(FAILED, "[Add][OutputDesc] to op:%s failed", pld_op_desc->GetName().c_str()); + return FAILED;) if (pld_op_desc->MutableOutputDesc(0) != nullptr) { ge::TensorUtils::SetRealDimCnt(*(pld_op_desc->MutableOutputDesc(0).get()), static_cast(input_desc.GetShape().GetDims().size())); } else { - GELOGE(GE_GRAPH_ADD_PLC_END_FAILED, "[GraphPartitioner]: pld_op_desc is null."); + REPORT_INNER_ERROR("E19999", "output(0) of op:%s is nullptr, check invalid", pld_op_desc->GetName().c_str()); + GELOGE(GE_GRAPH_ADD_PLC_END_FAILED, "[Check][Param] output(0) of op:%s is nullptr.", + pld_op_desc->GetName().c_str()); return FAILED; } return SUCCESS; @@ -285,17 +332,22 @@ Status ge::GraphPartitioner::UpdatePldOpDesc(const NodePtr &dst_node, int input_ Status ge::GraphPartitioner::UpdateEndOpDesc(const NodePtr &src_node, int output_index, OpDescPtr &end_op_desc) { if ((src_node == nullptr) || (end_op_desc == nullptr) || (src_node->GetOpDesc() == nullptr)) { - GELOGE(FAILED, "parameter ptr is null."); + REPORT_INNER_ERROR("E19999", "Param src_node or end_op_desc or op of src_node is nullptr, check invalid."); + GELOGE(FAILED, "[Check][Param] parameter ptr is null."); return FAILED; } const auto &output_desc = src_node->GetOpDesc()->GetOutputDesc(static_cast(output_index)); - GE_IF_BOOL_EXEC(end_op_desc->AddInputDesc(output_desc) != GRAPH_SUCCESS, GELOGE(FAILED, "AddInputDesc failed"); - return FAILED;) + GE_IF_BOOL_EXEC(end_op_desc->AddInputDesc(output_desc) != GRAPH_SUCCESS, + REPORT_CALL_ERROR("E19999", "AddInputDesc to op:%s failed", end_op_desc->GetName().c_str()); + GELOGE(FAILED, "[Add][InputDesc] to op:%s failed", end_op_desc->GetName().c_str()); + return FAILED;) if (end_op_desc->MutableInputDesc(0) != nullptr) { ge::TensorUtils::SetRealDimCnt(*(end_op_desc->MutableInputDesc(0).get()), static_cast(output_desc.GetShape().GetDims().size())); } else { - GELOGE(GE_GRAPH_ADD_PLC_END_FAILED, "[GraphPartitioner]: pld_op_desc is null."); + REPORT_INNER_ERROR("E19999", "input(0) of op:%s is nullptr, check invalid.", end_op_desc->GetName().c_str()); + GELOGE(GE_GRAPH_ADD_PLC_END_FAILED, "[Check][Param] input(0) of op:%s is nullptr.", + end_op_desc->GetName().c_str()); return FAILED; } return SUCCESS; @@ -315,7 +367,8 @@ graphStatus ge::GraphPartitioner::AddPlaceHolderEndInSrcDstGraph(const AnchorPtr string end_name = kEndType + std::to_string(graph_info_.num_of_pld_end_); auto end_op_desc = MakeShared(end_graph->GetName() + "_" + end_name, END); if (end_op_desc == nullptr) { - GELOGE(GRAPH_PARAM_INVALID, "pld_op_desc is nullptr."); + REPORT_CALL_ERROR("E19999", "New Memory for OpDesc failed."); + GELOGE(GRAPH_PARAM_INVALID, "[New][Memory] for OpDesc failed, pld_op_desc is nullptr."); return FAILED; } GE_IF_BOOL_EXEC(!AttrUtils::SetInt(end_op_desc, "peerIndex", graph_info_.num_of_pld_end_), @@ -333,28 +386,40 @@ graphStatus ge::GraphPartitioner::AddPlaceHolderEndInSrcDstGraph(const AnchorPtr bool is_need_update_desc = (output_index >= 0) && (graph_info_.mode_ == kPartitioning); if (is_need_update_desc) { if (UpdateEndOpDesc(src_node, output_index, end_op_desc) != SUCCESS) { - GELOGE(GRAPH_PARAM_INVALID, "UpdateEndOpDesc failed, input index %d", output_index); + GELOGE(GRAPH_PARAM_INVALID, "[Update][EndOpDesc] failed, input index:%d, end_op_desc:%s", + output_index, end_op_desc->GetName().c_str()); return FAILED; } } else { GeTensorDesc input_desc; if (end_op_desc->AddInputDesc(input_desc) != SUCCESS) { - GELOGE(GRAPH_PARAM_INVALID, "AddInputDesc failed, input index %d", output_index); + REPORT_CALL_ERROR("E19999", "add input desc to op:%s failed, input index:%d", + end_op_desc->GetName().c_str(), output_index); + GELOGE(GRAPH_PARAM_INVALID, "[Add][InputDesc] to op:%s failed, input index %d", + end_op_desc->GetName().c_str(), output_index); return FAILED; } } NodePtr new_end_node = end_graph->AddNode(end_op_desc); if (new_end_node == nullptr) { - GELOGE(GRAPH_PARAM_INVALID, "new_end_node is nullptr."); + REPORT_CALL_ERROR("E19999", "add node:%s in graph:%s failed", + end_op_desc->GetName().c_str(), end_graph->GetName().c_str()); + GELOGE(GRAPH_PARAM_INVALID, "[Add][Node] %s in graph:%s failed.", + end_op_desc->GetName().c_str(), end_graph->GetName().c_str()); return FAILED; } GE_IF_BOOL_EXEC(new_end_node->SetOwnerComputeGraph(end_graph) != GRAPH_SUCCESS, - GELOGE(GRAPH_PARAM_INVALID, "SetOwnerComputeGraph failed"); + REPORT_CALL_ERROR("E19999", "SetOwnerComputeGraph %s for node:%s failed", + end_graph->GetName().c_str(), new_end_node->GetName().c_str()); + GELOGE(GRAPH_PARAM_INVALID, "[Set][OwnerComputeGraph] %s for node:%s failed", + end_graph->GetName().c_str(), new_end_node->GetName().c_str()); return FAILED;) AnchorPtr end_dst_anchor = GetEndInAnchor(out_anchor, new_end_node); if (GraphUtils::AddEdge(out_anchor, end_dst_anchor) != GRAPH_SUCCESS) { - GELOGE(GE_GRAPH_ADD_PLC_END_FAILED, "add end node : %s node %dth out-anchor --> end in %s subgraph fail.", - src_node->GetName().c_str(), AnchorUtils::GetIdx(out_anchor), end_graph->GetName().c_str()); + REPORT_CALL_ERROR("E19999", "add edge from %s to %s failed", out_anchor->GetOwnerNode()->GetName().c_str(), + end_dst_anchor->GetOwnerNode()->GetName().c_str()); + GELOGE(GE_GRAPH_ADD_PLC_END_FAILED, "[Add][Edge] from %s to %s failed", + out_anchor->GetOwnerNode()->GetName().c_str(), end_dst_anchor->GetOwnerNode()->GetName().c_str()); return FAILED; } /// For fe, op id has been set in AddNode, @@ -365,7 +430,8 @@ graphStatus ge::GraphPartitioner::AddPlaceHolderEndInSrcDstGraph(const AnchorPtr const string pld_name = kPlaceHolderType + std::to_string(graph_info_.num_of_pld_end_); auto pld_op_desc = MakeShared(pld_graph->GetName() + "_" + pld_name, PLACEHOLDER); if (pld_op_desc == nullptr) { - GELOGE(GRAPH_PARAM_INVALID, "pld_op_desc is nullptr."); + REPORT_CALL_ERROR("E19999", "New Memory for OpDesc failed."); + GELOGE(GRAPH_PARAM_INVALID, "[New][Memory] for OpDesc failed."); return FAILED; } GE_IF_BOOL_EXEC(!AttrUtils::SetInt(pld_op_desc, "peerIndex", graph_info_.num_of_pld_end_), @@ -401,30 +467,42 @@ graphStatus ge::GraphPartitioner::AddPlaceHolderEndInSrcDstGraph(const AnchorPtr is_need_update_desc = (input_index >= 0) && (graph_info_.mode_ == kPartitioning); if (is_need_update_desc) { if (UpdatePldOpDesc(dst_node, input_index, pld_op_desc) != SUCCESS) { - GELOGE(GRAPH_PARAM_INVALID, "UpdateEndOpDesc failed, output index %d", input_index); + GELOGE(GRAPH_PARAM_INVALID, "[Update][PldOpDesc] failed, output index:%d, pld_op_desc:%s", + input_index, pld_op_desc->GetName().c_str()); return FAILED; } } else { GeTensorDesc output_desc; if (pld_op_desc->AddOutputDesc(output_desc) != SUCCESS) { - GELOGE(GRAPH_PARAM_INVALID, "AddOutputDesc failed, input index %d", input_index); + REPORT_CALL_ERROR("E19999", "AddOutputDesc to op:%s failed, input index %d", + pld_op_desc->GetName().c_str(), input_index); + GELOGE(GRAPH_PARAM_INVALID, "[Add][OutputDesc] to op:%s failed, input index %d", + pld_op_desc->GetName().c_str(), input_index); return FAILED; } } NodePtr new_pld_node = pld_graph->AddNode(pld_op_desc); if (new_pld_node == nullptr) { - GELOGE(GRAPH_PARAM_INVALID, "new_pld_node is nullptr."); + REPORT_CALL_ERROR("E19999", "AddNode %s in graph:%s failed.", + pld_op_desc->GetName().c_str(), pld_graph->GetName().c_str()); + GELOGE(GRAPH_PARAM_INVALID, "[Add][Node] %s in graph:%s failed.", + pld_op_desc->GetName().c_str(), pld_graph->GetName().c_str()); return FAILED; } GE_IF_BOOL_EXEC(new_pld_node->SetOwnerComputeGraph(pld_graph) != GRAPH_SUCCESS, - GELOGE(GRAPH_PARAM_INVALID, "SetOwnerComputeGraph failed"); + REPORT_CALL_ERROR("E19999", "SetOwnerComputeGraph for node:%s failed, graph:%s", + new_pld_node->GetName().c_str(), pld_graph->GetName().c_str()); + GELOGE(GRAPH_PARAM_INVALID, "[Set][OwnerComputeGraph] for node:%s failed, graph:%s", + new_pld_node->GetName().c_str(), pld_graph->GetName().c_str()); return FAILED;) AnchorPtr pld_src_anchor = GetPldOutAnchor(new_pld_node, peer_in_anchor); // link placeHolder -> computeNode if (GraphUtils::AddEdge(pld_src_anchor, peer_in_anchor) != GRAPH_SUCCESS) { - GELOGE(GE_GRAPH_ADD_PLC_END_FAILED, - "add placeholder node : placeholder --> %s node %dth in-anchor in %s subgraph fail.", - dst_node->GetName().c_str(), AnchorUtils::GetIdx(peer_in_anchor), pld_graph->GetName().c_str()); + REPORT_CALL_ERROR("E19999", "AddEdge from %s to %s failed", + pld_src_anchor->GetOwnerNode()->GetName().c_str(), + peer_in_anchor->GetOwnerNode()->GetName().c_str()); + GELOGE(GE_GRAPH_ADD_PLC_END_FAILED, "[Add][Edge] from %s to %s failed", + pld_src_anchor->GetOwnerNode()->GetName().c_str(), peer_in_anchor->GetOwnerNode()->GetName().c_str()); return FAILED; } graph_info_.index_2_end_[graph_info_.num_of_pld_end_] = new_end_node; @@ -436,7 +514,8 @@ graphStatus ge::GraphPartitioner::AddPlaceHolderEndInSrcDstGraph(const AnchorPtr Status ge::GraphPartitioner::LinkInput2EndRemoveOrginalLink(ge::NodePtr input_node, ge::ComputeGraphPtr src_graph, ge::ComputeGraphPtr dst_graph) { if ((input_node == nullptr) || (src_graph == nullptr) || (dst_graph == nullptr)) { - GELOGE(FAILED, "parameter ptr is null."); + REPORT_INNER_ERROR("E19999", "Param input_node or src_graph or dst_graph is nullptr, check invalid."); + GELOGE(FAILED, "[Check][Param] parameter input_node or src_graph or dst_graph is nullptr."); return FAILED; } // get the original anchors and remove the original link @@ -444,27 +523,40 @@ Status ge::GraphPartitioner::LinkInput2EndRemoveOrginalLink(ge::NodePtr input_no for (auto &peer_in_anchor : out_data_anchor->GetPeerAnchors()) { if (peer_in_anchor->GetOwnerNode()->GetType() != kEndType) { if (GraphUtils::RemoveEdge(out_data_anchor, peer_in_anchor) != GRAPH_SUCCESS) { - GELOGE(FAILED, "[GraphPartitioner]: RemoveEdge() failed."); + REPORT_CALL_ERROR("E19999", "RemoveEdge between %s and %s failed.", + out_data_anchor->GetOwnerNode()->GetName().c_str(), + peer_in_anchor->GetOwnerNode()->GetName().c_str()); + GELOGE(FAILED, "[Remove][Edge] between %s and %s failed.", + out_data_anchor->GetOwnerNode()->GetName().c_str(), peer_in_anchor->GetOwnerNode()->GetName().c_str()); return FAILED; } // link input -> end auto ret = AddPlaceHolderEndInSrcDstGraph(out_data_anchor, peer_in_anchor, src_graph, dst_graph); if (ret != SUCCESS) { - GELOGE(GE_GRAPH_ADD_PLC_END_FAILED, "[GraphPartitioner]: AddPlaceHolderEndInSrcDstGraph() failed."); + GELOGE(GE_GRAPH_ADD_PLC_END_FAILED, "[Call][AddPlaceHolderEndInSrcDstGraph] failed, ret:%d.", ret); return ret; } } else { auto end_node = peer_in_anchor->GetOwnerNode(); if (GraphUtils::RemoveJustNode(src_graph, end_node) != GRAPH_SUCCESS) { - GELOGE(FAILED, "[GraphPartitioner]: RemoveJustNode() failed."); + REPORT_CALL_ERROR("E19999", "RemoveJustNode %s from graph:%s failed.", + end_node->GetName().c_str(), src_graph->GetName().c_str()); + GELOGE(FAILED, "[Remove][JustNode] %s from graph:%s failed.", + end_node->GetName().c_str(), src_graph->GetName().c_str()); return FAILED; } if (end_node->SetOwnerComputeGraph(dst_graph) != GRAPH_SUCCESS) { - GELOGE(FAILED, "[GraphPartitioner]: RemoveJustNode() failed."); + REPORT_CALL_ERROR("E19999", "SetOwnerComputeGraph for node:%s failed, graph:%s.", + end_node->GetName().c_str(), dst_graph->GetName().c_str()); + GELOGE(FAILED, "[Set][OwnerComputeGraph] to node:%s failed, graph:%s.", + end_node->GetName().c_str(), dst_graph->GetName().c_str()); return FAILED; } if (dst_graph->AddNode(end_node) == nullptr) { - GELOGE(FAILED, "[GraphPartitioner]: AddNode() failed."); + REPORT_CALL_ERROR("E19999", "AddNode %s in graph:%s failed.", + end_node->GetName().c_str(), dst_graph->GetName().c_str()); + GELOGE(FAILED, "[Add][Node] %s in graph:%s failed.", + end_node->GetName().c_str(), dst_graph->GetName().c_str()); return FAILED; } } @@ -476,27 +568,37 @@ Status ge::GraphPartitioner::LinkInput2EndRemoveOrginalLink(ge::NodePtr input_no Status ge::GraphPartitioner::PutInputNodesInSubGraph(const ge::ComputeGraphPtr &src_graph, const ge::ComputeGraphPtr &dst_graph) { if ((src_graph == nullptr) || (dst_graph == nullptr)) { - GELOGE(FAILED, "parameter ptr is null."); + REPORT_INNER_ERROR("E19999", "Param src_graph or dst_graph is nullptr, check invalid."); + GELOGE(FAILED, "[Check][Param] parameter src_graph or dst_graph is nullptr."); return FAILED; } for (auto &input_node : src_graph->GetDirectNode()) { if (IsDataLike(input_node)) { if (input_node->SetOwnerComputeGraph(dst_graph) != GRAPH_SUCCESS) { - GELOGE(FAILED, "[GraphPartitioner]: SetOwnerComputeGraph failed."); + REPORT_CALL_ERROR("E19999", "SetOwnerComputeGraph for node:%s failed, graph:%s.", + input_node->GetName().c_str(), dst_graph->GetName().c_str()); + GELOGE(FAILED, "[Set][OwnerComputeGraph] for node:%s failed, graph:%s.", + input_node->GetName().c_str(), dst_graph->GetName().c_str()); return FAILED; } // remove input node from src_graph if (GraphUtils::RemoveJustNode(src_graph, input_node) != GRAPH_SUCCESS) { - GELOGE(FAILED, "[GraphPartitioner]: RemoveJustNode() failed."); + REPORT_CALL_ERROR("E19999", "RemoveJustNode %s from graph:%s failed.", + input_node->GetName().c_str(), src_graph->GetName().c_str()); + GELOGE(FAILED, "[Remove][JustNode] %s from graph:%s failed.", + input_node->GetName().c_str(), src_graph->GetName().c_str()); return FAILED; } // add input node to dst_graph if (dst_graph->AddNode(input_node) == nullptr) { - GELOGE(FAILED, "[GraphPartitioner]: AddNode() failed."); + REPORT_CALL_ERROR("E19999", "AddNode %s in graph:%s failed.", + input_node->GetName().c_str(), src_graph->GetName().c_str()); + GELOGE(FAILED, "[Add][Node] %s in graph:%s failed.", + input_node->GetName().c_str(), src_graph->GetName().c_str()); return FAILED; } if (LinkInput2EndRemoveOrginalLink(input_node, src_graph, dst_graph) != ge::SUCCESS) { - GELOGE(FAILED, "[GraphPartitioner]: LinkInput2EndRemoveOrginalLink() failed."); + GELOGE(FAILED, "[Call][LinkInput2EndRemoveOrginalLink] failed."); return FAILED; } } @@ -519,7 +621,7 @@ bool ge::GraphPartitioner::IsDataLike(ge::NodePtr node) { bool ge::GraphPartitioner::HasNoInput(ge::NodePtr node) { if (node == nullptr) { - GELOGE(FAILED, "node_ptr is null."); + GELOGE(FAILED, "[Check][Param] node is nullptr."); return true; } return node->GetInNodes().empty(); @@ -529,12 +631,13 @@ Status ge::GraphPartitioner::Initialize(ge::ComputeGraphPtr compute_graph) { GELOGI("Initialize starts."); std::shared_ptr instance_ptr = ge::GELib::GetInstance(); if (instance_ptr == nullptr || compute_graph == nullptr) { - GELOGE(GE_GRAPH_NOT_INIT, "Graph partitioner initialize failed."); + REPORT_INNER_ERROR("E19999", "compute_graph or instance_ptr of GELib is nullptr, check invalid."); + GELOGE(GE_GRAPH_NOT_INIT, "[Check][Param] compute_graph or instance_ptr of GELib is nullptr."); return FAILED; } graph_info_.engine_placer_.SetComputeGraph(compute_graph); if (graph_info_.engine_placer_.Run() != SUCCESS) { - GELOGE(FAILED, "Engine placer run failed."); + GELOGE(FAILED, "[Call][Run] Engine placer run failed, graph:%s.", compute_graph->GetName().c_str()); return FAILED; } const NodeEngineMap *node_engine_map = graph_info_.engine_placer_.GetNodeEngineMap(); @@ -552,14 +655,16 @@ Status ge::GraphPartitioner::Initialize(ge::ComputeGraphPtr compute_graph) { new_cluster = cluster; } else { if (node_engine_map->count(node) == 0) { - GELOGE(FAILED, "node[%s] does not owner engine!", node->GetName().c_str()); + REPORT_INNER_ERROR("E19999", "node:%s not find in node_engine_map", node->GetName().c_str()); + GELOGE(FAILED, "[Check][Param] node[%s] does not owner engine!", node->GetName().c_str()); return FAILED; } ClusterPtr cluster = MakeShared(temp_index, node_engine_map->at(node), temp_stream); new_cluster = cluster; } if (new_cluster == nullptr) { - GELOGE(FAILED, "[GraphPartitioner]: failed to allocate new_cluster"); + REPORT_CALL_ERROR("E19999", "Allocate Cluster failed, index:%zu", temp_index); + GELOGE(FAILED, "[Allocate][Cluster] failed, index:%zu", temp_index); return FAILED; } new_cluster->nodes_.push_back(node); @@ -570,11 +675,11 @@ Status ge::GraphPartitioner::Initialize(ge::ComputeGraphPtr compute_graph) { if (parent_id < node_id) { auto iter = graph_info_.node_2_cluster_.find(parent); if (iter == graph_info_.node_2_cluster_.end()) { - GELOGE(FAILED, - "[GraphPartitioner]: node[%s]id[%ld]'s parent_node[%s]id[%ld]" - "should make cluster in advance", - node->GetOpDesc()->GetName().c_str(), node_id, - parent->GetOpDesc()->GetName().c_str(), parent_id); + REPORT_INNER_ERROR("E19999", "node[%s]id[%ld]'s parent_node[%s]id[%ld] should make cluster in advance", + node->GetOpDesc()->GetName().c_str(), node_id, + parent->GetOpDesc()->GetName().c_str(), parent_id); + GELOGE(FAILED, "[Check][Param] node[%s]id[%ld]'s parent_node[%s]id[%ld] should make cluster in advance", + node->GetOpDesc()->GetName().c_str(), node_id, parent->GetOpDesc()->GetName().c_str(), parent_id); return FAILED; } new_cluster->in_clu_.insert(iter->second->index_); @@ -603,7 +708,8 @@ Status ge::GraphPartitioner::AddPartitionsToGraphNode(vectorGetName().c_str()); + GELOGE(GE_GRAPH_EMPTY_PARTITION, "[Check][Param] partition is null, subgraph:%s", sub_graph->GetName().c_str()); return FAILED; } auto &engine_name = graph_info_.partitions_.at(sub_graph); @@ -619,7 +725,8 @@ Status ge::GraphPartitioner::AddPartitionsToGraphNode(vectorSetParentNode(compute_graph->GetParentNode()); auto sgi = MakeShared(); if (sgi == nullptr) { - GELOGE(GE_GRAPH_PARAM_NULLPTR, "[GraphPartitioner]: MakeShared sub graph info failed."); + REPORT_CALL_ERROR("E19999", "allocate memory for SubGraphInfo failed."); + GELOGE(GE_GRAPH_PARAM_NULLPTR, "[Allocate][Memory] for SubGraphInfo failed."); return FAILED; } // set engine name @@ -767,7 +874,8 @@ void ge::GraphPartitioner::MarkClusters() { Status ge::GraphPartitioner::SplitSubGraphs(ge::ComputeGraphPtr compute_graph) { GELOGD("SplitSubGraphs starts."); if (compute_graph == nullptr) { - GELOGE(FAILED, "parameter ptr is null."); + REPORT_INNER_ERROR("E19999", "Param compute_graph is nullptr, check invalid"); + GELOGE(FAILED, "[Check][Param] parameter ptr is null."); return FAILED; } // Create graphs for all clusters @@ -785,7 +893,8 @@ Status ge::GraphPartitioner::SplitSubGraphs(ge::ComputeGraphPtr compute_graph) { std::string graph_name = "new_sub_graph" + std::to_string(graph_info_.partitions_.size()); ComputeGraphPtr new_sub_graph = MakeShared(graph_name); if (new_sub_graph == nullptr) { - GELOGE(GE_GRAPH_PARAM_NULLPTR, "[GraphPartitioner]: MakeShared() failed."); + REPORT_CALL_ERROR("E19999", "allocate memory for ge::ComputeGraph failed."); + GELOGE(GE_GRAPH_PARAM_NULLPTR, "[Allocate][Memory] for ge::ComputeGraph failed."); return FAILED; } AddNewGraphToPartition(new_sub_graph, child_cluster->engine_name_); @@ -796,7 +905,10 @@ Status ge::GraphPartitioner::SplitSubGraphs(ge::ComputeGraphPtr compute_graph) { // build node to corresponding node map NodePtr corresponding_node = corresponding_graph->AddNode(node->GetOpDesc()); if (corresponding_node == nullptr) { - GELOGE(GE_GRAPH_PARAM_NULLPTR, "[GraphPartitioner]: AddNode() failed."); + REPORT_CALL_ERROR("E19999", "add node:%s in graph:%s failed", + node->GetName().c_str(), corresponding_graph->GetName().c_str()); + GELOGE(GE_GRAPH_PARAM_NULLPTR, "[Add][Node] %s in graph:%s failed.", + node->GetName().c_str(), corresponding_graph->GetName().c_str()); return FAILED; } graph_info_.corresponding_node_in_partitions_[node] = corresponding_node; @@ -808,8 +920,12 @@ Status ge::GraphPartitioner::SplitSubGraphs(ge::ComputeGraphPtr compute_graph) { // Normally, all nodes have a copy in corresponding_node_in_partitions_, so function at can not be exception auto iter = graph_info_.corresponding_node_in_partitions_.find(peer_out_anchor->GetOwnerNode()); if (iter == graph_info_.corresponding_node_in_partitions_.end()) { - GELOGE(GRAPH_FAILED, - "[SpiltSubGraphs]: node[%s]id[%ld]'s parent_node[%s]id[%ld]" + REPORT_INNER_ERROR("E19999", "node[%s]id[%ld]'s parent_node[%s]id[%ld]" + "should make corresponding in advance", + node->GetOpDesc()->GetName().c_str(), node->GetOpDesc()->GetId(), + peer_out_anchor->GetOwnerNode()->GetOpDesc()->GetName().c_str(), + peer_out_anchor->GetOwnerNode()->GetOpDesc()->GetId()); + GELOGE(GRAPH_FAILED, "[Check][Param] node[%s]id[%ld]'s parent_node[%s]id[%ld]" "should make corresponding in advance", node->GetOpDesc()->GetName().c_str(), node->GetOpDesc()->GetId(), peer_out_anchor->GetOwnerNode()->GetOpDesc()->GetName().c_str(), @@ -827,13 +943,19 @@ Status ge::GraphPartitioner::SplitSubGraphs(ge::ComputeGraphPtr compute_graph) { if (parent_cluster != child_cluster) { GELOGD("Parent cluster is %zu, child_cluster is %zu", parent_cluster->index_, child_cluster->index_); if (AddPlaceHolderEnd(peer_out_anchor, in_anchor) != ge::SUCCESS) { - GELOGE(GE_GRAPH_ADD_PLC_END_FAILED, "[GraphPartitioner]: AddPlaceHolderEndInSrcDstGraph() failed."); + GELOGE(GE_GRAPH_ADD_PLC_END_FAILED, + "[Call][AddPlaceHolderEnd] failed, out_anchor:%s index:%d, in_anchor:%s index:%d.", + peer_out_anchor->GetOwnerNode()->GetName().c_str(), AnchorUtils::GetIdx(peer_out_anchor), + in_anchor->GetOwnerNode()->GetName().c_str(), AnchorUtils::GetIdx(in_anchor)); return FAILED; } } else { // parent and child in the same cluster, add edge GELOGD("AddEdge from parent cluster %zu to child %zu", parent_cluster->index_, child_cluster->index_); if (GraphUtils::AddEdge(src_anchor, dst_anchor) != GRAPH_SUCCESS) { - GELOGE(GRAPH_FAILED, "AddEdge fail, from %s to %s", peer_out_anchor->GetOwnerNode()->GetName().c_str(), + REPORT_CALL_ERROR("E19999", "add edge from %s to %s failed", + peer_out_anchor->GetOwnerNode()->GetName().c_str(), + in_anchor->GetOwnerNode()->GetName().c_str()); + GELOGE(GRAPH_FAILED, "[Add][Edge] from %s to %s failed", peer_out_anchor->GetOwnerNode()->GetName().c_str(), in_anchor->GetOwnerNode()->GetName().c_str()); return FAILED; } @@ -880,7 +1002,7 @@ Status ge::GraphPartitioner::Partition(ge::ComputeGraphPtr compute_graph, Mode m auto real_ret = SUCCESS; auto ret = PartitionSubGraph(compute_graph, mode); if (ret != SUCCESS) { - GELOGE(ret, "Sub graph partition Failed"); + GELOGE(ret, "[Partition][SubGraph] Failed, ret:%d", ret); real_ret = ret; } GE_CHECK_NOTNULL(compute_graph); @@ -888,7 +1010,7 @@ Status ge::GraphPartitioner::Partition(ge::ComputeGraphPtr compute_graph, Mode m for (const auto &sub_graph : compute_graph->GetAllSubgraphs()) { ret = PartitionSubGraph(sub_graph, mode); if (ret != SUCCESS) { - GELOGE(ret, "Sub graph partition Failed"); + GELOGE(ret, "[Partition][SubGraph] Failed, ret:%d", ret); real_ret = ret; } } @@ -903,7 +1025,8 @@ Status ge::GraphPartitioner::Partition(ge::ComputeGraphPtr compute_graph, Mode m Status ge::GraphPartitioner::PartitionSubGraph(ge::ComputeGraphPtr compute_graph, Mode mode) { if (compute_graph == nullptr) { - GELOGE(GE_GRAPH_NULL_INPUT, "[GraphPartitioner]: compute_graph is null."); + REPORT_INNER_ERROR("E19999", "Param compute_graph is nullptr, check invalid."); + GELOGE(GE_GRAPH_NULL_INPUT, "[Check][Param] compute_graph is nullptr."); return FAILED; } // clear graph_info @@ -912,18 +1035,24 @@ Status ge::GraphPartitioner::PartitionSubGraph(ge::ComputeGraphPtr compute_graph graph_info_.output_size_ = compute_graph->GetOutputSize(); graph_info_.input_size_ = compute_graph->GetInputSize(); if (graph_info_.output_size_ == 0) { - GELOGE(GE_GRAPH_NULL_INPUT, "The output size need to be greater than 0."); + REPORT_INNER_ERROR("E19999", "the output size of graph:%s is 0, check invalid.", + compute_graph->GetName().c_str()); + GELOGE(GE_GRAPH_NULL_INPUT, "[Check][Param] The output size:0 of graph:%s need to be greater than 0.", + compute_graph->GetName().c_str()); return FAILED; } GELOGI("Graph Partition starts, graph nodes size is %zu", compute_graph->GetDirectNodesSize()); Status ret = compute_graph->TopologicalSorting(); if (ret != SUCCESS) { - GELOGE(GE_GRAPH_TOPO_SORT_FAILED, "[GraphPartitioner]: subGraphPtr->TopologicalSorting failed"); + REPORT_CALL_ERROR("E19999", "TopologicalSorting for graph:%s failed", + compute_graph->GetName().c_str()); + GELOGE(GE_GRAPH_TOPO_SORT_FAILED, "[Call][TopologicalSorting] for subGraph:%s failed", + compute_graph->GetName().c_str()); return FAILED; } GE_TIMESTAMP_START(PartitionSubGraphInitialize); if (Initialize(compute_graph) != SUCCESS) { - GELOGE(GE_GRAPH_INIT_FAILED, "[GraphPartitioner]: initialize failed"); + GELOGE(GE_GRAPH_INIT_FAILED, "[Call][Initialize] for graph:%s failed", compute_graph->GetName().c_str()); return FAILED; } GE_TIMESTAMP_END(PartitionSubGraphInitialize, "GraphPartitioner::PartitionInitialize"); @@ -932,20 +1061,22 @@ Status ge::GraphPartitioner::PartitionSubGraph(ge::ComputeGraphPtr compute_graph GE_TIMESTAMP_END(PartitionSubGraphMarkClusters, "GraphPartitioner::PartitionMarkClusters"); GE_TIMESTAMP_START(PartitionSubGraphSplitSubGraphs); if (SplitSubGraphs(compute_graph) != SUCCESS) { - GELOGE(FAILED, "[GraphPartitioner]: SplitSubGraphs failed"); + GELOGE(FAILED, "[Split][SubGraphs] for graph:%s failed", compute_graph->GetName().c_str()); return FAILED; } GE_TIMESTAMP_END(PartitionSubGraphSplitSubGraphs, "GraphPartitioner::PartitionSplitSubGraphs"); GE_TIMESTAMP_START(PartitionSubGraphSortSubGraphs); if (SortSubGraphs(compute_graph) != ge::SUCCESS) { - GELOGE(GE_GRAPH_TOPO_SORT_FAILED, "Graph Partition SortSubGraphs failed."); + GELOGE(GE_GRAPH_TOPO_SORT_FAILED, "[Sort][SubGraphs] for graph:%s failed.", + compute_graph->GetName().c_str()); return ge::FAILED; } GE_TIMESTAMP_END(PartitionSubGraphSortSubGraphs, "GraphPartitioner::PartitionSortSubGraphs"); GE_TIMESTAMP_START(PartitionSubGraphAddPartitionsToGraphNode); vector output_subgraphs; if (AddPartitionsToGraphNode(output_subgraphs, compute_graph) != ge::SUCCESS) { - GELOGE(GE_GRAPH_EMPTY_PARTITION, "Graph Partition AddPartitionsToGraphNode failed."); + GELOGE(GE_GRAPH_EMPTY_PARTITION, "[Add][Partitions] To GraphNode failed, graph:%s.", + compute_graph->GetName().c_str()); return ge::FAILED; } GE_TIMESTAMP_END(PartitionSubGraphAddPartitionsToGraphNode, "GraphPartitioner::PartitionAddPartitionsToGraphNode"); @@ -961,14 +1092,16 @@ Status ge::GraphPartitioner::PartitionSubGraph(ge::ComputeGraphPtr compute_graph // all the inputs are the nodes and anchors in the original graph Status ge::GraphPartitioner::AddPlaceHolderEnd(const AnchorPtr &out_anchor, const AnchorPtr &in_anchor) { if ((out_anchor == nullptr) || (in_anchor == nullptr)) { - GELOGE(GE_GRAPH_PARAM_NULLPTR, "src_node or dst_node is null."); + REPORT_INNER_ERROR("E19999", "Param out_anchor or in_anchor is nullptr, check invalid."); + GELOGE(GE_GRAPH_PARAM_NULLPTR, "[Check][Param] out_anchor or in_anchor is nullptr."); return FAILED; } // nodes in original graph const auto &src_node = out_anchor->GetOwnerNode(); const auto &dst_node = in_anchor->GetOwnerNode(); if ((src_node == nullptr) || (dst_node == nullptr)) { - GELOGE(GE_GRAPH_PARAM_NULLPTR, "src_node or dst_node is null."); + REPORT_INNER_ERROR("E19999", "in_anchor'node or out_anchor'node is nullptr. check invalid."); + GELOGE(GE_GRAPH_PARAM_NULLPTR, "[Check][Param] src_node or dst_node is nullptr."); return FAILED; } // All nodes have a copy in corresponding_node_in_partitions_, so function at can not be execption @@ -977,7 +1110,10 @@ Status ge::GraphPartitioner::AddPlaceHolderEnd(const AnchorPtr &out_anchor, cons auto dst_anchor = graph_info_.corresponding_node_in_partitions_.at(dst_node)->GetInAnchor(AnchorUtils::GetIdx(in_anchor)); if ((src_anchor == nullptr) || (dst_anchor == nullptr)) { - GELOGE(GE_GRAPH_PARAM_NULLPTR, "src_anchor or dst_anchor is null."); + REPORT_INNER_ERROR("E19999", "src_anchor(index:%d) or dst_anchor(index:%d) is nullptr.", + AnchorUtils::GetIdx(out_anchor), AnchorUtils::GetIdx(in_anchor)); + GELOGE(GE_GRAPH_PARAM_NULLPTR, "[Check][Param] src_anchor(index:%d) or dst_anchor(index:%d) is nullptr.", + AnchorUtils::GetIdx(out_anchor), AnchorUtils::GetIdx(in_anchor)); return FAILED; } // anchors in subGraph @@ -986,7 +1122,7 @@ Status ge::GraphPartitioner::AddPlaceHolderEnd(const AnchorPtr &out_anchor, cons // add end and pld node auto ret = AddPlaceHolderEndInSrcDstGraph(src_anchor, dst_anchor, dst_subgraph, src_subgraph); if (ret != SUCCESS) { - GELOGE(GE_GRAPH_ADD_PLC_END_FAILED, "[GraphPartitioner]: add placeholder end failed."); + GELOGE(GE_GRAPH_ADD_PLC_END_FAILED, "[Call][AddPlaceHolderEndInSrcDstGraph] failed, ret:%d.", ret); return ret; } return SUCCESS; @@ -996,7 +1132,8 @@ Status ge::GraphPartitioner::SortSubGraphs(const ge::ComputeGraphPtr &compute_gr uint32_t rank = kRankOne; // rank 0 for data graph ComputeGraphPtr new_input_nodes_sub_graph = MakeShared("inputNodeGraph"); if ((new_input_nodes_sub_graph == nullptr) || (compute_graph == nullptr)) { - GELOGE(FAILED, "[GraphPartitioner]: new_input_nodes_sub_graph or compute_graph is null."); + REPORT_INNER_ERROR("E19999", "Param compute_graph is nullptr or Allocate Memory for ComputeGraph failed."); + GELOGE(FAILED, "[Check][Param] new_input_nodes_sub_graph or compute_graph is nullptr."); return FAILED; } for (const auto &node : compute_graph->GetDirectNode()) { @@ -1009,7 +1146,7 @@ Status ge::GraphPartitioner::SortSubGraphs(const ge::ComputeGraphPtr &compute_gr rank++; } else if (graph_info_.partitions_[sub_graph] == kEngineDefaultData) { // merge data graph if (PutInputNodesInSubGraph(sub_graph, new_input_nodes_sub_graph) != SUCCESS) { - GELOGE(FAILED, "[GraphPartitioner]: putInputNodesInSubGraph failed."); + GELOGE(FAILED, "[Call][putInputNodesInSubGraph] failed."); return FAILED; } auto to_be_del = graph_info_.partitions_.find(sub_graph); @@ -1038,7 +1175,8 @@ Status ge::GraphPartitioner::SortSubGraphs(const ge::ComputeGraphPtr &compute_gr AnchorPtr ge::GraphPartitioner::GetEndInAnchor(const AnchorPtr &src_anchor, const NodePtr &end_node) { if ((src_anchor == nullptr) || (end_node == nullptr)) { - GELOGE(FAILED, "parameter ptr is null."); + REPORT_INNER_ERROR("E19999", "Param src_anchor or end_node is nullptr, check invalid."); + GELOGE(FAILED, "[Check][Param] parameter src_anchor or end_node is nullptr."); return nullptr; } AnchorPtr end_in_anchor; @@ -1052,7 +1190,8 @@ AnchorPtr ge::GraphPartitioner::GetEndInAnchor(const AnchorPtr &src_anchor, cons AnchorPtr ge::GraphPartitioner::GetPldOutAnchor(const NodePtr &pld_node, const AnchorPtr &dst_anchor) { if ((pld_node == nullptr) || (dst_anchor == nullptr)) { - GELOGE(FAILED, "parameter ptr is null."); + REPORT_INNER_ERROR("E19999", "Param pld_node or dst_anchor is nullptr, check invalid."); + GELOGE(FAILED, "[Check][Param] parameter pld_node or dst_anchor is nullptr."); return nullptr; } AnchorPtr pld_out_anchor; @@ -1066,7 +1205,7 @@ AnchorPtr ge::GraphPartitioner::GetPldOutAnchor(const NodePtr &pld_node, const A void ge::GraphPartitioner::AddEndPldInformationToSubGraphInfo(ge::SubGraphInfoPtr &subgraph_info) { if (subgraph_info == nullptr) { - GELOGE(FAILED, "parameter ptr is null."); + GELOGE(FAILED, "[Check][Param] parameter subgraph_info is nullptr."); return; } auto subgraph = subgraph_info->GetSubGraph(); diff --git a/ge/graph/partition/stage_partition.cc b/ge/graph/partition/stage_partition.cc index 14776200..309e24c4 100644 --- a/ge/graph/partition/stage_partition.cc +++ b/ge/graph/partition/stage_partition.cc @@ -54,12 +54,12 @@ Status StagePartitioner::Partition() { GE_DUMP(root_graph_, "BeforeStagePartition"); if (SplitStageLevel() != SUCCESS) { - GELOGE(FAILED, "Split graph-stage for graph %s failed.", root_graph_->GetName().c_str()); + GELOGE(FAILED, "[Split][GraphStage] for graph %s failed.", root_graph_->GetName().c_str()); return FAILED; } if (StagePartition() != SUCCESS) { - GELOGE(FAILED, "Stage partition for graph %s failed.", root_graph_->GetName().c_str()); + GELOGE(FAILED, "[Stage][Partition] for graph %s failed.", root_graph_->GetName().c_str()); return FAILED; } @@ -71,7 +71,7 @@ Status StagePartitioner::Partition() { return a_level < b_level; }); if (root_graph_->TopologicalSorting() != GRAPH_SUCCESS) { - GELOGE(FAILED, "Topological sort for graph %s after stage partition failed, " + GELOGE(FAILED, "[Call][TopologicalSorting] for graph %s after stage partition failed, " "maybe stage_level was not set correctly.", root_graph_->GetName().c_str()); return FAILED; } @@ -103,7 +103,10 @@ Status StagePartitioner::SplitStageLevel() { continue; } if (!AttrUtils::SetInt(in_node->GetOpDesc(), ATTR_STAGE_LEVEL, cur_stage_level)) { - GELOGE(INTERNAL_ERROR, "Set attr ATTR_STAGE_LEVEL on node %s failed.", in_node->GetName().c_str()); + REPORT_CALL_ERROR("E19999", "Set Attr %s on node %s failed.", + ATTR_STAGE_LEVEL.c_str(), in_node->GetName().c_str()); + GELOGE(INTERNAL_ERROR, "[Set][Attr] %s on node %s failed.", + ATTR_STAGE_LEVEL.c_str(), in_node->GetName().c_str()); return INTERNAL_ERROR; } GELOGD("Mark stage_level node %s, stage_level=%u", in_node->GetName().c_str(), cur_stage_level); @@ -131,23 +134,26 @@ Status StagePartitioner::StagePartition() { std::string subgraph_name = "Subgraph_Level_" + std::to_string(stage.first); NodePtr graph_node = BuildSubgraphNode(subgraph_name, stage_info); if (graph_node == nullptr) { - GELOGE(FAILED, "Build PartitionedCall node for stage %u failed.", stage.first); + GELOGE(FAILED, "[Build][SubgraphNode] for stage %u failed, graph name:%s.", stage.first, subgraph_name.c_str()); return FAILED; } ComputeGraphPtr subgraph = BuildStageGraph(graph_node, stage_info); if (subgraph == nullptr) { - GELOGE(FAILED, "Build subgraph for stage %u failed.", stage.first); + GELOGE(FAILED, "[Build][StageGraph] %s for stage %u failed.", graph_node->GetName().c_str(), stage.first); return FAILED; } if (root_graph_->AddSubgraph(subgraph) != GRAPH_SUCCESS) { - GELOGE(FAILED, "Add subgraph of stage %u failed.", stage.first); + REPORT_CALL_ERROR("E19999", "add subgraph:%s in root graph:%s of stage %u failed.", + subgraph->GetName().c_str(), root_graph_->GetName().c_str(), stage.first); + GELOGE(FAILED, "[Add][SubGraph] %s in root graph:%s of stage %u failed.", + subgraph->GetName().c_str(), root_graph_->GetName().c_str(), stage.first); return FAILED; } if ((RelinkDataEdges(graph_node, stage_info) != SUCCESS) || (RelinkCtrlEdges(graph_node, stage_info) != SUCCESS)) { - GELOGE(FAILED, "Relink edges for stage %u failed.", stage.first); + GELOGE(FAILED, "[ReLink][Edges] for stage %u failed, graph_node:%s.", stage.first, graph_node->GetName().c_str()); return FAILED; } @@ -214,7 +220,7 @@ NodePtr StagePartitioner::BuildSubgraphNode(const std::string &graph_name, const for (size_t i = 0; i < input_num; i++) { auto input_desc = stage_info.data_inputs[i].second->GetOwnerNode()->GetOpDesc(); if (input_desc == nullptr) { - GELOGE(PARAM_INVALID, "op_desc is null, node: %s", + GELOGE(PARAM_INVALID, "[Check][Param] op_desc is null, node:%s", stage_info.data_inputs[i].second->GetOwnerNode()->GetName().c_str()); return nullptr; } @@ -225,7 +231,7 @@ NodePtr StagePartitioner::BuildSubgraphNode(const std::string &graph_name, const for (size_t i = 0; i < output_num; i++) { auto output_desc = stage_info.data_outputs[i].first->GetOwnerNode()->GetOpDesc(); if (output_desc == nullptr) { - GELOGE(PARAM_INVALID, "op_desc is null, node: %s", + GELOGE(PARAM_INVALID, "[Check][Param] op_desc is null, node:%s", stage_info.data_outputs[i].first->GetOwnerNode()->GetName().c_str()); return nullptr; } @@ -235,7 +241,7 @@ NodePtr StagePartitioner::BuildSubgraphNode(const std::string &graph_name, const OpDescPtr op_desc = op_desc_builder.Build(); if (op_desc == nullptr) { - GELOGE(FAILED, "Create op_desc for subgraph node failed, name:%s.", graph_name.c_str()); + GELOGE(FAILED, "[Create][OpDesc] for subgraph node failed, name:%s.", graph_name.c_str()); return nullptr; } @@ -243,17 +249,23 @@ NodePtr StagePartitioner::BuildSubgraphNode(const std::string &graph_name, const op_desc->SetSubgraphInstanceName(0, graph_name); if (!AttrUtils::SetInt(op_desc, ATTR_STAGE_LEVEL, stage_info.stage_level)) { - GELOGE(INTERNAL_ERROR, "Set attr ATTR_STAGE_LEVEL on node %s failed", op_desc->GetName().c_str()); + REPORT_CALL_ERROR("E19999", "set attr %s on node %s failed", ATTR_STAGE_LEVEL.c_str(), op_desc->GetName().c_str()); + GELOGE(INTERNAL_ERROR, "[Set][Attr] %s on node %s failed", ATTR_STAGE_LEVEL.c_str(), op_desc->GetName().c_str()); return nullptr; } NodePtr subgraph_node = root_graph_->AddNode(op_desc); if (subgraph_node == nullptr) { - GELOGE(FAILED, "Add node %s failed.", graph_name.c_str()); + REPORT_CALL_ERROR("E19999", "add node:%s in graph:%s failed.", + op_desc->GetName().c_str(), root_graph_->GetName().c_str()); + GELOGE(FAILED, "[Add][Node] %s in graph:%s failed.", op_desc->GetName().c_str(), root_graph_->GetName().c_str()); return nullptr; } if (subgraph_node->SetOwnerComputeGraph(root_graph_) != GRAPH_SUCCESS) { - GELOGE(FAILED, "Set owner graph for node %s failed.", subgraph_node->GetName().c_str()); + REPORT_CALL_ERROR("E19999", "SetOwnerComputeGraph for node %s failed, grpah:%s.", + subgraph_node->GetName().c_str(), root_graph_->GetName().c_str()); + GELOGE(FAILED, "[Set][OwnerGraph] for node %s failed, grpah:%s.", + subgraph_node->GetName().c_str(), root_graph_->GetName().c_str()); return nullptr; } @@ -314,11 +326,13 @@ ComputeGraphPtr StagePartitioner::BuildStageGraph(const NodePtr &subgraph_node, std::string error_msg; ComputeGraphPtr subgraph = graph_builder.Build(error_code, error_msg); if (subgraph == nullptr) { - GELOGE(error_code, "Build subgraph %s failed: %s.", subgraph_node->GetName().c_str(), error_msg.c_str()); + GELOGE(error_code, "[Build][Subgraph] %s failed:%s.", subgraph_node->GetName().c_str(), error_msg.c_str()); return nullptr; } if (!AttrUtils::SetInt(subgraph, ATTR_STAGE_LEVEL, stage_info.stage_level)) { - GELOGE(FAILED, "Set ATTR_STAGE_LEVEL on graph %s failed.", subgraph->GetName().c_str()); + REPORT_CALL_ERROR("E19999", "set attr %s on graph %s failed.", + ATTR_STAGE_LEVEL.c_str(), subgraph->GetName().c_str()); + GELOGE(FAILED, "[Set][Attr] %s on graph %s failed.", ATTR_STAGE_LEVEL.c_str(), subgraph->GetName().c_str()); return nullptr; } @@ -329,7 +343,12 @@ Status StagePartitioner::RelinkDataEdges(const NodePtr &subgraph_node, const Sta // in data nodes for (size_t i = 0; i < stage_info.data_inputs.size(); i++) { if (stage_info.data_inputs[i].first->Unlink(stage_info.data_inputs[i].second) != GRAPH_SUCCESS) { - GELOGE(INTERNAL_ERROR, "Remove data edge %s:%d->%s:%d failed.", + REPORT_CALL_ERROR("E19999", "remove data edge from %s:%d to %s:%d failed", + stage_info.data_inputs[i].first->GetOwnerNode()->GetName().c_str(), + stage_info.data_inputs[i].first->GetIdx(), + stage_info.data_inputs[i].second->GetOwnerNode()->GetName().c_str(), + stage_info.data_inputs[i].second->GetIdx()); + GELOGE(INTERNAL_ERROR, "[Remove][DataEdge] %s:%d->%s:%d failed.", stage_info.data_inputs[i].first->GetOwnerNode()->GetName().c_str(), stage_info.data_inputs[i].first->GetIdx(), stage_info.data_inputs[i].second->GetOwnerNode()->GetName().c_str(), @@ -337,7 +356,11 @@ Status StagePartitioner::RelinkDataEdges(const NodePtr &subgraph_node, const Sta return INTERNAL_ERROR; } if (stage_info.data_inputs[i].first->LinkTo(subgraph_node->GetInDataAnchor(i)) != GRAPH_SUCCESS) { - GELOGE(INTERNAL_ERROR, "Add data edge %s:%d->%s:%zu failed.", + REPORT_CALL_ERROR("E19999", "add data edge from %s:%d to %s:%zu failed.", + stage_info.data_inputs[i].first->GetOwnerNode()->GetName().c_str(), + stage_info.data_inputs[i].first->GetIdx(), + subgraph_node->GetName().c_str(), i); + GELOGE(INTERNAL_ERROR, "[Add][DataEdge] %s:%d->%s:%zu failed.", stage_info.data_inputs[i].first->GetOwnerNode()->GetName().c_str(), stage_info.data_inputs[i].first->GetIdx(), subgraph_node->GetName().c_str(), i); @@ -350,14 +373,20 @@ Status StagePartitioner::RelinkDataEdges(const NodePtr &subgraph_node, const Sta GE_CHECK_NOTNULL(out_data_anchor); for (const auto &peer_in_anchor : stage_info.data_outputs[i].second) { if (stage_info.data_outputs[i].first->Unlink(peer_in_anchor) != GRAPH_SUCCESS) { - GELOGE(INTERNAL_ERROR, "Remove data edge %s:%d->%s:%d failed.", + REPORT_CALL_ERROR("E19999", "Remove data edge from %s:%d to %s:%d failed.", + stage_info.data_outputs[i].first->GetOwnerNode()->GetName().c_str(), + stage_info.data_outputs[i].first->GetIdx(), + peer_in_anchor->GetOwnerNode()->GetName().c_str(), peer_in_anchor->GetIdx()); + GELOGE(INTERNAL_ERROR, "[Remove][DataEdge] %s:%d->%s:%d failed.", stage_info.data_outputs[i].first->GetOwnerNode()->GetName().c_str(), stage_info.data_outputs[i].first->GetIdx(), peer_in_anchor->GetOwnerNode()->GetName().c_str(), peer_in_anchor->GetIdx()); return INTERNAL_ERROR; } if (out_data_anchor->LinkTo(peer_in_anchor) != GRAPH_SUCCESS) { - GELOGE(INTERNAL_ERROR, "Add data edge %s:%zu->%s:%d failed.", subgraph_node->GetName().c_str(), i, + REPORT_CALL_ERROR("E19999", "Add data edge from %s:%zu to %s:%d failed.", subgraph_node->GetName().c_str(), i, + peer_in_anchor->GetOwnerNode()->GetName().c_str(), peer_in_anchor->GetIdx()); + GELOGE(INTERNAL_ERROR, "[Add][DataEdge] %s:%zu->%s:%d failed.", subgraph_node->GetName().c_str(), i, peer_in_anchor->GetOwnerNode()->GetName().c_str(), peer_in_anchor->GetIdx()); return INTERNAL_ERROR; } @@ -371,13 +400,18 @@ Status StagePartitioner::RelinkCtrlEdges(const NodePtr &subgraph_node, const Sta // in ctrl nodes for (const auto &ctrl_input : stage_info.ctrl_inputs) { if (ctrl_input.first->Unlink(ctrl_input.second) != GRAPH_SUCCESS) { - GELOGE(INTERNAL_ERROR, "Remove ctrl edge %s->%s failed.", + REPORT_CALL_ERROR("E19999", "Remove ctrl edge %s->%s failed.", + ctrl_input.first->GetOwnerNode()->GetName().c_str(), + ctrl_input.second->GetOwnerNode()->GetName().c_str()); + GELOGE(INTERNAL_ERROR, "[Remove][CtrlEdge] %s->%s failed.", ctrl_input.first->GetOwnerNode()->GetName().c_str(), ctrl_input.second->GetOwnerNode()->GetName().c_str()); return INTERNAL_ERROR; } if (!ctrl_input.first->IsLinkedWith(subgraph_node->GetInControlAnchor())) { if (ctrl_input.first->LinkTo(subgraph_node->GetInControlAnchor()) != GRAPH_SUCCESS) { - GELOGE(INTERNAL_ERROR, "Add ctrl edge %s->%s failed.", + REPORT_CALL_ERROR("E19999", "Add ctrl edge %s->%s failed.", + ctrl_input.first->GetOwnerNode()->GetName().c_str(), subgraph_node->GetName().c_str()); + GELOGE(INTERNAL_ERROR, "[Add][CtrlEdge] %s->%s failed.", ctrl_input.first->GetOwnerNode()->GetName().c_str(), subgraph_node->GetName().c_str()); return INTERNAL_ERROR; } @@ -386,14 +420,19 @@ Status StagePartitioner::RelinkCtrlEdges(const NodePtr &subgraph_node, const Sta // out ctrl nodes for (const auto &ctrl_output : stage_info.ctrl_outputs) { if (ctrl_output.first->Unlink(ctrl_output.second) != GRAPH_SUCCESS) { - GELOGE(INTERNAL_ERROR, "Remove ctrl edge %s->%s failed.", + REPORT_CALL_ERROR("E19999", "Remove ctrl edge %s->%s failed.", + ctrl_output.first->GetOwnerNode()->GetName().c_str(), + ctrl_output.second->GetOwnerNode()->GetName().c_str()); + GELOGE(INTERNAL_ERROR, "[Remove][CtrlEdge] %s->%s failed.", ctrl_output.first->GetOwnerNode()->GetName().c_str(), ctrl_output.second->GetOwnerNode()->GetName().c_str()); return INTERNAL_ERROR; } if (!subgraph_node->GetOutControlAnchor()->IsLinkedWith(ctrl_output.second)) { if (subgraph_node->GetOutControlAnchor()->LinkTo(ctrl_output.second) != GRAPH_SUCCESS) { - GELOGE(INTERNAL_ERROR, "Add ctrl edge %s->%s failed.", + REPORT_CALL_ERROR("E19999", "Add ctrl edge %s->%s failed.", + subgraph_node->GetName().c_str(), ctrl_output.second->GetOwnerNode()->GetName().c_str()); + GELOGE(INTERNAL_ERROR, "[Add][CtrlEdge] %s->%s failed.", subgraph_node->GetName().c_str(), ctrl_output.second->GetOwnerNode()->GetName().c_str()); return INTERNAL_ERROR; } diff --git a/ge/graph/passes/addn_pass.cc b/ge/graph/passes/addn_pass.cc index 3e2d3f06..6863a812 100644 --- a/ge/graph/passes/addn_pass.cc +++ b/ge/graph/passes/addn_pass.cc @@ -27,14 +27,14 @@ Status AddNPass::Run(NodePtr &node) { GELOGD("AddNPass running"); if (node == nullptr) { REPORT_INNER_ERROR("E19999", "Param node is nullptr, check invalid"); - GELOGE(PARAM_INVALID, "param [node] must not be null."); + GELOGE(PARAM_INVALID, "[Check][Param] param [node] must not be null."); return PARAM_INVALID; } if (node->GetType() == ADDN) { if (node->GetOpDesc() == nullptr) { REPORT_INNER_ERROR("E19999", "Param op_desc of node is nullptr, check invalid"); - GELOGE(PARAM_INVALID, "Param [node] op desc is null."); + GELOGE(PARAM_INVALID, "[Get][OpDesc] Param [node] op desc is null."); return PARAM_INVALID; } // AddN with single input can be optimized diff --git a/ge/graph/passes/aicpu_constant_folding_pass.cc b/ge/graph/passes/aicpu_constant_folding_pass.cc index b5a989c8..8fdb51a1 100644 --- a/ge/graph/passes/aicpu_constant_folding_pass.cc +++ b/ge/graph/passes/aicpu_constant_folding_pass.cc @@ -123,7 +123,7 @@ Status AicpuConstantFoldingPass::GetInputAddrs(const vector &w vector &input_addrs) { if (weight_vec.empty()) { REPORT_INNER_ERROR("E19999", "Param weight_vec is empty, check invalid"); - GELOGE(FAILED, "Weight is null"); + GELOGE(FAILED, "[Check][Param] Weight is null"); return FAILED; } for (const ConstGeTensorPtr &weight : weight_vec) { @@ -135,7 +135,7 @@ Status AicpuConstantFoldingPass::GetInputAddrs(const vector &w if (rt_ret != RT_ERROR_NONE) { REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret = 0x%X", weight->GetData().size(), rt_ret); - GELOGE(rt_ret, "rtMemcpy error"); + GELOGE(rt_ret, "[Call][RtMemcpy] failed, size:%zu, ret = 0x%X", weight->GetData().size(), rt_ret); GE_CHK_RT(rtFree(input_addr)); return FAILED; } @@ -150,7 +150,8 @@ Status AicpuConstantFoldingPass::GetOutputAddrs(const OpDescPtr &node_desc, vect if (node_desc->GetOutputsSize() == 0) { REPORT_INNER_ERROR("E19999", "Ouput desc size of op:%s(%s) is 0, check invalid", node_desc->GetName().c_str(), node_desc->GetType().c_str()); - GELOGE(FAILED, "Output size is 0 "); + GELOGE(FAILED, "[Get][OutputsSize] Ouput desc size of op:%s(%s) is 0", + node_desc->GetName().c_str(), node_desc->GetType().c_str()); return FAILED; } for (size_t i = 0; i < node_desc->GetOutputsSize(); ++i) { @@ -178,7 +179,7 @@ Status AicpuConstantFoldingPass::GenerateDataPtrInfo(const vector &out if (rt_ret != RT_ERROR_NONE) { REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%lu, ret = 0x%X", result_summary.shape_data_size, rt_ret); - GELOGE(rt_ret, "rtMalloc error"); + GELOGE(rt_ret, "[Call][RtMalloc] failed, size:%lu, ret = 0x%X", result_summary.shape_data_size, rt_ret); GE_CHK_RT(rtFree(raw_data_addr)); return FAILED; } @@ -208,7 +209,7 @@ Status AicpuConstantFoldingPass::UpdateWorkSpaceAddr(string &task_info, STR_FWK_ // Update the workspace_addr if (task_info.empty()) { REPORT_INNER_ERROR("E19999", "Param task_info is empty, check invalid"); - GELOGE(FAILED, "task_info is empty "); + GELOGE(FAILED, "[Check][Param] task_info is empty "); return FAILED; } void *workspace_addr = nullptr; @@ -218,7 +219,7 @@ Status AicpuConstantFoldingPass::UpdateWorkSpaceAddr(string &task_info, STR_FWK_ if (rt_ret != RT_ERROR_NONE) { REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret = 0x%X", task_info.size(), rt_ret); - GELOGE(rt_ret, "rtMemcpy error"); + GELOGE(rt_ret, "[Call][RtMemcpy] failed, size:%zu, ret = 0x%X", task_info.size(), rt_ret); GE_CHK_RT(rtFree(workspace_addr)); return FAILED; } @@ -232,7 +233,7 @@ Status AicpuConstantFoldingPass::UpdateInputAndOutputAddr(const vector auto addrs_size = sizeof(uint64_t) * (io_addrs.size()); if (addrs_size <= 0) { REPORT_INNER_ERROR("E19999", "Param io_addrs size is 0, check invalid"); - GELOGE(FAILED, "addrs_size is less than 1 "); + GELOGE(FAILED, "[Check][Param] addrs_size is less than 1 "); return FAILED; } void *input_output_addr = nullptr; @@ -241,7 +242,7 @@ Status AicpuConstantFoldingPass::UpdateInputAndOutputAddr(const vector if (rt_ret != RT_ERROR_NONE) { REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret = 0x%X", addrs_size, rt_ret); - GELOGE(rt_ret, "rtMemcpy error"); + GELOGE(rt_ret, "[Call][RtMemcpy] failed, size:%zu, ret = 0x%X", addrs_size, rt_ret); GE_CHK_RT(rtFree(input_output_addr)); return FAILED; } @@ -264,12 +265,12 @@ Status AicpuConstantFoldingPass::UpdateSingleOpAddr(string &task_info, const vec Status ret = UpdateInputAndOutputAddr(io_addrs, task); if (ret != SUCCESS) { - GELOGE(ret, "UpdateInputAndOutputAddr error"); + GELOGE(ret, "[Update][InputAndOutputAddr] failed, ret:%d", ret); return ret; } ret = UpdateWorkSpaceAddr(task_info, task); if (ret != SUCCESS) { - GELOGE(ret, "UpdateWorkSpaceAddr error"); + GELOGE(ret, "[Update][WorkSpaceAddr] failed, ret:%d", ret); return ret; } return SUCCESS; @@ -299,7 +300,7 @@ Status AicpuConstantFoldingPass::UpdateMemCopyAddr(string &task_info, const vect if (rt_ret != RT_ERROR_NONE) { REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret = 0x%X", data_size, rt_ret); - GELOGE(rt_ret, "rtMemcpy error"); + GELOGE(rt_ret, "[Call][RtMemcpy] failed, size:%zu, ret = 0x%X", data_size, rt_ret); GE_CHK_RT(rtFree(input_addr_ptr)); return FAILED; } @@ -311,12 +312,12 @@ Status AicpuConstantFoldingPass::UpdateMemCopyAddr(string &task_info, const vect Status ret = UpdateInputAndOutputAddr(io_addrs, task); if (ret != SUCCESS) { - GELOGE(ret, "UpdateInputAndOutputAddr error"); + GELOGE(ret, "[Update][InputAndOutputAddr] failed, ret:%d", ret); return ret; } ret = UpdateWorkSpaceAddr(task_info, task); if (ret != SUCCESS) { - GELOGE(ret, "UpdateWorkSpaceAddr error"); + GELOGE(ret, "[Update][WorkSpaceAddr] failed, ret:%d", ret); return ret; } return SUCCESS; @@ -328,14 +329,14 @@ Status AicpuConstantFoldingPass::LaunchSingleOpRunTask(const NodePtr &node, cons auto instance_ptr = ge::GELib::GetInstance(); if (instance_ptr == nullptr || !instance_ptr->InitFlag()) { REPORT_INNER_ERROR("E19999", "GeLib is not init before, check invalid"); - GELOGE(GE_CLI_GE_NOT_INITIALIZED, "GE is not initialized"); + GELOGE(GE_CLI_GE_NOT_INITIALIZED, "[Check][Param] GE is not initialized"); return GE_CLI_GE_NOT_INITIALIZED; } auto kernel_builder = OpsKernelBuilderManager::Instance().GetOpsKernelBuilder(kKernelLibName); if (kernel_builder == nullptr) { REPORT_INNER_ERROR("E19999", "Find ops kernel by name:%s failed", kKernelLibName); - GELOGE(FAILED, "Get op kernel info store failed"); + GELOGE(FAILED, "[Get][OpsKernelBuilder] by name:%s failed", kKernelLibName); return FAILED; } STR_FWK_OP_KERNEL aicpu_task; @@ -364,17 +365,17 @@ Status AicpuConstantFoldingPass::LaunchSingleOpRunTask(const NodePtr &node, cons ret = UpdateSingleOpAddr(task_info, input_addrs, output_addrs, aicpu_task); if (ret != SUCCESS) { - GELOGE(ret, "UpdateSingleOpAddr error"); + GELOGE(ret, "[Update][SingleOpAddr] failed, ret:%d", ret); return ret; } ret = GenerateTaskForLaunch(aicpu_task, task_buf); if (ret != SUCCESS) { - GELOGE(ret, "GenerateTaskForLaunch error"); + GELOGE(ret, "[Generate][Task] For Launch failed, ret:%d", ret); return ret; } ret = KernelLaunch(task_buf); if (ret != SUCCESS) { - GELOGE(ret, "KernelLaunch error"); + GELOGE(ret, "[Call][KernelLaunch] failed, ret:%d", ret); return ret; } @@ -386,14 +387,14 @@ Status AicpuConstantFoldingPass::LaunchMemCopyTask(const vector &data_ auto instance_ptr = ge::GELib::GetInstance(); if (instance_ptr == nullptr || !instance_ptr->InitFlag()) { REPORT_INNER_ERROR("E19999", "GeLib is not init before, check invalid"); - GELOGE(GE_CLI_GE_NOT_INITIALIZED, "GE is not initialized"); + GELOGE(GE_CLI_GE_NOT_INITIALIZED, "[Check][Param] GE is not initialized"); return GE_CLI_GE_NOT_INITIALIZED; } auto kernel_builder = OpsKernelBuilderManager::Instance().GetOpsKernelBuilder(kKernelLibName); if (kernel_builder == nullptr) { REPORT_INNER_ERROR("E19999", "Find ops kernel by name:%s failed", kKernelLibName); - GELOGE(FAILED, "Get op kernel info store failed"); + GELOGE(FAILED, "[Get][OpsKernelBuilder] by name:%s failed", kKernelLibName); return FAILED; } STR_FWK_OP_KERNEL aicpu_task; @@ -427,17 +428,17 @@ Status AicpuConstantFoldingPass::LaunchMemCopyTask(const vector &data_ ret = UpdateMemCopyAddr(task_info, data_infos, internal_addrs, aicpu_task); if (ret != SUCCESS) { - GELOGE(ret, "UpdateMemCopyAddr error"); + GELOGE(ret, "[Update][MemCopyAddr] failed, ret:%d", ret); return ret; } ret = GenerateTaskForLaunch(aicpu_task, task_buf); if (ret != SUCCESS) { - GELOGE(ret, "GenerateTaskForLaunch error"); + GELOGE(ret, "[Generate][Task] For Launch failed, ret:%d", ret); return ret; } ret = KernelLaunch(task_buf); if (ret != SUCCESS) { - GELOGE(ret, "KernelLaunch error"); + GELOGE(ret, "[Call][KernelLaunch] failed, ret:%d", ret); return ret; } return SUCCESS; @@ -451,7 +452,7 @@ Status AicpuConstantFoldingPass::GenerateTaskForLaunch(STR_FWK_OP_KERNEL &aicpu_ if (rt_ret != RT_ERROR_NONE) { REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret = 0x%X", sizeof(STR_FWK_OP_KERNEL), rt_ret); - GELOGE(rt_ret, "rtMemcpy error"); + GELOGE(rt_ret, "[Call][RtMemcpy] failed, size:%zu, ret = 0x%X", sizeof(STR_FWK_OP_KERNEL), rt_ret); GE_CHK_RT(rtFree(task_buf)); return FAILED; } @@ -482,56 +483,56 @@ Status AicpuConstantFoldingPass::KernelLaunch(void *task_buf) { if (rt_ret != RT_ERROR_NONE) { REPORT_CALL_ERROR("E19999", "Call rtModelCreate failed, ret = 0x%X", rt_ret); - GELOGE(rt_ret, "create model failed."); + GELOGE(rt_ret, "[Create][Model] failed, ret = 0x%X", rt_ret); return FAILED; } rt_ret = rtStreamCreate(&stream, 0); if (rt_ret != RT_ERROR_NONE) { REPORT_CALL_ERROR("E19999", "Call rtStreamCreate failed, ret = 0x%X", rt_ret); - GELOGE(rt_ret, "create stream failed."); + GELOGE(rt_ret, "[Create][Stream] failed, ret = 0x%X", rt_ret); return FAILED; } rt_ret = rtModelBindStream(model, stream, 0); if (rt_ret != RT_ERROR_NONE) { REPORT_CALL_ERROR("E19999", "Call rtModelBindStream failed, ret = 0x%X", rt_ret); - GELOGE(rt_ret, "rtModelBindStream failed."); + GELOGE(rt_ret, "[Call][RtModelBindStream] failed, ret = 0x%X", rt_ret); return FAILED; } rt_ret = rtKernelLaunchEx(task_buf, sizeof(STR_FWK_OP_KERNEL), 0, stream); if (rt_ret != RT_ERROR_NONE) { REPORT_CALL_ERROR("E19999", "Call rtModelBindStream failed, ret = 0x%X", rt_ret); - GELOGE(rt_ret, "rtKernelLaunchEx failed."); + GELOGE(rt_ret, "[Call][RtModelBindStream] failed, ret = 0x%X", rt_ret); return FAILED; } rt_ret = rtModelLoadComplete(model); if (rt_ret != RT_ERROR_NONE) { REPORT_CALL_ERROR("E19999", "Call rtModelLoadComplete failed, ret = 0x%X", rt_ret); - GELOGE(rt_ret, "rtModelLoadComplete failed."); + GELOGE(rt_ret, "[Call][RtModelLoadComplete] failed, ret = 0x%X", rt_ret); return FAILED; } rt_ret = rtStreamCreate(&stream_run, 0); if (rt_ret != RT_ERROR_NONE) { REPORT_CALL_ERROR("E19999", "Call rtStreamCreate failed, ret = 0x%X", rt_ret); - GELOGE(rt_ret, "create run stream failed."); + GELOGE(rt_ret, "[Call][RtStreamCreate] failed, ret = 0x%X", rt_ret); return FAILED; } rt_ret = rtModelExecute(model, stream_run, 0); if (rt_ret != RT_ERROR_NONE) { REPORT_CALL_ERROR("E19999", "Call rtModelExecute failed, ret = 0x%X", rt_ret); - GELOGE(rt_ret, "rtModelExecute failed."); + GELOGE(rt_ret, "[Call][RtModelExecute] failed, ret = 0x%X", rt_ret); return FAILED; } rt_ret = rtStreamSynchronize(stream_run); if (rt_ret != RT_ERROR_NONE) { REPORT_CALL_ERROR("E19999", "Call rtStreamSynchronize failed, ret = 0x%X", rt_ret); - GELOGE(rt_ret, "rtStreamSynchronize failed."); + GELOGE(rt_ret, "[Call][RtStreamSynchronize] failed, ret = 0x%X", rt_ret); return FAILED; } return SUCCESS; @@ -543,7 +544,8 @@ Status AicpuConstantFoldingPass::GenerateGeTensor(const OpDescPtr &node_desc, co REPORT_INNER_ERROR("E19999", "Output desc size:%zu of op:%s(%s), after multi 2, not equal to data_vec.size:%zu, " "check invalid", node_desc->GetOutputsSize(), node_desc->GetName().c_str(), node_desc->GetType().c_str(), data_vec.size()); - GELOGE(FAILED, "node[%s] something wrong with output size", node_desc->GetName().c_str()); + GELOGE(FAILED, "[Check][Param] Output desc size:%zu of op:%s(%s), after multi 2, not equal to data_vec.size:%zu", + node_desc->GetOutputsSize(), node_desc->GetName().c_str(), node_desc->GetType().c_str(), data_vec.size()); return FAILED; } @@ -552,7 +554,7 @@ Status AicpuConstantFoldingPass::GenerateGeTensor(const OpDescPtr &node_desc, co GeTensorPtr output_ptr = MakeShared(output_tensor_desc); if (output_ptr == nullptr) { REPORT_CALL_ERROR("E19999", "New GeTensor failed"); - GELOGE(FAILED, "node[%s] something wrong with construct GeTensor", node_desc->GetName().c_str()); + GELOGE(FAILED, "[New][GeTensor] failed"); return FAILED; } const DataPtrInfo &raw_data_info = data_vec.at(i * kDouble); @@ -561,14 +563,14 @@ Status AicpuConstantFoldingPass::GenerateGeTensor(const OpDescPtr &node_desc, co if (data_addr == nullptr) { REPORT_CALL_ERROR("E19999", "New Buffer failed, size:%lu", raw_data_size); - GELOGE(MEMALLOC_FAILED, "new data_addr failed"); + GELOGE(MEMALLOC_FAILED, "[New][Buffer] failed, size:%lu", raw_data_size); return INTERNAL_ERROR; } GE_CHK_RT_RET(rtMemcpy(data_addr.get(), raw_data_size, reinterpret_cast(reinterpret_cast(raw_data_info.dst_ptr)), raw_data_size, RT_MEMCPY_DEVICE_TO_HOST)); GE_IF_BOOL_EXEC(output_ptr->SetData(data_addr.get(), raw_data_size) != GRAPH_SUCCESS, - GELOGE(FAILED, "set data failed"); + GELOGE(FAILED, "[Set][Data] for node:%s output[%zu] failed", node_desc->GetName().c_str(), i); return FAILED); GELOGD("GenerateGeTensor: raw_data_size %lu", raw_data_size); @@ -586,7 +588,7 @@ Status AicpuConstantFoldingPass::GenerateGeTensor(const OpDescPtr &node_desc, co if (shape_addr == nullptr) { REPORT_CALL_ERROR("E19999", "New Buffer failed, size:%lu", dim_num); - GELOGE(MEMALLOC_FAILED, "new shape_addr failed"); + GELOGE(MEMALLOC_FAILED, "[New][Buffer] failed, size:%lu", dim_num); return INTERNAL_ERROR; } GE_CHK_RT_RET(rtMemcpy(shape_addr.get(), shape_data_size, @@ -632,22 +634,23 @@ bool AicpuConstantFoldingPass::IsSkipFold(const ge::NodePtr &node) { auto instance_ptr = ge::GELib::GetInstance(); if (instance_ptr == nullptr || !instance_ptr->InitFlag()) { REPORT_INNER_ERROR("E19999", "GeLib is not init before, check invalid"); - GELOGE(GE_CLI_GE_NOT_INITIALIZED, "GE is not initialized"); + GELOGE(GE_CLI_GE_NOT_INITIALIZED, "[Check][Param] GE is not initialized"); return true; } OpsKernelInfoStorePtr kernel_info = instance_ptr->OpsKernelManagerObj().GetOpsKernelInfoStore(kKernelLibName); if (kernel_info == nullptr) { REPORT_INNER_ERROR("E19999", "Find ops kernel by name:%s failed", kKernelLibName); - GELOGE(FAILED, "Get op kernel info store failed"); + GELOGE(FAILED, "[Get][OpsKernelInfoStore] by name:%s failed", kKernelLibName); return true; } std::string check_result; kernel_info->opsFlagCheck(*node, check_result); if (check_result.empty()) { - REPORT_CALL_ERROR("E19999", "Call opsFlagCheck faled, ops kernel name:%s, op:%s(%s)", + REPORT_CALL_ERROR("E19999", "Call opsFlagCheck failed, ops kernel name:%s, op:%s(%s)", kKernelLibName, node->GetName().c_str(), node->GetType().c_str()); - GELOGE(FAILED, "Get op check_result failed"); + GELOGE(FAILED, "[Call][OpsFlagCheck] failed, ops kernel name:%s, op:%s(%s)", + kKernelLibName, node->GetName().c_str(), node->GetType().c_str()); return true; } return check_result.substr(0, kOpsFlag) == kNotSupported; diff --git a/ge/graph/passes/assert_pass.cc b/ge/graph/passes/assert_pass.cc index 20734d56..e13fc300 100644 --- a/ge/graph/passes/assert_pass.cc +++ b/ge/graph/passes/assert_pass.cc @@ -36,7 +36,7 @@ Status AssertPass::Run(NodePtr &node) { } if (node->GetOpDesc() == nullptr) { REPORT_INNER_ERROR("E19999", "Param op_desc of node is nullptr, check invalid"); - GELOGE(PARAM_INVALID, "param [node] [opDesc] must not be null."); + GELOGE(PARAM_INVALID, "[Get][OpDesc] param [node] [opDesc] must not be null."); return PARAM_INVALID; } std::string op_type = node->GetOpDesc()->GetType(); @@ -49,7 +49,7 @@ Status AssertPass::Run(NodePtr &node) { // remove unused node Status status = RemoveUnusedNode(nodes_unused); if (status != SUCCESS) { - GELOGE(status, "remove unused node failed."); + GELOGE(status, "[Remove][UnusedNode] failed, ret:%d.", status); return status; } } @@ -95,8 +95,10 @@ Status AssertPass::RemoveUnusedNode(std::vector &nodes_unused) { } if (IsolateAndDeleteNode(node, assert_io_map) != SUCCESS) { - REPORT_INNER_ERROR("E19999", "Isolate and delete node:%s(%s) faild", - node->GetName().c_str(), node->GetType().c_str()); + REPORT_CALL_ERROR("E19999", "Isolate and delete node:%s(%s) failed", + node->GetName().c_str(), node->GetType().c_str()); + GELOGE(FAILED, "[Call][IsolateAndDeleteNode] for node:%s(%s) failed", + node->GetName().c_str(), node->GetType().c_str()); return FAILED; } } diff --git a/ge/graph/passes/assign_remove_pass.cc b/ge/graph/passes/assign_remove_pass.cc index 43a95516..1d78d6bd 100644 --- a/ge/graph/passes/assign_remove_pass.cc +++ b/ge/graph/passes/assign_remove_pass.cc @@ -33,13 +33,13 @@ Status AssignRemovePass::Run(NodePtr &node) { GELOGD("AssignRemovePass running"); if (TransformAttr(node) != SUCCESS) { - GELOGE(FAILED, "Transform assign_var_name attr failed, node=%s", node->GetName().c_str()); + GELOGE(FAILED, "[Call][TransformAttr] Transform assign_var_name attr failed, node=%s", node->GetName().c_str()); return FAILED; } if (node->GetType() == ASSIGN) { if (OptimizedAssignNode(node) != SUCCESS) { - GELOGE(FAILED, "Optimize for assign_node %s failed", node->GetName().c_str()); + GELOGE(FAILED, "[Call][Optimize] for assign_node %s failed", node->GetName().c_str()); return FAILED; } } @@ -60,7 +60,9 @@ Status AssignRemovePass::OptimizedAssignNode(NodePtr &assign_node) { REPORT_INNER_ERROR("E19999", "Index %d or %d input anchor of node:%s(%s) is nullptr, check invalid", kAssignRefInputIndex, kAssignValueInputIndex, assign_node->GetName().c_str(), assign_node->GetType().c_str()); - GELOGE(FAILED, "In data anchor is null, node:%s", assign_node->GetName().c_str()); + GELOGE(FAILED, "[Check][Param] Index %d or %d input anchor of node:%s(%s) is nullptr", + kAssignRefInputIndex, kAssignValueInputIndex, + assign_node->GetName().c_str(), assign_node->GetType().c_str()); return FAILED; } const auto &ref_peer_anchor = ref_in_anchor->GetPeerOutAnchor(); @@ -69,7 +71,9 @@ Status AssignRemovePass::OptimizedAssignNode(NodePtr &assign_node) { REPORT_INNER_ERROR("E19999", "Index %d or %d input anchor of node:%s(%s), peer anchor is nullptr, check invalid", kAssignRefInputIndex, kAssignValueInputIndex, assign_node->GetName().c_str(), assign_node->GetType().c_str()); - GELOGE(FAILED, "Peer data anchor is null, node:%s", assign_node->GetName().c_str()); + GELOGE(FAILED, "[Check][Param] Index %d or %d input anchor of node:%s(%s), peer anchor is nullptr", + kAssignRefInputIndex, kAssignValueInputIndex, + assign_node->GetName().c_str(), assign_node->GetType().c_str()); return FAILED; } @@ -87,7 +91,7 @@ Status AssignRemovePass::OptimizedAssignNode(NodePtr &assign_node) { if (IsolateAndDeleteNode(assign_node, {kAssignRefInputIndex}) != SUCCESS) { REPORT_CALL_ERROR("E19999", "Isolate and delete node:%s(%s) failed", assign_node->GetName().c_str(), assign_node->GetType().c_str()); - GELOGE(FAILED, "Isolate and delete assign_node %s failed.", assign_node->GetName().c_str()); + GELOGE(FAILED, "[IsolateAndDelete][Node] %s failed.", assign_node->GetName().c_str()); return FAILED; } @@ -97,7 +101,9 @@ Status AssignRemovePass::OptimizedAssignNode(NodePtr &assign_node) { REPORT_INNER_ERROR("E19999", "Input index %d or %d of node:%s(%s), peer op is nullptr, check invalid", kAssignRefInputIndex, kAssignValueInputIndex, assign_node->GetName().c_str(), assign_node->GetType().c_str()); - GELOGE(FAILED, "value input is null"); + GELOGE(FAILED, "[Check][Param] Input index %d or %d of node:%s(%s), peer op is nullptr", + kAssignRefInputIndex, kAssignValueInputIndex, + assign_node->GetName().c_str(), assign_node->GetType().c_str()); return FAILED; } @@ -105,7 +111,8 @@ Status AssignRemovePass::OptimizedAssignNode(NodePtr &assign_node) { if (ref_input->UpdateInputDesc(0, value_input->GetOutputDesc(value_peer_anchor->GetIdx())) != GRAPH_SUCCESS) { REPORT_CALL_ERROR("E19999", "Input index %d of node:%s(%s), update it's peer op input:0 desc failed", kAssignRefInputIndex, assign_node->GetName().c_str(), assign_node->GetType().c_str()); - GELOGE(FAILED, "Update input_desc for variable %s failed.", ref_input->GetName().c_str()); + GELOGE(FAILED, "[Update][InputDesc] Input index %d of node:%s(%s), update it's peer op input:0 desc failed", + kAssignRefInputIndex, assign_node->GetName().c_str(), assign_node->GetType().c_str()); return FAILED; } if (GraphUtils::AddEdge(value_peer_anchor, ref_peer_anchor->GetOwnerNode()->GetInDataAnchor(0)) != GRAPH_SUCCESS) { @@ -114,7 +121,10 @@ Status AssignRemovePass::OptimizedAssignNode(NodePtr &assign_node) { value_peer_anchor->GetOwnerNode()->GetType().c_str(), value_peer_anchor->GetIdx(), ref_peer_anchor->GetOwnerNode()->GetName().c_str(), ref_peer_anchor->GetOwnerNode()->GetType().c_str()); - GELOGE(FAILED, "Add data edge %s->%s failed", value_input->GetName().c_str(), ref_input->GetName().c_str()); + GELOGE(FAILED, "[Add][Edge] between op:%s(%s)(out_index:%d) and op:%s(%s)(in_index:0) failed", + value_peer_anchor->GetOwnerNode()->GetName().c_str(), + value_peer_anchor->GetOwnerNode()->GetType().c_str(), value_peer_anchor->GetIdx(), + ref_peer_anchor->GetOwnerNode()->GetName().c_str(), ref_peer_anchor->GetOwnerNode()->GetType().c_str()); return FAILED; } @@ -125,7 +135,9 @@ Status AssignRemovePass::OptimizedAssignNode(NodePtr &assign_node) { REPORT_CALL_ERROR("E19999", "Set Attr:%s to output:%d desc of node:%s(%s) failed", ASSIGN_VAR_NAME.c_str(), value_peer_anchor->GetIdx(), value_input->GetName().c_str(), value_input->GetType().c_str()); - GELOGE(FAILED, "Set attr ASSIGN_VAR_NAME failed."); + GELOGE(FAILED, "[Set][Attr] %s to output:%d desc of node:%s(%s) failed", + ASSIGN_VAR_NAME.c_str(), value_peer_anchor->GetIdx(), + value_input->GetName().c_str(), value_input->GetType().c_str()); return FAILED; } auto value_node = value_peer_anchor->GetOwnerNode(); @@ -160,7 +172,9 @@ Status AssignRemovePass::TransformAttr(NodePtr &node) { REPORT_CALL_ERROR("E19999", "Set Attr:%s to output:%d desc of node:%s(%s) failed", ASSIGN_VAR_NAME.c_str(), peer_data_anchor->GetIdx(), in_node->GetName().c_str(), in_node->GetType().c_str()); - GELOGE(FAILED, "Set attr ASSIGN_VAR_NAME failed."); + GELOGE(FAILED, "[Set][Attr] %s to output:%d desc of node:%s(%s) failed", + ASSIGN_VAR_NAME.c_str(), peer_data_anchor->GetIdx(), + in_node->GetName().c_str(), in_node->GetType().c_str()); return FAILED; } AddRePassNode(in_node); diff --git a/ge/graph/passes/atomic_addr_clean_pass.cc b/ge/graph/passes/atomic_addr_clean_pass.cc index da9d42f7..9f202c77 100755 --- a/ge/graph/passes/atomic_addr_clean_pass.cc +++ b/ge/graph/passes/atomic_addr_clean_pass.cc @@ -159,7 +159,8 @@ Status AtomicAddrCleanPass::HandleLoopGraph(ComputeGraphPtr &graph, const vector // Insert atomic clean op NodePtr clean_addr_node = InsertAtomicAddrCleanNode(graph); if (clean_addr_node == nullptr) { - GELOGE(FAILED, "Insert AtomicAddrClean node failed. Ignore atomicAddrClean pass."); + GELOGE(FAILED, "[Insert][AtomicAddrCleanNode] to graph:%s failed. Ignore atomicAddrClean pass.", + graph->GetName().c_str()); return FAILED; } @@ -173,7 +174,9 @@ Status AtomicAddrCleanPass::HandleLoopGraph(ComputeGraphPtr &graph, const vector auto ret = LinkToAtomicNode(node, clean_addr_node); if (ret != SUCCESS) { - GELOGE(ret, "Link control anchor failed from atomic node to atomic_addr_clean node."); + GELOGE(ret, + "[Call][LinkToAtomicNode] Link control anchor failed from atomic node:%s to atomic_addr_clean:%s node.", + node->GetName().c_str(), clean_addr_node->GetName().c_str()); return ret; } index++; @@ -188,7 +191,7 @@ Status AtomicAddrCleanPass::HandleNormalGraph(ComputeGraphPtr &graph, const vect vector dispersed_atomic_nodes; auto ret = HandleDispersedAtomicNodes(graph, atomic_node_vec, common_atomic_nodes, dispersed_atomic_nodes); if (ret != SUCCESS) { - GELOGE(ret, "Handle dispersed atomic nodes failed, graph name is %s.", graph->GetName().c_str()); + GELOGE(ret, "[Call][HandleDispersedAtomicNodes] failed, graph name is %s.", graph->GetName().c_str()); return ret; } @@ -200,13 +203,15 @@ Status AtomicAddrCleanPass::HandleNormalGraph(ComputeGraphPtr &graph, const vect // not loop graph , insert only one clean node in graph NodePtr clean_addr_node = InsertAtomicAddrCleanNode(graph); if (clean_addr_node == nullptr) { - GELOGE(FAILED, "Insert AtomicAddrClean node failed. Ignore atomicAddrClean pass."); + GELOGE(FAILED, "[Insert][AtomicAddrCleanNode] in graph:%s failed. Ignore atomicAddrClean pass.", + graph->GetName().c_str()); return FAILED; } for (const auto &node : common_atomic_nodes) { ret = LinkToAtomicNode(node, clean_addr_node); if (ret != SUCCESS) { - GELOGE(ret, "Link control anchor failed from atomic node to atomic_addr_clean node."); + GELOGE(ret, "[Link][ControlAnchor] failed from atomic node:%s to atomic_addr_clean node:%s.", + node->GetName().c_str(), clean_addr_node->GetName().c_str()); return ret; } } @@ -218,7 +223,8 @@ Status AtomicAddrCleanPass::HandleNormalGraph(ComputeGraphPtr &graph, const vect NodePtr peer_in_node = in_anchor->GetPeerOutAnchor()->GetOwnerNode(); ret = LinkToAtomicNode(peer_in_node, clean_addr_node); if (ret != SUCCESS) { - GELOGE(ret, "Link failed, %s : %s", peer_in_node->GetName().c_str(), clean_addr_node->GetName().c_str()); + GELOGE(ret, "[Link][ControlAnchor] from node:%s to node:%s failed", + peer_in_node->GetName().c_str(), clean_addr_node->GetName().c_str()); return ret; } } @@ -276,7 +282,8 @@ Status AtomicAddrCleanPass::HandleDispersedAtomicNodes(ComputeGraphPtr &graph, if (!node_anchors_connect_netoutput.empty()) { NodePtr dispersed_clean_addr_node = InsertAtomicAddrCleanNode(graph); if (dispersed_clean_addr_node == nullptr) { - GELOGE(FAILED, "Insert AtomicAddrClean node failed. Ignore atomicAddrClean pass."); + GELOGE(FAILED, "[Insert][AtomicAddrCleanNode] in graph:%s failed. Ignore atomicAddrClean pass.", + graph->GetName().c_str()); return FAILED; } @@ -291,7 +298,7 @@ Status AtomicAddrCleanPass::HandleDispersedAtomicNodes(ComputeGraphPtr &graph, ++index; Status ret = LinkToAtomicNode(node, dispersed_clean_addr_node); if (ret != SUCCESS) { - GELOGE(ret, "Link control anchor failed from atomic node: %s to atomic_addr_clean node: %s.", + GELOGE(ret, "[Link][ControlAnchor] failed from atomic node:%s to atomic_addr_clean node:%s.", node->GetName().c_str(), dispersed_clean_addr_node->GetName().c_str()); return ret; } @@ -308,7 +315,7 @@ NodePtr AtomicAddrCleanPass::InsertAtomicAddrCleanNode(ComputeGraphPtr &graph) { OpDescPtr op_desc = MakeShared(NODE_NAME_ATOMIC_ADDR_CLEAN, ATOMICADDRCLEAN); if (op_desc == nullptr) { REPORT_CALL_ERROR("E19999", "New OpDesc failed"); - GELOGE(INTERNAL_ERROR, "Make shared atomic addr clean op failed."); + GELOGE(INTERNAL_ERROR, "[New][OpDesc] failed."); return nullptr; } string session_graph_id; @@ -336,7 +343,7 @@ Status AtomicAddrCleanPass::LinkToAtomicNode(const NodePtr &atomic_node, NodePtr GE_IF_BOOL_EXEC(atomic_node == nullptr || atomic_clean_node == nullptr, REPORT_INNER_ERROR("E19999", "Param atomic_node or atomic_clean_node is nullptr, " "check invalid"); - DOMI_LOGE("param [atomic_node][atomic_clean_node] must not be null."); + DOMI_LOGE("[Check][Param] param [atomic_node][atomic_clean_node] must not be null."); return PARAM_INVALID); InControlAnchorPtr in_ctrl_anchor = atomic_node->GetInControlAnchor(); OutControlAnchorPtr out_ctrl_anchor = atomic_clean_node->GetOutControlAnchor(); @@ -345,9 +352,9 @@ Status AtomicAddrCleanPass::LinkToAtomicNode(const NodePtr &atomic_node, NodePtr "check invalid", atomic_node->GetName().c_str(), atomic_node->GetType().c_str(), atomic_clean_node->GetName().c_str(), atomic_clean_node->GetType().c_str()); - GELOGE(INTERNAL_ERROR, - "Get control anchor faild, dst node: %s.", - atomic_node->GetName().c_str()); + GELOGE(INTERNAL_ERROR, "[Check][Param] in_ctrl_anchor of op:%s(%s) or out_ctrl_anchor of op:%s(%s) is nullptr.", + atomic_node->GetName().c_str(), atomic_node->GetType().c_str(), + atomic_clean_node->GetName().c_str(), atomic_clean_node->GetType().c_str()); return INTERNAL_ERROR; } @@ -358,9 +365,9 @@ Status AtomicAddrCleanPass::LinkToAtomicNode(const NodePtr &atomic_node, NodePtr out_ctrl_anchor->GetOwnerNode()->GetType().c_str(), in_ctrl_anchor->GetOwnerNode()->GetName().c_str(), in_ctrl_anchor->GetOwnerNode()->GetType().c_str()); - GELOGE(INTERNAL_ERROR, - "Graph add cleanAddrNode op out ctrl edge fail, dst node: %s.", - atomic_node->GetName().c_str()); + GELOGE(INTERNAL_ERROR, "[Add][ControlEdge] between op:%s(%s) and op:%s(%s) failed", + out_ctrl_anchor->GetOwnerNode()->GetName().c_str(), out_ctrl_anchor->GetOwnerNode()->GetType().c_str(), + in_ctrl_anchor->GetOwnerNode()->GetName().c_str(), in_ctrl_anchor->GetOwnerNode()->GetType().c_str()); return INTERNAL_ERROR; } GELOGD("Graph add cleanAddrNode op out ctrl edge, dst node: %s.", atomic_node->GetName().c_str()); @@ -375,7 +382,7 @@ Status AtomicAddrCleanPass::LinkToAtomicNode(const NodePtr &atomic_node, NodePtr } bool AtomicAddrCleanPass::IsAtomicOp(const NodePtr &node) { - GE_IF_BOOL_EXEC(node == nullptr, GELOGE(FAILED, "node is null."); return false); + GE_IF_BOOL_EXEC(node == nullptr, GELOGE(FAILED, "[Check][Param] node is nullptr."); return false); OpDescPtr op_desc = node->GetOpDesc(); if (op_desc == nullptr) { return false; @@ -416,7 +423,7 @@ Status AtomicAddrCleanPass::CompileUnknownGraphOp(const vector &atomic_ std::shared_ptr instance = ge::GELib::GetInstance(); if ((instance == nullptr) || !instance->InitFlag()) { REPORT_INNER_ERROR("E19999", "GeLib is not init before, check invalid"); - GELOGE(ge::GE_CLI_GE_NOT_INITIALIZED, "CompileSingleOp failed."); + GELOGE(ge::GE_CLI_GE_NOT_INITIALIZED, "[Check][Param] GeLib is not init before."); return ge::GE_CLI_GE_NOT_INITIALIZED; } @@ -428,10 +435,10 @@ Status AtomicAddrCleanPass::CompileUnknownGraphOp(const vector &atomic_ } string kernel_lib_name = op_desc->GetOpKernelLibName(); if (kernel_lib_name.empty()) { - REPORT_INNER_ERROR("E19999", "Find ops kernel by name:%s failed", - kernel_lib_name.c_str()); - GELOGE(ge::INTERNAL_ERROR, "Get atomic node:%s(%s) kernel lib failed.", atomic_node->GetName().c_str(), - atomic_node->GetType().c_str()); + REPORT_INNER_ERROR("E19999", "Find ops kernel by name of op:%s(%s) failed", + op_desc->GetName().c_str(), op_desc->GetType().c_str()); + GELOGE(ge::INTERNAL_ERROR, "[Get][OpKernelLibName] of op:%s(%s) failed.", op_desc->GetName().c_str(), + op_desc->GetType().c_str()); return ge::INTERNAL_ERROR; } @@ -452,7 +459,7 @@ Status AtomicAddrCleanPass::CompileUnknownGraphOp(const vector &atomic_ if (ret != ge::SUCCESS) { REPORT_CALL_ERROR("E19999", "Call CompileOp failed, kernel_lib_name:%s, ret:%d", kernel_lib_name.c_str(), ret); - GELOGE(ret, "Compile atomic op failed, kernel lib name is %s", kernel_lib_name.c_str()); + GELOGE(ret, "[Compile][AtomicOp] failed, kernel lib name is %s", kernel_lib_name.c_str()); return ret; } } diff --git a/ge/graph/passes/attach_stream_label_pass.cc b/ge/graph/passes/attach_stream_label_pass.cc index 8dfcc481..d5b28ec7 100644 --- a/ge/graph/passes/attach_stream_label_pass.cc +++ b/ge/graph/passes/attach_stream_label_pass.cc @@ -29,10 +29,11 @@ Status AttachStreamLabelPass::Run(ComputeGraphPtr graph) { std::map branch_head_nodes; FindNodes(graph, need_label_nodes, enter_nodes, branch_head_nodes); for (const auto &node : need_label_nodes) { - GE_CHK_STATUS_RET(UpdateCondBranch(node, branch_head_nodes), "Update cond branch failed, start node:%s.", + GE_CHK_STATUS_RET(UpdateCondBranch(node, branch_head_nodes), "[Update][CondBranch] failed, start node:%s.", node->GetName().c_str()); } - GE_CHK_STATUS_RET(UpdateEnterNode(enter_nodes), "UpdateEnterNode failed."); + GE_CHK_STATUS_RET(UpdateEnterNode(enter_nodes), + "[Update][EnterNode] in graph:%s failed.", graph->GetName().c_str()); GELOGD("AttachStreamLabelPass Leave."); return SUCCESS; @@ -84,7 +85,7 @@ Status AttachStreamLabelPass::UpdateCondBranch(const NodePtr &node, const std::map &branch_head_nodes) { std::string stream_label; if (AttachFlag(node, stream_label) != SUCCESS) { - GELOGE(FAILED, "Attach flag for node %s failed.", node->GetName().c_str()); + GELOGE(FAILED, "[Attach][Flag] for node %s failed.", node->GetName().c_str()); return FAILED; } @@ -120,9 +121,8 @@ Status AttachStreamLabelPass::UpdateCondBranch(const NodePtr &node, GELOGD("Attach label %s to node: %s.", stream_label.c_str(), tmp_node->GetName().c_str()); auto status = SetStreamLabel(tmp_node, stream_label); if (status != ge::SUCCESS) { - REPORT_CALL_ERROR("E19999", "Set stream_label:%s to op:%s(%s) failed", - stream_label.c_str(), tmp_node->GetName().c_str(), tmp_node->GetType().c_str()); - GELOGE(status, "Set stream label failed."); + GELOGE(status, "[Set][StreamLabel] %s to op:%s(%s) failed.", + stream_label.c_str(), tmp_node->GetName().c_str(), tmp_node->GetType().c_str()); return status; } } @@ -142,7 +142,7 @@ Status AttachStreamLabelPass::AttachFlag(const NodePtr &node, std::string &strea if (node->GetInDataNodes().empty()) { REPORT_INNER_ERROR("E19999", "In data nodes is empty of op:%s(%s), check invalid", node->GetName().c_str(), node->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "node %s has no input_data_node.", node->GetName().c_str()); + GELOGE(INTERNAL_ERROR, "[Get][InDataNodes] node %s has no input_data_node.", node->GetName().c_str()); return INTERNAL_ERROR; } stream_label = node->GetInDataNodes().at(0)->GetName(); @@ -154,22 +154,21 @@ Status AttachStreamLabelPass::AttachFlag(const NodePtr &node, std::string &strea ATTR_NAME_SWITCH_TRUE_BRANCH_FLAG.c_str(), op_desc->GetName().c_str(), op_desc->GetType().c_str()); return FAILED, - "StreamSwitch get attr TRUE_BRANCH_STREAM failed."); + "[Get][Attr] %s of op:%s(%s) failed", ATTR_NAME_SWITCH_TRUE_BRANCH_FLAG.c_str(), + op_desc->GetName().c_str(), op_desc->GetType().c_str()); stream_label += (value ? "_t" : "_f"); auto status = SetActiveLabelList(node, {stream_label}); if (status != ge::SUCCESS) { - REPORT_CALL_ERROR("E19999", "Set active label list:%s to op:%s(%s) failed", - stream_label.c_str(), node->GetName().c_str(), node->GetType().c_str()); - GELOGE(status, "set active_label_list failed."); + GELOGE(status, "[Set][ActiveLabelList] %s to op:%s(%s) failed.", + stream_label.c_str(), node->GetName().c_str(), node->GetType().c_str()); return status; } } else if (type == STREAMMERGE) { stream_label = node->GetName(); auto status = SetStreamLabel(node, stream_label); if (status != ge::SUCCESS) { - REPORT_CALL_ERROR("E19999", "Set stream_label:%s to op:%s(%s) failed", - stream_label.c_str(), node->GetName().c_str(), node->GetType().c_str()); - GELOGE(status, "Set stream label failed."); + GELOGE(status, "[Set][StreamLabel] %s to op:%s(%s) failed.", + stream_label.c_str(), node->GetName().c_str(), node->GetType().c_str()); return status; } } @@ -199,7 +198,7 @@ Status AttachStreamLabelPass::UpdateEnterNode(const std::vector &enter_ for (const auto &pair : enter_active_map) { if (SetEnterLabel(pair.second, pair.first) != SUCCESS) { - GELOGE(FAILED, "Set stream_label for enter_nodes failed."); + GELOGE(FAILED, "[Set][EnterLabel] for enter_nodes failed."); return FAILED; } @@ -212,7 +211,8 @@ Status AttachStreamLabelPass::UpdateEnterNode(const std::vector &enter_ REPORT_CALL_ERROR("E19999", "Get Attr:%s of op:%s(%s) failed", ATTR_NAME_ACTIVE_LABEL_LIST.c_str(), active_node->GetName().c_str(), active_node->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "Get attr ATTR_NAME_ACTIVE_LABEL_LIST failed, node: %s.", active_node->GetName().c_str()); + GELOGE(INTERNAL_ERROR, "[Get][Attr] %s of op:%s(%s) failed.", ATTR_NAME_ACTIVE_LABEL_LIST.c_str(), + active_node->GetName().c_str(), active_node->GetType().c_str()); return INTERNAL_ERROR; } @@ -221,7 +221,7 @@ Status AttachStreamLabelPass::UpdateEnterNode(const std::vector &enter_ nodes.emplace(enter_node); } if (UpdateLoopBranch(nodes, active_label_list[0]) != SUCCESS) { - GELOGE(FAILED, "Update stream_label for loop_branch failed."); + GELOGE(FAILED, "[Update][StreamLabel] %s for loop_branch failed.", active_label_list[0].c_str()); return FAILED; } } @@ -247,9 +247,8 @@ Status AttachStreamLabelPass::SetEnterLabel(const std::vector &enter_no for (const auto &enter_node : enter_nodes) { auto status = SetStreamLabel(enter_node, stream_label); if (status != ge::SUCCESS) { - REPORT_CALL_ERROR("E19999", "Set stream_label:%s to op:%s(%s) failed", - stream_label.c_str(), enter_node->GetName().c_str(), enter_node->GetType().c_str()); - GELOGE(status, "Set stream label failed."); + GELOGE(status, "[Set][StreamLabel] %s to op:%s(%s) failed.", + stream_label.c_str(), enter_node->GetName().c_str(), enter_node->GetType().c_str()); return status; } } @@ -282,9 +281,8 @@ Status AttachStreamLabelPass::UpdateLoopBranch(const std::stack &enter_ GELOGD("Attach label %s to node: %s.", stream_label.c_str(), out_node->GetName().c_str()); auto status = SetStreamLabel(out_node, stream_label); if (status != ge::SUCCESS) { - REPORT_CALL_ERROR("E19999", "Set stream_label:%s to op:%s(%s) failed", - stream_label.c_str(), out_node->GetName().c_str(), out_node->GetType().c_str()); - GELOGE(status, "Set stream label failed."); + GELOGE(status, "[Set][StreamLabel] %s to op:%s(%s) failed.", + stream_label.c_str(), out_node->GetName().c_str(), out_node->GetType().c_str()); return status; } nodes.push(out_node); diff --git a/ge/graph/passes/base_pass.cc b/ge/graph/passes/base_pass.cc index 2f94c6ad..6d933295 100755 --- a/ge/graph/passes/base_pass.cc +++ b/ge/graph/passes/base_pass.cc @@ -142,13 +142,14 @@ void PushToRePassIfSeen(NodePtr &node, const std::pairGetName().c_str()); for (const auto &name_to_pass : names_to_passes) { if (name_to_pass.second == nullptr) { - GELOGE(INTERNAL_ERROR, "There is null pointer in passes(%s), skip it", name_to_pass.first.c_str()); + GELOGE(INTERNAL_ERROR, "[Check][Param] There is null pointer in passes(%s), skip it", name_to_pass.first.c_str()); continue; } @@ -156,8 +157,9 @@ Status RunPasses(NodePtr &node, const NamesToPass &names_to_passes, DuringPassNo name_to_pass.second->init(); auto result = name_to_pass.second->Run(node); if (result != SUCCESS) { - GELOGE(INTERNAL_ERROR, - "Failed to process pass %s on node %s, result " + REPORT_CALL_ERROR("E19999", "process pass %s on node:%s failed, ret:%u", + name_to_pass.first.c_str(), node->GetName().c_str(), result); + GELOGE(INTERNAL_ERROR, "[Process][Pass] %s on node %s failed, result " "%u, the passes will be terminated immediately.", name_to_pass.first.c_str(), node->GetName().c_str(), result); return result; @@ -201,26 +203,31 @@ void ClearOption(NamesToPass names_to_pass) { Status BaseNodePass::IsolateAndDeleteNode(NodePtr &node, const std::vector &io_map) { if (node == nullptr) { - GELOGE(FAILED, "parameter is null."); + REPORT_INNER_ERROR("E19999", "Param node is nullptr, check invalid."); + GELOGE(FAILED, "[Check][Param] parameter node is nullptr."); return FAILED; } GELOGI("Prepare to isolate and delete node, name:%s, type:%s.", node->GetName().c_str(), node->GetType().c_str()); ComputeGraphPtr graph = node->GetOwnerComputeGraph(); if (graph == nullptr) { - GELOGE(FAILED, "[%s] The owner graph must not be null.", node->GetName().c_str()); + REPORT_INNER_ERROR("E19999", "The owner graph of node:%s must not be null.", node->GetName().c_str()); + GELOGE(FAILED, "[Get][OwnerComputeGraph] failed, The owner graph of node:%s must not be null.", + node->GetName().c_str()); return FAILED; } AddRePassNodesWithInOut(node); if (GraphUtils::IsolateNode(node, io_map) != GRAPH_SUCCESS) { - GELOGE(FAILED, "[%s] IsolateNode failed.", node->GetName().c_str()); + REPORT_CALL_ERROR("E19999", "Isolate Node:%s failed", node->GetName().c_str()); + GELOGE(FAILED, "[Isolate][Node] %s failed.", node->GetName().c_str()); return FAILED; } if (GraphUtils::RemoveNodeWithoutRelink(graph, node) != SUCCESS) { - GELOGE(FAILED, "[%s] RemoveNodeWithoutRelink failed.", node->GetName().c_str()); + REPORT_CALL_ERROR("E19999", "call RemoveNodeWithoutRelink for node:%s failed.", node->GetName().c_str()); + GELOGE(FAILED, "[Call][RemoveNodeWithoutRelink] for node:%s failed.", node->GetName().c_str()); return FAILED; } @@ -230,7 +237,8 @@ Status BaseNodePass::IsolateAndDeleteNode(NodePtr &node, const std::vector Status GEPass::Run(const NamesToPass &names_to_passes) { if (graph_ == nullptr) { - GELOGE(INTERNAL_ERROR, "The graph is null"); + REPORT_INNER_ERROR("E19999", "graph_ is nullptr, check invalid."); + GELOGE(INTERNAL_ERROR, "[Check][Param] The graph is nullptr"); return INTERNAL_ERROR; } if (names_to_passes.empty()) { @@ -240,7 +248,7 @@ Status GEPass::Run(const NamesToPass &names_to_passes) { if (depth_ > kMaxRecursiveDepth) { GELOGE(PARAM_INVALID, - "The pass for root graph %s will be terminated because too many nesting" + "[Check][Param] The pass for root graph %s will be terminated because too many nesting" " levels(%d) of subgraphs, last subgraph is %s", root_graph_->GetName().c_str(), depth_, graph_->GetName().c_str()); return PARAM_INVALID; @@ -284,7 +292,7 @@ Status GEPass::RunPassesOneGraph(const NamesToPass &names_to_passes) { auto ret = RunPasses(node, names_to_passes, during_pass_node_set); if (ret != SUCCESS) { - GELOGE(ret, "Failed to process passes on node %s type %s, error code: %u", + GELOGE(ret, "[Process][Passes] on node %s type %s failed, error code:%u", node->GetName().c_str(), node->GetType().c_str(), ret); return ret; } @@ -292,7 +300,7 @@ Status GEPass::RunPassesOneGraph(const NamesToPass &names_to_passes) { bool has_sub_graph = false; ret = RunPassesOnSubGraph(node, names_to_passes, has_sub_graph); if (ret != SUCCESS) { - GELOGE(ret, "Failed to run passes on the sub graph of node %s", node->GetName().c_str()); + GELOGE(ret, "[Run][Passes] on the sub graph of node %s failed", node->GetName().c_str()); return ret; } @@ -301,7 +309,7 @@ Status GEPass::RunPassesOneGraph(const NamesToPass &names_to_passes) { SetFlagOption(kOptimizeAfterSubGraph, names_to_passes); ret = RunPasses(node, names_to_passes, during_pass_node_set); if (ret != SUCCESS) { - GELOGE(ret, "Failed to process passes on node %s type %s, error code: %u", + GELOGE(ret, "[Process][Passes] on node %s type %s failed, error code: %u", node->GetName().c_str(), node->GetType().c_str(), ret); return ret; } @@ -347,7 +355,7 @@ Status GEPass::RunPassesOnSubGraph(const NodePtr &node, const NamesToPass &names GEPass pass(graph, root_graph_, depth_ + 1); auto ret = pass.Run(names_to_passes); if (ret != SUCCESS) { - GELOGE(ret, "Failed to run passes for sub graph %s from node %s", name.c_str(), node->GetName().c_str()); + GELOGE(ret, "[Run][Passes] for sub graph:%s from node:%s failed", name.c_str(), node->GetName().c_str()); return ret; } } diff --git a/ge/graph/passes/bitcast_pass.cc b/ge/graph/passes/bitcast_pass.cc index 89136078..3d3d109c 100644 --- a/ge/graph/passes/bitcast_pass.cc +++ b/ge/graph/passes/bitcast_pass.cc @@ -33,7 +33,7 @@ Status BitcastPass::Run(NodePtr &node) { GELOGD("Bitcast running"); if (node == nullptr) { REPORT_INNER_ERROR("E19999", "Param node is nullptr, check invalid"); - GELOGE(PARAM_INVALID, "Param [node] must not be null."); + GELOGE(PARAM_INVALID, "[Check][Param] Param [node] must not be null."); return PARAM_INVALID; } @@ -44,6 +44,7 @@ Status BitcastPass::Run(NodePtr &node) { OpDescPtr op_desc = node->GetOpDesc(); if (op_desc == nullptr) { REPORT_INNER_ERROR("E19999", "Param op_desc of node is nullptr, check invalid"); + GELOGE(PARAM_INVALID, "[Get][OpDesc] failed, op_desc of node is nullptr"); return PARAM_INVALID; } ge::DataType dst_data_type; @@ -63,21 +64,24 @@ Status BitcastPass::CheckDstDataType(const OpDescPtr op_desc, ge::DataType &dst_ if (!ge::AttrUtils::GetDataType(op_desc, kAttrNameType, dst_data_type)) { REPORT_CALL_ERROR("E19999", "Get Attr:%s of op:%s(%s) failed", kAttrNameType, op_desc->GetName().c_str(), op_desc->GetType().c_str()); - GELOGE(PARAM_INVALID, "Node failed to get attribute type."); + GELOGE(PARAM_INVALID, "[Get][Attr] %s of op:%s(%s) failed", + kAttrNameType, op_desc->GetName().c_str(), op_desc->GetType().c_str()); return PARAM_INVALID; } if (dst_data_type >= ge::DT_UNDEFINED) { REPORT_INNER_ERROR("E19999", "Param dst_data_type:%d check invalid, op:%s(%s)", dst_data_type, op_desc->GetName().c_str(), op_desc->GetType().c_str()); - GELOGE(PARAM_INVALID, "dst_data_type[%s] is not valid.", - TypeUtils::DataTypeToSerialString(dst_data_type).c_str()); + GELOGE(PARAM_INVALID, "[Check][Param] dst_data_type[%s] is not valid, op:%s(%s)", + TypeUtils::DataTypeToSerialString(dst_data_type).c_str(), + op_desc->GetName().c_str(), op_desc->GetType().c_str()); return PARAM_INVALID; } if (op_desc->GetOutputDescPtr(0) == nullptr) { REPORT_INNER_ERROR("E19999", "Index 0 ouput desc of op:%s(%s) not exist, check invalid", op_desc->GetName().c_str(), op_desc->GetType().c_str()); - GELOGE(PARAM_INVALID, "Bitcast node outputDesc is null."); + GELOGE(PARAM_INVALID, "[Get][OutputDescPtr] Index 0 ouput desc of op:%s(%s) not exist.", + op_desc->GetName().c_str(), op_desc->GetType().c_str()); return PARAM_INVALID; } if (op_desc->GetOutputDescPtr(0)->GetDataType() != dst_data_type) { @@ -85,9 +89,10 @@ Status BitcastPass::CheckDstDataType(const OpDescPtr op_desc, ge::DataType &dst_ "check invalid", op_desc->GetName().c_str(), op_desc->GetType().c_str(), TypeUtils::DataTypeToSerialString(dst_data_type).c_str(), TypeUtils::DataTypeToSerialString(op_desc->GetOutputDescPtr(0)->GetDataType()).c_str()); - GELOGE(PARAM_INVALID, "dst_data_type[%s] is not equal to output_data_type[%s].", + GELOGE(PARAM_INVALID, "[Check][Param] dst_data_type[%s] is not equal to output_data_type[%s], op:%s(%s).", TypeUtils::DataTypeToSerialString(dst_data_type).c_str(), - TypeUtils::DataTypeToSerialString(op_desc->GetOutputDescPtr(0)->GetDataType()).c_str()); + TypeUtils::DataTypeToSerialString(op_desc->GetOutputDescPtr(0)->GetDataType()).c_str(), + op_desc->GetName().c_str(), op_desc->GetType().c_str()); return PARAM_INVALID; } return SUCCESS; @@ -99,7 +104,8 @@ Status BitcastPass::CheckOutputShape(const OpDescPtr op_desc, const ge::DataType if (input_tensor_desc == nullptr) { REPORT_INNER_ERROR("E19999", "Index 0 input desc of op:%s(%s) not exist, check invalid", op_desc->GetName().c_str(), op_desc->GetType().c_str()); - GELOGE(PARAM_INVALID, "input_tensor_desc must not be null."); + GELOGE(PARAM_INVALID, "[Check][Param] input_tensor_desc(index:0) of op:%s(%s) must not be null.", + op_desc->GetName().c_str(), op_desc->GetType().c_str()); return PARAM_INVALID; } @@ -109,8 +115,9 @@ Status BitcastPass::CheckOutputShape(const OpDescPtr op_desc, const ge::DataType REPORT_INNER_ERROR("E19999", "ori_data_type:%d of index 0 input desc in op:%s(%s), " "check invalid", ori_data_type, op_desc->GetName().c_str(), op_desc->GetType().c_str()); - GELOGE(PARAM_INVALID, "ori_data_type[%s] is not valid.", - TypeUtils::DataTypeToSerialString(ori_data_type).c_str()); + GELOGE(PARAM_INVALID, "[Check][Param] ori_data_type[%s] of input desc(index 0) in op:%s(%s) is not valid.", + TypeUtils::DataTypeToSerialString(ori_data_type).c_str(), + op_desc->GetName().c_str(), op_desc->GetType().c_str()); return PARAM_INVALID; } @@ -121,7 +128,7 @@ Status BitcastPass::CheckOutputShape(const OpDescPtr op_desc, const ge::DataType BitcastPass::kVecInt64 dim_vec(input_tensor_desc->GetShape().GetDims()); if (CalcAndUpdateShape(dim_vec, ori_data_type, dst_data_type) != SUCCESS) { - GELOGE(PARAM_INVALID, "CalcAndUpdateShape failed."); + GELOGE(PARAM_INVALID, "[Call][CalcAndUpdateShape] failed."); return PARAM_INVALID; } @@ -130,7 +137,9 @@ Status BitcastPass::CheckOutputShape(const OpDescPtr op_desc, const ge::DataType "check invalid", formats::JoinToString(output_tensor_desc->GetShape().GetDims()).c_str(), op_desc->GetName().c_str(), op_desc->GetType().c_str(), formats::JoinToString(dim_vec).c_str()); - GELOGE(PARAM_INVALID, "out_put_shape is different from expectations."); + GELOGE(PARAM_INVALID, "[Check][Param] Shape:%s of index 0 output desc in op:%s(%s), different from expect shape:%s", + formats::JoinToString(output_tensor_desc->GetShape().GetDims()).c_str(), + op_desc->GetName().c_str(), op_desc->GetType().c_str(), formats::JoinToString(dim_vec).c_str()); return PARAM_INVALID; } @@ -141,7 +150,7 @@ Status BitcastPass::CalcAndUpdateShape(BitcastPass::kVecInt64 &dim_vec, ge::Data ge::DataType dst_data_type) { if (dim_vec.size() == 0) { REPORT_INNER_ERROR("E19999", "Param dim_vec is empty, check invalid"); - GELOGE(PARAM_INVALID, "Pre node shape size is zero."); + GELOGE(PARAM_INVALID, "[Check][Param] Param dim_vec is empty."); return PARAM_INVALID; } int64_t ori_data_size = GetSizeByDataType(ori_data_type); @@ -155,7 +164,10 @@ Status BitcastPass::CalcAndUpdateShape(BitcastPass::kVecInt64 &dim_vec, ge::Data "check invalid", ori_data_size, TypeUtils::DataTypeToSerialString(ori_data_type).c_str(), dst_data_size, TypeUtils::DataTypeToSerialString(dst_data_type).c_str()); - GELOGE(PARAM_INVALID, "ori_data_size is not divisible by dst_data_size."); + GELOGE(PARAM_INVALID, + "[Check][Param] size:%ld of ori_data_type:%s is not divisible by size:%ld of dst_data_type:%s.", + ori_data_size, TypeUtils::DataTypeToSerialString(ori_data_type).c_str(), + dst_data_size, TypeUtils::DataTypeToSerialString(dst_data_type).c_str()); return PARAM_INVALID; } dim_vec.push_back(ori_data_size / dst_data_size); @@ -166,7 +178,10 @@ Status BitcastPass::CalcAndUpdateShape(BitcastPass::kVecInt64 &dim_vec, ge::Data "check invalid", dst_data_size, TypeUtils::DataTypeToSerialString(dst_data_type).c_str(), ori_data_size, TypeUtils::DataTypeToSerialString(ori_data_type).c_str()); - GELOGE(PARAM_INVALID, "dst_data_size is not divisible by ori_data_size."); + GELOGE(PARAM_INVALID, + "[Check][Param] size:%ld of dst_data_type:%s is not divisible by size:%ld of ori_data_type:%s.", + dst_data_size, TypeUtils::DataTypeToSerialString(dst_data_type).c_str(), + ori_data_size, TypeUtils::DataTypeToSerialString(ori_data_type).c_str()); return PARAM_INVALID; } @@ -174,7 +189,9 @@ Status BitcastPass::CalcAndUpdateShape(BitcastPass::kVecInt64 &dim_vec, ge::Data REPORT_INNER_ERROR("E19999", "The last dim:%ld in param dim_vec is not equal to " "dst_data_size:%ld / ori_data_size:%ld, check invalid", dim_vec[dim_vec.size() - 1], dst_data_size, ori_data_size); - GELOGE(PARAM_INVALID, "The last dim is not equal to dst_data_size / ori_data_size."); + GELOGE(PARAM_INVALID, "[Check][Param] The last dim:%ld in param dim_vec is not equal to " + "dst_data_size:%ld / ori_data_size:%ld", + dim_vec[dim_vec.size() - 1], dst_data_size, ori_data_size); return PARAM_INVALID; } dim_vec.pop_back(); diff --git a/ge/graph/passes/cast_remove_pass.cc b/ge/graph/passes/cast_remove_pass.cc index 7e2bb7bb..564b311d 100644 --- a/ge/graph/passes/cast_remove_pass.cc +++ b/ge/graph/passes/cast_remove_pass.cc @@ -26,13 +26,13 @@ namespace ge { Status CastRemovePass::Run(NodePtr &node) { if (node == nullptr) { REPORT_INNER_ERROR("E19999", "Param node is nullptr, check invalid"); - GELOGE(PARAM_INVALID, "Param [node] must not be null."); + GELOGE(PARAM_INVALID, "[Check][Param] Param [node] must not be null."); return PARAM_INVALID; } OpDescPtr op_desc = node->GetOpDesc(); if (op_desc == nullptr) { REPORT_INNER_ERROR("E19999", "Param op_desc of node is nullptr, check invalid"); - GELOGE(PARAM_INVALID, "OpDesc of param [node] must not be null."); + GELOGE(PARAM_INVALID, "[Get][OpDesc] OpDesc of param [node] must not be null."); return PARAM_INVALID; } @@ -49,7 +49,7 @@ Status CastRemovePass::Run(NodePtr &node) { OpDescPtr end_op_desc = end_node->GetOpDesc(); if (end_op_desc == nullptr) { REPORT_INNER_ERROR("E19999", "op_desc of end_node is nullptr, check invalid"); - GELOGE(PARAM_INVALID, "OpDesc of end node must not be null."); + GELOGE(PARAM_INVALID, "[Get][OpDesc] OpDesc of end node must not be null."); return PARAM_INVALID; } @@ -104,7 +104,7 @@ Status CastRemovePass::RemoveCast(DataType &type, std::vector &nodes_to if (IsolateAndDeleteNode(node, {0}) != SUCCESS) { REPORT_CALL_ERROR("E19999", "Isolate and delete node:%s(%s) failed", node->GetName().c_str(), node->GetType().c_str()); - GELOGE(FAILED, "IsolateAndDeleteNode %s failed.", node->GetName().c_str()); + GELOGE(FAILED, "[IsolateAndDelete][Node] %s failed.", node->GetName().c_str()); return FAILED; } } @@ -120,7 +120,7 @@ Status CastRemovePass::RemoveCast(DataType &type, std::vector &nodes_to OpDescPtr op_desc = node->GetOpDesc(); if (op_desc == nullptr) { REPORT_INNER_ERROR("E19999", "Find nullptr op_desc in node, check invalid"); - GELOGE(FAILED, "OpDesc must not be null."); + GELOGE(FAILED, "[Get][OpDesc] OpDesc must not be null."); return FAILED; } @@ -132,7 +132,8 @@ Status CastRemovePass::RemoveCast(DataType &type, std::vector &nodes_to REPORT_CALL_ERROR("E19999", "Set Attr:%s of op:%s(%s) failed", ATTR_NEED_COMPILE.c_str(), op_desc->GetName().c_str(), op_desc->GetType().c_str()); - GELOGE(FAILED, "Set ATTR_NEED_COMPILE Attr fail."); + GELOGE(FAILED, "[Set][Attr] %s of op:%s(%s) failed", ATTR_NEED_COMPILE.c_str(), + op_desc->GetName().c_str(), op_desc->GetType().c_str()); return FAILED; } auto in_desc = op_desc->MutableInputDesc(0); diff --git a/ge/graph/passes/cast_translate_pass.cc b/ge/graph/passes/cast_translate_pass.cc index 37e9bc83..d49424c8 100644 --- a/ge/graph/passes/cast_translate_pass.cc +++ b/ge/graph/passes/cast_translate_pass.cc @@ -33,7 +33,7 @@ namespace ge { bool CastTranslatePass::CheckInAndOutDataAnchor(NodePtr &node) const { if (node == nullptr) { - GELOGE(FAILED, "parameter is null."); + GELOGE(FAILED, "[Check][Param] parameter node is nullptr."); return false; } if (node->GetOpDesc() == nullptr) { @@ -191,7 +191,7 @@ bool CastTranslatePass::IsOpSupportedOptimize(NodePtr &cast_node, NodePtr &trans } bool CastTranslatePass::CheckOpSupportOptimize(NodePtr &node, bool &is_src_cast) { - GE_IF_BOOL_EXEC(node == nullptr, GELOGE(FAILED, "node is null."); return false); + GE_IF_BOOL_EXEC(node == nullptr, GELOGE(FAILED, "[Check][Param] node is nullptr."); return false); auto out_node = node->GetOutDataNodes().at(0); // N dst nodes have the same datatype and format, check the first node if (is_src_cast) { @@ -249,14 +249,19 @@ Status CastTranslatePass::FuseDstNTranslates(NodePtr &node) { GE_CHECK_NOTNULL(out_data_node); AddRePassNodesWithInOut(out_data_node); // Has checked nodes only has one in data anchor one out data anchor - GE_CHK_GRAPH_STATUS_RET(NodeUtils::MoveOutputEdges(out_data_node, base_node), "move out put edge failed"); + GE_CHK_GRAPH_STATUS_RET(NodeUtils::MoveOutputEdges(out_data_node, base_node), + "[Move][OutputEdges] failed, out data node:%s, index:0", + base_node->GetName().c_str()); // Relink in control anchor, delete in data anchor auto in_ctr_anchor = out_data_node->GetInControlAnchor(); GE_CHECK_NOTNULL(in_ctr_anchor); for (const auto &peer_anchor : in_ctr_anchor->GetPeerOutControlAnchors()) { GE_CHECK_NOTNULL(base_node->GetInControlAnchor()); - GE_CHK_GRAPH_STATUS_RET(base_node->GetInControlAnchor()->LinkFrom(peer_anchor), "link from peer anchor failed"); + GE_CHK_GRAPH_STATUS_RET(base_node->GetInControlAnchor()->LinkFrom(peer_anchor), + "[Add][Edge] between %s and %s failed", + base_node->GetInControlAnchor()->GetOwnerNode()->GetName().c_str(), + peer_anchor->GetOwnerNode()->GetName().c_str()); } in_ctr_anchor->UnlinkAll(); out_data_node->GetAllInDataAnchors().at(0)->UnlinkAll(); @@ -266,7 +271,8 @@ Status CastTranslatePass::FuseDstNTranslates(NodePtr &node) { if (GraphUtils::RemoveNodeWithoutRelink(graph, out_data_node) != SUCCESS) { REPORT_CALL_ERROR("E19999", "Remove node:%s(%s) without relink in graph:%s failed", out_data_node->GetName().c_str(), out_data_node->GetType().c_str(), graph->GetName().c_str()); - GELOGE(FAILED, "[%s] RemoveNodeWithoutRelink failed.", out_data_node->GetName().c_str()); + GELOGE(FAILED, "[Remove][Node] %s(%s) without relink in graph:%s failed", + out_data_node->GetName().c_str(), out_data_node->GetType().c_str(), graph->GetName().c_str()); return FAILED; } AddNodeDeleted(out_data_node); diff --git a/ge/graph/passes/common_subexpression_elimination_pass.cc b/ge/graph/passes/common_subexpression_elimination_pass.cc index a95d0077..852ed98a 100644 --- a/ge/graph/passes/common_subexpression_elimination_pass.cc +++ b/ge/graph/passes/common_subexpression_elimination_pass.cc @@ -109,8 +109,8 @@ Status CommonSubexpressionEliminationPass::Run(ComputeGraphPtr graph) { REPORT_CALL_ERROR("E19999", "Replace node:%s(%s)'s anchor by node:%s(%s) failed", node->GetName().c_str(), node->GetType().c_str(), iter->second->GetName().c_str(), iter->second->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "Failed to replace node %s by node %s error node %u", - node->GetName().c_str(), iter->second->GetName().c_str(), ret); + GELOGE(INTERNAL_ERROR, "[Replace][Node] %s by node %s failed, ret:%u", + node->GetName().c_str(), iter->second->GetName().c_str(), ret); return INTERNAL_ERROR; } @@ -120,7 +120,8 @@ Status CommonSubexpressionEliminationPass::Run(ComputeGraphPtr graph) { if (ret != GRAPH_SUCCESS) { REPORT_CALL_ERROR("E19999", "Remove node:%s(%s) without relink in graph:%s failed", node->GetName().c_str(), node->GetType().c_str(), graph->GetName().c_str()); - GELOGE(INTERNAL_ERROR, "Failed to remove node %s from graph", node->GetName().c_str()); + GELOGE(INTERNAL_ERROR, "[Remove][Node] %s from graph:%s failed", node->GetName().c_str(), + graph->GetName().c_str()); return INTERNAL_ERROR; } diff --git a/ge/graph/passes/compile_nodes_pass.cc b/ge/graph/passes/compile_nodes_pass.cc index 76330dc6..d0dcec16 100755 --- a/ge/graph/passes/compile_nodes_pass.cc +++ b/ge/graph/passes/compile_nodes_pass.cc @@ -42,7 +42,7 @@ graphStatus CompileNodesPass::Run(ComputeGraphPtr graph) { std::shared_ptr instance = ge::GELib::GetInstance(); if (instance == nullptr || !instance->InitFlag()) { REPORT_INNER_ERROR("E19999", "Gelib not init before, check invalid"); - GELOGE(ge::GE_CLI_GE_NOT_INITIALIZED, "Run CompileNodesPass failed."); + GELOGE(ge::GE_CLI_GE_NOT_INITIALIZED, "[Check][Param] Gelib not init before."); return ge::GE_CLI_GE_NOT_INITIALIZED; } std::unordered_map> kernel_to_compile_nodes; @@ -71,7 +71,7 @@ graphStatus CompileNodesPass::Run(ComputeGraphPtr graph) { kernel_to_compile_nodes.insert(std::make_pair(kernel_lib_name, node_vec)); } } else { - GELOGE(GRAPH_FAILED, "Get node:%s, type:%s supported kernel failed.", node->GetName().c_str(), + GELOGE(GRAPH_FAILED, "[Get][SupportedKernel] for node:%s(%s) failed.", node->GetName().c_str(), node->GetType().c_str()); return GRAPH_FAILED; } @@ -79,7 +79,7 @@ graphStatus CompileNodesPass::Run(ComputeGraphPtr graph) { // compile node follow different kernel, currently only TBE kernel auto result = CompileNodes(instance, kernel_to_compile_nodes); if (result != GRAPH_SUCCESS) { - GELOGE(result, "Compile op failed."); + GELOGE(result, "[Compile][Op] failed, ret:%u.", result); return result; } GELOGD("[CompileNodesPass]: Optimize success."); @@ -91,7 +91,7 @@ graphStatus CompileNodesPass::GetSupportedKernel(const NodePtr &node, const std: string &kernel_lib_name) { auto op_desc = node->GetOpDesc(); if (op_desc == nullptr) { - GELOGE(ge::GE_GRAPH_PARAM_NULLPTR, "Get op %s opdesc failed", node->GetName().c_str()); + GELOGE(ge::GE_GRAPH_PARAM_NULLPTR, "[Get][OpDesc] failed, op of param node is nullptr."); return ge::GE_GRAPH_PARAM_NULLPTR; } // reset op kernel lib, find supported kernel @@ -102,7 +102,7 @@ graphStatus CompileNodesPass::GetSupportedKernel(const NodePtr &node, const std: if (kernel_lib_name.empty()) { REPORT_INNER_ERROR("E19999", "kernel_lib_name in op:%s(%s) is empty, check invalid", op_desc->GetName().c_str(), op_desc->GetType().c_str()); - GELOGE(GRAPH_FAILED, "Get node:%s, type:%s kernel lib failed.", node->GetName().c_str(), + GELOGE(GRAPH_FAILED, "[Get][OpKernelLib] for node:%s(%s) failed.", node->GetName().c_str(), op_desc->GetType().c_str()); return GRAPH_FAILED; } @@ -111,7 +111,7 @@ graphStatus CompileNodesPass::GetSupportedKernel(const NodePtr &node, const std: if (kernel_info == nullptr) { REPORT_INNER_ERROR("E19999", "Find ops kernel by name:%s failed for op:%s(%s)", kernel_lib_name.c_str(), op_desc->GetName().c_str(), op_desc->GetType().c_str()); - GELOGE(ge::GE_GRAPH_PARAM_NULLPTR, "Get op %s ops kernel info store failed", node->GetName().c_str()); + GELOGE(ge::GE_GRAPH_PARAM_NULLPTR, "[Get][OpsKernelInfoStore] for op:%s failed", node->GetName().c_str()); return ge::GE_GRAPH_PARAM_NULLPTR; } @@ -144,13 +144,13 @@ graphStatus CompileNodesPass::GetSupportedKernel(const NodePtr &node, const std: REPORT_INPUT_ERROR("E13002", std::vector({"optype", "opskernel", "reason"}), std::vector({op_desc->GetType(), it.first, it.second})); GELOGE(GE_GRAPH_ASSIGN_ENGINE_FAILED, - "CheckAccuracySupport:Op type %s of ops kernel %s is unsupported, reason:%s", + "[Call][CheckAccuracySupport] for Op type %s of ops kernel %s is unsupported, reason:%s", op_desc->GetType().c_str(), it.first.c_str(), it.second.c_str()); } REPORT_INPUT_ERROR("E13003", std::vector({"opname", "optype"}), std::vector({op_desc->GetName(), op_desc->GetType()})); - GELOGE(GRAPH_FAILED, "Cannot find kernel lib support node:%s, type:%s , get kernel lib failed.", + GELOGE(GRAPH_FAILED, "[Check][Param] Cannot find kernel lib support node:%s, type:%s , get kernel lib failed.", node->GetName().c_str(), op_desc->GetType().c_str()); return GRAPH_FAILED; } @@ -173,9 +173,8 @@ graphStatus CompileNodesPass::CompileNodes(const std::shared_ptr instance for (auto &kernel_nodes : kernel_to_compile_nodes) { kernel_info = instance->OpsKernelManagerObj().GetOpsKernelInfoStore(kernel_nodes.first); if (kernel_info == nullptr) { - REPORT_INNER_ERROR("E19999", "Find ops kernel by name:%s failed", - kernel_nodes.first.c_str()); - GELOGE(ge::GE_GRAPH_PARAM_NULLPTR, "Get op %s ops kernel info store failed", kernel_nodes.first.c_str()); + REPORT_INNER_ERROR("E19999", "Find ops kernel by name:%s failed", kernel_nodes.first.c_str()); + GELOGE(ge::GE_GRAPH_PARAM_NULLPTR, "[Get][OpsKernelInfoStore] for op %s failed", kernel_nodes.first.c_str()); return ge::GE_GRAPH_PARAM_NULLPTR; } string reason; @@ -192,7 +191,7 @@ graphStatus CompileNodesPass::CompileNodes(const std::shared_ptr instance if (ret != GRAPH_SUCCESS) { REPORT_CALL_ERROR("E19999", "Call CompileOp failed, kernel_lib_name:%s, ret:%d", kernel_nodes.first.c_str(), ret); - GELOGE(ret, "Compile op failed, kernel name is %s", kernel_nodes.first.c_str()); + GELOGE(ret, "[Compile][Op] failed, kernel name is %s", kernel_nodes.first.c_str()); return GRAPH_FAILED; } } diff --git a/ge/graph/passes/cond_pass.cc b/ge/graph/passes/cond_pass.cc index db43dc21..116e4f89 100644 --- a/ge/graph/passes/cond_pass.cc +++ b/ge/graph/passes/cond_pass.cc @@ -32,7 +32,7 @@ Status CondPass::Run(NodePtr &node) { if (ret == NOT_CHANGED) { return SUCCESS; } else if (ret != SUCCESS) { - GELOGE(FAILED, "Get cond_info for node %s failed.", node->GetName().c_str()); + GELOGE(FAILED, "[Get][CondInfo] for node %s failed.", node->GetName().c_str()); return FAILED; } @@ -48,19 +48,19 @@ Status CondPass::Run(NodePtr &node) { if (cond_tensor.MutableShape().GetDim(0) == UNKNOWN_DIM_NUM) { GELOGI("Output tensor rank of Cond is unknown."); if (cond_tensor.GetDataType() == DT_STRING) { - GE_CHK_STATUS_RET(HandleStringCond(graph, peer_out_anchor, cond_in_anchor), "HandleStringCond for %s failed.", - op_desc->GetName().c_str()) + GE_CHK_STATUS_RET(HandleStringCond(graph, peer_out_anchor, cond_in_anchor), + "[Handle][StringCond] for op:%s failed.", op_desc->GetName().c_str()) } return SUCCESS; } if (!cond_tensor.GetShape().IsScalar()) { - GE_CHK_STATUS_RET(HandleNonScalarCond(graph, peer_out_anchor, cond_in_anchor), "HandleNonScalarCond for %s failed.", - op_desc->GetName().c_str()) + GE_CHK_STATUS_RET(HandleNonScalarCond(graph, peer_out_anchor, cond_in_anchor), + "[Handle][NonScalarCond] for op:%s failed.", op_desc->GetName().c_str()) } else { switch (cond_tensor.GetDataType()) { case DT_STRING: - GE_CHK_STATUS_RET(HandleStringCond(graph, peer_out_anchor, cond_in_anchor), "HandleStringCond for %s failed.", - op_desc->GetName().c_str()) + GE_CHK_STATUS_RET(HandleStringCond(graph, peer_out_anchor, cond_in_anchor), + "[Handle][StringCond] for op:%s failed.", op_desc->GetName().c_str()) break; case DT_BOOL: case DT_FLOAT: @@ -70,7 +70,7 @@ Status CondPass::Run(NodePtr &node) { case DT_INT8: case DT_INT64: GE_CHK_STATUS_RET(HandleScalarCond(graph, peer_out_anchor, cond_in_anchor, cond_tensor.GetDataType()), - "HandleScalarCond for %s failed.", op_desc->GetName().c_str()) + "[Handle][ScalarCond] for op:%s failed.", op_desc->GetName().c_str()) break; case DT_INT32: break; @@ -79,7 +79,9 @@ Status CondPass::Run(NodePtr &node) { "data_type:%d of index:%d input tensor in op:%s(%s) check invalid", cond_tensor.GetDataType(), cond_in_anchor->GetIdx(), op_desc->GetName().c_str(), op_desc->GetType().c_str()); - GELOGE(FAILED, "UpdateInputDesc for node %s failed.", op_desc->GetName().c_str()); + GELOGE(FAILED, "[Check][Param] data_type:%d of index:%d input tensor in op:%s(%s) is invalid", + cond_tensor.GetDataType(), cond_in_anchor->GetIdx(), + op_desc->GetName().c_str(), op_desc->GetType().c_str()); return FAILED; } } @@ -91,7 +93,8 @@ Status CondPass::Run(NodePtr &node) { if (op_desc->UpdateInputDesc(cond_in_anchor->GetIdx(), cond_tensor) != GRAPH_SUCCESS) { REPORT_CALL_ERROR("E19999", "Update input desc of op:%s(%s) failed, index:%d", op_desc->GetName().c_str(), op_desc->GetType().c_str(), cond_in_anchor->GetIdx()); - GELOGE(FAILED, "UpdateInputDesc for node %s failed.", op_desc->GetName().c_str()); + GELOGE(FAILED, "[Update][InputDesc] for op:%s(%s) failed, index:%d", + op_desc->GetName().c_str(), op_desc->GetType().c_str(), cond_in_anchor->GetIdx()); return FAILED; } @@ -112,12 +115,12 @@ Status CondPass::GetCondInfo(const NodePtr &node, ComputeGraphPtr &graph, OutDat std::string type = node->GetType(); if (kIfOpTypes.count(type) != 0) { if (GetCondInfoForIf(node, graph, peer_out_anchor, cond_in_anchor) != SUCCESS) { - GELOGE(FAILED, "Get cond_info for if node failed."); + GELOGE(FAILED, "[Get][CondInfo] for if node:%s failed.", node->GetName().c_str()); return FAILED; } } else if (kWhileOpTypes.count(type) != 0) { if (GetCondInfoForWhile(node, graph, peer_out_anchor, cond_in_anchor) != SUCCESS) { - GELOGE(FAILED, "Get cond_info for while node failed."); + GELOGE(FAILED, "[Get][CondInfo] for while node:%s failed.", node->GetName().c_str()); return FAILED; } } else { @@ -167,7 +170,8 @@ Status CondPass::GetCondInfoForWhile(const NodePtr &node, ComputeGraphPtr &graph REPORT_INNER_ERROR("E19999", "subgraph name:%s not exist in SubgraphNameIndexes map of op:%s(%s), " "check invalid", ATTR_NAME_WHILE_COND.c_str(), op_desc->GetName().c_str(), op_desc->GetType().c_str()); - GELOGE(FAILED, "Get cond_graph index failed, while_node:%s.", node->GetName().c_str()); + GELOGE(FAILED, "subgraph name:%s not exist in SubgraphNameIndexes map of op:%s(%s)", ATTR_NAME_WHILE_COND.c_str(), + op_desc->GetName().c_str(), op_desc->GetType().c_str()); return FAILED; } std::string cond_graph_instance_name = op_desc->GetSubgraphInstanceName(iter->second); @@ -181,7 +185,7 @@ Status CondPass::GetCondInfoForWhile(const NodePtr &node, ComputeGraphPtr &graph if (output_num != 1) { REPORT_INNER_ERROR("E19999", "Input data anchor num:%u of op:%s(%s) not equal to 1, check invalid", output_num, op_desc->GetName().c_str(), op_desc->GetType().c_str()); - GELOGE(FAILED, "output size of cond_graph is invalid, expect 1 but %u exactly, while_node:%s.", + GELOGE(FAILED, "[Check][Param] output size of cond_graph is invalid, expect 1 but %u exactly, while_node:%s.", output_num, node->GetName().c_str()); return FAILED; } @@ -239,7 +243,7 @@ Status CondPass::HandleScalarCond(const ComputeGraphPtr &graph, const OutDataAnc std::string cast_name = cond_in_anchor->GetOwnerNode()->GetName() + "_Cast"; NodePtr cast_node = AddCastNode(graph, cast_name, tensor, src_type, DT_INT32); if (cast_node == nullptr) { - GELOGE(FAILED, "Add Cast node failed, name:%s.", cast_name.c_str()); + GELOGE(FAILED, "[Add][CastNode] failed, name:%s.", cast_name.c_str()); return FAILED; } @@ -250,7 +254,7 @@ Status CondPass::HandleScalarCond(const ComputeGraphPtr &graph, const OutDataAnc peer_out_anchor->GetOwnerNode()->GetType().c_str(), cond_in_anchor->GetOwnerNode()->GetName().c_str(), cond_in_anchor->GetOwnerNode()->GetType().c_str()); - GELOGE(FAILED, "Insert Cast node %s between %s->%s failed.", + GELOGE(FAILED, "[Insert][CastNode] %s between %s->%s failed.", cast_node->GetName().c_str(), peer_out_anchor->GetOwnerNode()->GetName().c_str(), cond_in_anchor->GetOwnerNode()->GetName().c_str()); return FAILED; @@ -287,14 +291,16 @@ Status CondPass::InsertNode(const ComputeGraphPtr &graph, const OutDataAnchorPtr if (op_desc == nullptr) { REPORT_CALL_ERROR("E19999", "Create op_desc:%s(%s) failed", (in_data_anchor->GetOwnerNode()->GetName() + "_" + type).c_str(), type.c_str()); - GELOGE(FAILED, "Create op_desc failed."); + GELOGE(FAILED, "[Create][OpDesc] %s(%s) failed.", + (in_data_anchor->GetOwnerNode()->GetName() + "_" + type).c_str(), type.c_str()); return FAILED; } NodePtr new_node = graph->AddNode(op_desc); if (new_node == nullptr) { REPORT_CALL_ERROR("E19999", "Add node:%s(%s) to graph:%s failed", op_desc->GetName().c_str(), op_desc->GetType().c_str(), graph->GetName().c_str()); - GELOGE(FAILED, "Create %s node failed.", type.c_str()); + GELOGE(FAILED, "[Add][Node] %s(%s) to graph:%s failed", + op_desc->GetName().c_str(), op_desc->GetType().c_str(), graph->GetName().c_str()); return FAILED; } AddRePassNode(new_node); @@ -306,9 +312,10 @@ Status CondPass::InsertNode(const ComputeGraphPtr &graph, const OutDataAnchorPtr peer_out_anchor->GetOwnerNode()->GetType().c_str(), in_data_anchor->GetOwnerNode()->GetName().c_str(), in_data_anchor->GetOwnerNode()->GetType().c_str()); - GELOGE(FAILED, "Insert %s node %s between %s->%s failed.", type.c_str(), - new_node->GetName().c_str(), peer_out_anchor->GetOwnerNode()->GetName().c_str(), - in_data_anchor->GetOwnerNode()->GetName().c_str()); + GELOGE(FAILED, "[Insert][Node] %s(%s) between %s(%s)->%s(%s) failed", + new_node->GetName().c_str(), new_node->GetType().c_str(), + peer_out_anchor->GetOwnerNode()->GetName().c_str(), peer_out_anchor->GetOwnerNode()->GetType().c_str(), + in_data_anchor->GetOwnerNode()->GetName().c_str(), in_data_anchor->GetOwnerNode()->GetType().c_str()); return FAILED; } @@ -337,20 +344,22 @@ NodePtr CondPass::AddCastNode(const ComputeGraphPtr &graph, const std::string &n OpDescBuilder op_desc_builder(name, CAST); OpDescPtr cast_desc = op_desc_builder.AddInput("x", in_tensor).AddOutput("y", out_tensor).Build(); if (cast_desc == nullptr) { - REPORT_CALL_ERROR("E19999", "Create op_desc:%s(%s) failed", - name.c_str(), CAST); - GELOGE(FAILED, "Create cast op_desc failed, name: %s.", name.c_str()); + REPORT_CALL_ERROR("E19999", "Create op_desc:%s(%s) failed", name.c_str(), CAST); + GELOGE(FAILED, "[Create][OpDesc] failed, name:%s(%s).", name.c_str(), CAST); return nullptr; } if (!(AttrUtils::SetInt(cast_desc, CAST_ATTR_SRCT, src) && AttrUtils::SetInt(cast_desc, CAST_ATTR_DSTT, dst) && AttrUtils::SetInt(cast_desc, CAST_ATTR_DST_TYPE, dst) && AttrUtils::SetBool(cast_desc, CAST_ATTR_TRUNCATE, false))) { - REPORT_CALL_ERROR("E19999", "Set Attr:%s,%s,%s,%s to node:%s(%s) not all success", + REPORT_CALL_ERROR("E19999", "Set Attr:%s, %s, %s, %s to node:%s(%s) not all success", CAST_ATTR_SRCT.c_str(), CAST_ATTR_DSTT.c_str(), CAST_ATTR_DST_TYPE.c_str(), CAST_ATTR_TRUNCATE.c_str(), cast_desc->GetName().c_str(), cast_desc->GetType().c_str()); - GELOGE(FAILED, "Set CAST_ATTR failed, node: %s.", name.c_str()); + GELOGE(FAILED, "[Set][Attr] %s, %s, %s, %s to node:%s(%s) not all success", + CAST_ATTR_SRCT.c_str(), CAST_ATTR_DSTT.c_str(), + CAST_ATTR_DST_TYPE.c_str(), CAST_ATTR_TRUNCATE.c_str(), + cast_desc->GetName().c_str(), cast_desc->GetType().c_str()); return nullptr; } @@ -358,7 +367,8 @@ NodePtr CondPass::AddCastNode(const ComputeGraphPtr &graph, const std::string &n if (cast_node == nullptr) { REPORT_CALL_ERROR("E19999", "Add node:%s(%s) to graph:%s failed", cast_desc->GetName().c_str(), cast_desc->GetType().c_str(), graph->GetName().c_str()); - GELOGE(FAILED, "Add cast node failed, name: %s.", name.c_str()); + GELOGE(FAILED, "[Add][Node] %s(%s) to graph:%s failed", + cast_desc->GetName().c_str(), cast_desc->GetType().c_str(), graph->GetName().c_str()); return nullptr; } AddRePassNode(cast_node); diff --git a/ge/graph/passes/cond_remove_pass.cc b/ge/graph/passes/cond_remove_pass.cc index 74568c2f..478858a9 100644 --- a/ge/graph/passes/cond_remove_pass.cc +++ b/ge/graph/passes/cond_remove_pass.cc @@ -41,7 +41,7 @@ Status CondRemovePass::Run(NodePtr &node) { if (ret == NOT_CHANGED) { return SUCCESS; } else if (ret != SUCCESS) { - GELOGE(FAILED, "Get cond_info for node %s failed.", node->GetName().c_str()); + GELOGE(FAILED, "[Get][CondInfo] for node %s failed.", node->GetName().c_str()); return FAILED; } int32_t cond_index = 0; @@ -90,7 +90,7 @@ Status CondRemovePass::RemoveDeadCondLink(const int32_t index, const NodePtr &no peerout_anchor->GetOwnerNode()->GetType().c_str(), peerout_anchor->GetIdx(), in_anchor->GetOwnerNode()->GetName().c_str(), in_anchor->GetOwnerNode()->GetType().c_str(), in_anchor->GetIdx()); - GELOGE(FAILED, "Remove edge from node %s index %d to node %s index %d.", + GELOGE(FAILED, "[Remove][Edge] from node %s index %d to node %s index %d.", peerout_anchor->GetOwnerNode()->GetName().c_str(), peerout_anchor->GetIdx(), in_anchor->GetOwnerNode()->GetName().c_str(), in_anchor->GetIdx()); return FAILED; @@ -105,7 +105,7 @@ Status CondRemovePass::GetCaseChosenBranch(const NodePtr &node, const uint32_t c if (subgraph_names_size == 0) { REPORT_INNER_ERROR("E19999", "subgraph size of op:%s(%s) is 0, check invavlid", node->GetName().c_str(), node->GetType().c_str()); - GELOGE(FAILED, "Node %s has none subgraph.", node->GetName().c_str()); + GELOGE(FAILED, "[Check][Param] Node %s has none subgraph.", node->GetName().c_str()); return ge::FAILED; } // If cond index is over the maimum subgraph number, choose the last subgraph @@ -116,7 +116,7 @@ Status CondRemovePass::GetCaseChosenBranch(const NodePtr &node, const uint32_t c if (chosen_branch_name.empty()) { REPORT_INNER_ERROR("E19999", "Get subgraph name from op:%s(%s) by index:%u failed", node->GetName().c_str(), node->GetType().c_str(), cond_index_new); - GELOGE(FAILED, "Node %s has no subgraph, index is %u.", node->GetName().c_str(), cond_index_new); + GELOGE(FAILED, "[Get][SubGraph] Node %s has no subgraph, index is %u.", node->GetName().c_str(), cond_index_new); return ge::FAILED; } auto chosen_graph = GraphUtils::FindRootGraph(node->GetOwnerComputeGraph())->GetSubgraph(chosen_branch_name); @@ -132,7 +132,7 @@ Status CondRemovePass::GetIfChosenBranch(const NodePtr &node, const uint32_t con if (subgraph_names_size == 0) { REPORT_INNER_ERROR("E19999", "subgraph size of op:%s(%s) is 0, check invavlid", node->GetName().c_str(), node->GetType().c_str()); - GELOGE(FAILED, "Node %s has none subgraph.", node->GetName().c_str()); + GELOGE(FAILED, "[Check][Param] Node %s has none subgraph.", node->GetName().c_str()); return ge::FAILED; } // If cond is false, else branch @@ -143,7 +143,7 @@ Status CondRemovePass::GetIfChosenBranch(const NodePtr &node, const uint32_t con if (chosen_branch_name.empty()) { REPORT_INNER_ERROR("E19999", "Get subgraph name from op:%s(%s) by index:%u failed", node->GetName().c_str(), node->GetType().c_str(), cond_index_new); - GELOGE(FAILED, "Node %s has no subgraph, index is %u.", node->GetName().c_str(), cond_index_new); + GELOGE(FAILED, "[Get][SubGraph] Node %s has no subgraph, index is %u.", node->GetName().c_str(), cond_index_new); return ge::FAILED; } auto chosen_graph = GraphUtils::FindRootGraph(node->GetOwnerComputeGraph())->GetSubgraph(chosen_branch_name); @@ -151,7 +151,7 @@ Status CondRemovePass::GetIfChosenBranch(const NodePtr &node, const uint32_t con REPORT_INNER_ERROR("E19999", "Find subgraph by name:%s from node:%s(%s)'s root_graph failed", chosen_branch_name.c_str(), node->GetName().c_str(), node->GetType().c_str()); - GELOGE(FAILED, "Can not find branch %s in node %s's parent graph %s.", chosen_branch_name.c_str(), + GELOGE(FAILED, "[Check][Param] Can not find branch %s in node %s's parent graph %s.", chosen_branch_name.c_str(), node->GetName().c_str(), node->GetOwnerComputeGraph()->GetName().c_str()); return ge::FAILED; } @@ -263,7 +263,7 @@ Status CondRemovePass::ReplaceIfCaseNodeWithPartitioncall(const NodePtr &node, c peerout_anchor->GetOwnerNode()->GetType().c_str(), peerout_anchor->GetIdx(), partitioncall_node->GetName().c_str(), partitioncall_node->GetType().c_str(), input_anchor->GetIdx()); - GELOGE(FAILED, "Add edge failed, from node:%s idx:%d to node:%s idx:%d, input num:%zu, output num:%zu", + GELOGE(FAILED, "[Add][Edge] failed, from node:%s idx:%d to node:%s idx:%d, input num:%zu, output num:%zu", peerout_anchor->GetOwnerNode()->GetName().c_str(), peerout_anchor->GetIdx(), partitioncall_node->GetName().c_str(), input_anchor->GetIdx(), input_desc_size, output_desc_size); @@ -280,7 +280,7 @@ Status CondRemovePass::ReplaceIfCaseNodeWithPartitioncall(const NodePtr &node, c node->GetName().c_str(), node->GetType().c_str(), output_anchor->GetIdx(), peerin_anchor->GetOwnerNode()->GetName().c_str(), peerin_anchor->GetOwnerNode()->GetType().c_str(), peerin_anchor->GetIdx()); - GELOGE(FAILED, "Remove edge failed, from node:%s idx:%d to node:%s idx:%d, input num:%zu, output num:%zu", + GELOGE(FAILED, "[Remove][Edge] failed, from node:%s idx:%d to node:%s idx:%d, input num:%zu, output num:%zu", node->GetName().c_str(), output_anchor->GetIdx(), peerin_anchor->GetOwnerNode()->GetName().c_str(), peerin_anchor->GetIdx(), input_desc_size, output_desc_size); return FAILED; @@ -292,7 +292,7 @@ Status CondRemovePass::ReplaceIfCaseNodeWithPartitioncall(const NodePtr &node, c partitioncall_node->GetType().c_str(), output_anchor->GetIdx(), peerin_anchor->GetOwnerNode()->GetName().c_str(), peerin_anchor->GetOwnerNode()->GetType().c_str(), peerin_anchor->GetIdx()); - GELOGE(FAILED, "Add edge failed, from node:%s idx:%d to node:%s idx:%d, input num:%zu, output num:%zu", + GELOGE(FAILED, "[Add][Edge] failed, from node:%s idx:%d to node:%s idx:%d, input num:%zu, output num:%zu", partitioncall_node->GetName().c_str(), output_anchor->GetIdx(), peerin_anchor->GetOwnerNode()->GetName().c_str(), peerin_anchor->GetIdx(), input_desc_size, output_desc_size); @@ -370,7 +370,7 @@ Status CondRemovePass::GetCondInfo(const NodePtr &node, ComputeGraphPtr &graph, std::string type = node->GetType(); if ((kIfOpTypes.count(type) != 0) || (kCaseOpTypes.count(type) != 0)) { if (GetCondInfoForIfCase(node, graph, cond_out_anchor, cond_in_anchor) != SUCCESS) { - GELOGE(FAILED, "Get cond_info for if/case node failed."); + GELOGE(FAILED, "[Get][CondInfo] for if/case node:%s failed.", node->GetName().c_str()); return FAILED; } } else { diff --git a/ge/graph/passes/constant_folding_pass.cc b/ge/graph/passes/constant_folding_pass.cc index db2ef494..25fe26da 100644 --- a/ge/graph/passes/constant_folding_pass.cc +++ b/ge/graph/passes/constant_folding_pass.cc @@ -33,12 +33,12 @@ Status RunOpKernelWithCheck(NodePtr &node, std::vector &outputs) { std::shared_ptr instance_ptr = ge::GELib::GetInstance(); if ((instance_ptr == nullptr) || (!instance_ptr->InitFlag())) { - GELOGE(GE_CLI_GE_NOT_INITIALIZED, "GE is not initialized or is finalized."); + GELOGE(GE_CLI_GE_NOT_INITIALIZED, "[Check][Param] GE is not initialized or is finalized."); return UNSUPPORTED; } OpsKernelInfoStorePtr kernel_info = instance_ptr->OpsKernelManagerObj().GetOpsKernelInfoStore(kKernelLibName); if (kernel_info == nullptr) { - GELOGE(FAILED, "Get op kernel info store %s failed", kKernelLibName.c_str()); + GELOGE(FAILED, "[Get][OpsKernelInfoStore] %s failed", kKernelLibName.c_str()); return UNSUPPORTED; } @@ -110,7 +110,7 @@ Status ConstantFoldingPass::Run(ge::NodePtr &node) { } REPORT_CALL_ERROR("E19999", "Calculate for node %s(%s) failed", node->GetName().c_str(), node->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "Calculate for node %s failed in constant folding", node->GetName().c_str()); + GELOGE(INTERNAL_ERROR, "[Call][Calculate] for node %s failed in constant folding", node->GetName().c_str()); return ret; } GELOGI("Node %s type %s, constant folding compute success.", node->GetName().c_str(), node->GetType().c_str()); @@ -129,10 +129,8 @@ Status ConstantFoldingPass::Run(ge::NodePtr &node) { if (outputs.empty()) { REPORT_INNER_ERROR("E19999", "After calculate for node %s(%s), output weight is empty, check invalid", node->GetName().c_str(), node->GetType().c_str()); - GELOGE(INTERNAL_ERROR, - "Failed to constant folding on node %s," - " no output weight", - node->GetName().c_str()); + GELOGE(INTERNAL_ERROR, "[Check][Param] After calculate for node %s(%s), output weight is empty", + node->GetName().c_str(), node->GetType().c_str()); return INTERNAL_ERROR; } diff --git a/ge/graph/passes/constant_fuse_same_pass.cc b/ge/graph/passes/constant_fuse_same_pass.cc index 8cb8c091..08f5ac4a 100644 --- a/ge/graph/passes/constant_fuse_same_pass.cc +++ b/ge/graph/passes/constant_fuse_same_pass.cc @@ -58,7 +58,7 @@ void GetOutDataNodeToIndexMap(NodePtr &node, std::map & Status ConstantFuseSamePass::Run(ge::ComputeGraphPtr graph) { if (graph == nullptr) { REPORT_INNER_ERROR("E19999", "Param graph is nullptr, check invalid"); - GELOGE(GE_GRAPH_PARAM_NULLPTR, "Compute graph is null."); + GELOGE(GE_GRAPH_PARAM_NULLPTR, "[Check][Param] Compute graph is nullptr."); return GE_GRAPH_PARAM_NULLPTR; } GELOGI("ConstantFuseSamePass in."); @@ -160,13 +160,14 @@ Status ConstantFuseSamePass::MoveOutDataEdges(NodePtr &src_node, NodePtr &dst_no } auto ret = dst_out_data_anchor->LinkTo(it->second); if (ret != SUCCESS) { - REPORT_CALL_ERROR("E19999", - "Op:%s(%s) out index:0 link to op:%s(%s) in index:%d failed", + REPORT_CALL_ERROR("E19999", "Op:%s(%s) out index:0 link to op:%s(%s) in index:%d failed", dst_node->GetName().c_str(), dst_node->GetType().c_str(), it->second->GetOwnerNode()->GetName().c_str(), it->second->GetOwnerNode()->GetType().c_str(), it->second->GetIdx()); - GELOGE(FAILED, "Failed to move out data edge from %s to %s", src_node->GetName().c_str(), - dst_node->GetName().c_str()); + GELOGE(FAILED, "[Add][Edge] Op:%s(%s) out index:0 link to op:%s(%s) in index:%d failed", + dst_node->GetName().c_str(), dst_node->GetType().c_str(), + it->second->GetOwnerNode()->GetName().c_str(), it->second->GetOwnerNode()->GetType().c_str(), + it->second->GetIdx()); return FAILED; } } @@ -193,7 +194,8 @@ Status ConstantFuseSamePass::FuseConstNodes(ComputeGraphPtr &graph, if (GraphUtils::RemoveNodeWithoutRelink(graph, node) != SUCCESS) { REPORT_CALL_ERROR("E19999", "Remove node:%s(%s) without relink in graph:%s failed", node->GetName().c_str(), node->GetType().c_str(), graph->GetName().c_str()); - GELOGE(FAILED, "[%s] RemoveNodeWithoutRelink failed.", node->GetName().c_str()); + GELOGE(FAILED, "[Remove][Node] %s(%s) Without Relink in graph:%s failed.", + node->GetName().c_str(), node->GetType().c_str(), graph->GetName().c_str()); return FAILED; } } diff --git a/ge/graph/passes/control_trigger_pass.cc b/ge/graph/passes/control_trigger_pass.cc index 9125a48f..85505dc5 100644 --- a/ge/graph/passes/control_trigger_pass.cc +++ b/ge/graph/passes/control_trigger_pass.cc @@ -30,7 +30,7 @@ Status ControlTriggerPass::Run(ComputeGraphPtr graph) { auto in_ctrl_nodes = node->GetInControlNodes(); for (NodePtr &in_ctrl_node : in_ctrl_nodes) { if (HandleDynamicCtrlEdges(graph, node, in_ctrl_node) != SUCCESS) { - GELOGE(FAILED, "HandleDynamicCtrlEdges for %s->%s fail.", in_ctrl_node->GetName().c_str(), + GELOGE(FAILED, "[Handle][DynamicCtrlEdges] for node:%s->node:%s failed.", in_ctrl_node->GetName().c_str(), node->GetName().c_str()); return FAILED; } @@ -55,7 +55,7 @@ Status ControlTriggerPass::HandleDynamicCtrlEdges(ComputeGraphPtr &graph, NodePt NodePtr switch_node = nullptr; bool branch_flag = false; if (FindSwitchNode(in_ctrl_node, switch_node, branch_flag) != SUCCESS) { - GELOGE(FAILED, "FindSwitchNode fail."); + GELOGE(FAILED, "[Find][SwitchNode] failed, in_ctrl_node:%s.", in_ctrl_node->GetName().c_str()); return FAILED; } @@ -76,8 +76,9 @@ Status ControlTriggerPass::HandleDynamicCtrlEdges(ComputeGraphPtr &graph, NodePt node->GetName().c_str(), node->GetType().c_str(), in_ctrl_node->GetName().c_str(), in_ctrl_node->GetType().c_str(), constant->GetName().c_str(), constant->GetType().c_str()); - GELOGE(FAILED, "Replace ctrl edge fail, %s->%s, %s->%s.", in_ctrl_node->GetName().c_str(), - node->GetName().c_str(), in_ctrl_node->GetName().c_str(), constant->GetName().c_str()); + GELOGE(FAILED, "[Replace][CtrlEdge] failed, remove edge:%s->%s, add edge:%s->%s.", + in_ctrl_node->GetName().c_str(), node->GetName().c_str(), + in_ctrl_node->GetName().c_str(), constant->GetName().c_str()); return FAILED; } @@ -87,7 +88,8 @@ Status ControlTriggerPass::HandleDynamicCtrlEdges(ComputeGraphPtr &graph, NodePt } if (InsertOppositeBranch(graph, node, in_ctrl_node, switch_node, branch_flag) != SUCCESS) { - GELOGE(FAILED, "InsertOppositeBranch fail."); + GELOGE(FAILED, "[Insert][OppositeBranch] failed, node:%s, in_ctrl_node:%s.", + node->GetName().c_str(), in_ctrl_node->GetName().c_str()); return FAILED; } @@ -145,7 +147,7 @@ Status ControlTriggerPass::FindSwitchNode(const NodePtr &node, NodePtr &switch_n case kNotControlOp: break; default: - GELOGE(FAILED, "invalid type"); + GELOGE(FAILED, "[Check][Param] invalid node type"); return FAILED; } @@ -167,6 +169,12 @@ Status ControlTriggerPass::FindSwitchNode(const NodePtr &node, NodePtr &switch_n /// @return ControlNodeType /// ControlNodeType ControlTriggerPass::TransferNodeType(const NodePtr &node, uint32_t index) { + OpDescPtr merge_desc = node->GetOpDesc(); + if (merge_desc == nullptr) { + REPORT_INNER_ERROR("E19999", "op_desc in merge node is nullptr, check invalid"); + GELOGE(INTERNAL_ERROR, "[Get][OpDesc] failed, merge_desc is nullptr."); + return kInvalidType; + } const std::string type = node->GetType(); if ((type == SWITCH) || (type == REFSWITCH)) { if ((index != SWITCH_TRUE_OUTPUT) && (index != SWITCH_FALSE_OUTPUT)) { @@ -175,7 +183,7 @@ ControlNodeType ControlTriggerPass::TransferNodeType(const NodePtr &node, uint32 } if (FindPredInput(node) != SUCCESS) { - GELOGE(INTERNAL_ERROR, "FindPredInput fail, switch_node: %s.", node->GetName().c_str()); + GELOGE(INTERNAL_ERROR, "[Find][PredInput] failed, switch_node:%s.", node->GetName().c_str()); return kInvalidType; } @@ -189,12 +197,6 @@ ControlNodeType ControlTriggerPass::TransferNodeType(const NodePtr &node, uint32 return branch_flag ? kLoopSwitchT : kLoopSwitchF; } } else if ((type == MERGE) || (type == REFMERGE)) { - OpDescPtr merge_desc = node->GetOpDesc(); - if (merge_desc == nullptr) { - REPORT_INNER_ERROR("E19999", "op_desc in merge node is nullptr, check invalid"); - GELOGE(INTERNAL_ERROR, "FindPredInput fail, merge_desc is null, merge_node: %s.", node->GetName().c_str()); - return kInvalidType; - } if (!merge_desc->HasAttr(ATTR_NAME_NEXT_ITERATION)) { return kCondMerge; } @@ -248,14 +250,16 @@ Status ControlTriggerPass::InsertOppositeBranch(ComputeGraphPtr &graph, NodePtr NodePtr merge_node = InsertMergeNode(graph, node, in_ctrl_node, data_desc); if (merge_node == nullptr) { - GELOGE(FAILED, "InsertMergeNode fail."); + GELOGE(FAILED, "[Insert][MergeNode] failed, node:%s, in_ctrl_node:%s.", + node->GetName().c_str(), in_ctrl_node->GetName().c_str()); return FAILED; } NodePtr const_f = InsertConstNode(graph, merge_node, data_desc, false); NodePtr const_t = InsertConstNode(graph, merge_node, data_desc, true); if ((const_f == nullptr) || (const_t == nullptr)) { - GELOGE(FAILED, "InsertConstNode fail."); + GELOGE(FAILED, "[Insert][ConstNode] failed, graph:%s, merge_node:%s.", + graph->GetName().c_str(), merge_node->GetName().c_str()); return FAILED; } @@ -266,7 +270,8 @@ Status ControlTriggerPass::InsertOppositeBranch(ComputeGraphPtr &graph, NodePtr const std::string identity_name = switch_desc->GetName() + "_" + IDENTITY; NodePtr identity_node = InsertIdentityNode(graph, identity_name, switch_desc->GetOutputDesc(new_idx)); if (identity_node == nullptr) { - GELOGE(FAILED, "InsertIdentityNode fail."); + GELOGE(FAILED, "[Insert][IdentityNode] name:%s failed, graph:%s.", + identity_name.c_str(), graph->GetName().c_str()); return FAILED; } @@ -274,21 +279,25 @@ Status ControlTriggerPass::InsertOppositeBranch(ComputeGraphPtr &graph, NodePtr REPORT_CALL_ERROR("E19999", "Add control edge between op:%s(%s) and op:%s(%s) failed", in_ctrl_node->GetName().c_str(), in_ctrl_node->GetType().c_str(), orig_const->GetName().c_str(), orig_const->GetType().c_str()); - GELOGE(FAILED, "Add in ctrl edge fail, %s->%s.", in_ctrl_node->GetName().c_str(), orig_const->GetName().c_str()); + GELOGE(FAILED, "[Add][CtrlEdge] failed, %s->%s.", in_ctrl_node->GetName().c_str(), orig_const->GetName().c_str()); return FAILED; } if (GraphUtils::AddEdge(switch_node->GetOutDataAnchor(new_idx), identity_node->GetInDataAnchor(0)) != GRAPH_SUCCESS) { REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(index:%u) and op:%s(%s)(index:0) failed", switch_node->GetName().c_str(), switch_node->GetType().c_str(), new_idx, identity_node->GetName().c_str(), identity_node->GetType().c_str()); - GELOGE(FAILED, "Add in data edge fail, %s->%s.", switch_desc->GetName().c_str(), identity_node->GetName().c_str()); + GELOGE(FAILED, "[Add][Edge] between op:%s(%s)(index:%u) and op:%s(%s)(index:0) failed", + switch_node->GetName().c_str(), switch_node->GetType().c_str(), new_idx, + identity_node->GetName().c_str(), identity_node->GetType().c_str()); return FAILED; } if (GraphUtils::AddEdge(identity_node->GetOutControlAnchor(), new_const->GetInControlAnchor()) != GRAPH_SUCCESS) { REPORT_CALL_ERROR("E19999", "Add control edge between op:%s(%s) and op:%s(%s) failed", identity_node->GetName().c_str(), identity_node->GetType().c_str(), new_const->GetName().c_str(), new_const->GetType().c_str()); - GELOGE(FAILED, "Add in ctrl edge fail, %s->%s.", identity_node->GetName().c_str(), new_const->GetName().c_str()); + GELOGE(FAILED, "[Add][ControlEdge] between op:%s(%s) and op:%s(%s) failed", + identity_node->GetName().c_str(), identity_node->GetType().c_str(), + new_const->GetName().c_str(), new_const->GetType().c_str()); return FAILED; } @@ -299,7 +308,7 @@ Status ControlTriggerPass::InsertOppositeBranch(ComputeGraphPtr &graph, NodePtr } else { if (!iter->second.insert(pred_const).second) { REPORT_INNER_ERROR("E19999", "Insert to control_trigger_map_ failed"); - GELOGE(FAILED, "control_trigger_map_ insert failed."); + GELOGE(FAILED, "[Check][Param] control_trigger_map_ insert failed."); return FAILED; } } @@ -321,7 +330,7 @@ NodePtr ControlTriggerPass::InsertMergeNode(ComputeGraphPtr &graph, NodePtr &nod OpDescPtr op_desc = MakeShared(name, MERGE); if (op_desc == nullptr) { REPORT_CALL_ERROR("E19999", "New OpDesc failed"); - GELOGE(FAILED, "Create Merge op %s: create op_desc fail.", name.c_str()); + GELOGE(FAILED, "[New][OpDesc] failed"); return nullptr; } @@ -329,7 +338,8 @@ NodePtr ControlTriggerPass::InsertMergeNode(ComputeGraphPtr &graph, NodePtr &nod (op_desc->AddOutputDesc(data_desc) != GRAPH_SUCCESS) || (op_desc->AddOutputDesc(data_desc) != GRAPH_SUCCESS)) { REPORT_CALL_ERROR("E19999", "Add input or ouput desc to op:%s(%s) failed", op_desc->GetName().c_str(), op_desc->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "Create Merge op %s: add input/output desc fail.", name.c_str()); + GELOGE(INTERNAL_ERROR, "[Add][GeTensorDesc] to op:%s(%s) failed", + op_desc->GetName().c_str(), op_desc->GetType().c_str()); return nullptr; } @@ -338,7 +348,8 @@ NodePtr ControlTriggerPass::InsertMergeNode(ComputeGraphPtr &graph, NodePtr &nod if (merge_node == nullptr) { REPORT_CALL_ERROR("E19999", "Add node:%s(%s) to graph:%s failed", op_desc->GetName().c_str(), op_desc->GetType().c_str(), graph->GetName().c_str()); - GELOGE(INTERNAL_ERROR, "Create Merge op %s fail.", name.c_str()); + GELOGE(INTERNAL_ERROR, "[Add][Node] %s(%s) to graph:%s failed", + op_desc->GetName().c_str(), op_desc->GetType().c_str(), graph->GetName().c_str()); return nullptr; } @@ -350,7 +361,8 @@ NodePtr ControlTriggerPass::InsertMergeNode(ComputeGraphPtr &graph, NodePtr &nod node->GetName().c_str(), node->GetType().c_str(), merge_node->GetName().c_str(), merge_node->GetType().c_str(), node->GetName().c_str(), node->GetType().c_str()); - GELOGE(FAILED, "Replace ctrl edge fail, %s->%s, %s->%s", in_ctrl_node->GetName().c_str(), node->GetName().c_str(), + GELOGE(FAILED, "[Replace][CtrlEdge] failed, remove edge:%s->%s, add edge:%s->%s", + in_ctrl_node->GetName().c_str(), node->GetName().c_str(), merge_node->GetName().c_str(), node->GetName().c_str()); return nullptr; } @@ -372,7 +384,7 @@ NodePtr ControlTriggerPass::InsertConstNode(ComputeGraphPtr &graph, NodePtr &mer OpDescPtr op_desc = MakeShared(name, CONSTANT); if (op_desc == nullptr) { REPORT_CALL_ERROR("E19999", "New OpDesc failed"); - GELOGE(FAILED, "Create Const op %s: create op_desc fail.", name.c_str()); + GELOGE(FAILED, "[New][OpDesc] failed."); return nullptr; } @@ -380,20 +392,22 @@ NodePtr ControlTriggerPass::InsertConstNode(ComputeGraphPtr &graph, NodePtr &mer GeTensorPtr const_value = MakeShared(data_desc, reinterpret_cast(&value), sizeof(int32_t)); if (const_value == nullptr) { REPORT_CALL_ERROR("E19999", "New GeTensor failed"); - GELOGE(FAILED, "Create tensor fail."); + GELOGE(FAILED, "[New][GeTensor] failed."); return nullptr; } if (!AttrUtils::SetTensor(op_desc, ATTR_NAME_WEIGHTS, const_value)) { REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed", ATTR_NAME_WEIGHTS.c_str(), op_desc->GetName().c_str(), op_desc->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "Create Const op %s: set attr ATTR_NAME_WEIGHTS fail.", name.c_str()); + GELOGE(INTERNAL_ERROR, "[Set][Attr] %s to op:%s(%s) failed", ATTR_NAME_WEIGHTS.c_str(), + op_desc->GetName().c_str(), op_desc->GetType().c_str()); return nullptr; } if (op_desc->AddOutputDesc(data_desc) != GRAPH_SUCCESS) { REPORT_CALL_ERROR("E19999", "Add ouput desc to op:%s(%s) failed", op_desc->GetName().c_str(), op_desc->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "Create Const op %s: add output desc fail.", name.c_str()); + GELOGE(INTERNAL_ERROR, "[Add][OutputDesc] to op:%s(%s) failed", + op_desc->GetName().c_str(), op_desc->GetType().c_str()); return nullptr; } @@ -402,7 +416,8 @@ NodePtr ControlTriggerPass::InsertConstNode(ComputeGraphPtr &graph, NodePtr &mer if (const_node == nullptr) { REPORT_CALL_ERROR("E19999", "Add node:%s(%s) to graph:%s failed", op_desc->GetName().c_str(), op_desc->GetType().c_str(), graph->GetName().c_str()); - GELOGE(INTERNAL_ERROR, "Create Const op %s fail.", name.c_str()); + GELOGE(INTERNAL_ERROR, "[Add][Node] %s(%s) to graph:%s failed", + op_desc->GetName().c_str(), op_desc->GetType().c_str(), graph->GetName().c_str()); return nullptr; } @@ -411,7 +426,9 @@ NodePtr ControlTriggerPass::InsertConstNode(ComputeGraphPtr &graph, NodePtr &mer REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(index:0) and op:%s(%s)(index:%u) failed", const_node->GetName().c_str(), const_node->GetType().c_str(), merge_node->GetName().c_str(), merge_node->GetType().c_str(), out_idx); - GELOGE(FAILED, "Add in data edge fail, %s->%s", const_node->GetName().c_str(), merge_node->GetName().c_str()); + GELOGE(FAILED, "[Add][Edge] between op:%s(%s)(index:0) and op:%s(%s)(index:%u) failed", + const_node->GetName().c_str(), const_node->GetType().c_str(), + merge_node->GetName().c_str(), merge_node->GetType().c_str(), out_idx); return nullptr; } @@ -430,14 +447,15 @@ NodePtr ControlTriggerPass::InsertIdentityNode(ComputeGraphPtr &graph, const std OpDescPtr op_desc = MakeShared(name, IDENTITY); if (op_desc == nullptr) { REPORT_CALL_ERROR("E19999", "New OpDesc failed"); - GELOGE(FAILED, "Create Identity op %s: create op_desc fail.", name.c_str()); + GELOGE(FAILED, "[New][OpDesc] failed"); return nullptr; } if ((op_desc->AddInputDesc(data_desc) != GRAPH_SUCCESS) || (op_desc->AddOutputDesc(data_desc) != GRAPH_SUCCESS)) { REPORT_CALL_ERROR("E19999", "Add input or output desc to op:%s(%s) failed", op_desc->GetName().c_str(), op_desc->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "Create Identity op %s: add input/output desc fail.", name.c_str()); + GELOGE(INTERNAL_ERROR, "[Add][GeTensorDesc] to op:%s(%s) failed", + op_desc->GetName().c_str(), op_desc->GetType().c_str()); return nullptr; } @@ -446,7 +464,8 @@ NodePtr ControlTriggerPass::InsertIdentityNode(ComputeGraphPtr &graph, const std if (identity_node == nullptr) { REPORT_CALL_ERROR("E19999", "Add node:%s(%s) to graph:%s failed", op_desc->GetName().c_str(), op_desc->GetType().c_str(), graph->GetName().c_str()); - GELOGE(INTERNAL_ERROR, "Create Identity op %s fail.", name.c_str()); + GELOGE(INTERNAL_ERROR, "[Add][Node] %s(%s) to graph:%s failed", + op_desc->GetName().c_str(), op_desc->GetType().c_str(), graph->GetName().c_str()); return nullptr; } @@ -463,7 +482,7 @@ NodePtr ControlTriggerPass::InsertIdentityNode(ComputeGraphPtr &graph, const std Status ControlTriggerPass::FindPredInput(const NodePtr &switch_node) { if (switch_node == nullptr) { REPORT_INNER_ERROR("E19999", "Param switch_node is nullptr, check invalid"); - GELOGE(INTERNAL_ERROR, "switch_node is null"); + GELOGE(INTERNAL_ERROR, "[Check][Param] switch_node is nullptr"); return INTERNAL_ERROR; } @@ -472,7 +491,8 @@ Status ControlTriggerPass::FindPredInput(const NodePtr &switch_node) { REPORT_INNER_ERROR("E19999", "Index:%d in anchor of switch_node:%s(%s) is nullptr, check invalid", SWITCH_PRED_INPUT, switch_node->GetName().c_str(), switch_node->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "in_cond_anchor is nullptr, node: %s.", switch_node->GetName().c_str()); + GELOGE(INTERNAL_ERROR, "[Get][InDataAnchor] Index:%d in anchor of switch_node:%s(%s) is nullptr", + SWITCH_PRED_INPUT, switch_node->GetName().c_str(), switch_node->GetType().c_str()); return INTERNAL_ERROR; } OutDataAnchorPtr pred_cond_anchor = in_cond_anchor->GetPeerOutAnchor(); @@ -480,7 +500,8 @@ Status ControlTriggerPass::FindPredInput(const NodePtr &switch_node) { REPORT_INNER_ERROR("E19999", "Index:%d in anchor of switch_node:%s(%s), it's peer anchor is nullptr, " "check invalid", SWITCH_PRED_INPUT, switch_node->GetName().c_str(), switch_node->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "pred_cond_anchor is nullptr, node: %s.", switch_node->GetName().c_str()); + GELOGE(INTERNAL_ERROR, "Index:%d in anchor of switch_node:%s(%s), it's peer anchor is nullptr", + SWITCH_PRED_INPUT, switch_node->GetName().c_str(), switch_node->GetType().c_str()); return INTERNAL_ERROR; } diff --git a/ge/graph/passes/ctrl_edge_transfer_pass.cc b/ge/graph/passes/ctrl_edge_transfer_pass.cc index 6cf6e8fe..f1796b2f 100755 --- a/ge/graph/passes/ctrl_edge_transfer_pass.cc +++ b/ge/graph/passes/ctrl_edge_transfer_pass.cc @@ -65,13 +65,17 @@ Status CtrlEdgeTransferPass::Run(ge::ComputeGraphPtr graph) { for (auto &in_control_node : n->GetInControlNodes()) { GE_CHECK_NOTNULL(in_control_node); GE_CHK_GRAPH_STATUS_RET(ge::GraphUtils::RemoveEdge(in_control_node->GetOutControlAnchor(), - n->GetInControlAnchor()), "remove edge failed"); + n->GetInControlAnchor()), + "[Remove][ControlEdge] between %s and %s failed", + in_control_node->GetName().c_str(), n->GetName().c_str()); for (auto &out_node : n->GetOutNodes()) { if (out_node == nullptr) { continue; } GE_CHK_GRAPH_STATUS_RET(ge::GraphUtils::AddEdge(in_control_node->GetOutControlAnchor(), - out_node->GetInControlAnchor()), "add edge failed."); + out_node->GetInControlAnchor()), + "[Add][ControlEdge] between %s and %s failed.", + in_control_node->GetName().c_str(), out_node->GetName().c_str()); } } } diff --git a/ge/graph/passes/data_pass.cc b/ge/graph/passes/data_pass.cc index cb94b161..0974baf2 100644 --- a/ge/graph/passes/data_pass.cc +++ b/ge/graph/passes/data_pass.cc @@ -32,7 +32,8 @@ Status MappingSubgraphInput(const ComputeGraphPtr &graph, const std::functionGetOpDesc(), "index", index)) { REPORT_CALL_ERROR("E19999", "Get Attr:%s from op:%s(%s) failed", "index", node->GetName().c_str(), node->GetType().c_str()); - GELOGE(FAILED, "Failed to get index from data[%s]", node->GetName().c_str()); + GELOGE(FAILED, "[Get][Attr] index from op:%s(%s) failed", + node->GetName().c_str(), node->GetType().c_str()); return FAILED; } @@ -42,7 +43,8 @@ Status MappingSubgraphInput(const ComputeGraphPtr &graph, const std::functionGetOpDesc(), ATTR_NAME_PARENT_NODE_INDEX, parent_index)) { REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed", ATTR_NAME_PARENT_NODE_INDEX.c_str(), node->GetName().c_str(), node->GetType().c_str()); - GELOGE(FAILED, "Failed to set parent index for node %s", node->GetName().c_str()); + GELOGE(FAILED, "[Set][Attr] %s to op:%s(%s) failed", ATTR_NAME_PARENT_NODE_INDEX.c_str(), + node->GetName().c_str(), node->GetType().c_str()); return FAILED; } } @@ -72,7 +74,8 @@ Status MappingSubgraphOutput(const ComputeGraphPtr &graph, const std::functionGetName().c_str(), op_desc->GetType().c_str(), index); - GELOGE(FAILED, "Failed to set parent index for graph %s", graph->GetName().c_str()); + GELOGE(FAILED, "[Set][Attr] %s to tensor of op:%s(%s) input:%zu failed", + ATTR_NAME_PARENT_NODE_INDEX.c_str(), op_desc->GetName().c_str(), op_desc->GetType().c_str(), index); return FAILED; } } @@ -87,12 +90,12 @@ Status MappingSubgraphIndex(const ComputeGraphPtr &graph, GE_CHECK_NOTNULL(input); GE_CHECK_NOTNULL(output); if (MappingSubgraphInput(graph, input) != SUCCESS) { - GELOGE(FAILED, "Failed to mapping subgraph input for graph: %s", graph->GetName().c_str()); + GELOGE(FAILED, "[Call][MappingSubgraphInput] for graph:%s failed", graph->GetName().c_str()); return FAILED; } if (MappingSubgraphOutput(graph, output) != SUCCESS) { - GELOGE(FAILED, "Failed to mapping subgraph output for graph: %s", graph->GetName().c_str()); + GELOGE(FAILED, "[Call][MappingSubgraphOutput] for graph:%s failed", graph->GetName().c_str()); return FAILED; } @@ -149,7 +152,7 @@ Status DataPass::PostParseSubgraph(const ComputeGraphPtr &graph, const string &i if (post_func_it == subgraph_handle.end()) { REPORT_INNER_ERROR("E19999", "The subgraph post func for node %s type %s is null, check invalid", parent_node->GetName().c_str(), parent_node->GetType().c_str()); - GELOGE(FAILED, "The subgraph post func for node %s type %s is null.", + GELOGE(FAILED, "[Check][Param] The subgraph post func for node %s type %s is null.", parent_node->GetName().c_str(), parent_node->GetType().c_str()); return FAILED; } @@ -157,7 +160,7 @@ Status DataPass::PostParseSubgraph(const ComputeGraphPtr &graph, const string &i if (post_func_it->second(ir_name, graph) != SUCCESS) { REPORT_INNER_ERROR("E19999", "Post process subgraph %s on node %s type %s failed", graph->GetName().c_str(), parent_node->GetName().c_str(), parent_node->GetType().c_str()); - GELOGE(FAILED, "Failed to post process subgraph %s on node %s type %s", + GELOGE(FAILED, "[Call][PostFunc] Failed to post process subgraph %s on node %s type %s", graph->GetName().c_str(), parent_node->GetName().c_str(), parent_node->GetType().c_str()); return FAILED; } @@ -188,7 +191,7 @@ Status DataPass::Run(ComputeGraphPtr compute_graph) { GE_CHECK_NOTNULL(parent_node->GetOpDesc()); auto func_desc = parent_node->GetOpDesc(); GE_CHK_STATUS_RET(func_desc->GetSubgraphNameByInstanceName(compute_graph->GetName(), subgraph_name), - "Subgraph: %s get subgraph name failed.", compute_graph->GetName().c_str()); + "[Get][SubGraphName] for Graph:%s failed.", compute_graph->GetName().c_str()); GELOGI("Post process for subgraph %s, Subgraph name: %s, Parent name: %s, Parent type: %s.", compute_graph->GetName().c_str(), subgraph_name.c_str(), parent_node->GetName().c_str(), diff --git a/ge/graph/passes/dimension_adjust_pass.cc b/ge/graph/passes/dimension_adjust_pass.cc index dbea8dc9..03cf3053 100755 --- a/ge/graph/passes/dimension_adjust_pass.cc +++ b/ge/graph/passes/dimension_adjust_pass.cc @@ -30,14 +30,14 @@ const int kRemoveInputIndex = 1; Status DimensionAdjustPass::Run(ge::NodePtr &node) { if (node == nullptr) { REPORT_INNER_ERROR("E19999", "Param node is nullptr, check invalid"); - GELOGE(PARAM_INVALID, "node is nullptr."); + GELOGE(PARAM_INVALID, "[Check][Param] node is nullptr."); return PARAM_INVALID; } OpDescPtr op_desc_ptr = node->GetOpDesc(); if (op_desc_ptr == nullptr) { REPORT_INNER_ERROR("E19999", "Param op_desc of node is nullptr, check invalid"); - GELOGE(PARAM_INVALID, "GetOpDesc return nullptr."); + GELOGE(PARAM_INVALID, "[Get][OpDesc] return nullptr."); return PARAM_INVALID; } @@ -46,7 +46,7 @@ Status DimensionAdjustPass::Run(ge::NodePtr &node) { if (ret != SUCCESS) { REPORT_CALL_ERROR("E19999", "Get OriginalType of op:%s(%s) failed", node->GetName().c_str(), node->GetType().c_str()); - GELOGE(ret, "DimensionAdjustPass get originnal type fail."); + GELOGE(ret, "[Get][OriginalType] of op:%s(%s) failed", node->GetName().c_str(), node->GetType().c_str()); return ret; } @@ -75,7 +75,7 @@ Status DimensionAdjustPass::Run(ge::NodePtr &node) { } REPORT_CALL_ERROR("E19999", "kernel compute for op:%s(%s) failed", node->GetName().c_str(), node->GetType().c_str()); - GELOGE(ret, "DimensionAdjustPass compute failed"); + GELOGE(ret, "[Call][Compute] for op:%s(%s) failed", node->GetName().c_str(), node->GetType().c_str()); return ret; } // Need to handle axis_input of node like ExpandDims @@ -88,21 +88,22 @@ Status DimensionAdjustPass::Run(ge::NodePtr &node) { if (ret != SUCCESS) { REPORT_CALL_ERROR("E19999", "Unlink op:%s(%s) data input:%u with control edge copy failed", node->GetName().c_str(), node->GetType().c_str(), kRemoveInputIndex); - GELOGE(ret, "DimensionAdjustPass unlink node with control copy fail."); + GELOGE(ret, "[Unlink][Op] %s(%s) data input:%u with control edge copy failed", + node->GetName().c_str(), node->GetType().c_str(), kRemoveInputIndex); return ret; } // 2.Remove const axis node without any output if ((axis_node->GetType() == CONSTANT || axis_node->GetType() == CONSTANTOP) && axis_node->GetOutDataNodesSize() == 0) { ret = IsolateAndDeleteNode(axis_node, {}); - GE_CHK_GRAPH_STATUS_RET(ret, "Fail to remove node %s.", axis_node->GetName().c_str()); + GE_CHK_GRAPH_STATUS_RET(ret, "[Remove][Node] %s failed.", axis_node->GetName().c_str()); GELOGI("Remove useless axis input const %s", axis_node->GetName().c_str()); } } ret = DealWithInNodes(node); if (ret != SUCCESS) { - GELOGE(ret, "DealWithInNodes of %s failed.", node->GetName().c_str()); + GELOGE(ret, "[DealWith][InNodes] of node:%s failed.", node->GetName().c_str()); return ret; } @@ -147,14 +148,14 @@ NodePtr DimensionAdjustPass::AddIdentityNodeToGraph(const string &name, const Ge ComputeGraphPtr &graph) { if (graph == nullptr) { REPORT_INNER_ERROR("E19999", "Param graph is nullptr, check invalid"); - GELOGE(INTERNAL_ERROR, "Comput graph ptr is null in creating identity node."); + GELOGE(INTERNAL_ERROR, "[Check][Param] Comput graph ptr is nullptr in creating identity node."); return nullptr; } OpDescPtr desc = MakeShared("", ""); if (desc == nullptr) { REPORT_CALL_ERROR("E19999", "New OpDesc failed"); - GELOGE(MEMALLOC_FAILED, "Failed to create op desc."); + GELOGE(MEMALLOC_FAILED, "[New][OpDesc] failed."); return nullptr; } @@ -165,7 +166,8 @@ NodePtr DimensionAdjustPass::AddIdentityNodeToGraph(const string &name, const Ge if ((ret != GRAPH_SUCCESS) || (ret2 != GRAPH_SUCCESS)) { REPORT_CALL_ERROR("E19999", "Add input or ouput desc to op:%s(%s) failed", desc->GetName().c_str(), desc->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "Failed to add input/output desc in creating identity."); + GELOGE(INTERNAL_ERROR, "[Add][GeTensorDesc] to op:%s(%s) failed", + desc->GetName().c_str(), desc->GetType().c_str()); return nullptr; } diff --git a/ge/graph/passes/dimension_compute_pass.cc b/ge/graph/passes/dimension_compute_pass.cc index cfd978b6..350faf71 100755 --- a/ge/graph/passes/dimension_compute_pass.cc +++ b/ge/graph/passes/dimension_compute_pass.cc @@ -41,7 +41,7 @@ Status DimensionComputePass::Run(ge::NodePtr &node) { } else { REPORT_CALL_ERROR("E19999", "kernel compute for op:%s(%s) failed", node->GetName().c_str(), node->GetType().c_str()); - GELOGE(ret, "DimensionComputePass Compute failed"); + GELOGE(ret, "[Call][Compute] for op:%s(%s) failed", node->GetName().c_str(), node->GetType().c_str()); return ret; } } @@ -49,10 +49,8 @@ Status DimensionComputePass::Run(ge::NodePtr &node) { if (outputs.empty()) { REPORT_INNER_ERROR("E19999", "After compute for node %s(%s), output weight is empty, check invalid", node->GetName().c_str(), node->GetType().c_str()); - GELOGE(INTERNAL_ERROR, - "Failed to compute dims for node %s," - " no output weight", - node->GetName().c_str()); + GELOGE(INTERNAL_ERROR, "[Check][Param] After compute for node %s(%s), output weight is empty", + node->GetName().c_str(), node->GetType().c_str()); return INTERNAL_ERROR; } diff --git a/ge/graph/passes/dropout_pass.cc b/ge/graph/passes/dropout_pass.cc index 11be74f0..03b35efd 100644 --- a/ge/graph/passes/dropout_pass.cc +++ b/ge/graph/passes/dropout_pass.cc @@ -32,12 +32,12 @@ Status DropOutPass::Run(NodePtr &node) { GELOGD("DropOutPass running"); if (node == nullptr) { REPORT_INNER_ERROR("E19999", "Param node is nullptr, check invalid"); - GELOGE(FAILED, "parameter is null."); + GELOGE(FAILED, "[Check][Param] parameter node is nullptr."); return FAILED; } if (node->GetOpDesc() == nullptr) { REPORT_INNER_ERROR("E19999", "Param op_desc of node is nullptr, check invalid"); - GELOGE(PARAM_INVALID, "param [opDesc] must not be null."); + GELOGE(PARAM_INVALID, "[Get][OpDesc] failed, param [opDesc] must not be null."); return PARAM_INVALID; } std::string op_type = node->GetOpDesc()->GetType(); diff --git a/ge/graph/passes/end_of_sequence_add_control_pass.cc b/ge/graph/passes/end_of_sequence_add_control_pass.cc index 361d4a46..0aee7b03 100755 --- a/ge/graph/passes/end_of_sequence_add_control_pass.cc +++ b/ge/graph/passes/end_of_sequence_add_control_pass.cc @@ -27,7 +27,7 @@ namespace ge { Status EndOfSequenceAddControlPass::Run(ComputeGraphPtr graph) { if (graph == nullptr) { REPORT_INNER_ERROR("E19999", "Param graph is nullptr, check invalid"); - GELOGE(PARAM_INVALID, "param [graph] must not be null."); + GELOGE(PARAM_INVALID, "[Check][Param] param [graph] must not be null."); return PARAM_INVALID; } if (graph->GetParentGraph() != nullptr) { @@ -67,7 +67,8 @@ Status EndOfSequenceAddControlPass::Run(ComputeGraphPtr graph) { // Insert control edge Status status = AddControlEdge(end_of_sequence, target_nodes); if (status != SUCCESS) { - GELOGE(FAILED, "Graph add EndOfSequence op out ctrl edge fail."); + GELOGE(FAILED, "[Add][ControlEdge] Graph add EndOfSequence op:%s out ctrl edge failed.", + end_of_sequence->GetName().c_str()); return FAILED; } GELOGI("EndOfSequenceAddControlPass end."); @@ -83,11 +84,12 @@ Status EndOfSequenceAddControlPass::AddControlEdge(NodePtr &end_of_sequence, std } Status status = GraphUtils::AddEdge(out_ctrl_anchor, in_ctrl_anchor); if (status != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", - "Add control edge between op:%s(%s) and op:%s(%s) failed", + REPORT_CALL_ERROR("E19999", "Add control edge between op:%s(%s) and op:%s(%s) failed", end_of_sequence->GetName().c_str(), end_of_sequence->GetType().c_str(), node->GetName().c_str(), node->GetType().c_str()); - GELOGE(FAILED, "Graph add EndOfSequence op out ctrl edge fail, dst node: %s.", node->GetName().c_str()); + GELOGE(FAILED, "[Add][ControlEdge] between op:%s(%s) and op:%s(%s) failed", + end_of_sequence->GetName().c_str(), end_of_sequence->GetType().c_str(), + node->GetName().c_str(), node->GetType().c_str()); return FAILED; } GELOGI("Graph add EndOfSequence op out ctrl edge, dst node: %s.", node->GetName().c_str()); diff --git a/ge/graph/passes/enter_pass.cc b/ge/graph/passes/enter_pass.cc index cde3d6d9..81e44e1f 100644 --- a/ge/graph/passes/enter_pass.cc +++ b/ge/graph/passes/enter_pass.cc @@ -38,7 +38,7 @@ Status EnterPass::Run(NodePtr &node) { // enter node has only one input if (node->GetInDataNodes().empty()) { REPORT_INNER_ERROR("E19999", "Param node in data nodes is empty, check invalid"); - GELOGE(PARAM_INVALID, "enter_node %s has no input", node->GetName().c_str()); + GELOGE(PARAM_INVALID, "[Check][Param] enter_node %s has no input", node->GetName().c_str()); return PARAM_INVALID; } NodePtr in_node = node->GetInDataNodes().at(0); @@ -62,18 +62,19 @@ Status EnterPass::Run(NodePtr &node) { REPORT_CALL_ERROR("E19999", "Remove control edge between op:%s(%s) and op:%s(%s) failed", node->GetName().c_str(), node->GetType().c_str(), out_ctrl_node->GetName().c_str(), out_ctrl_node->GetType().c_str()); - GELOGE(FAILED, "Remove Enter ctrl output fail, %s->%s", node->GetName().c_str(), - out_ctrl_node->GetName().c_str()); + GELOGE(FAILED, "[Remove][ControlEdge] between op:%s(%s) and op:%s(%s) failed", + node->GetName().c_str(), node->GetType().c_str(), + out_ctrl_node->GetName().c_str(), out_ctrl_node->GetType().c_str()); return FAILED; } } } else { if (OptimizeEnterWithOnlyDataOut(node, in_node) != SUCCESS) { - GELOGE(FAILED, "Optimize enter node[%s] with only out data node failed.", node->GetName().c_str()); + GELOGE(FAILED, "[Optimize][EnterNode] [%s] with only out data node failed.", node->GetName().c_str()); return FAILED; } if (UnlinkCtrlEdgeBeforeConst(node) != SUCCESS) { - GELOGE(FAILED, "Unlink control edge before const of node[%s]'s out nodes failed.", node->GetName().c_str()); + GELOGE(FAILED, "[Unlink][ControlEdge] before const of node[%s]'s out nodes failed.", node->GetName().c_str()); return FAILED; } } diff --git a/ge/graph/passes/flow_ctrl_pass.cc b/ge/graph/passes/flow_ctrl_pass.cc index 0072224b..fe0cb9ea 100755 --- a/ge/graph/passes/flow_ctrl_pass.cc +++ b/ge/graph/passes/flow_ctrl_pass.cc @@ -52,7 +52,8 @@ Status FlowCtrlPass::Run(ComputeGraphPtr compute_graph) { // Add big cycle Status ret = AddFpBpIteratorCtrl(compute_graph, node); if (ret != SUCCESS) { - GELOGE(ret, "AddFpBpIteratorCtrl fail, node: %s.", node->GetName().c_str()); + GELOGE(ret, "[Add][FpBpIteratorCtrl] failed, node:%s, graph:%s.", + node->GetName().c_str(), compute_graph->GetName().c_str()); return ret; } graph_change = true; @@ -74,7 +75,8 @@ Status FlowCtrlPass::Run(ComputeGraphPtr compute_graph) { if (is_found && need_cycle_flag) { Status ret = AddSpecialNodeIteratorCtrl(compute_graph, node); if (ret != SUCCESS) { - GELOGE(ret, "AddSpecialNodeIteratorCtrl fail, node: %s.", node->GetName().c_str()); + GELOGE(ret, "[Add][SpecialNodeIteratorCtrl] failed, node:%s, graph:%s.", + node->GetName().c_str(), compute_graph->GetName().c_str()); return ret; } graph_change = true; @@ -116,7 +118,7 @@ NodePtr FlowCtrlPass::InsertOp(ComputeGraphPtr &compute_graph, const string &nod OpDescPtr op_desc = MakeShared(node_name, node_type); if (op_desc == nullptr) { REPORT_CALL_ERROR("E19999", "New OpDesc failed"); - GELOGE(FAILED, "Make OpDesc failed, name:%s, type:%s.", node_name.c_str(), node_type.c_str()); + GELOGE(FAILED, "[New][OpDesc] failed, name:%s, type:%s.", node_name.c_str(), node_type.c_str()); return nullptr; } @@ -125,7 +127,7 @@ NodePtr FlowCtrlPass::InsertOp(ComputeGraphPtr &compute_graph, const string &nod if (graph_status != GRAPH_SUCCESS) { REPORT_CALL_ERROR("E19999", "Add input desc to op:%s(%s) failed", op_desc->GetName().c_str(), op_desc->GetType().c_str()); - GELOGE(FAILED, "Add node:%s intput desc failed, error=%u.", node_name.c_str(), graph_status); + GELOGE(FAILED, "[Add][InputDesc] to op:%s(%s) failed", op_desc->GetName().c_str(), op_desc->GetType().c_str()); return nullptr; } } @@ -135,20 +137,22 @@ NodePtr FlowCtrlPass::InsertOp(ComputeGraphPtr &compute_graph, const string &nod if (graph_status != GRAPH_SUCCESS) { REPORT_CALL_ERROR("E19999", "Add output desc to op:%s(%s) failed", op_desc->GetName().c_str(), op_desc->GetType().c_str()); - GELOGE(FAILED, "Add node:%s output desc failed, error=%u.", node_name.c_str(), graph_status); + GELOGE(FAILED, "[Add][OutputDesc] to op:%s(%s) failed", + op_desc->GetName().c_str(), op_desc->GetType().c_str()); return nullptr; } } GE_IF_BOOL_EXEC(compute_graph == nullptr, REPORT_INNER_ERROR("E19999", "Param compute_graph is nullptr, check invalid"); - DOMI_LOGE("compute_graph is nullptr"); + DOMI_LOGE("[Check][Param] compute_graph is nullptr"); return nullptr); NodePtr node = compute_graph->AddNode(op_desc); if (node == nullptr) { REPORT_CALL_ERROR("E19999", "Add node:%s(%s) to graph:%s failed", op_desc->GetName().c_str(), op_desc->GetType().c_str(), compute_graph->GetName().c_str()); - GELOGE(FAILED, "add node failed, name:%s, type:%s.", node_name.c_str(), node_type.c_str()); + GELOGE(FAILED, "[Add][Node] %s(%s) to graph:%s failed", + op_desc->GetName().c_str(), op_desc->GetType().c_str(), compute_graph->GetName().c_str()); return nullptr; } @@ -159,21 +163,19 @@ NodePtr FlowCtrlPass::InsertOp(ComputeGraphPtr &compute_graph, const string &nod NodePtr FlowCtrlPass::InsertStreamSwitchOp(ComputeGraphPtr &compute_graph, const string &switch_name, const NodePtr &loop_cond, const NodePtr &iter_per_loop) { GE_IF_BOOL_EXEC(loop_cond == nullptr || loop_cond->GetOpDesc() == nullptr, - REPORT_INNER_ERROR("E19999", "Param loop_cond or its op_desc is nullptr, " - "check invalid"); - GELOGE(FAILED, "loop_cond is null"); + REPORT_INNER_ERROR("E19999", "Param loop_cond or its op_desc is nullptr, check invalid"); + GELOGE(FAILED, "[Check][Param] Param loop_cond or its op_desc is nullptr"); return nullptr); GE_IF_BOOL_EXEC(iter_per_loop == nullptr || iter_per_loop->GetOpDesc() == nullptr, - REPORT_INNER_ERROR("E19999", "Param iter_per_loop or its op_desc is nullptr, " - "check invalid"); - GELOGE(FAILED, "iter_per_loop is nullptr"); + REPORT_INNER_ERROR("E19999", "Param iter_per_loop or its op_desc is nullptr, check invalid"); + GELOGE(FAILED, "[Check][Param] Param iter_per_loop or its op_desc is nullptr"); return nullptr); std::vector input_desc_list = {loop_cond->GetOpDesc()->GetOutputDesc(0), iter_per_loop->GetOpDesc()->GetOutputDesc(0)}; std::vector output_desc_list; NodePtr stream_switch = InsertOp(compute_graph, STREAMSWITCH, switch_name, input_desc_list, output_desc_list); if (stream_switch == nullptr) { - GELOGE(FAILED, "InsertStreamSwitchOp failed, name:%s.", switch_name.c_str()); + GELOGE(FAILED, "[Insert][StreamSwitchOp] failed, name:%s.", switch_name.c_str()); return nullptr; } @@ -183,7 +185,9 @@ NodePtr FlowCtrlPass::InsertStreamSwitchOp(ComputeGraphPtr &compute_graph, const REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(index:0) and op:%s(%s)(index:0) failed", loop_cond->GetName().c_str(), loop_cond->GetType().c_str(), stream_switch->GetName().c_str(), stream_switch->GetType().c_str()); - GELOGE(FAILED, "Add loop_cond_node to switch_node:%s edge failed, ret = %u.", switch_name.c_str(), add_ret); + GELOGE(FAILED, "[Add][Edge] between op:%s(%s)(index:0) and op:%s(%s)(index:0) failed", + loop_cond->GetName().c_str(), loop_cond->GetType().c_str(), + stream_switch->GetName().c_str(), stream_switch->GetType().c_str()); return nullptr; } @@ -193,17 +197,20 @@ NodePtr FlowCtrlPass::InsertStreamSwitchOp(ComputeGraphPtr &compute_graph, const REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(index:0) and op:%s(%s)(index:1) failed", iter_per_loop->GetName().c_str(), iter_per_loop->GetType().c_str(), stream_switch->GetName().c_str(), stream_switch->GetType().c_str()); - GELOGE(FAILED, "Add iter_per_loop_node to switch_node:%s edge failed, ret = %u.", switch_name.c_str(), add_ret); + GELOGE(FAILED, "[Add][Edge] between op:%s(%s)(index:0) and op:%s(%s)(index:1) failed", + iter_per_loop->GetName().c_str(), iter_per_loop->GetType().c_str(), + stream_switch->GetName().c_str(), stream_switch->GetType().c_str()); return nullptr; } // stream switch op need switch cond by attr. GE_IF_BOOL_EXEC(!AttrUtils::SetInt(stream_switch->GetOpDesc(), ATTR_NAME_STREAM_SWITCH_COND, - static_cast(RT_LESS)), - REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed", - ATTR_NAME_STREAM_SWITCH_COND.c_str(), + static_cast(RT_LESS)), + REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed", ATTR_NAME_STREAM_SWITCH_COND.c_str(), stream_switch->GetName().c_str(), stream_switch->GetType().c_str()); - DOMI_LOGE("set ATTR_NAME_STREAM_SWITCH_COND failed"); return nullptr); + DOMI_LOGE("[Set][Attr] %s to op:%s(%s) failed", ATTR_NAME_STREAM_SWITCH_COND.c_str(), + stream_switch->GetName().c_str(), stream_switch->GetType().c_str()); + return nullptr); return stream_switch; } @@ -211,7 +218,7 @@ NodePtr FlowCtrlPass::InsertStreamSwitchOp(ComputeGraphPtr &compute_graph, const NodePtr FlowCtrlPass::AddVariableNode(ComputeGraphPtr &compute_graph, const string &name) { GE_IF_BOOL_EXEC(compute_graph == nullptr, REPORT_INNER_ERROR("E19999", "Param compute_graph is nullptr, check invalid"); - DOMI_LOGE("compute_graph is nullptr"); + DOMI_LOGE("[Check][Param] compute_graph is nullptr"); return nullptr); NodePtr exist_node = compute_graph->FindNode(name); if (exist_node != nullptr) { @@ -221,15 +228,14 @@ NodePtr FlowCtrlPass::AddVariableNode(ComputeGraphPtr &compute_graph, const stri // fetch and set tensor desc GeTensorDesc tensor_desc; if (ge::VarManager::Instance(compute_graph->GetSessionID()) == nullptr) { - REPORT_INNER_ERROR("E19999", "Get VarManager by session_id:%lu failed", - compute_graph->GetSessionID()); + REPORT_INNER_ERROR("E19999", "Get VarManager by session_id:%lu failed", compute_graph->GetSessionID()); return nullptr; } Status ret = ge::VarManager::Instance(compute_graph->GetSessionID())->GetCurVarDesc(name, tensor_desc); if (ret != SUCCESS) { REPORT_INNER_ERROR("E19999", "Get var tensor from VarManager by name:%s failed, session_id:%lu", name.c_str(), compute_graph->GetSessionID()); - GELOGE(FAILED, "Get var desc fail, name:%s", name.c_str()); + GELOGE(FAILED, "[Get][CurVarDesc] failed, name:%s, session_id:%lu", name.c_str(), compute_graph->GetSessionID()); return nullptr; } std::vector input_desc_list; @@ -263,7 +269,7 @@ Status FlowCtrlPass::AddGlobalStepVariableNode(ComputeGraphPtr &compute_graph) { NodePtr global_step = InsertOp(compute_graph, VARIABLE, NODE_NAME_GLOBAL_STEP, input_desc_list, output_desc_list); if (global_step == nullptr) { - GELOGE(FAILED, "Add global_step node failed, global_step is null."); + GELOGE(FAILED, "[Insert][Op] in graph:%s failed, global_step is null.", compute_graph->GetName().c_str()); return FAILED; } @@ -273,7 +279,9 @@ Status FlowCtrlPass::AddGlobalStepVariableNode(ComputeGraphPtr &compute_graph) { REPORT_CALL_ERROR("E19999", "Add control edge between op:%s(%s) and op:%s(%s) failed", global_step->GetName().c_str(), global_step->GetType().c_str(), output_node->GetName().c_str(), output_node->GetType().c_str()); - GELOGE(FAILED, "Add global_step to netoutput edge failed, add_ret=%u.", add_ret); + GELOGE(FAILED, "[Add][ControlEdge] between op:%s(%s) and op:%s(%s) failed", + global_step->GetName().c_str(), global_step->GetType().c_str(), + output_node->GetName().c_str(), output_node->GetType().c_str()); return FAILED; } GELOGD("Add global_step to netoutput edge in graph %u success", compute_graph->GetGraphID()); @@ -284,9 +292,9 @@ NodePtr FlowCtrlPass::InsertAssignOp(ge::ComputeGraphPtr &compute_graph, const s const string &node_name, const NodePtr &ref_node, const NodePtr &value_node) { GE_IF_BOOL_EXEC(ref_node == nullptr || value_node == nullptr || ref_node->GetOpDesc() == nullptr || value_node->GetOpDesc() == nullptr, - REPORT_INNER_ERROR("E19999", "Param ref_node or value_node or their op_desc has nullptr, " + REPORT_INNER_ERROR("E19999", "Param ref_node or value_node or their op_desc is nullptr, " "check invalid"); - GELOGE(FAILED, "ref node or value node is null"); + GELOGE(FAILED, "[Check][Param] Param ref_node or value_node or their op_desc is nullptr"); return nullptr); GeTensorDesc ref_tensor_desc = ref_node->GetOpDesc()->GetOutputDesc(0); GeTensorDesc val_tensor_desc = value_node->GetOpDesc()->GetOutputDesc(0); @@ -294,7 +302,7 @@ NodePtr FlowCtrlPass::InsertAssignOp(ge::ComputeGraphPtr &compute_graph, const s std::vector output_desc_list = {ref_tensor_desc}; NodePtr assign_node = InsertOp(compute_graph, node_type, node_name, input_desc_list, output_desc_list); if (assign_node == nullptr) { - GELOGE(FAILED, "Insert node %s(%s) failed.", node_name.c_str(), node_type.c_str()); + GELOGE(FAILED, "[Insert][node] %s(%s) failed.", node_name.c_str(), node_type.c_str()); return nullptr; } // assign node input 0 = ref_node @@ -303,7 +311,9 @@ NodePtr FlowCtrlPass::InsertAssignOp(ge::ComputeGraphPtr &compute_graph, const s REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(index:0) and op:%s(%s)(index:0) failed", ref_node->GetName().c_str(), ref_node->GetType().c_str(), assign_node->GetName().c_str(), assign_node->GetType().c_str()); - GELOGE(FAILED, "Add ref_node to %s edge failed, add_ret=%u.", node_name.c_str(), add_ret); + GELOGE(FAILED, "[Add][Edge] between op:%s(%s)(index:0) and op:%s(%s)(index:0) failed", + ref_node->GetName().c_str(), ref_node->GetType().c_str(), + assign_node->GetName().c_str(), assign_node->GetType().c_str()); return nullptr; } // assign input 1 = value_node @@ -312,7 +322,9 @@ NodePtr FlowCtrlPass::InsertAssignOp(ge::ComputeGraphPtr &compute_graph, const s REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(index:0) and op:%s(%s)(index:1) failed", value_node->GetName().c_str(), value_node->GetType().c_str(), assign_node->GetName().c_str(), assign_node->GetType().c_str()); - GELOGE(FAILED, "Add value_node to %s edge failed, add_ret=%u.", node_name.c_str(), add_ret); + GELOGE(FAILED, "[Add][Edge] between op:%s(%s)(index:0) and op:%s(%s)(index:1) failed", + value_node->GetName().c_str(), value_node->GetType().c_str(), + assign_node->GetName().c_str(), assign_node->GetType().c_str()); return nullptr; } (void)ge::AttrUtils::SetBool(assign_node->GetOpDesc(), ATTR_NEED_COMPILE, true); @@ -335,7 +347,7 @@ Status FlowCtrlPass::CreateIterCtrlTrueBranch(ComputeGraphPtr &compute_graph, co assign_add_node_in_fpbp_loop_ = InsertAssignOp(compute_graph, ASSIGNADD, NODE_NAME_FLOWCTRL_LOOP_ASSIGNADD, loop_cond_node, loop_inc_node); if (assign_add_node_in_fpbp_loop_ == nullptr || switch_node == nullptr) { - GELOGE(PARAM_INVALID, "assign add node or switch node is null"); + GELOGE(PARAM_INVALID, "[Check][Param] assign add node or switch node is null"); return FAILED; } @@ -346,7 +358,9 @@ Status FlowCtrlPass::CreateIterCtrlTrueBranch(ComputeGraphPtr &compute_graph, co REPORT_CALL_ERROR("E19999", "Set stream_label:%s to op:%s(%s) failed", active_name.c_str(), assign_add_node_in_fpbp_loop_->GetName().c_str(), assign_add_node_in_fpbp_loop_->GetType().c_str()); - GELOGE(status, "Set stream label failed."); + GELOGE(status, "[Set][StreamLabel] %s to op:%s(%s) failed", + active_name.c_str(), assign_add_node_in_fpbp_loop_->GetName().c_str(), + assign_add_node_in_fpbp_loop_->GetType().c_str()); return status; } @@ -355,28 +369,31 @@ Status FlowCtrlPass::CreateIterCtrlTrueBranch(ComputeGraphPtr &compute_graph, co if (status != ge::SUCCESS) { REPORT_CALL_ERROR("E19999", "Set active label list:%s to op:%s(%s) failed", active_name.c_str(), switch_node->GetName().c_str(), switch_node->GetType().c_str()); - GELOGE(status, "set active_label_list failed."); + GELOGE(status, "[Set][ActiveLabelList] %s to op:%s(%s) failed", + active_name.c_str(), switch_node->GetName().c_str(), switch_node->GetType().c_str()); return status; } // 2. Insert active node NodePtr active_node = InsertOp(compute_graph, STREAMACTIVE, active_name, {}, {}); if (active_node == nullptr) { - GELOGE(FAILED, "Insert stream active node:%s for IterCtrlTrueStream failed.", active_name.c_str()); + GELOGE(FAILED, "[Insert][StreamActiveNode] %s for IterCtrlTrueStream failed.", active_name.c_str()); return FAILED; } status = SetStreamLabel(active_node, active_name); if (status != ge::SUCCESS) { REPORT_CALL_ERROR("E19999", "Set stream_label:%s to op:%s(%s) failed", active_name.c_str(), active_node->GetName().c_str(), active_node->GetType().c_str()); - GELOGE(status, "Set stream label failed."); + GELOGE(status, "[Set][StreamLabel] %s to op:%s(%s) failed", + active_name.c_str(), active_node->GetName().c_str(), active_node->GetType().c_str()); return status; } GE_IF_BOOL_EXEC(!AttrUtils::SetBool(active_node->GetOpDesc(), ATTR_NAME_IS_LOOP_ACTIVE, true), REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed", ATTR_NAME_IS_LOOP_ACTIVE.c_str(), active_node->GetName().c_str(), active_node->GetType().c_str()); - DOMI_LOGE("set ATTR_NAME_IS_LOOP_ACTIVE failed"); + DOMI_LOGE("[Set][Attr] %s to op:%s(%s) failed", ATTR_NAME_IS_LOOP_ACTIVE.c_str(), + active_node->GetName().c_str(), active_node->GetType().c_str()); return FAILED); // add ctrl edges @@ -387,7 +404,9 @@ Status FlowCtrlPass::CreateIterCtrlTrueBranch(ComputeGraphPtr &compute_graph, co switch_node->GetName().c_str(), switch_node->GetType().c_str(), assign_add_node_in_fpbp_loop_->GetName().c_str(), assign_add_node_in_fpbp_loop_->GetType().c_str()); - GELOGE(FAILED, "Add switch_node to assign_add_node ctrl edge failed, add_ret=%u.", add_ret); + GELOGE(FAILED, "[Add][ControlEdge] between op:%s(%s) and op:%s(%s) failed", + switch_node->GetName().c_str(), switch_node->GetType().c_str(), + assign_add_node_in_fpbp_loop_->GetName().c_str(), assign_add_node_in_fpbp_loop_->GetType().c_str()); return FAILED; } @@ -398,7 +417,9 @@ Status FlowCtrlPass::CreateIterCtrlTrueBranch(ComputeGraphPtr &compute_graph, co assign_add_node_in_fpbp_loop_->GetName().c_str(), assign_add_node_in_fpbp_loop_->GetType().c_str(), active_node->GetName().c_str(), active_node->GetType().c_str()); - GELOGE(FAILED, "Add assign_add_node to active_node ctrl edge failed, add_ret=%u.", add_ret); + GELOGE(FAILED, "[Add][ControlEdge] between op:%s(%s) and op:%s(%s) failed", + assign_add_node_in_fpbp_loop_->GetName().c_str(), assign_add_node_in_fpbp_loop_->GetType().c_str(), + active_node->GetName().c_str(), active_node->GetType().c_str()); return FAILED; } @@ -421,7 +442,7 @@ Status FlowCtrlPass::CreateIterCtrlFalseBranch(ComputeGraphPtr &compute_graph, c NodePtr assign_node = InsertAssignOp(compute_graph, ASSIGN, NODE_NAME_FLOWCTRL_LOOP_ASSIGN, loop_cond_node, loop_reset_node); if (assign_node == nullptr || switch_node == nullptr) { - GELOGE(PARAM_INVALID, "assign_node or switch node is null."); + GELOGE(PARAM_INVALID, "[Check][Param] assign_node or switch node is null."); return FAILED; } @@ -429,7 +450,8 @@ Status FlowCtrlPass::CreateIterCtrlFalseBranch(ComputeGraphPtr &compute_graph, c if (status != ge::SUCCESS) { REPORT_CALL_ERROR("E19999", "Set stream_label:%s to op:%s(%s) failed", switch_node->GetName().c_str(), assign_node->GetName().c_str(), assign_node->GetType().c_str()); - GELOGE(status, "Set stream label failed."); + GELOGE(status, "[Set][StreamLabel] %s to op:%s(%s) failed", + switch_node->GetName().c_str(), assign_node->GetName().c_str(), assign_node->GetType().c_str()); return status; } @@ -438,7 +460,9 @@ Status FlowCtrlPass::CreateIterCtrlFalseBranch(ComputeGraphPtr &compute_graph, c REPORT_CALL_ERROR("E19999", "Add control edge between op:%s(%s) and op:%s(%s) failed", switch_node->GetName().c_str(), switch_node->GetType().c_str(), assign_node->GetName().c_str(), assign_node->GetType().c_str()); - GELOGE(FAILED, "Add switch_node to assign_node ctrl edge failed, add_ret=%u.", add_ret); + GELOGE(FAILED, "[Add][ControlEdge] between op:%s(%s) and op:%s(%s) failed", + switch_node->GetName().c_str(), switch_node->GetType().c_str(), + assign_node->GetName().c_str(), assign_node->GetType().c_str()); return FAILED; } @@ -448,25 +472,28 @@ Status FlowCtrlPass::CreateIterCtrlFalseBranch(ComputeGraphPtr &compute_graph, c string active_name = switch_node->GetName() + "_StreamExitActive"; NodePtr active_node = InsertOp(compute_graph, STREAMACTIVE, active_name, {}, {}); if (active_node == nullptr) { - GELOGE(FAILED, "Insert stream active node:%s for IterCtrlTrueStream failed.", active_name.c_str()); + GELOGE(FAILED, "[Insert][StreamActiveNode] %s for IterCtrlTrueStream failed.", active_name.c_str()); return FAILED; } status = SetStreamLabel(active_node, switch_node->GetName()); if (status != ge::SUCCESS) { - REPORT_CALL_ERROR("E19999", "Set stream_label:%s to op:%s(%s) failed", - switch_node->GetName().c_str(), active_node->GetName().c_str(), active_node->GetType().c_str()); - GELOGE(status, "Set stream label failed."); + REPORT_CALL_ERROR("E19999", "Set stream_label:%s to op:%s(%s) failed", switch_node->GetName().c_str(), + active_node->GetName().c_str(), active_node->GetType().c_str()); + GELOGE(status, "[Set][StreamLabel] %s to op:%s(%s) failed", switch_node->GetName().c_str(), + active_node->GetName().c_str(), active_node->GetType().c_str()); return status; } GE_CHK_STATUS_RET(SetSwitchBranchNodeLabel(active_node, switch_node->GetName()), - "set switch branch node label failed."); + "[Set][SwitchBranchNodeLabel] %s to op:%s(%s) failed", switch_node->GetName().c_str(), + active_node->GetName().c_str(), active_node->GetType().c_str()); string model_exit_name = switch_node->GetName() + "_ModelExit"; status = SetActiveLabelList(active_node, { model_exit_name }); if (status != ge::SUCCESS) { REPORT_CALL_ERROR("E19999", "Set active label list:%s to op:%s(%s) failed", model_exit_name.c_str(), active_node->GetName().c_str(), active_node->GetType().c_str()); - GELOGE(status, "set active_label_list failed."); + GELOGE(status, "[Set][ActiveLabelList] %s to op:%s(%s) failed", + model_exit_name.c_str(), active_node->GetName().c_str(), active_node->GetType().c_str()); return status; } @@ -475,14 +502,16 @@ Status FlowCtrlPass::CreateIterCtrlFalseBranch(ComputeGraphPtr &compute_graph, c REPORT_CALL_ERROR("E19999", "Add control edge between op:%s(%s) and op:%s(%s) failed", assign_node->GetName().c_str(), assign_node->GetType().c_str(), active_node->GetName().c_str(), active_node->GetType().c_str()); - GELOGE(FAILED, "Add assign_node to active_node ctrl edge failed, add_ret=%u.", add_ret); + GELOGE(FAILED, "[Add][ControlEdge] between op:%s(%s) and op:%s(%s) failed", + assign_node->GetName().c_str(), assign_node->GetType().c_str(), + active_node->GetName().c_str(), active_node->GetType().c_str()); return FAILED; } // 3. Insert model exit node and add ctrl edge NodePtr model_exit_node = InsertOp(compute_graph, MODELEXIT, model_exit_name, {}, {}); if (model_exit_node == nullptr) { - GELOGE(FAILED, "Insert model_exit node:%s for IterCtrlTrueStream failed.", model_exit_name.c_str()); + GELOGE(FAILED, "[Insert][ModelExitNode] %s for IterCtrlTrueStream failed.", model_exit_name.c_str()); return FAILED; } status = SetStreamLabel(model_exit_node, model_exit_name); @@ -490,7 +519,8 @@ Status FlowCtrlPass::CreateIterCtrlFalseBranch(ComputeGraphPtr &compute_graph, c REPORT_CALL_ERROR("E19999", "Set stream_label:%s to op:%s(%s) failed", model_exit_name.c_str(), model_exit_node->GetName().c_str(), model_exit_node->GetType().c_str()); - GELOGE(status, "Set stream label failed."); + GELOGE(status, "[Set][StreamLabel] %s to op:%s(%s) failed", model_exit_name.c_str(), + model_exit_node->GetName().c_str(), model_exit_node->GetType().c_str()); return status; } @@ -499,7 +529,9 @@ Status FlowCtrlPass::CreateIterCtrlFalseBranch(ComputeGraphPtr &compute_graph, c REPORT_CALL_ERROR("E19999", "Add control edge between op:%s(%s) and op:%s(%s) failed", active_node->GetName().c_str(), assign_node->GetType().c_str(), model_exit_node->GetName().c_str(), model_exit_node->GetType().c_str()); - GELOGE(FAILED, "Add active_node to model_exit_node ctrl edge failed, add_ret=%u.", add_ret); + GELOGE(FAILED, "[Add][ControlEdge] between op:%s(%s) and op:%s(%s) failed", + active_node->GetName().c_str(), assign_node->GetType().c_str(), + model_exit_node->GetName().c_str(), model_exit_node->GetType().c_str()); return FAILED; } } @@ -509,28 +541,28 @@ Status FlowCtrlPass::CreateIterCtrlFalseBranch(ComputeGraphPtr &compute_graph, c } Status FlowCtrlPass::AddFpBpIteratorCtrl(ComputeGraphPtr &compute_graph, NodePtr &pre_node) { - GE_IF_BOOL_EXEC(pre_node == nullptr, DOMI_LOGE("pre_node is nullptr."); return FAILED); + GE_IF_BOOL_EXEC(pre_node == nullptr, DOMI_LOGE("[Check][Param] pre_node is nullptr."); return FAILED); string pre_node_name = pre_node->GetName(); GELOGI("Add FpBp Iterator ctrl, pre node:%s.", pre_node_name.c_str()); // 1. Get or add variables NodePtr loop_cond_node = AddVariableNode(compute_graph, NODE_NAME_FLOWCTRL_LOOP_COND); if (loop_cond_node == nullptr) { - GELOGE(FAILED, "Add variable:%s failed.", NODE_NAME_FLOWCTRL_LOOP_COND.c_str()); + GELOGE(FAILED, "[Add][Variable] %s failed.", NODE_NAME_FLOWCTRL_LOOP_COND.c_str()); return FAILED; } NodePtr loop_inc_node = AddVariableNode(compute_graph, NODE_NAME_FLOWCTRL_LOOP_INCREMENT); if (loop_inc_node == nullptr) { - GELOGE(FAILED, "Add variable:%s failed.", NODE_NAME_FLOWCTRL_LOOP_INCREMENT.c_str()); + GELOGE(FAILED, "[Add][Variable] %s failed.", NODE_NAME_FLOWCTRL_LOOP_INCREMENT.c_str()); return FAILED; } NodePtr loop_reset_node = AddVariableNode(compute_graph, NODE_NAME_FLOWCTRL_LOOP_RESETVALUE); if (loop_reset_node == nullptr) { - GELOGE(FAILED, "Add variable:%s failed.", NODE_NAME_FLOWCTRL_LOOP_RESETVALUE.c_str()); + GELOGE(FAILED, "[Add][Variable] %s failed.", NODE_NAME_FLOWCTRL_LOOP_RESETVALUE.c_str()); return FAILED; } NodePtr iter_per_loop_node = AddVariableNode(compute_graph, NODE_NAME_FLOWCTRL_LOOP_PER_ITER); if (iter_per_loop_node == nullptr) { - GELOGE(FAILED, "Add variable:%s failed.", NODE_NAME_FLOWCTRL_LOOP_PER_ITER.c_str()); + GELOGE(FAILED, "[Add][Variable] %s failed.", NODE_NAME_FLOWCTRL_LOOP_PER_ITER.c_str()); return FAILED; } @@ -538,14 +570,15 @@ Status FlowCtrlPass::AddFpBpIteratorCtrl(ComputeGraphPtr &compute_graph, NodePtr string switch_name = pre_node_name + "_" + NODE_NAME_STREAM_SWITCH; NodePtr switch_node = InsertStreamSwitchOp(compute_graph, switch_name, loop_cond_node, iter_per_loop_node); if (switch_node == nullptr) { - GELOGE(FAILED, "InsertStreamSwitchOp:%s failed.", switch_name.c_str()); + GELOGE(FAILED, "[Insert][StreamSwitchOp] %s failed.", switch_name.c_str()); return FAILED; } auto status = SetStreamLabel(switch_node, switch_name); if (status != ge::SUCCESS) { REPORT_CALL_ERROR("E19999", "Set stream label:%s to op:%s(%s) failed", switch_name.c_str(), switch_node->GetName().c_str(), switch_node->GetType().c_str()); - GELOGE(status, "set stream label failed."); + GELOGE(status, "[Set][StreamLabel] %s to op:%s(%s) failed", + switch_name.c_str(), switch_node->GetName().c_str(), switch_node->GetType().c_str()); return status; } @@ -554,15 +587,16 @@ Status FlowCtrlPass::AddFpBpIteratorCtrl(ComputeGraphPtr &compute_graph, NodePtr REPORT_CALL_ERROR("E19999", "Add control edge between op:%s(%s) and op:%s(%s) failed", pre_node->GetName().c_str(), pre_node->GetType().c_str(), switch_node->GetName().c_str(), switch_node->GetType().c_str()); - GELOGE(FAILED, "Add pre node:%s to switch_node:%s ctrl edge failed, ret = %u.", pre_node_name.c_str(), - switch_name.c_str(), add_ret); + GELOGE(FAILED, "[Add][ControlEdge] between op:%s(%s) and op:%s(%s) failed", + pre_node->GetName().c_str(), pre_node->GetType().c_str(), + switch_node->GetName().c_str(), switch_node->GetType().c_str()); return FAILED; } // 3. Create switch false branch: return results and reset the loopCond Status ret = CreateIterCtrlFalseBranch(compute_graph, loop_cond_node, loop_reset_node, switch_node); if (ret != SUCCESS) { - GELOGE(ret, "CreateIterCtrlFalseBranch fail, pre node:%s.", pre_node_name.c_str()); + GELOGE(ret, "[Create][IterCtrlFalseBranch] fail, pre node:%s.", pre_node_name.c_str()); return ret; } @@ -570,7 +604,7 @@ Status FlowCtrlPass::AddFpBpIteratorCtrl(ComputeGraphPtr &compute_graph, NodePtr // active train streams and increase the loopCond ret = CreateIterCtrlTrueBranch(compute_graph, loop_cond_node, loop_inc_node, switch_node); if (ret != SUCCESS) { - GELOGE(ret, "CreateIterCtrlTrueBranch fail, pre node:%s.", pre_node_name.c_str()); + GELOGE(ret, "[Create][IterCtrlTrueBranch] fail, pre node:%s.", pre_node_name.c_str()); return ret; } return SUCCESS; @@ -594,15 +628,15 @@ Status FlowCtrlPass::AddSpecialNodeIteratorCtrl(ComputeGraphPtr &compute_graph, * itersPerLoop loopCond */ GE_IF_BOOL_EXEC(loop_after_node == nullptr || compute_graph == nullptr, - REPORT_INNER_ERROR("E19999", "Param loop_after_node or compute_graph is nullptr, " - "check invalid"); - DOMI_LOGE("loop after node or compute graph is null."); + REPORT_INNER_ERROR("E19999", "Param loop_after_node or compute_graph is nullptr, check invalid"); + DOMI_LOGE("[Check][Param] loop after node or compute graph is null."); return FAILED); InDataAnchorPtr in_anchor = loop_after_node->GetInDataAnchor(0); if (in_anchor == nullptr || in_anchor->GetPeerOutAnchor() == nullptr) { REPORT_INNER_ERROR("E19999", "Param loop_after_node:%s(%s) no in data node, check invalid", loop_after_node->GetName().c_str(), loop_after_node->GetType().c_str()); - GELOGE(FAILED, "Find %s in data anchor failed.", loop_after_node->GetName().c_str()); + GELOGE(FAILED, "[Check][Param] Param loop_after_node:%s(%s) no in data node.", + loop_after_node->GetName().c_str(), loop_after_node->GetType().c_str()); return FAILED; } NodePtr loop_pre_node = in_anchor->GetPeerOutAnchor()->GetOwnerNode(); @@ -612,28 +646,30 @@ Status FlowCtrlPass::AddSpecialNodeIteratorCtrl(ComputeGraphPtr &compute_graph, if (loop_cond_node == nullptr) { REPORT_INNER_ERROR("E19999", "Node:%s not found in graph:%s, check invalid", NODE_NAME_FLOWCTRL_LOOP_COND.c_str(), compute_graph->GetName().c_str()); - GELOGE(FAILED, "Find node :%s failed.", NODE_NAME_FLOWCTRL_LOOP_COND.c_str()); + GELOGE(FAILED, "[Check][Param] Node:%s not found in graph:%s.", + NODE_NAME_FLOWCTRL_LOOP_COND.c_str(), compute_graph->GetName().c_str()); return FAILED; } NodePtr iter_per_loop_node = compute_graph->FindNode(NODE_NAME_FLOWCTRL_LOOP_PER_ITER); if (iter_per_loop_node == nullptr) { REPORT_INNER_ERROR("E19999", "Node:%s not found in graph:%s, check invalid", NODE_NAME_FLOWCTRL_LOOP_PER_ITER.c_str(), compute_graph->GetName().c_str()); - GELOGE(FAILED, "Find node :%s failed.", NODE_NAME_FLOWCTRL_LOOP_PER_ITER.c_str()); + GELOGE(FAILED, "[Check][Param] Node:%s not found in graph:%s.", + NODE_NAME_FLOWCTRL_LOOP_PER_ITER.c_str(), compute_graph->GetName().c_str()); return FAILED; } // 2. Add StreamSwitch and edges to switch_node. GE_IF_BOOL_EXEC(loop_pre_node == nullptr, - REPORT_INNER_ERROR("E19999", "Param loop_after_node:%s(%s) no in data node, " - "check invalid", loop_after_node->GetName().c_str(), - loop_after_node->GetType().c_str()); - DOMI_LOGE("loop pre node is null."); + REPORT_INNER_ERROR("E19999", "Param loop_after_node:%s(%s) no in data node, check invalid", + loop_after_node->GetName().c_str(), loop_after_node->GetType().c_str()); + DOMI_LOGE("[Check][Param] Param loop_after_node:%s(%s) no in data node", + loop_after_node->GetName().c_str(), loop_after_node->GetType().c_str()); return FAILED); string switch_name = loop_pre_node->GetName() + "_" + NODE_NAME_STREAM_SWITCH; NodePtr switch_node = InsertStreamSwitchOp(compute_graph, switch_name, loop_cond_node, iter_per_loop_node); if (switch_node == nullptr) { - GELOGE(FAILED, "InsertStreamSwitchOp:%s failed.", switch_name.c_str()); + GELOGE(FAILED, "[Insert][StreamSwitchOp] %s failed.", switch_name.c_str()); return FAILED; } @@ -641,7 +677,8 @@ Status FlowCtrlPass::AddSpecialNodeIteratorCtrl(ComputeGraphPtr &compute_graph, if (status != ge::SUCCESS) { REPORT_CALL_ERROR("E19999", "Set stream label:%s to op:%s(%s) failed", switch_name.c_str(), switch_node->GetName().c_str(), switch_node->GetType().c_str()); - GELOGE(status, "set stream label failed."); + GELOGE(status, "[Set][StreamLabel] %s to op:%s(%s) failed", + switch_name.c_str(), switch_node->GetName().c_str(), switch_node->GetType().c_str()); return status; } @@ -650,8 +687,9 @@ Status FlowCtrlPass::AddSpecialNodeIteratorCtrl(ComputeGraphPtr &compute_graph, REPORT_CALL_ERROR("E19999", "Add control edge between op:%s(%s) and op:%s(%s) failed", loop_pre_node->GetName().c_str(), loop_pre_node->GetType().c_str(), switch_node->GetName().c_str(), switch_node->GetType().c_str()); - GELOGE(FAILED, "Add loop_pre_node:%s to switch_node:%s ctrl edge failed, ret = %u.", - loop_pre_node->GetName().c_str(), switch_name.c_str(), add_ret); + GELOGE(FAILED, "[Add][ControlEdge] between op:%s(%s) and op:%s(%s) failed", + loop_pre_node->GetName().c_str(), loop_pre_node->GetType().c_str(), + switch_node->GetName().c_str(), switch_node->GetType().c_str()); return FAILED; } add_ret = GraphUtils::AddEdge(loop_after_node->GetOutControlAnchor(), switch_node->GetInControlAnchor()); @@ -659,8 +697,9 @@ Status FlowCtrlPass::AddSpecialNodeIteratorCtrl(ComputeGraphPtr &compute_graph, REPORT_CALL_ERROR("E19999", "Add control edge between op:%s(%s) and op:%s(%s) failed", loop_after_node->GetName().c_str(), loop_after_node->GetType().c_str(), switch_node->GetName().c_str(), switch_node->GetType().c_str()); - GELOGE(FAILED, "Add node:%s to switch_node:%s ctrl edge failed, ret = %u.", loop_after_node->GetName().c_str(), - switch_name.c_str(), add_ret); + GELOGE(FAILED, "[Add][ControlEdge] between op:%s(%s) and op:%s(%s) failed", + loop_after_node->GetName().c_str(), loop_after_node->GetType().c_str(), + switch_node->GetName().c_str(), switch_node->GetType().c_str()); return FAILED; } @@ -668,7 +707,7 @@ Status FlowCtrlPass::AddSpecialNodeIteratorCtrl(ComputeGraphPtr &compute_graph, string active_name = switch_name + "_StreamActive"; NodePtr active_node = InsertOp(compute_graph, STREAMACTIVE, active_name, {}, {}); if (active_node == nullptr) { - GELOGE(FAILED, "Insert stream active node:%s for SpecialNodeIteratorCtrl failed.", active_name.c_str()); + GELOGE(FAILED, "[Insert][StreamActiveNode] %s for SpecialNodeIteratorCtrl failed.", active_name.c_str()); return FAILED; } @@ -676,15 +715,16 @@ Status FlowCtrlPass::AddSpecialNodeIteratorCtrl(ComputeGraphPtr &compute_graph, if (status != ge::SUCCESS) { REPORT_CALL_ERROR("E19999", "Set stream label:%s to op:%s(%s) failed", active_name.c_str(), active_node->GetName().c_str(), active_node->GetType().c_str()); - GELOGE(status, "set stream label failed."); + GELOGE(status, "[Set][StreamLabel] %s to op:%s(%s) failed", + active_name.c_str(), active_node->GetName().c_str(), active_node->GetType().c_str()); return status; } GE_IF_BOOL_EXEC(!AttrUtils::SetBool(active_node->GetOpDesc(), ATTR_NAME_IS_LOOP_ACTIVE, true), - REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed", - ATTR_NAME_IS_LOOP_ACTIVE.c_str(), + REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed", ATTR_NAME_IS_LOOP_ACTIVE.c_str(), active_node->GetName().c_str(), active_node->GetType().c_str()); - DOMI_LOGE("set ATTR_NAME_IS_LOOP_ACTIVE failed"); + DOMI_LOGE("[Set][Attr] %s to op:%s(%s) failed", ATTR_NAME_IS_LOOP_ACTIVE.c_str(), + active_node->GetName().c_str(), active_node->GetType().c_str()); return FAILED); add_ret = GraphUtils::AddEdge(switch_node->GetOutControlAnchor(), active_node->GetInControlAnchor()); @@ -692,8 +732,9 @@ Status FlowCtrlPass::AddSpecialNodeIteratorCtrl(ComputeGraphPtr &compute_graph, REPORT_CALL_ERROR("E19999", "Add control edge between op:%s(%s) and op:%s(%s) failed", switch_node->GetName().c_str(), switch_node->GetType().c_str(), active_node->GetName().c_str(), active_node->GetType().c_str()); - GELOGE(FAILED, "Add switch_node:%s to active_node:%s ctrl edge failed, ret = %u.", switch_name.c_str(), - active_name.c_str(), add_ret); + GELOGE(FAILED, "[Add][ControlEdge] between op:%s(%s) and op:%s(%s) failed", + switch_node->GetName().c_str(), switch_node->GetType().c_str(), + active_node->GetName().c_str(), active_node->GetType().c_str()); return FAILED; } @@ -702,15 +743,17 @@ Status FlowCtrlPass::AddSpecialNodeIteratorCtrl(ComputeGraphPtr &compute_graph, if (status != ge::SUCCESS) { REPORT_CALL_ERROR("E19999", "Set active label list:%s to op:%s(%s) failed", active_name.c_str(), switch_node->GetName().c_str(), switch_node->GetType().c_str()); - GELOGE(status, "set active_label_list failed."); + GELOGE(status, "[Set][ActiveLabelList] %s to op:%s(%s) failed", + active_name.c_str(), switch_node->GetName().c_str(), switch_node->GetType().c_str()); return status; } // used for stream assign to find active stream status = SetActiveLabelList(active_node, { loop_pre_node->GetName() }); if (status != ge::SUCCESS) { - REPORT_CALL_ERROR("E19999", "Set active label list:%s to op:%s(%s) failed", - loop_pre_node->GetName().c_str(), active_node->GetName().c_str(), active_node->GetType().c_str()); - GELOGE(status, "set active_label_list failed."); + REPORT_CALL_ERROR("E19999", "Set active label list:%s to op:%s(%s) failed", loop_pre_node->GetName().c_str(), + active_node->GetName().c_str(), active_node->GetType().c_str()); + GELOGE(status, "[Set][ActiveLabelList] %s to op:%s(%s) failed", + loop_pre_node->GetName().c_str(), active_node->GetName().c_str(), active_node->GetType().c_str()); return status; } active_nodes_in_iter_loop_.push_back(active_node); diff --git a/ge/graph/passes/folding_pass.cc b/ge/graph/passes/folding_pass.cc index d4558ac7..c0a0f2a2 100755 --- a/ge/graph/passes/folding_pass.cc +++ b/ge/graph/passes/folding_pass.cc @@ -36,7 +36,7 @@ namespace folding_pass { shared_ptr GetKernelByType(const NodePtr &node) { if (node == nullptr) { REPORT_INNER_ERROR("E19999", "Param node is nullptr, check invalid"); - GELOGE(FAILED, "parameter is null."); + GELOGE(FAILED, "[Check][Param] parameter node is nullptr."); return nullptr; } KernelFactory &factory = KernelFactory::Instance(); @@ -84,7 +84,7 @@ NodePtr AddConstNodeToGraph(GeTensorPtr &tensor, ComputeGraphPtr &graph) { auto const_desc = OpDescUtils::CreateConstOp(tensor); if (const_desc == nullptr) { REPORT_CALL_ERROR("E19999", "Create Const op failed"); - GELOGE(OUT_OF_MEMORY, "Failed to get const desc from tensor"); + GELOGE(OUT_OF_MEMORY, "[Create][ConstOp] failed"); return nullptr; } @@ -96,14 +96,14 @@ NodePtr AddConstNodeToGraph(GeTensorPtr &tensor, ComputeGraphPtr &graph) { NodePtr AddIdentityNodeToGraph(const std::string &name, const GeTensorDesc &tensor, ComputeGraphPtr &graph) { if (graph == nullptr) { REPORT_INNER_ERROR("E19999", "Param graph is nullptr, check invalid"); - GELOGE(INTERNAL_ERROR, "Compute graph ptr is null in creating identity node."); + GELOGE(INTERNAL_ERROR, "[Check][Param] Compute graph ptr is null in creating identity node."); return nullptr; } OpDescPtr desc = MakeShared("", ""); if (desc == nullptr) { REPORT_CALL_ERROR("E19999", "New OpDesc failed"); - GELOGE(MEMALLOC_FAILED, "Failed to create op desc."); + GELOGE(MEMALLOC_FAILED, "[New][OpDesc] failed."); return nullptr; } @@ -114,7 +114,8 @@ NodePtr AddIdentityNodeToGraph(const std::string &name, const GeTensorDesc &tens if ((ret != GRAPH_SUCCESS) || (ret2 != GRAPH_SUCCESS)) { REPORT_CALL_ERROR("E19999", "Add input or output desc to op:%s(%s) failed", desc->GetName().c_str(), desc->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "Failed to add input/output desc in creating Identity."); + GELOGE(INTERNAL_ERROR, "[Add][GeTensorDesc] to op:%s(%s) failed", + desc->GetName().c_str(), desc->GetType().c_str()); return nullptr; } @@ -146,9 +147,9 @@ Status FoldingPass::Folding(NodePtr &node, vector &outputs) { auto in_data_nodes = node->GetInDataNodes(); std::unordered_set in_data_nodes_set(in_data_nodes.begin(), in_data_nodes.end()); if (IsolateAndDeleteNode(node, {}) != SUCCESS) { - REPORT_INNER_ERROR("E19999", "Isolate and delete node:%s(%s) faild", + REPORT_INNER_ERROR("E19999", "Isolate and delete node:%s(%s) failed", node->GetName().c_str(), node->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "Failed to isolate and delete node %s, type %s.", + GELOGE(INTERNAL_ERROR, "[IsolateAndDelete][Node] %s(%s) failed.", node->GetName().c_str(), node->GetType().c_str()); return INTERNAL_ERROR; } @@ -160,9 +161,9 @@ Status FoldingPass::Folding(NodePtr &node, vector &outputs) { continue; } if (IsolateAndDeleteNode(pre_node, {}) != SUCCESS) { - REPORT_INNER_ERROR("E19999", "Isolate and delete node:%s(%s) faild", + REPORT_INNER_ERROR("E19999", "Isolate and delete node:%s(%s) failed", pre_node->GetName().c_str(), pre_node->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "Failed to isolate and delete in data node %s, type %s.", + GELOGE(INTERNAL_ERROR, "[IsolateAndDelete][Node] %s(%s) failed.", pre_node->GetName().c_str(), pre_node->GetType().c_str()); return INTERNAL_ERROR; } @@ -190,11 +191,10 @@ Status FoldingPass::DealWithInNodes(NodePtr &node) { GELOGI("The in_node name is %s, and node type is %s.", in_node->GetName().c_str(), in_node->GetType().c_str()); auto ret = in_node_anchor->Unlink(in_data_anchor); if (ret != SUCCESS) { - REPORT_CALL_ERROR("E19999", - "Op:%s(%s) out index:%d unlink from op:%s(%s) in index:%d failed", + REPORT_CALL_ERROR("E19999", "Op:%s(%s) out index:%d unlink from op:%s(%s) in index:%d failed", in_node->GetName().c_str(), in_node->GetType().c_str(), in_node_anchor->GetIdx(), node->GetName().c_str(), node->GetType().c_str(), in_data_anchor->GetIdx()); - GELOGE(INTERNAL_ERROR, "Failed to unlink anchor between const node %s to constant-folding-node %s, type %s.", + GELOGE(INTERNAL_ERROR, "[Unlink][Anchor] between const node:%s and constant-folding-node:%s(%s) failed.", in_node->GetName().c_str(), node->GetName().c_str(), node->GetType().c_str()); return INTERNAL_ERROR; } @@ -204,16 +204,18 @@ Status FoldingPass::DealWithInNodes(NodePtr &node) { auto identity = AddIdentityNodeToGraph(identity_name, node->GetOpDesc()->GetInputDesc(in_data_anchor->GetIdx()), graph); if (identity == nullptr) { - GELOGE(INTERNAL_ERROR, "Failed to add identity node to graph."); + GELOGE(INTERNAL_ERROR, "[Add][IdentityNode] %s to graph:%s failed.", + identity_name.c_str(), graph->GetName().c_str()); return INTERNAL_ERROR; } ret = GraphUtils::AddEdge(in_node_anchor, identity->GetInDataAnchor(0)); if (ret != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(index:%d) and op:%s(%s)(inde:0) failed", + REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(index:%d) and op:%s(%s)(index:0) failed", in_node->GetName().c_str(), in_node->GetType().c_str(), in_node_anchor->GetIdx(), identity->GetName().c_str(), identity->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "Failed to add edge, from node %s to node %s.", in_node->GetName().c_str(), - identity->GetName().c_str()); + GELOGE(INTERNAL_ERROR, "[Add][Edge] between op:%s(%s)(index:%d) and op:%s(%s)(index:0) failed", + in_node->GetName().c_str(), in_node->GetType().c_str(), in_node_anchor->GetIdx(), + identity->GetName().c_str(), identity->GetType().c_str()); return INTERNAL_ERROR; } GELOGI("Create new identity node success."); @@ -222,8 +224,9 @@ Status FoldingPass::DealWithInNodes(NodePtr &node) { REPORT_CALL_ERROR("E19999", "Add control edge between op:%s(%s) and op:%s(%s) failed", identity->GetName().c_str(), identity->GetType().c_str(), node->GetName().c_str(), node->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "Failed to add edge, from node %s to node %s.", in_node->GetName().c_str(), - node->GetName().c_str()); + GELOGE(INTERNAL_ERROR, "[Add][ControlEdge] between op:%s(%s) and op:%s(%s) failed", + identity->GetName().c_str(), identity->GetType().c_str(), + node->GetName().c_str(), node->GetType().c_str()); return INTERNAL_ERROR; } } @@ -236,7 +239,7 @@ Status FoldingPass::AddConstNode(NodePtr &node, IndexsToAnchors indexes_to_ancho std::vector &v_weight) { if (node == nullptr) { REPORT_INNER_ERROR("E19999", "Param node is nullptr, check invalid"); - GELOGE(PARAM_INVALID, "node is null"); + GELOGE(PARAM_INVALID, "[Check][Param] node is nullptr"); return FAILED; } auto graph = node->GetOwnerComputeGraph(); @@ -245,24 +248,23 @@ Status FoldingPass::AddConstNode(NodePtr &node, IndexsToAnchors indexes_to_ancho if (index >= v_weight.size()) { REPORT_INNER_ERROR("E19999", "Index:%lu in param index_to_anchors >= param v_weight.size:%zu, " "check invalid", index, v_weight.size()); - GELOGE(INTERNAL_ERROR, - "Failed to constant fold on node %s type %s, " + GELOGE(INTERNAL_ERROR, "[Check][Param] Failed to constant fold on node %s type %s, " "the out nodes num %lu calculated is less than the node out anchor index %zu", node->GetName().c_str(), node->GetType().c_str(), v_weight.size(), index); return INTERNAL_ERROR; } GeTensorPtr weight = v_weight[index]; if (weight == nullptr) { - REPORT_INNER_ERROR("E19999", "Index:%lu in param v_weight is nullptr check invalid", - index); - GELOGE(INTERNAL_ERROR, "Failed to constant fold on node %s type %s, the %lust node calculated is null", + REPORT_INNER_ERROR("E19999", "Index:%lu in param v_weight is nullptr check invalid", index); + GELOGE(INTERNAL_ERROR, + "[Check][Param] Failed to constant fold on node %s type %s, the %lust node calculated is null", node->GetName().c_str(), node->GetType().c_str(), index); return INTERNAL_ERROR; } auto const_node = AddConstNodeToGraph(weight, graph); if (const_node == nullptr) { - GELOGE(INTERNAL_ERROR, "Failed to add dynamic const node, node name:%s, index:%zu.", + GELOGE(INTERNAL_ERROR, "[Add][ConstNode] To Graph failed, node name:%s, index:%zu.", node->GetName().c_str(), index); return INTERNAL_ERROR; } @@ -273,7 +275,8 @@ Status FoldingPass::AddConstNode(NodePtr &node, IndexsToAnchors indexes_to_ancho if (in_anchor == nullptr) { REPORT_INNER_ERROR("E19999", "Index:%lu in param index_to_anchors has nullptr member in_anchor, " "check invalid", index); - GELOGE(INTERNAL_ERROR, "In anchor is nullptr."); + GELOGE(INTERNAL_ERROR, + "[Check][Param] Index:%lu in param index_to_anchors has nullptr member in_anchor", index); return INTERNAL_ERROR; } auto ret = ConnectNodeToInAnchor(in_anchor, const_node, 0); @@ -287,7 +290,7 @@ Status FoldingPass::AddConstNode(NodePtr &node, IndexsToAnchors indexes_to_ancho REPORT_CALL_ERROR("E19999", "Add control edge between op:%s(%s) and op:%s(%s) failed", node->GetName().c_str(), node->GetType().c_str(), const_node->GetName().c_str(), const_node->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "Failed to add control edge, from node %s to const node %s.", node->GetName().c_str(), + GELOGE(INTERNAL_ERROR, "[Add][ControlEdge] failed, from node %s to const node %s.", node->GetName().c_str(), const_node->GetName().c_str()); return INTERNAL_ERROR; } @@ -296,11 +299,10 @@ Status FoldingPass::AddConstNode(NodePtr &node, IndexsToAnchors indexes_to_ancho if (AttrUtils::GetStr(node->GetOpDesc(), ATTR_NAME_STREAM_LABEL, stream_label)) { GE_CHECK_NOTNULL(const_node->GetOpDesc()); if (!AttrUtils::SetStr(const_node->GetOpDesc(), ATTR_NAME_STREAM_LABEL, stream_label)) { - REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed", - ATTR_NAME_STREAM_LABEL.c_str(), + REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed", ATTR_NAME_STREAM_LABEL.c_str(), const_node->GetName().c_str(), const_node->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "Failed to set stream label on dynamic const node %s, with stream label:%s.", - const_node->GetName().c_str(), stream_label.c_str()); + GELOGE(INTERNAL_ERROR, "[Set][Attr] %s to op:%s(%s) failed", ATTR_NAME_STREAM_LABEL.c_str(), + const_node->GetName().c_str(), const_node->GetType().c_str()); return INTERNAL_ERROR; } } @@ -317,7 +319,7 @@ Status FoldingPass::RemoveNodeKeepingCtrlEdges(NodePtr &node) { if (ret != GRAPH_SUCCESS) { REPORT_CALL_ERROR("E19999", "Isolate node:%s(%s) in graph failed", node->GetName().c_str(), node->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "Failed to isolate the folding-node %s type %s", node->GetName().c_str(), + GELOGE(INTERNAL_ERROR, "[Isolate][Node] %s type %s failed", node->GetName().c_str(), node->GetType().c_str()); return INTERNAL_ERROR; } @@ -327,7 +329,8 @@ Status FoldingPass::RemoveNodeKeepingCtrlEdges(NodePtr &node) { if (ret != GRAPH_SUCCESS) { REPORT_CALL_ERROR("E19999", "Remove node:%s(%s) without relink in graph:%s failed", node->GetName().c_str(), node->GetType().c_str(), graph->GetName().c_str()); - GELOGE(INTERNAL_ERROR, "Failed to remove node %s from graph", node->GetName().c_str()); + GELOGE(INTERNAL_ERROR, "[Remove][Node] %s(%s) without relink in graph:%s failed", + node->GetName().c_str(), node->GetType().c_str(), graph->GetName().c_str()); return INTERNAL_ERROR; } AddNodeDeleted(node); @@ -338,7 +341,7 @@ Status FoldingPass::ConnectNodeToInAnchor(InDataAnchorPtr &in_anchor, NodePtr &n // the origin edge must be removed before add if (in_anchor == nullptr || node == nullptr) { REPORT_INNER_ERROR("E19999", "Param node or in_anchor is nullptr, check invalid"); - GELOGE(PARAM_INVALID, "in anchor or node is null"); + GELOGE(PARAM_INVALID, "[Check][Param] in anchor or node is null"); return PARAM_INVALID; } auto peer_out_anchor = in_anchor->GetPeerOutAnchor(); @@ -352,8 +355,7 @@ Status FoldingPass::ConnectNodeToInAnchor(InDataAnchorPtr &in_anchor, NodePtr &n if (new_out_anchor == nullptr) { REPORT_INNER_ERROR("E19999", "Param out index:%d data anchor of node:%s(%s) is nullptr, check invalid", node_index, node->GetName().c_str(), node->GetType().c_str()); - GELOGE(INTERNAL_ERROR, - "Failed to add node to in anchor," + GELOGE(INTERNAL_ERROR, "[Check][Param] Failed to add node to in anchor," " the index %d for node %s, type %s is invalid", node_index, node->GetName().c_str(), node->GetType().c_str()); return INTERNAL_ERROR; @@ -363,10 +365,10 @@ Status FoldingPass::ConnectNodeToInAnchor(InDataAnchorPtr &in_anchor, NodePtr &n node->GetName().c_str(), node->GetType().c_str(), node_index, in_anchor->GetOwnerNode()->GetName().c_str(), in_anchor->GetOwnerNode()->GetType().c_str(), in_anchor->GetIdx()); - GELOGE(INTERNAL_ERROR, - "Failed to add edge between anchors," - " new node %s, type %s", - node->GetName().c_str(), node->GetType().c_str()); + GELOGE(INTERNAL_ERROR, "[Add][Edge] between op:%s(%s)(index:%d) and op:%s(%s)(index:%d) failed", + node->GetName().c_str(), node->GetType().c_str(), node_index, + in_anchor->GetOwnerNode()->GetName().c_str(), in_anchor->GetOwnerNode()->GetType().c_str(), + in_anchor->GetIdx()); return INTERNAL_ERROR; } AddRePassNodesWithInOut(node); diff --git a/ge/graph/passes/for_pass.cc b/ge/graph/passes/for_pass.cc index 0b6377dc..7d09f370 100644 --- a/ge/graph/passes/for_pass.cc +++ b/ge/graph/passes/for_pass.cc @@ -56,17 +56,18 @@ Status ForPass::Run(NodePtr &node) { ForInfo for_info; GE_CHK_STATUS_RET(BuildForInfo(root_graph, node, for_info), - "Build ForInfo failed, node:%s.", node->GetName().c_str()); + "[Build][ForInfo] failed, node:%s.", node->GetName().c_str()); WhileInfo while_info; GE_CHK_STATUS_RET(TranWhileInfo(graph, for_info, while_info), - "Transfer WhileInfo from ForInfo failed, node:%s.", node->GetName().c_str()); + "[Transfer][WhileInfo] from ForInfo failed, node:%s.", node->GetName().c_str()); ComputeGraphPtr cond_graph = BuildCondGraph(while_info); if ((cond_graph == nullptr) || (root_graph->AddSubgraph(cond_graph) != GRAPH_SUCCESS)) { REPORT_CALL_ERROR("E19999", "Build cond graph failed or add cond subgraph to root_graph:%s failed", root_graph->GetName().c_str()); - GELOGE(FAILED, "Add while_cond_graph failed, node:%s.", node->GetName().c_str()); + GELOGE(FAILED, "[Check][Param] Build cond graph failed or add cond subgraph to root_graph:%s failed.", + root_graph->GetName().c_str()); return FAILED; } @@ -74,12 +75,13 @@ Status ForPass::Run(NodePtr &node) { if ((body_graph == nullptr) || (root_graph->AddSubgraph(body_graph) != GRAPH_SUCCESS)) { REPORT_CALL_ERROR("E19999", "Build body graph failed or add body subgraph to root_graph:%s failed", root_graph->GetName().c_str()); - GELOGE(FAILED, "Add while_body_graph failed, node:%s.", node->GetName().c_str()); + GELOGE(FAILED, "[Check][Param] Build body graph failed or add body subgraph to root_graph:%s failed", + root_graph->GetName().c_str()); return FAILED; } GE_CHK_STATUS_RET(UpdateForBodyInputMapping(while_info), - "Update InputMapping for for-body-graph failed, node:%s.", node->GetName().c_str()); + "[Update][InputMapping] for for-body-graph failed, node:%s.", node->GetName().c_str()); // for node has and only has one subgraph GE_CHECK_NOTNULL(node->GetOpDesc()); @@ -107,7 +109,9 @@ Status ForPass::BuildForInfo(const ComputeGraphPtr &root_graph, const NodePtr &n "in data anchor of op:%s(%s) lack, check invalid", FOR_START_INPUT, FOR_LIMIT_INPUT, FOR_DELTA_INPUT, node->GetName().c_str(), node->GetType().c_str()); - GELOGE(FAILED, "BuildForInfo for %s failed: start/limit/delta is NULL.", node->GetName().c_str()); + GELOGE(FAILED, "[Check][Param] FOR_START_INPUT index:%d or FOR_LIMIT_INPUT index:%d or FOR_DELTA_INPUT index:%d " + "in data anchor of op:%s(%s) lack", + FOR_START_INPUT, FOR_LIMIT_INPUT, FOR_DELTA_INPUT, node->GetName().c_str(), node->GetType().c_str()); return FAILED; } @@ -116,7 +120,7 @@ Status ForPass::BuildForInfo(const ComputeGraphPtr &root_graph, const NodePtr &n std::vector ctrl_inputs; std::vector ctrl_outputs; if (FindInputsAndOutputs(node, data_inputs, data_outputs, ctrl_inputs, ctrl_outputs) != SUCCESS) { - GELOGE(FAILED, "BuildForInfo for %s failed: find inputs/outputs failed.", node->GetName().c_str()); + GELOGE(FAILED, "[Find][InputsAndOutputs] in node:%s failed.", node->GetName().c_str()); return FAILED; } NodeUtils::UnlinkAll(*node); @@ -128,14 +132,16 @@ Status ForPass::BuildForInfo(const ComputeGraphPtr &root_graph, const NodePtr &n if (for_body_name.empty()) { REPORT_INNER_ERROR("E19999", "Get subgraph name from op:%s(%s) by index 0 failed", op_desc->GetName().c_str(), op_desc->GetType().c_str()); - GELOGE(FAILED, "BuildForInfo for %s failed: sub_graph_name is empty.", node->GetName().c_str()); + GELOGE(FAILED, "[Get][SubGraphName] from op:%s(%s) by index 0 failed", + op_desc->GetName().c_str(), op_desc->GetType().c_str()); return FAILED; } ComputeGraphPtr for_body = root_graph->GetSubgraph(for_body_name); if (for_body == nullptr) { REPORT_INNER_ERROR("E19999", "Get subgraph from graph:%s by name:%s failed", root_graph->GetName().c_str(), for_body_name.c_str()); - GELOGE(FAILED, "BuildForInfo for %s failed: for_body_graph is NULL.", node->GetName().c_str()); + GELOGE(FAILED, "[Get][SubGraph] from graph:%s by name:%s failed", + root_graph->GetName().c_str(), for_body_name.c_str()); return FAILED; } @@ -162,13 +168,14 @@ Status ForPass::BuildForInfo(const ComputeGraphPtr &root_graph, const NodePtr &n /// OutDataAnchorPtr ForPass::FindInputWithIndex(const NodePtr &node, uint32_t index) { if (node == nullptr) { - GELOGE(FAILED, "FindInputWithIndex failed: node is NULL."); + GELOGE(FAILED, "[Check][Param] node is nullptr."); return nullptr; } InDataAnchorPtr in_data_anchor = node->GetInDataAnchor(index); if (in_data_anchor == nullptr) { - GELOGE(FAILED, "FindInputWithIndex %s:%u failed: in_data_anchor is NULL.", node->GetName().c_str(), index); + GELOGE(FAILED, "[Get][InDataAnchor] failed, In Data Anchor index:%u in node:%s is nullptr.", + index, node->GetName().c_str()); return nullptr; } @@ -234,9 +241,8 @@ Status ForPass::TranWhileInfo(const ComputeGraphPtr &graph, const ForInfo &for_i std::string i_name = for_name + "_i"; NodePtr i_node = graph->AddNode(CreateConstDesc(i_name, 0)); if (i_node == nullptr) { - REPORT_CALL_ERROR("E19999", "Add node:%s(Const) to graph:%s failed", - i_name.c_str(), graph->GetName().c_str()); - GELOGE(FAILED, "TranWhileInfo failed: create i_node failed."); + REPORT_CALL_ERROR("E19999", "Add node:%s(Const) to graph:%s failed", i_name.c_str(), graph->GetName().c_str()); + GELOGE(FAILED, "[Add][Node] %s(Const) to graph:%s failed", i_name.c_str(), graph->GetName().c_str()); return FAILED; } AddRePassNode(i_node); @@ -249,7 +255,9 @@ Status ForPass::TranWhileInfo(const ComputeGraphPtr &graph, const ForInfo &for_i REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(index:0) and op:%s(%s)(index:0) failed", i_node->GetName().c_str(), i_node->GetType().c_str(), identity_node->GetName().c_str(), identity_node->GetType().c_str()); - GELOGE(FAILED, "TranWhileInfo failed: Add data-edge %s:0->%s:0 failed.", i_name.c_str(), identity_name.c_str()); + GELOGE(FAILED, "[Add][Edge] between op:%s(%s)(index:0) and op:%s(%s)(index:0) failed", + i_node->GetName().c_str(), i_node->GetType().c_str(), + identity_node->GetName().c_str(), identity_node->GetType().c_str()); return FAILED; } AddRePassNode(identity_node); @@ -259,21 +267,22 @@ Status ForPass::TranWhileInfo(const ComputeGraphPtr &graph, const ForInfo &for_i if (i_input == nullptr) { REPORT_INNER_ERROR("E19999", "Out data anchor index:0 in op:%s(%s) is nullptr, check invalid", identity_node->GetName().c_str(), identity_node->GetType().c_str()); - GELOGE(FAILED, "TranWhileInfo failed: i_input is NULL."); + GELOGE(FAILED, "[Get][OutDataAnchor] failed, Out data anchor index:0 in op:%s(%s) is nullptr", + identity_node->GetName().c_str(), identity_node->GetType().c_str()); return FAILED; } OutDataAnchorPtr range_input = nullptr; OutDataAnchorPtr abs_delta_input = nullptr; if (CreateLoopInput(graph, for_info, range_input, abs_delta_input) != SUCCESS) { - GELOGE(FAILED, "TranWhileInfo failed: create loop input failed."); + GELOGE(FAILED, "[Create][LoopInput] failed, graph:%s.", graph->GetName().c_str()); return FAILED; } BuildWhileInfo(for_info, i_input, range_input, abs_delta_input, while_info); if (InsertWhileNode(graph, for_name + "_While", while_info) != SUCCESS) { - GELOGE(FAILED, "TranWhileInfo failed: insert while node failed."); + GELOGE(FAILED, "[Insert][WhileNode] in graph:%s failed.", graph->GetName().c_str()); return FAILED; } @@ -292,7 +301,7 @@ OpDescPtr ForPass::CreateConstDesc(const std::string &name, int32_t value) { OpDescPtr const_op_desc = MakeShared(name, CONSTANT); if (const_op_desc == nullptr) { REPORT_CALL_ERROR("E19999", "New OpDesc failed"); - GELOGE(FAILED, "Create op_desc failed, const:%s.", name.c_str()); + GELOGE(FAILED, "[New][OpDesc] failed."); return nullptr; } @@ -300,21 +309,23 @@ OpDescPtr ForPass::CreateConstDesc(const std::string &name, int32_t value) { GeTensorPtr const_value = MakeShared(data_desc, reinterpret_cast(&value), sizeof(int32_t)); if (const_value == nullptr) { REPORT_CALL_ERROR("E19999", "New GeTensor failed"); - GELOGE(FAILED, "Create tensor failed, const:%s.", name.c_str()); + GELOGE(FAILED, "[New][GeTensor] failed"); return nullptr; } if (!AttrUtils::SetTensor(const_op_desc, ATTR_NAME_WEIGHTS, const_value)) { REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed", ATTR_NAME_WEIGHTS.c_str(), const_op_desc->GetName().c_str(), const_op_desc->GetType().c_str()); - GELOGE(FAILED, "Set ATTR_NAME_WEIGHTS failed, const:%s.", name.c_str()); + GELOGE(FAILED, "[Set][Attr] %s to op:%s(%s) failed", ATTR_NAME_WEIGHTS.c_str(), + const_op_desc->GetName().c_str(), const_op_desc->GetType().c_str()); return nullptr; } if (const_op_desc->AddOutputDesc("y", data_desc) != GRAPH_SUCCESS) { REPORT_CALL_ERROR("E19999", "Add ouput desc to op:%s(%s) failed, name:y", const_op_desc->GetName().c_str(), const_op_desc->GetType().c_str()); - GELOGE(FAILED, "Add output desc failed, const:%s.", name.c_str()); + GELOGE(FAILED, "[Add][OutputDesc] to op:%s(%s) failed, name:y", + const_op_desc->GetName().c_str(), const_op_desc->GetType().c_str()); return nullptr; } @@ -360,7 +371,7 @@ Status ForPass::CreateLoopInput(const ComputeGraphPtr &graph, const ForInfo &for std::string error_msg; if ((graph_builder.Build(error_code, error_msg) == nullptr) || (error_code != GRAPH_SUCCESS)) { REPORT_CALL_ERROR("E19999", "Add loop input node to graph:%s failed", graph->GetName().c_str()); - GELOGE(FAILED, "Create loop_count node failed: error_code:%u, error_msg:%s.", error_code, error_msg.c_str()); + GELOGE(FAILED, "[Create][LoopInputNode] failed: error_code:%u, error_msg:%s.", error_code, error_msg.c_str()); return FAILED; } @@ -373,7 +384,7 @@ Status ForPass::CreateLoopInput(const ComputeGraphPtr &graph, const ForInfo &for NodePtr loop_count_node = graph_builder.GetNode(abs_name_1); if ((abs_delta_node == nullptr) || (loop_count_node == nullptr)) { REPORT_CALL_ERROR("E19999", "Add loop input node to graph:%s failed", graph->GetName().c_str()); - GELOGE(FAILED, "Create loop node failed: node is NULL."); + GELOGE(FAILED, "[Create][LoopNode] failed: node is nullptr, graph:%s.", graph->GetName().c_str()); return FAILED; } @@ -467,14 +478,15 @@ Status ForPass::InsertWhileNode(const ComputeGraphPtr &graph, const std::string if (while_node == nullptr) { REPORT_CALL_ERROR("E19999", "Add node:%s(%s) to graph:%s failed", op_desc->GetName().c_str(), op_desc->GetType().c_str(), graph->GetName().c_str()); - GELOGE(FAILED, "Create while node failed, name:%s.", name.c_str()); + GELOGE(FAILED, "[Add][Node] %s(%s) to graph:%s failed", + op_desc->GetName().c_str(), op_desc->GetType().c_str(), graph->GetName().c_str()); return FAILED; } AddRePassNode(while_node); while_info.while_node = while_node; if (BuildWhileLink(while_info) != SUCCESS) { - GELOGE(FAILED, "Build while link-edge failed, name:%s.", name.c_str()); + GELOGE(FAILED, "[Build][WhileLink] failed, node:%s.", while_node->GetName().c_str()); return FAILED; } @@ -500,7 +512,7 @@ Status ForPass::BuildWhileLink(const WhileInfo &while_info) { continue; } GE_CHK_GRAPH_STATUS_RET(GraphUtils::AddEdge(peer_out_anchor, in_data_anchor), - "Add data-edge %s:%d->%s:%zu failed.", + "[Add][DataEdge] %s:%d->%s:%zu failed.", peer_out_anchor->GetOwnerNode()->GetName().c_str(), peer_out_anchor->GetIdx(), while_node->GetName().c_str(), i); } @@ -511,7 +523,7 @@ Status ForPass::BuildWhileLink(const WhileInfo &while_info) { GE_CHECK_NOTNULL(out_data_anchor); for (auto &peer_in_anchor : while_info.data_outputs[i]) { GE_CHK_GRAPH_STATUS_RET(GraphUtils::AddEdge(out_data_anchor, peer_in_anchor), - "Add data-edge %s:%zu->%s:%d failed.", + "[Add][DataEdge] %s:%zu->%s:%d failed.", while_node->GetName().c_str(), i + kWhileOutputIndex, peer_in_anchor->GetOwnerNode()->GetName().c_str(), peer_in_anchor->GetIdx()); } @@ -521,7 +533,7 @@ Status ForPass::BuildWhileLink(const WhileInfo &while_info) { GE_CHECK_NOTNULL(in_ctrl_anchor); for (auto &peer_out_anchor : while_info.ctrl_inputs) { GE_CHK_GRAPH_STATUS_RET(GraphUtils::AddEdge(peer_out_anchor, in_ctrl_anchor), - "Add ctrl-edge %s->%s failed.", + "[Add][CtrlEdge] %s->%s failed.", peer_out_anchor->GetOwnerNode()->GetName().c_str(), in_ctrl_anchor->GetOwnerNode()->GetName().c_str()); } @@ -530,7 +542,7 @@ Status ForPass::BuildWhileLink(const WhileInfo &while_info) { GE_CHECK_NOTNULL(out_ctrl_anchor); for (auto &peer_in_anchor : while_info.ctrl_outputs) { GE_CHK_GRAPH_STATUS_RET(GraphUtils::AddEdge(out_ctrl_anchor, peer_in_anchor), - "Add ctrl-edge %s->%s failed.", + "[Add][CtrlEdge] %s->%s failed.", out_ctrl_anchor->GetOwnerNode()->GetName().c_str(), peer_in_anchor->GetOwnerNode()->GetName().c_str()); } @@ -585,7 +597,7 @@ ComputeGraphPtr ForPass::BuildCondGraph(WhileInfo &while_info) { ComputeGraphPtr cond_graph = graph_builder.Build(error_code, error_msg); if (cond_graph == nullptr) { REPORT_CALL_ERROR("E19999", "Build graph:%s failed", cond_name.c_str()); - GELOGE(FAILED, "Build cond_graph failed: error_code:%u, error_msg:%s.", error_code, error_msg.c_str()); + GELOGE(FAILED, "[Build][CondGraph] failed: error_code:%u, error_msg:%s.", error_code, error_msg.c_str()); return nullptr; } @@ -667,13 +679,13 @@ ComputeGraphPtr ForPass::BuildBodyGraph(WhileInfo &while_info) { std::string error_msg; ComputeGraphPtr body_graph = graph_builder.Build(error_code, error_msg); if (body_graph == nullptr) { - GELOGE(FAILED, "Build body_graph failed: error_code:%u, error_msg:%s.", error_code, error_msg.c_str()); + GELOGE(FAILED, "[Build][BodyGraph] failed: error_code:%u, error_msg:%s.", error_code, error_msg.c_str()); return nullptr; } NodePtr sub_graph_node = graph_builder.GetNode(sub_graph_node_name); if (sub_graph_node == nullptr) { - GELOGE(FAILED, "Get sub_graph_node failed: name:%s.", sub_graph_node_name.c_str()); + GELOGE(FAILED, "[Get][Node] by name:%s failed.", sub_graph_node_name.c_str()); return nullptr; } while_info.sub_graph_node = sub_graph_node; @@ -699,9 +711,8 @@ OpDescPtr ForPass::CreateSubgraphOpDesc(const std::string &name, uint32_t input_ OpDescPtr op_desc = op_desc_builder.Build(); if (op_desc == nullptr) { - REPORT_CALL_ERROR("E19999", "Build op_desc:%s(%s) failed", - name.c_str(), PARTITIONEDCALL); - GELOGE(FAILED, "Create op_desc for subgraph node failed, name:%s.", name.c_str()); + REPORT_CALL_ERROR("E19999", "Build op_desc:%s(%s) failed", name.c_str(), PARTITIONEDCALL); + GELOGE(FAILED, "[Build][OpDesc] %s(%s) failed", name.c_str(), PARTITIONEDCALL); return nullptr; } diff --git a/ge/graph/passes/fuse_data_nodes_with_common_input_pass.cc b/ge/graph/passes/fuse_data_nodes_with_common_input_pass.cc index 1f062813..ec7b2388 100644 --- a/ge/graph/passes/fuse_data_nodes_with_common_input_pass.cc +++ b/ge/graph/passes/fuse_data_nodes_with_common_input_pass.cc @@ -35,14 +35,14 @@ namespace ge { Status FuseDataNodesWithCommonInputPass::Run(ge::ComputeGraphPtr graph) { if (graph == nullptr) { REPORT_INNER_ERROR("E19999", "Param graph is nullptr, check invalid"); - GELOGE(GE_GRAPH_PARAM_NULLPTR, "Compute graph is null."); + GELOGE(GE_GRAPH_PARAM_NULLPTR, "[Check][Param] Compute graph is nullptr."); return GE_GRAPH_PARAM_NULLPTR; } GELOGD("FuseDataNodesWithCommonInputPass in."); // key: subgraph, value:--key: peer out anchor to parent node, --value: parent indexes to parent node map>> subgraphs_to_need_fuse_nodes_info; if (InitNeedFuseNodesInfo(graph, subgraphs_to_need_fuse_nodes_info) != SUCCESS) { - GELOGE(FAILED, "InitNeedFuseNodesInfo failed."); + GELOGE(FAILED, "[Init][NeedFuseNodesInfo] for graph:%s failed.", graph->GetName().c_str()); return FAILED; } return FuseDataNodes(subgraphs_to_need_fuse_nodes_info); @@ -116,7 +116,8 @@ Status FuseDataNodesWithCommonInputPass::FuseDataNodes( if (GraphUtils::RemoveNodeWithoutRelink(subgraph, node) != SUCCESS) { REPORT_CALL_ERROR("E19999", "Remove node:%s(%s) without relink in graph:%s failed", node->GetName().c_str(), node->GetType().c_str(), subgraph->GetName().c_str()); - GELOGE(FAILED, "[%s] RemoveNodeWithoutRelink failed.", node->GetName().c_str()); + GELOGE(FAILED, "[Remove][Node] %s(%s) without relink in graph:%s failed", + node->GetName().c_str(), node->GetType().c_str(), subgraph->GetName().c_str()); return FAILED; } } diff --git a/ge/graph/passes/get_original_format_pass.cc b/ge/graph/passes/get_original_format_pass.cc index 4b78ae49..670cd50c 100644 --- a/ge/graph/passes/get_original_format_pass.cc +++ b/ge/graph/passes/get_original_format_pass.cc @@ -37,7 +37,8 @@ using domi::SUCCESS; namespace ge { Status GetOriginalFormatPass::Run(ge::ComputeGraphPtr graph) { GE_CHECK_NOTNULL(graph); - GE_RETURN_WITH_LOG_IF_ERROR(SetOriginalFormat(graph), "SetOriginalFormat failed"); + GE_RETURN_WITH_LOG_IF_ERROR(SetOriginalFormat(graph), + "[Set][OriginalFormat] for graph:%s failed", graph->GetName().c_str()); return SUCCESS; } @@ -54,7 +55,8 @@ Status GetOriginalFormatPass::SetOriginalFormat(const ge::ComputeGraphPtr &graph REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed", ATTR_NAME_INFERRED_FORMAT.c_str(), node_ptr->GetName().c_str(), node_ptr->GetType().c_str()); - GELOGE(FAILED, "set ATTR_NAME_INFERRED_FORMAT failed"); + GELOGE(FAILED, "[Set][Attr] %s to op:%s(%s) failed", ATTR_NAME_INFERRED_FORMAT.c_str(), + node_ptr->GetName().c_str(), node_ptr->GetType().c_str()); return FAILED); } @@ -70,13 +72,15 @@ Status GetOriginalFormatPass::SetOriginalFormat(const ge::ComputeGraphPtr &graph REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed", ATTR_NAME_FORMAT.c_str(), desc_ptr->GetName().c_str(), desc_ptr->GetType().c_str()); - GELOGE(FAILED, "set ATTR_NAME_FORMAT failed"); + GELOGE(FAILED, "[Set][Attr] %s to op:%s(%s) failed", ATTR_NAME_FORMAT.c_str(), + desc_ptr->GetName().c_str(), desc_ptr->GetType().c_str()); return FAILED); GE_IF_BOOL_EXEC(!AttrUtils::SetInt(desc_ptr, ATTR_NAME_INFERRED_FORMAT, ori_format), REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed", ATTR_NAME_INFERRED_FORMAT.c_str(), desc_ptr->GetName().c_str(), desc_ptr->GetType().c_str()); - GELOGE(FAILED, "set ATTR_NAME_INFERRED_FORMAT failed"); + GELOGE(FAILED, "[Set][Attr] %s to op:%s(%s) failed", ATTR_NAME_INFERRED_FORMAT.c_str(), + desc_ptr->GetName().c_str(), desc_ptr->GetType().c_str()); return FAILED); continue; } @@ -142,7 +146,8 @@ Status GetOriginalFormatPass::SetOriginalFormat(const ge::ComputeGraphPtr &graph REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed", ATTR_NAME_IGNORE_PRED_FORMAT.c_str(), tmp_op_ptr->GetName().c_str(), tmp_op_ptr->GetType().c_str()); - GELOGE(FAILED, "remove edge failed"); + GELOGE(FAILED, "[Set][Attr] %s to op:%s(%s) failed", ATTR_NAME_IGNORE_PRED_FORMAT.c_str(), + tmp_op_ptr->GetName().c_str(), tmp_op_ptr->GetType().c_str()); return FAILED); } @@ -152,23 +157,27 @@ Status GetOriginalFormatPass::SetOriginalFormat(const ge::ComputeGraphPtr &graph REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed", ATTR_NAME_FORMAT.c_str(), tmp_op_ptr->GetName().c_str(), tmp_op_ptr->GetType().c_str()); - GELOGE(FAILED, "set ATTR_NAME_FORMAT failed"); + GELOGE(FAILED, "[Set][Attr] %s to op:%s(%s) failed", ATTR_NAME_FORMAT.c_str(), + tmp_op_ptr->GetName().c_str(), tmp_op_ptr->GetType().c_str()); return FAILED); GE_IF_BOOL_EXEC(!AttrUtils::SetInt(tmp_op_ptr, ATTR_NAME_INFERRED_FORMAT, ori_format), REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed", ATTR_NAME_INFERRED_FORMAT.c_str(), tmp_op_ptr->GetName().c_str(), tmp_op_ptr->GetType().c_str()); - GELOGE(FAILED, "set ATTR_NAME_INFERRED_FORMAT failed"); + GELOGE(FAILED, "[Set][Attr] %s to op:%s(%s) failed", ATTR_NAME_INFERRED_FORMAT.c_str(), + tmp_op_ptr->GetName().c_str(), tmp_op_ptr->GetType().c_str()); return FAILED); } else { int64_t existingFormat = 0; GE_RETURN_WITH_LOG_IF_FALSE(AttrUtils::GetInt(tmp_op_ptr, ATTR_NAME_FORMAT, existingFormat), - "Get existing_format attr failed"); + "[Get][Attr] %s from op:%s(%s) failed", ATTR_NAME_FORMAT.c_str(), + tmp_op_ptr->GetName().c_str(), tmp_op_ptr->GetType().c_str()); if (!AttrUtils::SetInt(tmp_op_ptr, ATTR_NAME_INFERRED_FORMAT, existingFormat)) { REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed", ATTR_NAME_INFERRED_FORMAT.c_str(), tmp_op_ptr->GetName().c_str(), tmp_op_ptr->GetType().c_str()); - GELOGE(FAILED, "set ATTR_NAME_INFERRED_FORMAT failed"); + GELOGE(FAILED, "[Set][Attr] %s to op:%s(%s) failed", ATTR_NAME_INFERRED_FORMAT.c_str(), + tmp_op_ptr->GetName().c_str(), tmp_op_ptr->GetType().c_str()); return FAILED; } } @@ -177,7 +186,7 @@ Status GetOriginalFormatPass::SetOriginalFormat(const ge::ComputeGraphPtr &graph } bool GetOriginalFormatPass::IsFormatTranspose(const ge::OpDescPtr op_ptr, int32_t ori_format) { - GE_CHK_BOOL_EXEC(op_ptr != nullptr, return false, "opdef is nullptr"); + GE_CHK_BOOL_EXEC(op_ptr != nullptr, return false, "[Check][Param] op_ptr is nullptr"); if (op_ptr->GetType() == PERMUTE) { vector index_list; GE_IF_BOOL_EXEC(!AttrUtils::GetListInt(op_ptr, PERMUTE_ATTR_ORDER, index_list), return false); diff --git a/ge/graph/passes/global_step_insert_pass.cc b/ge/graph/passes/global_step_insert_pass.cc index d702e758..f27641fc 100755 --- a/ge/graph/passes/global_step_insert_pass.cc +++ b/ge/graph/passes/global_step_insert_pass.cc @@ -41,7 +41,7 @@ NodePtr GlobalStepInsertPass::InsertOp(ComputeGraphPtr &compute_graph, OpDescPtr op_desc = MakeShared(node_name, node_type); GE_IF_BOOL_EXEC(op_desc == nullptr, REPORT_CALL_ERROR("E19999", "New OpDesc failed"); - GELOGE(FAILED,"Make OpDesc failed"); + GELOGE(FAILED,"[New][OpDesc] failed"); return nullptr); for (auto &input_desc : input_list) { @@ -49,7 +49,8 @@ NodePtr GlobalStepInsertPass::InsertOp(ComputeGraphPtr &compute_graph, if (graph_status != GRAPH_SUCCESS) { REPORT_CALL_ERROR("E19999", "Add input desc to op:%s(%s) failed", op_desc->GetName().c_str(), op_desc->GetType().c_str()); - GELOGE(FAILED, "Add node:%s intput desc failed, error=%u.", node_name.c_str(), graph_status); + GELOGE(FAILED, "[Add][InputDesc] to op:%s(%s) failed", + op_desc->GetName().c_str(), op_desc->GetType().c_str()); return nullptr; } } @@ -59,17 +60,19 @@ NodePtr GlobalStepInsertPass::InsertOp(ComputeGraphPtr &compute_graph, if (graph_status != GRAPH_SUCCESS) { REPORT_CALL_ERROR("E19999", "Add output desc to op:%s(%s) failed", op_desc->GetName().c_str(), op_desc->GetType().c_str()); - GELOGE(FAILED, "Add node:%s output desc failed, error=%u.", node_name.c_str(), graph_status); + GELOGE(FAILED, "[Add][OutputDesc] to op:%s(%s) failed, ret:%u.", + op_desc->GetName().c_str(), op_desc->GetType().c_str(), graph_status); return nullptr; } } - GE_IF_BOOL_EXEC(compute_graph == nullptr, GELOGE(FAILED,"compute_graph is nullptr"); return nullptr); + GE_IF_BOOL_EXEC(compute_graph == nullptr, GELOGE(FAILED,"[Check][Param] compute_graph is nullptr"); return nullptr); NodePtr node = compute_graph->AddNode(op_desc); GE_IF_BOOL_EXEC(node == nullptr, REPORT_CALL_ERROR("E19999", "Add node:%s(%s) to graph:%s failed", op_desc->GetName().c_str(), op_desc->GetType().c_str(), compute_graph->GetName().c_str()); - GELOGE(FAILED, "add node failed, name:%s, type:%s.", node_name.c_str(), node_type.c_str()); + GELOGE(FAILED, "[Add][Node] %s(%s) to graph:%s failed", + op_desc->GetName().c_str(), op_desc->GetType().c_str(), compute_graph->GetName().c_str()); return nullptr); GELOGI("Insert op success, name:%s, type:%s.", node_name.c_str(), node_type.c_str()); @@ -107,7 +110,7 @@ Status GlobalStepInsertPass::Run(ComputeGraphPtr compute_graph) { NodePtr global_step = InsertOp(compute_graph, VARIABLE, NODE_NAME_GLOBAL_STEP, input_desc_list, output_desc_list); if (global_step == nullptr) { - GELOGE(FAILED, "Add global_step node failed, global_step is null."); + GELOGE(FAILED, "[Insert][Op] to graph:%s failed.", compute_graph->GetName().c_str()); return FAILED; } @@ -117,7 +120,9 @@ Status GlobalStepInsertPass::Run(ComputeGraphPtr compute_graph) { REPORT_CALL_ERROR("E19999", "Add control edge between op:%s(%s) and op:%s(%s) failed", global_step->GetName().c_str(), global_step->GetType().c_str(), output_node->GetName().c_str(), output_node->GetType().c_str()); - GELOGE(FAILED, "Add global_step to netoutput edge failed, add_ret=%u.", add_ret); + GELOGE(FAILED, "[Add][ControlEdge] between op:%s(%s) and op:%s(%s) failed", + global_step->GetName().c_str(), global_step->GetType().c_str(), + output_node->GetName().c_str(), output_node->GetType().c_str()); return FAILED; } GELOGD("Add global_step to netoutput edge in graph %u success", compute_graph->GetGraphID()); diff --git a/ge/graph/passes/guarantee_const_pass.cc b/ge/graph/passes/guarantee_const_pass.cc index f6567fce..1d369f38 100644 --- a/ge/graph/passes/guarantee_const_pass.cc +++ b/ge/graph/passes/guarantee_const_pass.cc @@ -36,19 +36,20 @@ Status GuaranteeConstPass::Run(NodePtr &node) { string type; Status status_ret = GetOriginalType(node, type); if (status_ret != SUCCESS) { - REPORT_CALL_ERROR("E19999", "Get original type for node:%s failed", - node->GetName().c_str()); - GELOGE(status_ret, "GuaranteeConstPass get original type fail."); + REPORT_CALL_ERROR("E19999", "Get original type for node:%s failed", node->GetName().c_str()); + GELOGE(status_ret, "[Get][OriginalType] for node:%s failed", node->GetName().c_str()); return status_ret; } if (type != GUARANTEECONST) { return SUCCESS; } if (node->GetOpDesc()->GetAllInputsDesc().size() != kGuaranteeConstInputsSize) { - REPORT_CALL_ERROR("E19999", "Num:%zu of input desc node:%s(%s) not equal to %u, " + REPORT_CALL_ERROR("E19999", "Num:%zu of input desc in node:%s(%s) not equal to %u, " "check invalid", node->GetOpDesc()->GetAllInputsDesc().size(), node->GetName().c_str(), node->GetType().c_str(), kGuaranteeConstInputsSize); - GELOGE(PARAM_INVALID, "input size error. Input size:%zu", node->GetOpDesc()->GetAllInputsDesc().size()); + GELOGE(PARAM_INVALID, "[Check][Param] Num:%zu of input desc in node:%s(%s) not equal to %u", + node->GetOpDesc()->GetAllInputsDesc().size(), + node->GetName().c_str(), node->GetType().c_str(), kGuaranteeConstInputsSize); return PARAM_INVALID; } // [Cascade pointer] @@ -57,12 +58,13 @@ Status GuaranteeConstPass::Run(NodePtr &node) { // Input tensor cannot be a resource variable handle. const DataType &input_dtype = in_desc->GetDataType(); if (input_dtype == DT_RESOURCE) { - REPORT_CALL_ERROR("E19999", - "Data type:%s of op:%s(%s) input0 tensor not equal to %s, check invalid", + REPORT_CALL_ERROR("E19999", "Data type:%s of op:%s(%s) input0 tensor not equal to %s, check invalid", TypeUtils::DataTypeToSerialString(input_dtype).c_str(), node->GetName().c_str(), node->GetType().c_str(), TypeUtils::DataTypeToSerialString(DT_RESOURCE).c_str()); - GELOGE(FAILED, "Input tensor cannot be a resource variable handle in [%s].", node->GetName().c_str()); + GELOGE(FAILED, "[Check][Param] Data type:%s of op:%s(%s) input0 tensor not equal to %s", + TypeUtils::DataTypeToSerialString(input_dtype).c_str(), + node->GetName().c_str(), node->GetType().c_str(), TypeUtils::DataTypeToSerialString(DT_RESOURCE).c_str()); return FAILED; } diff --git a/ge/graph/preprocess/graph_preprocess.cc b/ge/graph/preprocess/graph_preprocess.cc index 86abbacc..e1921f29 100644 --- a/ge/graph/preprocess/graph_preprocess.cc +++ b/ge/graph/preprocess/graph_preprocess.cc @@ -102,7 +102,7 @@ OpDescPtr CreateTensorShape(const GeTensorDesc &data_tensor) { GeTensorPtr tensor = MakeShared(); if (tensor == nullptr) { REPORT_CALL_ERROR("E19999", "New GeTensor failed"); - GELOGE(INTERNAL_ERROR, "Create shared ptr for GeTensor failed"); + GELOGE(INTERNAL_ERROR, "[New][GeTensor] failed"); return nullptr; } tensor->MutableTensorDesc().SetDataType(DT_INT32); @@ -114,7 +114,7 @@ OpDescPtr CreateTensorShape(const GeTensorDesc &data_tensor) { int32_t dst_shape = 1; if (tensor->SetData(reinterpret_cast(&dst_shape), sizeof(int32_t)) != GRAPH_SUCCESS) { REPORT_CALL_ERROR("E19999", "Set data to tensor failed"); - GELOGE(INTERNAL_ERROR, "tensor set data failed"); + GELOGE(INTERNAL_ERROR, "[Set][Data] to tensor failed"); return nullptr; } } else { @@ -122,7 +122,7 @@ OpDescPtr CreateTensorShape(const GeTensorDesc &data_tensor) { unique_ptr dst_shape(new (std::nothrow) int32_t[dim_cnt]()); if (dst_shape == nullptr) { REPORT_CALL_ERROR("E19999", "Malloc buffer failed, size:%zu", dim_cnt); - GELOGE(INTERNAL_ERROR, "Create unique ptr failed"); + GELOGE(INTERNAL_ERROR, "[Malloc][Buffer] failed, size:%zu", dim_cnt); return nullptr; } for (int64_t i = 0; i < dim_cnt; ++i) { @@ -132,7 +132,7 @@ OpDescPtr CreateTensorShape(const GeTensorDesc &data_tensor) { GE_IF_BOOL_EXEC( tensor->SetData(reinterpret_cast(dst_shape.get()), dim_cnt * sizeof(int32_t)) != GRAPH_SUCCESS, REPORT_CALL_ERROR("E19999", "Set data to tensor failed"); - GELOGE(INTERNAL_ERROR, "tensor set data failed"); + GELOGE(INTERNAL_ERROR, "[Set][Data] to tensor failed"); return nullptr;) } @@ -180,14 +180,16 @@ NodePtr CreateTransNode(const std::string &name, const std::string &node_type, c if (node == nullptr) { REPORT_INNER_ERROR("E19999", "Param node is nullptr, trans_name:%s, trans_type:%s, check invalid", name.c_str(), node_type.c_str()); - GELOGE(PARAM_INVALID, "node is null."); + GELOGE(PARAM_INVALID, "[Check][Param] Param node is nullptr, trans_name:%s, trans_type:%s", + name.c_str(), node_type.c_str()); return nullptr; } auto graph = node->GetOwnerComputeGraph(); if (graph == nullptr) { REPORT_INNER_ERROR("E19999", "Owner graph in node is nullptr, trans_name:%s, trans_type:%s, check invalid", name.c_str(), node_type.c_str()); - GELOGE(PARAM_INVALID, "Owner graph is null, node name:%s.", node->GetName().c_str()); + GELOGE(PARAM_INVALID, "[Get][OwnerGraph] in node is nullptr, trans_name:%s, trans_type:%s", + name.c_str(), node_type.c_str()); return nullptr; } @@ -196,14 +198,15 @@ NodePtr CreateTransNode(const std::string &name, const std::string &node_type, c ErrorManager::GetInstance().ATCReportErrMessage( "E19025", {"situation", "reason"}, {"The trans node type[" + node_type + "]", "it must be " + TransOpUtil::TransopMapToString()}); - GELOGE(INTERNAL_ERROR, "The trans node type %s does not exists", node_type.c_str()); + GELOGE(INTERNAL_ERROR, "[Check][Param] The trans node type %s does not exists", node_type.c_str()); return nullptr; } OpDescPtr op_desc = MakeShared(name, node_type); if (op_desc == nullptr) { - REPORT_CALL_ERROR("E19999", "New OpDesc failed, trans_name:%s, trans_type:%s,", + REPORT_CALL_ERROR("E19999", "New OpDesc failed, trans_name:%s, trans_type:%s", name.c_str(), node_type.c_str()); - GELOGE(INTERNAL_ERROR, "Create shared ptr for OpDesc failed"); + GELOGE(INTERNAL_ERROR, "[New][OpDesc] failed, trans_name:%s, trans_type:%s", + name.c_str(), node_type.c_str()); return nullptr; } @@ -217,14 +220,16 @@ NodePtr CreateTransNode(const std::string &name, const std::string &node_type, c if (ret != GRAPH_SUCCESS) { REPORT_CALL_ERROR("E19999", "Add input desc into op:%s(%s) failed", op_desc->GetName().c_str(), op_desc->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "Failed to add input desc when create node %s type %s", name.c_str(), node_type.c_str()); + GELOGE(INTERNAL_ERROR, "[Add][InputDesc] into op:%s(%s) failed", + op_desc->GetName().c_str(), op_desc->GetType().c_str()); return nullptr; } ret = op_desc->AddOutputDesc(output); if (ret != GRAPH_SUCCESS) { REPORT_CALL_ERROR("E19999", "Add output desc into op:%s(%s) failed", op_desc->GetName().c_str(), op_desc->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "Failed to add output desc when create node %s type %s", name.c_str(), node_type.c_str()); + GELOGE(INTERNAL_ERROR, "[Add][OutputDesc] into op:%s(%s) failed", + op_desc->GetName().c_str(), op_desc->GetType().c_str()); return nullptr; } @@ -234,7 +239,7 @@ NodePtr CreateTransNode(const std::string &name, const std::string &node_type, c if (node_type == RESHAPE) { auto shape_desc = CreateTensorShape(output); if (shape_desc == nullptr) { - GELOGE(INTERNAL_ERROR, "Failed to add shape for reshape %s, can not create the shape input", + GELOGE(INTERNAL_ERROR, "[Create][TensorShape] Failed to add shape for reshape %s", node->GetName().c_str()); return nullptr; } @@ -242,7 +247,8 @@ NodePtr CreateTransNode(const std::string &name, const std::string &node_type, c if (ret != GRAPH_SUCCESS) { REPORT_CALL_ERROR("E19999", "Add input desc into op:%s(%s) failed", op_desc->GetName().c_str(), op_desc->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "Failed to add the first input for reshape %s", name.c_str()); + GELOGE(INTERNAL_ERROR, "[Add][InputDesc] into op:%s(%s) failed", + op_desc->GetName().c_str(), op_desc->GetType().c_str()); return nullptr; } @@ -251,7 +257,8 @@ NodePtr CreateTransNode(const std::string &name, const std::string &node_type, c REPORT_CALL_ERROR("E19999", "Add node:%s(%s) to graph:%s failed", shape_desc->GetName().c_str(), shape_desc->GetType().c_str(), graph->GetName().c_str()); - GELOGE(INTERNAL_ERROR, "Failed to add shape node for reshape %s, can not add the shape to graph", name.c_str()); + GELOGE(INTERNAL_ERROR, "[Add][Node] %s(%s) to graph:%s failed", + shape_desc->GetName().c_str(), shape_desc->GetType().c_str(), graph->GetName().c_str()); return nullptr; } } @@ -261,16 +268,19 @@ NodePtr CreateTransNode(const std::string &name, const std::string &node_type, c REPORT_CALL_ERROR("E19999", "Add node:%s(%s) to graph:%s failed", op_desc->GetName().c_str(), op_desc->GetType().c_str(), graph->GetName().c_str()); - GELOGE(INTERNAL_ERROR, "Failed to add trans node %s to graph", name.c_str()); + GELOGE(INTERNAL_ERROR, "[Add][Node] %s(%s) to graph:%s failed", + op_desc->GetName().c_str(), op_desc->GetType().c_str(), graph->GetName().c_str()); return nullptr; } if (node_type == RESHAPE) { if (GraphUtils::AddEdge(shape_node->GetOutDataAnchor(0), trans_node->GetInDataAnchor(1)) != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(out_index:0) and op:%s(%s)(in_index:0) failed", + REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(out_index:0) and op:%s(%s)(in_index:1) failed", shape_node->GetName().c_str(), shape_node->GetType().c_str(), trans_node->GetName().c_str(), trans_node->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "Failed to add shape node for reshape %s, can not add the edge", name.c_str()); + GELOGE(INTERNAL_ERROR, "[Add][Edge] between op:%s(%s)(out_index:0) and op:%s(%s)(in_index:1) failed", + shape_node->GetName().c_str(), shape_node->GetType().c_str(), + trans_node->GetName().c_str(), trans_node->GetType().c_str()); return nullptr; } } @@ -291,8 +301,9 @@ Status RecoverOneTransNodeForVar(const std::string &name, const TransNodeInfo &t REPORT_CALL_ERROR("E19999", "Replace out anchors of node:%s(%s) by node:%s(%s) failed", node->GetName().c_str(), node->GetType().c_str(), trans_node->GetName().c_str(), trans_node->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "Failed to replace out anchors when recover trans node for %s type %s", - node->GetName().c_str(), node->GetType().c_str()); + GELOGE(INTERNAL_ERROR, "[Replace][OutAnchors] of node:%s(%s) by node:%s(%s) failed", + node->GetName().c_str(), node->GetType().c_str(), + trans_node->GetName().c_str(), trans_node->GetType().c_str()); return INTERNAL_ERROR; } @@ -301,8 +312,9 @@ Status RecoverOneTransNodeForVar(const std::string &name, const TransNodeInfo &t REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(out_index:0) and op:%s(%s)(in_index:0) failed", node->GetName().c_str(), node->GetType().c_str(), trans_node->GetName().c_str(), trans_node->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "Failed to connect node %s to trans node %s", node->GetName().c_str(), - trans_node->GetName().c_str()); + GELOGE(INTERNAL_ERROR, "[Add][Edge] between op:%s(%s)(out_index:0) and op:%s(%s)(in_index:0) failed", + node->GetName().c_str(), node->GetType().c_str(), + trans_node->GetName().c_str(), trans_node->GetType().c_str()); return INTERNAL_ERROR; } @@ -311,8 +323,9 @@ Status RecoverOneTransNodeForVar(const std::string &name, const TransNodeInfo &t REPORT_CALL_ERROR("E19999", "Move out control edges from node:%s(%s) to node:%s(%s) failed", node->GetName().c_str(), node->GetType().c_str(), trans_node->GetName().c_str(), trans_node->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "Failed to move out control edges from %s to %s when recover trans node.", - node->GetName().c_str(), trans_node->GetName().c_str()); + GELOGE(INTERNAL_ERROR, "[MoveOut][ControlEdges] from node:%s(%s) to node:%s(%s) failed", + node->GetName().c_str(), node->GetType().c_str(), + trans_node->GetName().c_str(), trans_node->GetType().c_str()); return INTERNAL_ERROR; } @@ -332,8 +345,9 @@ Status RecoverOneTransNodeForVarRef(const std::string &name, const TransNodeInfo REPORT_CALL_ERROR("E19999", "Replace out anchors of node:%s(%s) by node:%s(%s) failed", node->GetName().c_str(), node->GetType().c_str(), trans_node->GetName().c_str(), trans_node->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "Failed to replace int anchors when recover trans node for %s type %s", - node->GetName().c_str(), node->GetType().c_str()); + GELOGE(INTERNAL_ERROR, "[Replace][OutAnchors] of node:%s(%s) by node:%s(%s) failed", + node->GetName().c_str(), node->GetType().c_str(), + trans_node->GetName().c_str(), trans_node->GetType().c_str()); return INTERNAL_ERROR; } @@ -342,18 +356,20 @@ Status RecoverOneTransNodeForVarRef(const std::string &name, const TransNodeInfo REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(out_index:0) and op:%s(%s)(in_index:0) failed", trans_node->GetName().c_str(), trans_node->GetType().c_str(), node->GetName().c_str(), node->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "Failed to connect trans node %s to node %s", trans_node->GetName().c_str(), - node->GetName().c_str()); + GELOGE(INTERNAL_ERROR, "[Add][Edge] between op:%s(%s)(out_index:0) and op:%s(%s)(in_index:0) failed", + trans_node->GetName().c_str(), trans_node->GetType().c_str(), + node->GetName().c_str(), node->GetType().c_str()); return INTERNAL_ERROR; } ret = GraphUtils::MoveInCtrlEdges(node, trans_node); if (ret != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Move out control edges from node:%s(%s) to node:%s(%s) failed", + REPORT_CALL_ERROR("E19999", "Move in control edges from node:%s(%s) to node:%s(%s) failed", node->GetName().c_str(), node->GetType().c_str(), trans_node->GetName().c_str(), trans_node->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "Failed to move int control edges from %s to %s when recover trans node.", - node->GetName().c_str(), trans_node->GetName().c_str()); + GELOGE(INTERNAL_ERROR, "[MoveIn][CtrlEdges] from node:%s(%s) to node:%s(%s) failed", + node->GetName().c_str(), node->GetType().c_str(), + trans_node->GetName().c_str(), trans_node->GetType().c_str()); return INTERNAL_ERROR; } @@ -374,7 +390,8 @@ Status UpdateVarFormats(const NodePtr &var, const GeTensorDesc &tensor_desc) { GE_IF_BOOL_EXEC(var->GetOpDesc()->UpdateOutputDesc(0, output_desc) != GRAPH_SUCCESS, REPORT_CALL_ERROR("E19999", "Update output desc of node:%s(%s) failed, index:0,", var->GetName().c_str(), var->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "UpdateOutputDesc failed"); + GELOGE(INTERNAL_ERROR, "[Update][OutputDesc] of node:%s(%s) failed, index:0,", + var->GetName().c_str(), var->GetType().c_str()); return INTERNAL_ERROR;); } @@ -389,7 +406,8 @@ Status UpdateVarFormats(const NodePtr &var, const GeTensorDesc &tensor_desc) { GE_IF_BOOL_EXEC(var->GetOpDesc()->UpdateInputDesc(0, desc) != GRAPH_SUCCESS, REPORT_CALL_ERROR("E19999", "Update input desc of node:%s(%s) failed, index:0,", var->GetName().c_str(), var->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "UpdateInputDesc failed"); + GELOGE(INTERNAL_ERROR, "[Update][InputDesc] of node:%s(%s) failed, index:0,", + var->GetName().c_str(), var->GetType().c_str()); return INTERNAL_ERROR;) } return SUCCESS; @@ -405,7 +423,7 @@ Status RecoverTransRoadForVar(const NodePtr &var, const VarTransRoad &road) { if (ret != SUCCESS) { ErrorManager::GetInstance().ATCReportErrMessage( "E15001", {"variable", "index", "type"}, {var->GetName(), std::to_string(index), iter->node_type}); - GELOGE(INTERNAL_ERROR, "Failed to recover trans node for variable %s, index %d, type %s", var->GetName().c_str(), + GELOGE(INTERNAL_ERROR, "[Recover][TransNode] for variable %s, index %d, type %s", var->GetName().c_str(), index, iter->node_type.c_str()); return INTERNAL_ERROR; } @@ -419,7 +437,8 @@ Status RecoverTransRoadForVar(const NodePtr &var, const VarTransRoad &road) { if (status != ge::SUCCESS) { REPORT_CALL_ERROR("E19999", "Set stream_label:%s to op:%s(%s) failed", stream_label.c_str(), last_node->GetName().c_str(), last_node->GetType().c_str()); - GELOGE(status, "Set stream label failed."); + GELOGE(status, "[Set][StreamLabel] %s to op:%s(%s) failed.", + stream_label.c_str(), last_node->GetName().c_str(), last_node->GetType().c_str()); return status; } } @@ -427,7 +446,9 @@ Status RecoverTransRoadForVar(const NodePtr &var, const VarTransRoad &road) { REPORT_CALL_ERROR("E19999", "Set Attr:%s to node:%s(%s) failed", ge::ATTR_INSERTED_BY_GE.c_str(), last_node->GetName().c_str(), last_node->GetType().c_str()); - return INTERNAL_ERROR, "Set attr ATTR_INSERTED_BY_GE failed."); + return INTERNAL_ERROR, + "[Set][Attr] %s to node:%s(%s) failed", ge::ATTR_INSERTED_BY_GE.c_str(), + last_node->GetName().c_str(), last_node->GetType().c_str()); GELOGD("Recover trans node %s type %s success", trans_name.c_str(), iter->node_type.c_str()); } if (road.empty()) { @@ -448,7 +469,7 @@ Status RecoverTransRoadForVarRef(const std::set &nodes, const VarTransR if (ret != SUCCESS) { ErrorManager::GetInstance().ATCReportErrMessage( "E15001", {"variable", "index", "type"}, {var->GetName(), std::to_string(index), iter->node_type}); - GELOGE(INTERNAL_ERROR, "Failed to recover trans node for variable %s, index %d, type %s", + GELOGE(INTERNAL_ERROR, "[Recover][TransNode] for variable %s failed, index %d, type %s", var->GetName().c_str(), index, iter->node_type.c_str()); return INTERNAL_ERROR; } @@ -462,7 +483,8 @@ Status RecoverTransRoadForVarRef(const std::set &nodes, const VarTransR if (status != ge::SUCCESS) { REPORT_CALL_ERROR("E19999", "Set stream_label:%s to op:%s(%s) failed", stream_label.c_str(), last_node->GetName().c_str(), last_node->GetType().c_str()); - GELOGE(status, "Set stream label failed."); + GELOGE(status, "[Set][StreamLabel] %s to op:%s(%s) failed.", + stream_label.c_str(), last_node->GetName().c_str(), last_node->GetType().c_str()); return status; } } @@ -471,7 +493,9 @@ Status RecoverTransRoadForVarRef(const std::set &nodes, const VarTransR REPORT_CALL_ERROR("E19999", "Set Attr:%s of node:%s(%s) failed", ge::ATTR_INSERTED_BY_GE.c_str(), last_node->GetName().c_str(), last_node->GetType().c_str()); - return INTERNAL_ERROR, "Set attr ATTR_INSERTED_BY_GE failed."); + return INTERNAL_ERROR, + "[Set][Attr] %s of node:%s(%s) failed", ge::ATTR_INSERTED_BY_GE.c_str(), + last_node->GetName().c_str(), last_node->GetType().c_str()); } if (!(road.empty()) && (UpdateVarFormats(var, road.rbegin()->output) != SUCCESS)) { return INTERNAL_ERROR; @@ -487,7 +511,7 @@ VarNamesToRefs CollectVarNamesToRefs(const ComputeGraphPtr &graph) { std::string var_name; if (graph == nullptr) { REPORT_INNER_ERROR("E19999", "Param graph is nullptr, check invalid"); - GELOGE(PARAM_INVALID, "graph is null."); + GELOGE(PARAM_INVALID, "[Check][Param] graph is nullptr."); return names_to_refs; } for (auto &node : graph->GetAllNodes()) { @@ -506,13 +530,13 @@ Status TransferShape2NC1HWC0(Format src_format, const std::vector &src_ if (src_format == FORMAT_NCHW) { formats::FormatTransferNchwNc1hwc0 transfer; if (transfer.TransShape(src_format, src_shape, dt, dst_format, dst_shape) != SUCCESS) { - GELOGE(INTERNAL_ERROR, "TransShape failed"); + GELOGE(INTERNAL_ERROR, "[Trans][Shape] failed"); return FAILED; } } else if (src_format == FORMAT_NHWC) { formats::FormatTransferNhwcNc1hwc0 transfer; if (transfer.TransShape(src_format, src_shape, dt, dst_format, dst_shape) != SUCCESS) { - GELOGE(INTERNAL_ERROR, "TransShape failed"); + GELOGE(INTERNAL_ERROR, "[Trans][Shape] failed"); return FAILED; } } @@ -532,7 +556,8 @@ Status ModifyInputFormatAndShape(NodePtr &node_ptr) { if (TransferShape2NC1HWC0(old_format, old_shape, dt, FORMAT_NC1HWC0, dst_shape_dims) != SUCCESS) { REPORT_CALL_ERROR("E19999", "Transfer shape to NC1HWC0 failed, op:%s(%s),", op_desc->GetName().c_str(), op_desc->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "Trans shape failed"); + GELOGE(INTERNAL_ERROR, "[Transfer][Shape] to NC1HWC0 failed, op:%s(%s),", + op_desc->GetName().c_str(), op_desc->GetType().c_str()); return FAILED; } @@ -549,7 +574,8 @@ Status ModifyInputFormatAndShape(NodePtr &node_ptr) { if (graph_status != ge::GRAPH_SUCCESS) { REPORT_CALL_ERROR("E19999", "Get output tensor size failed, op:%s(%s), index:0", op_desc->GetName().c_str(), op_desc->GetType().c_str()); - GELOGE(graph_status, "GetTensorSizeInBytes failed!"); + GELOGE(graph_status, "[Get][TensorSize] In Bytes failed, op:%s(%s), index:0", + op_desc->GetName().c_str(), op_desc->GetType().c_str()); return FAILED; } ge::TensorUtils::SetSize(*output, size); @@ -565,7 +591,7 @@ Status ModifyFormatAndShapeForSingleTensor(const GeTensorDescPtr &input_output) ge::DataType dt = input_output->GetDataType(); std::vector dst_shape_dims; if (TransferShape2NC1HWC0(old_format, old_shape, dt, FORMAT_NC1HWC0, dst_shape_dims) != SUCCESS) { - GELOGE(INTERNAL_ERROR, "Trans shape failed"); + GELOGE(INTERNAL_ERROR, "[Trans][Shape] to NC1HWC0 failed"); return FAILED; } input_output->SetFormat(FORMAT_NC1HWC0); @@ -595,7 +621,8 @@ Status ModifyDataNetOutputFormatAndShape(OpDescPtr &op_desc, uint32_t index, For if (graph_status != ge::GRAPH_SUCCESS) { REPORT_CALL_ERROR("E19999", "Get output tensor size failed, op:%s(%s), index:%u", op_desc->GetName().c_str(), op_desc->GetType().c_str(), index); - GELOGE(graph_status, "GetTensorSizeInBytes failed!"); + GELOGE(graph_status, "[Get][TensorSize] In Bytes failed, op:%s(%s), index:%u", + op_desc->GetName().c_str(), op_desc->GetType().c_str(), index); return FAILED; } ge::TensorUtils::SetSize(*input, size); @@ -618,7 +645,7 @@ Status CheckIfDynamicBatchScene(NodePtr &data_node, bool &is_dynamic_batch, Node if (related_node_name.empty()) { ErrorManager::GetInstance().ATCReportErrMessage( "E15002", {"opname", "value", "reason"}, {data_node->GetName(), "flag", "but the value is empty"}); - GELOGE(INTERNAL_ERROR, "The data node %s has switchn node flag, but the value is empty", + GELOGE(INTERNAL_ERROR, "[Check][Param] The data node %s has switchn node flag, but the value is empty", data_node->GetName().c_str()); return INTERNAL_ERROR; } @@ -636,7 +663,7 @@ Status CheckIfDynamicBatchScene(NodePtr &data_node, bool &is_dynamic_batch, Node ErrorManager::GetInstance().ATCReportErrMessage( "E15002", {"opname", "value", "reason"}, {data_node->GetName(), related_node_name, "but can not find it on the graph"}); - GELOGE(INTERNAL_ERROR, "The data node %s has switchn node %s, but can not find it on the graph", + GELOGE(INTERNAL_ERROR, "[Check][Param] The data node %s has switchn node %s, but can not find it on the graph", data_node->GetName().c_str(), related_node_name.c_str()); return INTERNAL_ERROR; } @@ -783,15 +810,15 @@ Status UpdateSubgraphDataOfCase(NodePtr &mbatch_node, DataType &dt_set, int32_t Status ProcessMbatchScene(NodePtr &mbatch_node, DataType &dt_set, int32_t index) { GELOGI("The node [%s] dtype set fp16.", mbatch_node->GetName().c_str()); if (UpdateInputOutputDataType(mbatch_node, dt_set, index) != SUCCESS) { - GELOGE(FAILED, "Update input and output data type of node[name: %s, type: %s] to %s failed.", + GELOGE(FAILED, "[Update][InputOutputDataType] of node[name: %s, type: %s] to %s failed.", mbatch_node->GetName().c_str(), mbatch_node->GetType().c_str(), TypeUtils::DataTypeToSerialString(dt_set).c_str()); return FAILED; } if (UpdateSubgraphDataOfCase(mbatch_node, dt_set, index) != SUCCESS) { - GELOGE(FAILED, "Update input and output data type of Data node[parent_node_index: %d] in subgraphs of " - "node[name: %s, type: %s] to %s failed.", index, mbatch_node->GetName().c_str(), + GELOGE(FAILED, "[Update][SubgraphDataOfCase] node[parent_node_index:%d] in subgraphs of " + "node[name:%s, type:%s] to %s failed.", index, mbatch_node->GetName().c_str(), mbatch_node->GetType().c_str(), TypeUtils::DataTypeToSerialString(dt_set).c_str()); return FAILED; } @@ -813,11 +840,13 @@ Status ProcessInputNC1HWC0DynShape(NodePtr &node_ptr, bool &is_dynamic_batch, No "E19014", {"opname", "value", "reason"}, {op_desc->GetName(), "format[" + TypeUtils::FormatToSerialString(old_format) + "]", "only support FORMAT_NC1HWC0,FORMAT_NCHW,FORMAT_NHWC"}); - GELOGE(INTERNAL_ERROR, "The format [%s] is unsupported", TypeUtils::FormatToSerialString(old_format).c_str()); + GELOGE(INTERNAL_ERROR, "[Check][Param] The format [%s] is unsupported, op:%s", + TypeUtils::FormatToSerialString(old_format).c_str(), op_desc->GetName().c_str()); return FAILED; } if (ModifyInputFormatAndShape(node_ptr) != SUCCESS) { - GELOGE(INTERNAL_ERROR, "modify format and shape failed"); + GELOGE(INTERNAL_ERROR, "[Modify][InputFormatAndShape] failed, op:%s(%s)", + op_desc->GetName().c_str(), op_desc->GetType().c_str()); return FAILED; } if (is_dynamic_batch) { @@ -827,7 +856,8 @@ Status ProcessInputNC1HWC0DynShape(NodePtr &node_ptr, bool &is_dynamic_batch, No if (ModifyFormatAndShapeForSingleTensor(switchn_input) != SUCCESS) { REPORT_CALL_ERROR("E19999", "Modify format and shape of input:0 in op:%s(%s) failed", switchn_op_desc->GetName().c_str(), switchn_op_desc->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "modify format and shape failed"); + GELOGE(INTERNAL_ERROR, "[Modify][FormatAndShape] of input:0 in op:%s(%s) failed", + switchn_op_desc->GetName().c_str(), switchn_op_desc->GetType().c_str()); return FAILED; } for (uint32_t i = 0; i < switchn_node->GetAllOutDataAnchorsSize(); ++i) { @@ -838,7 +868,8 @@ Status ProcessInputNC1HWC0DynShape(NodePtr &node_ptr, bool &is_dynamic_batch, No if (ModifyFormatAndShapeForSingleTensor(switchn_output) != SUCCESS) { REPORT_CALL_ERROR("E19999", "Modify format and shape of output:%u in op:%s(%s) failed", i, switchn_op_desc->GetName().c_str(), switchn_op_desc->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "modify format and shape failed"); + GELOGE(INTERNAL_ERROR, "[Modify][FormatAndShape] of output:%u in op:%s(%s) failed", i, + switchn_op_desc->GetName().c_str(), switchn_op_desc->GetType().c_str()); return FAILED; } } @@ -859,15 +890,15 @@ Status ProcessDataNodeDynShape(NodePtr &node_ptr) { NodePtr mbatch_node = nullptr; int32_t index = 0; if (CheckIfDynamicBatchScene(node_ptr, is_dynamic_batch, mbatch_node, index)) { - GELOGE(INTERNAL_ERROR, "CheckIfDynamicBatchScene failed"); + GELOGE(INTERNAL_ERROR, "[Call][CheckIfDynamicBatchScene] failed, op:%s", op_desc->GetName().c_str()); return FAILED; } if (ProcessInputDtDynShape(node_ptr, mbatch_node, dt_set) != SUCCESS) { - GELOGE(INTERNAL_ERROR, "ProcessInputFP16 failed"); + GELOGE(INTERNAL_ERROR, "[Process][InputDtDynShape] ProcessInputFP16 failed, op:%s", op_desc->GetName().c_str()); return FAILED; } if (is_dynamic_batch && ProcessMbatchScene(mbatch_node, dt_set, index) != SUCCESS) { - GELOGE(INTERNAL_ERROR, "ProcessMbatchScene failed"); + GELOGE(INTERNAL_ERROR, "[Process][MbatchScene] failed"); return FAILED; } @@ -877,7 +908,7 @@ Status ProcessDataNodeDynShape(NodePtr &node_ptr) { if (ret && (!set_format.empty()) && TypeUtils::SerialStringToFormat(set_format) == FORMAT_NC1HWC0) { GELOGI("The format of node [%s] should be set NC1HWC0.", node_ptr->GetName().c_str()); if (ProcessInputNC1HWC0DynShape(node_ptr, is_dynamic_batch, mbatch_node) != SUCCESS) { - GELOGE(INTERNAL_ERROR, "ProcessInputNC1HWC0 failed"); + GELOGE(INTERNAL_ERROR, "[Process][InputNC1HWC0] failed, op:%s", node_ptr->GetName().c_str()); return FAILED; } } @@ -906,8 +937,8 @@ Status GetStorageFormatAndShape(OpDescPtr &op_desc, const GeTensorDescPtr &tenso ErrorManager::GetInstance().ATCReportErrMessage( "15003", {"opname", "format"}, {op_desc->GetName(), TypeUtils::FormatToSerialString(storage_format)}); - GELOGE(PARAM_INVALID, "Update node by storage format failed, storage_shape not set. " - "node: [%s], storage_format [%s]", + GELOGE(PARAM_INVALID, "[Check][Param] Update node by storage format failed, storage_shape not set. " + "node:[%s], storage_format [%s]", op_desc->GetName().c_str(), TypeUtils::FormatToSerialString(storage_format).c_str()); return FAILED; } @@ -947,7 +978,9 @@ Status ProcessNetoutputNodeFp16Nc1hwc0DynShape(GeTensorDesc &src_desc, GeTensorD REPORT_CALL_ERROR("E19999", "Transfer output:0 shape of op:%s(%s) to NC1HWC0 format failed, shape:%s, format:%s", src_op_desc->GetName().c_str(), src_op_desc->GetType().c_str(), src_shape.ToString().c_str(), TypeUtils::FormatToSerialString(src_format).c_str()); - GELOGE(INTERNAL_ERROR, "Trans shape failed"); + GELOGE(INTERNAL_ERROR, "[Trans][Shape] of op:%s(%s) to NC1HWC0 format failed, shape:%s, format:%s", + src_op_desc->GetName().c_str(), src_op_desc->GetType().c_str(), + src_shape.ToString().c_str(), TypeUtils::FormatToSerialString(src_format).c_str()); return FAILED; } ge::GeShape dst_shape(dst_shape_dims); @@ -959,7 +992,8 @@ Status ProcessNetoutputNodeFp16Nc1hwc0DynShape(GeTensorDesc &src_desc, GeTensorD if (ModifyFormatAndShapeForSingleTensor(merge_out) != SUCCESS) { REPORT_CALL_ERROR("E19999", "Modify format and shape of output:0 in op:%s(%s) failed", src_op_desc->GetName().c_str(), src_op_desc->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "modify format and shape failed"); + GELOGE(INTERNAL_ERROR, "[Modify][FormatAndShape] of output:0 in op:%s(%s) failed", + src_op_desc->GetName().c_str(), src_op_desc->GetType().c_str()); return FAILED; } for (uint32_t i = 0; i < node->GetAllInDataAnchorsSize(); ++i) { @@ -968,7 +1002,8 @@ Status ProcessNetoutputNodeFp16Nc1hwc0DynShape(GeTensorDesc &src_desc, GeTensorD if (ModifyFormatAndShapeForSingleTensor(merge_in) != SUCCESS) { REPORT_CALL_ERROR("E19999", "Modify format and shape of input:%u in op:%s(%s) failed", i, src_op_desc->GetName().c_str(), src_op_desc->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "modify format and shape failed"); + GELOGE(INTERNAL_ERROR, "[Modify][FormatAndShape] of input:%u in op:%s(%s) failed", i, + src_op_desc->GetName().c_str(), src_op_desc->GetType().c_str()); return FAILED; } } @@ -1055,13 +1090,13 @@ Status ProcessNetoutputNodeDynShape(NodePtr &node) { "E19014", {"opname", "value", "reason"}, {op_desc->GetName(), "format[" + TypeUtils::FormatToSerialString(old_format) + "]", "only support FORMAT_NC1HWC0,FORMAT_NCHW,FORMAT_NHWC"}); - GELOGE(INTERNAL_ERROR, "Format is not one of NCHW, NHWC, NC1HWC0."); + GELOGE(INTERNAL_ERROR, "[Check][Param] Format is not one of NCHW, NHWC, NC1HWC0."); return FAILED; } GeTensorDesc old_desc(old_shape, old_format, old_dtype); if (ProcessNetoutputNodeFp16Nc1hwc0DynShape(old_desc, net_output_input_desc, src_node) != SUCCESS) { - GELOGE(INTERNAL_ERROR, "Process netoutput fp16 nc1hwc0."); + GELOGE(INTERNAL_ERROR, "[Process][NetOutput] fp16 nc1hwc0 failed."); return FAILED; } } @@ -1092,7 +1127,7 @@ Status GetDynamicInputShapeRange(const std::vector &user_input, const } else { REPORT_INNER_ERROR("E19999", "Graph option: %s and %s should be enabled at the same time, check invalid", OPTION_EXEC_DYNAMIC_EXECUTE_MODE, OPTION_EXEC_DATA_INPUTS_SHAPE_RANGE); - GELOGE(PARAM_INVALID, "Graph option: %s and %s should be enabled at the same time.", + GELOGE(PARAM_INVALID, "[Check][Param] Graph option: %s and %s should be enabled at the same time.", OPTION_EXEC_DYNAMIC_EXECUTE_MODE, OPTION_EXEC_DATA_INPUTS_SHAPE_RANGE); return PARAM_INVALID; } @@ -1101,8 +1136,8 @@ Status GetDynamicInputShapeRange(const std::vector &user_input, const return PARAM_INVALID; } if (range_vec.size() != user_input.size()) { - GELOGE(PARAM_INVALID, "Dynamic input shape range size is %zu, inputs size is %zu. Not match.", range_vec.size(), - user_input.size()); + GELOGE(PARAM_INVALID, "[Check][Param] Dynamic input shape range size is %zu, inputs size is %zu. Not match.", + range_vec.size(), user_input.size()); return PARAM_INVALID; } return SUCCESS; @@ -1117,8 +1152,8 @@ Status UpdateDynamicInputShapeRange(const ge::GeAttrValue::INT index, REPORT_INNER_ERROR("E19999", "Given shape_range dim num is %zu, current dim:%s num is %zu, not match, " "check invalid", current_shape_range_vec.size(), origin_shape.ToString().c_str(), origin_shape.GetDimNum()); - GELOGE(PARAM_INVALID, "Given shape_range dim num is %zu, current dim num is %zu, not match.Pleace Check.", - current_shape_range_vec.size(), origin_shape.GetDimNum()); + GELOGE(PARAM_INVALID, "[Check][Param] Given shape_range dim num is %zu, current dim num is %zu, " + "not match.Pleace Check.", current_shape_range_vec.size(), origin_shape.GetDimNum()); return PARAM_INVALID; } for (size_t i = 0; i < origin_shape.GetDimNum(); ++i) { @@ -1130,8 +1165,8 @@ Status UpdateDynamicInputShapeRange(const ge::GeAttrValue::INT index, if (curr_dim != left_range) { REPORT_INNER_ERROR("E19999", "Given shape range is %ld, current dim shape is %ld, not match, dim_index:%zu, " "check invalid", left_range, curr_dim, i); - GELOGE(PARAM_INVALID, "Given shape range is %ld, current dim shape is %ld, not match.Pleace Check.", - left_range, curr_dim); + GELOGE(PARAM_INVALID, "[Check][Param] Given shape range is %ld, current dim shape is %ld, " + "not match.Pleace Check.", left_range, curr_dim); return PARAM_INVALID; } origin_shape.SetDim(i, left_range); @@ -1142,8 +1177,8 @@ Status UpdateDynamicInputShapeRange(const ge::GeAttrValue::INT index, REPORT_INNER_ERROR("E19999", "Given shape range is [%ld~%ld], current dim shape is %ld, out of range, " "dim_index:%zu, check invalid", left_range, right_range, curr_dim, i); - GELOGE(PARAM_INVALID, "Given shape range is [%ld~%ld], current dim shape is %ld, out of range.Pleace Check.", - left_range, right_range, curr_dim); + GELOGE(PARAM_INVALID, "[Check][Param] Given shape range is [%ld~%ld], current dim shape is %ld, " + "out of range.Pleace Check.", left_range, right_range, curr_dim); return PARAM_INVALID; } } @@ -1154,9 +1189,9 @@ Status UpdateDynamicInputShapeRange(const ge::GeAttrValue::INT index, desc.SetShapeRange(current_shape_range_vec); graphStatus graph_ret = op->UpdateInputDesc(0, desc); - GE_CHK_GRAPH_STATUS_RET(graph_ret, "UpdateInputDesc fail, graph ret: %u", graph_ret); + GE_CHK_GRAPH_STATUS_RET(graph_ret, "[Update][InputDesc] fail, graph ret: %u", graph_ret); graph_ret = op->UpdateOutputDesc(0, desc); - GE_CHK_GRAPH_STATUS_RET(graph_ret, "UpdateInputDesc fail, graph ret: %u", graph_ret); + GE_CHK_GRAPH_STATUS_RET(graph_ret, "[Update][OutputDesc] fail, graph ret: %u", graph_ret); return SUCCESS; } } // namespace @@ -1189,14 +1224,14 @@ Status GraphPrepare::UpdateVariableFormats(ComputeGraphPtr &graph) { auto ret = RecoverTransRoadForVar(node, *trans_road); if (ret != SUCCESS) { - GELOGE(INTERNAL_ERROR, "Failed to recovery trans road for var %s", node->GetName().c_str()); + GELOGE(INTERNAL_ERROR, "[Recover][TransRoad] for var %s failed", node->GetName().c_str()); return INTERNAL_ERROR; } auto iter = var_names_to_refs.find(node->GetName()); if (iter != var_names_to_refs.end()) { ret = RecoverTransRoadForVarRef(iter->second, *trans_road); if (ret != SUCCESS) { - GELOGE(INTERNAL_ERROR, "Failed to recovery trans road for var ref %s", node->GetName().c_str()); + GELOGE(INTERNAL_ERROR, "[Recover][TransRoad] for var ref %s failed", node->GetName().c_str()); return INTERNAL_ERROR; } } @@ -1216,13 +1251,13 @@ Status GraphPrepare::Init(const ge::Graph &graph, uint64_t session_id) { Status ret = CheckGraph(); if (ret != SUCCESS) { - GELOGE(ret, "RunGraph graph check fail, ret:%u", ret); + GELOGE(ret, "[Check][Graph] fail, ret:%u", ret); return ret; } (void)compute_graph_->TopologicalSorting(); ret = CheckRefOp(); if (ret != SUCCESS) { - GELOGE(ret, "RunGraph check ref op fail, ret:%u", ret); + GELOGE(ret, "[Check][RefOp] fail, ret:%u", ret); return ret; } return SUCCESS; @@ -1231,20 +1266,20 @@ Status GraphPrepare::Init(const ge::Graph &graph, uint64_t session_id) { Status GraphPrepare::CheckGraph() { if (compute_graph_ == nullptr) { REPORT_INNER_ERROR("E19999", "compute_graph_ is nullptr, check invalid"); - GELOGE(GE_GRAPH_INIT_FAILED, "Graph prepare init compute graph is NULLPTR"); + GELOGE(GE_GRAPH_INIT_FAILED, "[Check][Param] compute_graph_ is nullptr"); return GE_GRAPH_INIT_FAILED; } auto nodes = compute_graph_->GetAllNodes(); if (nodes.empty()) { REPORT_INNER_ERROR("E19999", "nodes in graph is empty, check invalid"); - GELOGE(GE_GRAPH_INIT_FAILED, "Invalid graph, no nodes in this graph."); + GELOGE(GE_GRAPH_INIT_FAILED, "[Check][Param] Invalid graph, no nodes in this graph."); return GE_GRAPH_INIT_FAILED; } for (const NodePtr &node : compute_graph_->GetAllNodes()) { GE_CHECK_NOTNULL(node); if (node->GetOpDesc() == nullptr) { REPORT_INNER_ERROR("E19999", "node without opdesc exist in graph, check invalid"); - GELOGE(GE_GRAPH_INIT_FAILED, "Check Graph node opdesc is NULL"); + GELOGE(GE_GRAPH_INIT_FAILED, "[Get][OpDesc] failed, Check Graph node opdesc is NULL"); return GE_GRAPH_INIT_FAILED; } } @@ -1283,7 +1318,8 @@ Status GraphPrepare::CheckRefInputNode(const NodePtr &node, const std::string &i REPORT_INNER_ERROR("E19999", "Get Attr:%s of op:%s(%s) failed", ATTR_NAME_FRAMEWORK_ORIGINAL_TYPE.c_str(), input_op_desc->GetName().c_str(), input_op_desc->GetType().c_str()); - GELOGE(PARAM_INVALID, "Get original type failed."); + GELOGE(PARAM_INVALID, "[Get][Attr] %s of op:%s(%s) failed", ATTR_NAME_FRAMEWORK_ORIGINAL_TYPE.c_str(), + input_op_desc->GetName().c_str(), input_op_desc->GetType().c_str()); return PARAM_INVALID; } } @@ -1292,8 +1328,8 @@ Status GraphPrepare::CheckRefInputNode(const NodePtr &node, const std::string &i ErrorManager::GetInstance().ATCReportErrMessage( "E15005", {"opname", "optype", "opname1", "optype1"}, {op_desc->GetName(), node->GetType(), input_op_desc->GetName(), input_op_desc->GetType()}); - GELOGE(PARAM_INVALID, "The ref input of ref node %s[%s] must be ref node or variable, but %s[%s]isn't.", - node->GetName().c_str(), node->GetType().c_str(), input_op_desc->GetName().c_str(), + GELOGE(PARAM_INVALID, "[Check][Param] The ref input of ref node %s[%s] must be ref node or variable, " + "but %s[%s]isn't.", node->GetName().c_str(), node->GetType().c_str(), input_op_desc->GetName().c_str(), input_op_desc->GetType().c_str()); return PARAM_INVALID; } @@ -1307,13 +1343,13 @@ Status GraphPrepare::CheckRefOp() { for (const NodePtr &node : compute_graph_->GetDirectNode()) { if (node == nullptr) { REPORT_INNER_ERROR("E19999", "nullptr node exist in graph, check invalid"); - GELOGE(PARAM_INVALID, "param [node] must not be null."); + GELOGE(PARAM_INVALID, "[Check][Param] param [node] must not be null."); return PARAM_INVALID; } auto op_desc = node->GetOpDesc(); if (op_desc == nullptr) { REPORT_INNER_ERROR("E19999", "node without opdesc exist in graph, check invalid"); - GELOGE(PARAM_INVALID, "OpDesc of param [node] must not be null."); + GELOGE(PARAM_INVALID, "[Check][Param] OpDesc of param [node] must not be null."); return PARAM_INVALID; } @@ -1322,7 +1358,7 @@ Status GraphPrepare::CheckRefOp() { for (const auto &name_index : input_name_index) { if (op_desc->GetOutputIndexByName(name_index.first) != -1) { if (CheckRefInputNode(node, name_index.first, ref_nodes) != SUCCESS) { - GELOGE(PARAM_INVALID, "CheckRefInputNode failed."); + GELOGE(PARAM_INVALID, "[Check][RefInputNode] failed, node:%s.", op_desc->GetName().c_str()); return PARAM_INVALID; } (void)ref_nodes.insert(node); // no need to check value @@ -1347,13 +1383,13 @@ Status GraphPrepare::SetRtContext(rtContext_t rt_context, rtCtxMode_t mode) { Status GraphPrepare::AdjustDataOpOutput(const NodePtr &node) { if (node == nullptr) { REPORT_INNER_ERROR("E19999", "Param node is nullptr, check invalid"); - GELOGE(GE_GRAPH_GRAPH_NODE_NULL, "Input node is NULL"); + GELOGE(GE_GRAPH_GRAPH_NODE_NULL, "[Check][Param] Input node is nullptr"); return GE_GRAPH_GRAPH_NODE_NULL; } OpDescPtr op_desc_ptr = node->GetOpDesc(); if (op_desc_ptr == nullptr) { REPORT_INNER_ERROR("E19999", "Param node's op_desc is nullptr, check invalid"); - GELOGE(GE_GRAPH_GRAPH_NODE_NULL, "Input node opdesc is NULL"); + GELOGE(GE_GRAPH_GRAPH_NODE_NULL, "[Get][OpDesc] Input node opdesc is NULL"); return GE_GRAPH_GRAPH_NODE_NULL; } GeTensorDesc output = op_desc_ptr->GetOutputDesc(0); @@ -1368,7 +1404,7 @@ Status GraphPrepare::AdjustDataOpOutput(const NodePtr &node) { if (graph_status != GRAPH_SUCCESS) { ErrorManager::GetInstance().ATCReportErrMessage( "E19012", {"function", "reason"}, {"GetTensorMemorySizeInBytes", "opname is " + node->GetName()}); - GELOGE(graph_status, "GetTensorMemorySizeInBytes failed!"); + GELOGE(graph_status, "[Call][GetTensorMemorySizeInBytes] failed, op:%s", node->GetName().c_str()); return FAILED; } TensorUtils::SetSize(output, tensor_size); @@ -1376,7 +1412,8 @@ Status GraphPrepare::AdjustDataOpOutput(const NodePtr &node) { if (graph_ret != GRAPH_SUCCESS) { REPORT_CALL_ERROR("E19999", "Update output desc of op:%s(%s) failed, index:0", op_desc_ptr->GetName().c_str(), op_desc_ptr->GetType().c_str()); - GELOGE(graph_ret, "UpdateOutputDesc fail, graph_ret:%u", graph_ret); + GELOGE(graph_ret, "[Update][OutputDesc] of op:%s(%s) failed, index:0", + op_desc_ptr->GetName().c_str(), op_desc_ptr->GetType().c_str()); return graph_ret; } return SUCCESS; @@ -1387,7 +1424,7 @@ Status GraphPrepare::UpdateInput(const std::vector &user_input, // Get shape range of input in dynamic_execute mode vector>> dynamic_shape_range_vec; auto ret = GetDynamicInputShapeRange(user_input, graph_option, dynamic_shape_range_vec); - GE_CHK_STATUS_RET(ret, "Graph option is not right on Dynamic execute mode."); + GE_CHK_STATUS_RET(ret, "[Get][DynamicInputShapeRange] failed, Graph option is not right on Dynamic execute mode."); compute_graph_->SaveDataFormat(ge::TypeUtils::DomiFormatToFormat(GetLocalOmgContext().format)); for (NodePtr &input_node : compute_graph_->GetDirectNode()) { GE_CHECK_NOTNULL(input_node); @@ -1404,7 +1441,8 @@ Status GraphPrepare::UpdateInput(const std::vector &user_input, std::string situation = "data op index[" + std::to_string(index) + "]"; std::string reason = "it must less than user_input size[" + std::to_string(user_input.size()) + "]"; ErrorManager::GetInstance().ATCReportErrMessage("E19025", {"situation", "reason"}, {situation, reason}); - GELOGE(PARAM_INVALID, "user_input size = %zu, graph data op index = %ld.", user_input.size(), index); + GELOGE(PARAM_INVALID, "[Check][Param] user_input size = %zu, graph data op index = %ld.", + user_input.size(), index); return FAILED; } @@ -1423,7 +1461,7 @@ Status GraphPrepare::UpdateInput(const std::vector &user_input, ErrorManager::GetInstance().ATCReportErrMessage("E19025", {"situation", "reason"}, {"Input format[" + TypeUtils::FormatToSerialString(format) + "] or origin_format[" + TypeUtils::FormatToSerialString(origin_format) + "]", "it is not support"}); - GELOGE(PARAM_INVALID, "Input format %s or origin_format %s is not support.", + GELOGE(PARAM_INVALID, "[Check][Param] Input format %s or origin_format %s is not support.", TypeUtils::FormatToSerialString(format).c_str(), TypeUtils::FormatToSerialString(origin_format).c_str()); return FAILED; @@ -1436,7 +1474,7 @@ Status GraphPrepare::UpdateInput(const std::vector &user_input, if (!type_ret) { ErrorManager::GetInstance().ATCReportErrMessage("E19025", {"situation", "reason"}, {"Input datatype[" + TypeUtils::DataTypeToSerialString(data_type) + "]", "it is not support"}); - GELOGE(PARAM_INVALID, "Input datatype %s is not support.", + GELOGE(PARAM_INVALID, "[Check][Param] Input datatype %s is not support.", TypeUtils::DataTypeToSerialString(data_type).c_str()); return FAILED; } @@ -1447,7 +1485,7 @@ Status GraphPrepare::UpdateInput(const std::vector &user_input, int64_t size = 0; GE_IF_BOOL_EXEC(ge::TensorUtils::GetSize(desc, size) != GRAPH_SUCCESS, REPORT_CALL_ERROR("E19999", "Get size of user input tensor failed, index:%ld", index); - GELOGE(INTERNAL_ERROR, "TensorUtils GetSize failed"); + GELOGE(INTERNAL_ERROR, "[Get][Size] of user input tensor failed, index:%ld", index); return FAILED); bool size_check = (size != 0 && shape_size != size); if (size_check) { @@ -1455,7 +1493,7 @@ Status GraphPrepare::UpdateInput(const std::vector &user_input, "] and shape_size[" + std::to_string(size) + "]"; std::string reason = "because size != 0 and shape_size != size"; ErrorManager::GetInstance().ATCReportErrMessage("E19025", {"situation", "reason"}, {situation, reason}); - GELOGE(PARAM_INVALID, "input data size =%ld, shape_size =%ld.", size, shape_size); + GELOGE(PARAM_INVALID, "[Check][Param] input data size = %ld, shape_size = %ld.", size, shape_size); return FAILED; } ge::TensorUtils::SetSize(desc, shape_size); @@ -1464,7 +1502,8 @@ Status GraphPrepare::UpdateInput(const std::vector &user_input, if (graph_ret != GRAPH_SUCCESS) { REPORT_CALL_ERROR("E19999", "Update input desc of op:%s(%s) failed, index:0", op->GetName().c_str(), op->GetType().c_str()); - GELOGE(graph_ret, "UpdateInputDesc fail, graph_ret:%u", graph_ret); + GELOGE(graph_ret, "[Update][InputDesc] of op:%s(%s) failed, index:0", + op->GetName().c_str(), op->GetType().c_str()); return graph_ret; } // Size will be recalculated in the build stage @@ -1473,7 +1512,8 @@ Status GraphPrepare::UpdateInput(const std::vector &user_input, if (graph_ret != GRAPH_SUCCESS) { REPORT_CALL_ERROR("E19999", "Update output desc of op:%s(%s) failed, index:0", op->GetName().c_str(), op->GetType().c_str()); - GELOGE(graph_ret, "UpdateOutputDesc fail, graph_ret:%u", graph_ret); + GELOGE(graph_ret, "[Update][OutputDesc] of op:%s(%s) failed, index:0", + op->GetName().c_str(), op->GetType().c_str()); return graph_ret; } } else { @@ -1481,13 +1521,13 @@ Status GraphPrepare::UpdateInput(const std::vector &user_input, } if (!dynamic_shape_range_vec.empty()) { ret = UpdateDynamicInputShapeRange(index, dynamic_shape_range_vec, op, desc); - GE_CHK_STATUS_RET(ret, "Fail to update dynamic input shape range on %s.", op->GetName().c_str()); + GE_CHK_STATUS_RET(ret, "[Update][DynamicInputShapeRange] on %s failed.", op->GetName().c_str()); continue; } if (!options_.train_graph_flag) { Status ret = AdjustDataOpOutput(input_node); - GE_IF_BOOL_EXEC(ret != SUCCESS, GELOGE(ret, "AdjustDataOpOutput fail, ret:%u", ret); return ret); + GE_IF_BOOL_EXEC(ret != SUCCESS, GELOGE(ret, "[Adjust][DataOpOutput] fail, ret:%u", ret); return ret); } } } @@ -1501,18 +1541,18 @@ Status GraphPrepare::TryDoAipp() { GE_DUMP(compute_graph_, "Before_insert_aipp"); Status ret = ge::InsertNewOpUtil::Instance().Init(); if (ret != SUCCESS) { - GELOGE(INTERNAL_ERROR, "TryDoAipp: InsertNewOpUtil instance failed."); + GELOGE(INTERNAL_ERROR, "[Init][InsertNewOpUtil] failed."); return INTERNAL_ERROR; } ret = ge::InsertNewOpUtil::Instance().Parse(options_.insert_op_file.c_str()); if (ret != SUCCESS) { - GELOGE(GE_GRAPH_OPTIMIZE_INSERT_OP_PARSE_FAILED, "TryDoAipp: parse config file %s failed", + GELOGE(GE_GRAPH_OPTIMIZE_INSERT_OP_PARSE_FAILED, "[Parse][ConfigFile] %s failed", options_.insert_op_file.c_str()); return GE_GRAPH_OPTIMIZE_INSERT_OP_PARSE_FAILED; } ret = ge::InsertNewOpUtil::Instance().InsertAippOps(compute_graph_, options_.insert_op_file); if (ret != SUCCESS) { - GELOGE(GE_GRAPH_OPTIMIZE_INSERT_DYN_OP_FAILED, "TryDoAipp: insert aipp op ret failed, ret:%u", ret); + GELOGE(GE_GRAPH_OPTIMIZE_INSERT_DYN_OP_FAILED, "[Insert][AippOps] failed, ret:%u", ret); return GE_GRAPH_OPTIMIZE_INSERT_DYN_OP_FAILED; } } @@ -1531,7 +1571,7 @@ Status GraphPrepare::FormatAndShapeProcess() { GE_TIMESTAMP_END(InferOriginFormat1, "GraphPrepare::InferOriginFormat1"); GE_DUMP(compute_graph_, "after_first_inferformat"); if (ret != SUCCESS) { - GELOGE(ret, "Prepare Graph first inferformat failed"); + GELOGE(ret, "[Call][InferOriginFormat] Prepare Graph first inferformat failed"); return ret; } @@ -1540,7 +1580,7 @@ Status GraphPrepare::FormatAndShapeProcess() { GE_TIMESTAMP_END(InferShapeForPreprocess, "GraphPrepare::InferShapeForPreprocess"); GE_DUMP(compute_graph_, "after_infershape"); if (ret != SUCCESS) { - GELOGE(GE_GRAPH_INFERSHAPE_FAILED, "Prepare Graph infershape failed"); + GELOGE(GE_GRAPH_INFERSHAPE_FAILED, "[Call][InferShapeForPreprocess] Prepare Graph infershape failed"); return GE_GRAPH_INFERSHAPE_FAILED; } @@ -1548,7 +1588,7 @@ Status GraphPrepare::FormatAndShapeProcess() { ret = compute_graph_->InferOriginFormat(); GE_TIMESTAMP_END(InferOriginFormat2, "GraphPrepare::InferOriginFormat2"); if (ret != SUCCESS) { - GELOGE(ret, "Prepare Graph inferformat failed"); + GELOGE(ret, "[Call][InferOriginFormat] Prepare Graph inferformat failed"); return ret; } @@ -1572,13 +1612,13 @@ Status GraphPrepare::ResourcePairProcess(const std::string &action) { } } catch (std::bad_alloc &e) { REPORT_INNER_ERROR("E19999", "bad memory allocation occur when add ResourcePair Pass"); - GELOGE(INTERNAL_ERROR, "Add pass failed, bad memory allocation occur, action:%s.", action.c_str()); + GELOGE(INTERNAL_ERROR, "[Add][Pass] failed, bad memory allocation occur, action:%s.", action.c_str()); return INTERNAL_ERROR; } } Status ret = control_pass.Run(compute_graph_); if (ret != SUCCESS && ret != NOT_CHANGED) { - GELOGE(ret, "Run ResourcePairControlPass failed, action:%s, ret:%u.", action.c_str(), ret); + GELOGE(ret, "[Run][ResourcePairControlPass] failed, action:%s, ret:%u.", action.c_str(), ret); return ret; } return SUCCESS; @@ -1595,7 +1635,8 @@ Status GraphPrepare::UpdateDataNetOutputByStorageFormat() { Format storage_format = FORMAT_RESERVED; vector dst_shape_dims; if (GetStorageFormatAndShape(op_desc, input, storage_format, dst_shape_dims) != SUCCESS) { - GELOGE(INTERNAL_ERROR, "Get storage format for input failed"); + GELOGE(INTERNAL_ERROR, "[Get][StorageFormatAndShape] for input failed, op:%s, index:0", + op_desc->GetName().c_str()); return FAILED; } @@ -1604,7 +1645,8 @@ Status GraphPrepare::UpdateDataNetOutputByStorageFormat() { } if (ModifyDataNetOutputFormatAndShape(op_desc, index, storage_format, dst_shape_dims) != SUCCESS) { - GELOGE(INTERNAL_ERROR, "Modify format and shape for inputfailed"); + GELOGE(INTERNAL_ERROR, "[Modify][DataNetOutputFormatAndShape] for input failed, op:%s, index:0", + op_desc->GetName().c_str()); return FAILED; } } @@ -1617,14 +1659,16 @@ Status GraphPrepare::UpdateDataNetOutputByStorageFormat() { Format storage_format = FORMAT_RESERVED; vector dst_shape_dims; if (GetStorageFormatAndShape(op_desc, output, storage_format, dst_shape_dims) != SUCCESS) { - GELOGE(INTERNAL_ERROR, "Get storage format from output failed"); + GELOGE(INTERNAL_ERROR, "[Get][StorageFormatAndShape] from output failed, op:%s, index:%u", + op_desc->GetName().c_str(), index); return FAILED; } if (storage_format == FORMAT_RESERVED) { continue; } if (ModifyDataNetOutputFormatAndShape(op_desc, index, storage_format, dst_shape_dims) != SUCCESS) { - GELOGE(INTERNAL_ERROR, "Modify format and shape for output failed"); + GELOGE(INTERNAL_ERROR, "[Modify][DataNetOutputFormatAndShape] for output failed, op:%s, index:%u", + op_desc->GetName().c_str(), index); return FAILED; } } @@ -1710,7 +1754,7 @@ Status GraphPrepare::PrepareRunningFormatRefiner() { auto ret = pass_manager.Run(compute_graph); GE_TIMESTAMP_END(pass_manager, "GraphPrepare::PrepareRunningFormatRefiner"); if (ret != SUCCESS && ret != NOT_CHANGED) { - GELOGE(ret, "Run passes for running format refiner failed, ret:%u.", ret); + GELOGE(ret, "[Run][Passes] for running format refiner failed, ret:%u.", ret); return ret; } PP_RUN_AND_DUMP("UpdateInputOutputByUserOptions", UpdateInputOutputByOptions); @@ -1721,7 +1765,7 @@ Status GraphPrepare::PrepareRunningFormatRefiner() { Status GraphPrepare::SwitchOpOptimize(ComputeGraphPtr &compute_graph) { if (compute_graph == nullptr) { REPORT_INNER_ERROR("E19999", "Param compute_graph is nullptr, check invalid"); - GELOGE(GE_GRAPH_NULL_INPUT, "Input Graph is NULL"); + GELOGE(GE_GRAPH_NULL_INPUT, "[Check][Param] Input Graph is NULL"); return GE_GRAPH_NULL_INPUT; } GEPass ge_passes(compute_graph); @@ -1731,13 +1775,13 @@ Status GraphPrepare::SwitchOpOptimize(ComputeGraphPtr &compute_graph) { hccl_group.emplace_back("HcclGroupPass", &hccl_group_pass); auto ret = ge_passes.Run(hccl_group); if (ret != SUCCESS) { - GELOGE(ret, "Run HcclGroupPass pass for preprocess failed, ret:%u.", ret); + GELOGE(ret, "[Run][HcclGroupPass] pass for preprocess failed, ret:%u.", ret); return ret; } ret = compute_graph->TopologicalSorting(); if (ret != SUCCESS) { REPORT_CALL_ERROR("E19999", "Topological sorting failed"); - GELOGE(ret, "Graph topological sort failed, ret:%u.", ret); + GELOGE(ret, "[Call][TopologicalSorting] Graph topological sort failed, ret:%u.", ret); return ret; } return SUCCESS; @@ -1748,13 +1792,13 @@ Status GraphPrepare::SwitchOpOptimize(ComputeGraphPtr &compute_graph) { Status GraphPrepare::GenerateInfershapeGraph(ConstGraphPtr graph) { if (graph == nullptr) { REPORT_INNER_ERROR("E19999", "Param graph is nullptr, check invalid"); - GELOGE(GE_GRAPH_NULL_INPUT, "Input Graph is NULL"); + GELOGE(GE_GRAPH_NULL_INPUT, "[Check][Param] Input Graph is NULL"); return GE_GRAPH_NULL_INPUT; } const Graph &const_graph = *graph; Status ret = Init(const_graph, 0); if (ret != SUCCESS) { - GELOGE(ret, "Init graph_prepare fail, ret:%u", ret); + GELOGE(ret, "[Init][GraphPrepare] fail, ret:%u", ret); return ret; } GE_DUMP(compute_graph_, "after_parser"); @@ -1763,7 +1807,7 @@ Status GraphPrepare::GenerateInfershapeGraph(ConstGraphPtr graph) { GE_DUMP(compute_graph_, "after_inferformat"); if (ret != SUCCESS) { REPORT_CALL_ERROR("E19999", "Infer OriginFormat failed"); - GELOGE(ret, "Prepare Graph inferformat failed"); + GELOGE(ret, "[Infer][OriginFormat] failed"); return ret; } InferShapePass infer_shape_pass; @@ -1773,7 +1817,7 @@ Status GraphPrepare::GenerateInfershapeGraph(ConstGraphPtr graph) { ret = ge_passes.Run(names_to_passes); GE_DUMP(compute_graph_, "after_infershape"); if (ret != SUCCESS) { - GELOGE(ret, "Run ge_passes infershape for preprocess failed, ret:%u.", ret); + GELOGE(ret, "[Run][GePasses] infershape for preprocess failed, ret:%u.", ret); return ret; } ShapeRefiner::ClearContextMap(); @@ -1790,7 +1834,7 @@ Status GraphPrepare::CheckConstOp() { auto op_desc = node_ptr->GetOpDesc(); if (op_desc == nullptr) { REPORT_INNER_ERROR("E19999", "op_desc is nullptr, check invalid"); - GELOGE(PARAM_INVALID, "Get op desc failed"); + GELOGE(PARAM_INVALID, "[Get][OpDesc] of node failed, op_desc is nullptr, node type:FRAMEWORKOP."); return PARAM_INVALID; } std::string original_type; @@ -1813,7 +1857,8 @@ Status GraphPrepare::VerifyConstOp(const NodePtr &node) { if (!(AttrUtils::GetTensor(op_desc, ATTR_NAME_WEIGHTS, ge_tensor_ptr))) { REPORT_INNER_ERROR("E19999", "Get Attr:%s of op:%s(%s) failed", ATTR_NAME_WEIGHTS.c_str(), op_desc->GetName().c_str(), op_desc->GetType().c_str()); - GELOGE(PARAM_INVALID, "Get value from const attr failed"); + GELOGE(PARAM_INVALID, "[Get][Attr] %s of op:%s(%s) failed", ATTR_NAME_WEIGHTS.c_str(), + op_desc->GetName().c_str(), op_desc->GetType().c_str()); return PARAM_INVALID; } GE_CHECK_NOTNULL(ge_tensor_ptr); @@ -1829,7 +1874,8 @@ Status GraphPrepare::VerifyConstOp(const NodePtr &node) { if (!type_ret) { ErrorManager::GetInstance().ATCReportErrMessage("E19025", {"situation", "reason"}, {"Input datatype[" + TypeUtils::DataTypeToSerialString(data_type) + "]", "it is not support"}); - GELOGE(PARAM_INVALID, "Input datatype %s is not support.", TypeUtils::DataTypeToSerialString(data_type).c_str()); + GELOGE(PARAM_INVALID, "[Check][Param] Input datatype %s is not support.", + TypeUtils::DataTypeToSerialString(data_type).c_str()); return FAILED; } FMK_INT64_UINT32_MULCHECK(shape_size, length); @@ -1840,18 +1886,18 @@ Status GraphPrepare::VerifyConstOp(const NodePtr &node) { // shape = [], means it's a sclar tensor. GE_CHK_BOOL_EXEC(data_size / length == 1, ErrorManager::GetInstance().ATCReportErrMessage("E10043", {"reason"}, {"Const is invalid scalar tensor."}); - return PARAM_INVALID, "Const is invalid scalar tensor."); + return PARAM_INVALID, "[Check][Param] Const is invalid scalar tensor."); } else { // shape = [x, y, 0,...], means it's a vector tensor that value is []. GE_CHK_BOOL_EXEC(data_size == 0, ErrorManager::GetInstance().ATCReportErrMessage("E10043", {"reason"}, {"Const is invalid vector scalar."}); - return PARAM_INVALID, "Const is invalid vector scalar."); + return PARAM_INVALID, "[Check][Param] Const is invalid vector scalar."); } } else { GE_CHK_BOOL_EXEC(data_size == static_cast(shape_size * length) && data_size != 0, ErrorManager::GetInstance().ATCReportErrMessage( "E10043", {"reason"}, {"Const input data size is not equal with tensor desc shape"}); - return PARAM_INVALID, "Const input data size is not equal with tensor desc shape"); + return PARAM_INVALID, "[Check][Param] Const input data size is not equal with tensor desc shape"); } return SUCCESS; } @@ -1889,14 +1935,16 @@ Status GraphPrepare::CheckUserInput(const std::vector &user_input) { if (!(AttrUtils::GetInt(op, ATTR_NAME_INDEX, index))) { REPORT_INNER_ERROR("E19999", "Get Attr:%s of op:%s(%s) failed", ATTR_NAME_WEIGHTS.c_str(), op->GetName().c_str(), op->GetType().c_str()); - GELOGE(GE_GRAPH_INIT_FAILED, "Get index from attr failed"); + GELOGE(GE_GRAPH_INIT_FAILED, "[Get][Attr] %s of op:%s(%s) failed", ATTR_NAME_WEIGHTS.c_str(), + op->GetName().c_str(), op->GetType().c_str()); return GE_GRAPH_INIT_FAILED; } if ((index < 0) || (static_cast(index) >= user_input.size())) { std::string situation = "data op index[" + std::to_string(index) + "]"; std::string reason = "it must less than user_input size[" + std::to_string(user_input.size()) + "]"; ErrorManager::GetInstance().ATCReportErrMessage("E19025", {"situation", "reason"}, {situation, reason}); - GELOGE(GE_GRAPH_INIT_FAILED, "user_input size:%zu, data op index:%ld.", user_input.size(), index); + GELOGE(GE_GRAPH_INIT_FAILED, "[Check][Param] user_input size:%zu must larger than data op index:%ld.", + user_input.size(), index); return GE_GRAPH_INIT_FAILED; } if (IsDynamicDims(input_node)) { @@ -1953,7 +2001,7 @@ Status GraphPrepare::InferShapeForPreprocess() { if (rt_err == RT_ERROR_NONE) { Status result = SetRtContext(rtContext_t(), RT_CTX_NORMAL_MODE); if (result != SUCCESS) { - GELOGE(result, "Set rt context failed."); + GELOGE(result, "[Set][RtContext] failed, mode = RT_CTX_NORMAL_MODE."); return result; } names_to_passes.emplace_back("AicpuConstantFoldingPass", &aicpu_constant_folding_pass); @@ -1964,14 +2012,14 @@ Status GraphPrepare::InferShapeForPreprocess() { if (rt_err == RT_ERROR_NONE) { Status result = SetRtContext(rtContext_t(), RT_CTX_GEN_MODE); if (result != SUCCESS) { - GELOGE(result, "Set rt context failed."); + GELOGE(result, "[Set][RtContext] failed, mode = RT_CTX_GEN_MODE."); return result; } } } ShapeRefiner::ClearContextMap(); if (ret != SUCCESS) { - GELOGE(ret, "Run ge_passes infershape for preprocess failed, ret:%u.", ret); + GELOGE(ret, "[Run][GePasses] infershape for preprocess failed, ret:%u.", ret); return ret; } return SUCCESS; @@ -1983,7 +2031,7 @@ Status GraphPrepare::PrepareOptimize() { bool has_conflict = false; graph_optimize.CheckRWConflict(compute_graph_, has_conflict); if (has_conflict) { - GELOGE(GRAPH_PARAM_INVALID, "There has rw conflict.Stop optimize."); + GELOGE(GRAPH_PARAM_INVALID, "[Check][RWConflict] There has rw conflict.Stop optimize."); return FAILED; } PassManager original_graph_passes; @@ -1994,7 +2042,7 @@ Status GraphPrepare::PrepareOptimize() { (void)original_graph_passes.AddPass("PrepareOptimize::MarkAgnosticPass", new MarkAgnosticPass); } catch (std::bad_alloc &e) { REPORT_INNER_ERROR("E19999", "bad memory allocation occur when add Pass"); - GELOGE(INTERNAL_ERROR, "Add pass failed, bad memory allocation occurs."); + GELOGE(INTERNAL_ERROR, "[Add][Pass] failed, bad memory allocation occurs."); return INTERNAL_ERROR; } @@ -2002,7 +2050,7 @@ Status GraphPrepare::PrepareOptimize() { Status ret = original_graph_passes.Run(compute_graph_); GE_TIMESTAMP_END(original_graph_passes, "GraphPrepare::OriginalGraphPasses"); if (ret != SUCCESS && ret != NOT_CHANGED) { - GELOGE(ret, "Run graph passes optimize for preprocess failed, ret:%u.", ret); + GELOGE(ret, "[Run][GraphPasses] optimize for preprocess failed, ret:%u.", ret); return ret; } // New pass @@ -2047,7 +2095,7 @@ Status GraphPrepare::PrepareOptimize() { ret = ge_passes.Run(names_to_passes); GE_TIMESTAMP_END(names_to_passes, "GraphPrepare::NamesToPasses"); if (ret != SUCCESS) { - GELOGE(ret, "Run ge_passes optimize for preprocess failed, ret:%u.", ret); + GELOGE(ret, "[Run][GePasses] optimize for preprocess failed, ret:%u.", ret); return ret; } @@ -2058,7 +2106,7 @@ Status GraphPrepare::PrepareOptimize() { (void)graph_pass.AddPass("PrepareOptimize::HcclMemcpyPass", new HcclMemcpyPass); } catch (std::bad_alloc &e) { REPORT_INNER_ERROR("E19999", "bad memory allocation occur when add Pass"); - GELOGE(INTERNAL_ERROR, "Add pass failed, bad memory allocation occurs."); + GELOGE(INTERNAL_ERROR, "[Add][Pass] failed, bad memory allocation occurs."); return INTERNAL_ERROR; } @@ -2066,7 +2114,7 @@ Status GraphPrepare::PrepareOptimize() { ret = graph_pass.Run(compute_graph_); GE_TIMESTAMP_END(graph_passes, "GraphPrepare::GraphPasses"); if (ret != SUCCESS && ret != NOT_CHANGED) { - GELOGE(ret, "Run graph passes optimize for preprocess failed, ret:%u.", ret); + GELOGE(ret, "[Run][GraphPasses] optimize for preprocess failed, ret:%u.", ret); return ret; } // The constant for train is CONSTANTOP, and is CONSTANT for inference. They will be unified in future. @@ -2075,7 +2123,7 @@ Status GraphPrepare::PrepareOptimize() { ret = compute_graph_->TopologicalSorting(); if (ret != SUCCESS) { REPORT_CALL_ERROR("E19999", "Topological sorting failed"); - GELOGE(ret, "Graph topological sort failed, ret:%u.", ret); + GELOGE(ret, "[Call][TopologicalSorting] Graph topological sort failed, ret:%u.", ret); return ret; } @@ -2129,7 +2177,7 @@ Status GraphPrepare::ProcessBeforeInfershape() { auto ret = GEPass(compute_graph_).Run(names_to_passes); GE_TIMESTAMP_END(ProcessCondRemove, "GraphManager::ProcessCondRemove"); if (ret != SUCCESS) { - GELOGE(ret, "Run ge_passes optimize for OptimizeAfterMergeSubGraph failed, ret:%d.", ret); + GELOGE(ret, "[Run][GEPass] optimize for OptimizeAfterMergeSubGraph failed, ret:%d.", ret); return ret; } return SUCCESS; @@ -2152,7 +2200,7 @@ Status GraphPrepare::ProcessNetOutput() { auto ret = graph_passes_before_infershape.Run(compute_graph_); if ((ret != SUCCESS) && (ret != NOT_CHANGED)) { - GELOGE(ret, "Run graph_passes_before_infershape failed, ret:%d.", ret); + GELOGE(ret, "[Run][GraphPasses] before Infershape failed, ret:%d.", ret); return ret; } return SUCCESS; @@ -2167,26 +2215,26 @@ Status GraphPrepare::CheckAndUpdateInput(const std::vector &user_input auto ret = CheckUserInput(user_input); if (ret != SUCCESS) { - GELOGE(ret, "Check user input failed."); + GELOGE(ret, "[Check][UserInput] failed, ret:%u", ret); return ret; } ret = UpdateInput(user_input, graph_option); if (ret != SUCCESS) { - GELOGE(ret, "UpdateInput fail, ret:%u", ret); + GELOGE(ret, "[Update][Input] fail, ret:%u", ret); return ret; } if (user_input.size() != 0) { ret = CheckConstOp(); if (ret != SUCCESS) { - GELOGE(ret, "CheckConstOp fail, ret:%u", ret); + GELOGE(ret, "[Check][ConstOp] fail, ret:%u", ret); return ret; } } else { ret = compute_graph_->TopologicalSorting(); if (ret != SUCCESS) { REPORT_CALL_ERROR("E19999", "Topological sorting failed"); - GELOGE(ret, "graph prepare error: compute_graph_->Topological Sorting"); + GELOGE(ret, "[Call][TopologicalSorting] failed."); return FAILED; } } @@ -2195,7 +2243,7 @@ Status GraphPrepare::CheckAndUpdateInput(const std::vector &user_input Status GraphPrepare::UpdateInputOutputByOptions() { auto ret = UpdateDataNetOutputByStorageFormat(); if (ret != SUCCESS) { - GELOGE(ret, "Update format acoording to storage format failed."); + GELOGE(ret, "[Update][DataNetOutputByStorageFormat] failed."); return ret; } @@ -2206,20 +2254,20 @@ Status GraphPrepare::UpdateInputOutputByOptions() { for (auto &node_ptr : compute_graph_->GetDirectNode()) { GE_CHECK_NOTNULL(node_ptr); if (CheckIfNeedSetNdFormat(node_ptr) != SUCCESS) { - GELOGE(INTERNAL_ERROR, "Set node [%s] format ND failed", node_ptr->GetName().c_str()); + GELOGE(INTERNAL_ERROR, "[Set][NdFormat] for node:%s failed", node_ptr->GetName().c_str()); return FAILED; } if (node_ptr->GetType() == DATA) { if (ProcessDataNodeDynShape(node_ptr) != SUCCESS) { - GELOGE(INTERNAL_ERROR, "Process data node failed"); + GELOGE(INTERNAL_ERROR, "[Call][ProcessDataNodeDynShape] for node:%s failed", node_ptr->GetName().c_str()); return FAILED; } } if (node_ptr->GetType() == ge::NETOUTPUT) { if (ProcessNetoutputNodeDynShape(node_ptr) != SUCCESS) { - GELOGE(INTERNAL_ERROR, "Process netoutput node failed"); + GELOGE(INTERNAL_ERROR, "[Call][ProcessNetoutputNodeDynShape] for node:%s failed", node_ptr->GetName().c_str()); return FAILED; } } diff --git a/ge/graph/preprocess/insert_op/ge_aipp_op.cc b/ge/graph/preprocess/insert_op/ge_aipp_op.cc index d46cb0f3..1086b842 100755 --- a/ge/graph/preprocess/insert_op/ge_aipp_op.cc +++ b/ge/graph/preprocess/insert_op/ge_aipp_op.cc @@ -116,7 +116,8 @@ Status GetDataDimN(const ge::NodePtr &data_node, ge::Format format, int64_t &bat TypeUtils::FormatToSerialString(format), "only format " + TypeUtils::FormatToSerialString(FORMAT_NCHW) + " and " + TypeUtils::FormatToSerialString(FORMAT_NHWC) + " supported"})); - GELOGE(PARAM_INVALID, "Not support data format: %s", TypeUtils::FormatToSerialString(format).c_str()); + GELOGE(PARAM_INVALID, "[Check][Param] Not support data format:%s, node:%s", + TypeUtils::FormatToSerialString(format).c_str(), data_node->GetName().c_str()); return PARAM_INVALID; } } @@ -125,7 +126,8 @@ Status GetDataDimN(const ge::NodePtr &data_node, ge::Format format, int64_t &bat ErrorManager::GetInstance().ATCReportErrMessage("E10001", {"parameter", "value", "reason"}, {data_node->GetName() + " shape size", to_string(shape.size()), errormsg}); - GELOGE(PARAM_INVALID, "The shape size of this node [%s] which linked dynamic aipp must be in range[3, 4], but is %zu", + GELOGE(PARAM_INVALID, "[Check][Param] The shape size of this node [%s] " + "which linked dynamic aipp must be in range[3, 4], but is %zu", data_node->GetName().c_str(), shape.size()); return PARAM_INVALID; } @@ -153,7 +155,8 @@ Format GetAndCheckFormat() { case domi::DOMI_TENSOR_NHWC: return FORMAT_NHWC; default: - GELOGE(PARAM_INVALID, "Unexpected format found %d", static_cast(GetLocalOmgContext().format)); + GELOGE(PARAM_INVALID, "[Check][Param] Unexpected format found %d", + static_cast(GetLocalOmgContext().format)); return FORMAT_ND; } } @@ -163,6 +166,7 @@ Status AippOp::Init(domi::AippOpParams *aipp_params) { aipp_params_ = new (std::nothrow) domi::AippOpParams(); if (aipp_params_ == nullptr) { REPORT_CALL_ERROR("E19999", "New AippOpParams failed"); + GELOGE(FAILED, "[New][AippOpParams] failed"); return FAILED; } aipp_params_->CopyFrom(*aipp_params); @@ -182,10 +186,10 @@ Status AippOp::InsertAippToGraph(ComputeGraphPtr &graph, std::string &aippConfig std::vector> target_edges; if (this->ConvertRelatedInputNameToRank() != SUCCESS) { - GELOGE(FAILED, "AippOp: convert related input name to rank failed."); + GELOGE(FAILED, "[Call][ConvertRelatedInputNameToRank] failed."); return FAILED; } - GE_CHK_STATUS_RET(this->GetTargetPosition(graph, target_input, target_edges), "Get data nodes position failed"); + GE_CHK_STATUS_RET(this->GetTargetPosition(graph, target_input, target_edges), "[Get][TargetPosition] failed"); std::map out_anchors_to_aipp; for (auto &out_in_anchors : target_edges) { @@ -203,7 +207,12 @@ Status AippOp::InsertAippToGraph(ComputeGraphPtr &graph, std::string &aippConfig out_in_anchors.first->GetOwnerNode()->GetType().c_str(), out_in_anchors.second->GetOwnerNode()->GetName().c_str(), out_in_anchors.second->GetOwnerNode()->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "Failed to link edges for aipp node %s", aipp->GetName().c_str()); + GELOGE(INTERNAL_ERROR, "[Insert][Node] %s(%s) between op:%s(%s) and op:%s:%s failed", + aipp->GetName().c_str(), aipp->GetType().c_str(), + out_in_anchors.first->GetOwnerNode()->GetName().c_str(), + out_in_anchors.first->GetOwnerNode()->GetType().c_str(), + out_in_anchors.second->GetOwnerNode()->GetName().c_str(), + out_in_anchors.second->GetOwnerNode()->GetType().c_str()); return INTERNAL_ERROR; } @@ -211,7 +220,7 @@ Status AippOp::InsertAippToGraph(ComputeGraphPtr &graph, std::string &aippConfig if (GetAippMode() == domi::AippOpParams::dynamic) { ret = CreateAippData(aipp); if (ret != SUCCESS) { - GELOGE(INTERNAL_ERROR, "Failed to create aipp data for aipp %s data %s", aipp->GetName().c_str(), + GELOGE(INTERNAL_ERROR, "[Create][AippData] for aipp %s data %s failed", aipp->GetName().c_str(), out_in_anchors.first->GetOwnerNode()->GetName().c_str()); return INTERNAL_ERROR; } @@ -226,7 +235,7 @@ Status AippOp::InsertAippToGraph(ComputeGraphPtr &graph, std::string &aippConfig aipp->GetName().c_str(), aipp->GetType().c_str(), out_in_anchors.second->GetOwnerNode()->GetName().c_str(), out_in_anchors.second->GetOwnerNode()->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "Failed to link aipp %s to the peer node %s", aipp->GetName().c_str(), + GELOGE(INTERNAL_ERROR, "[Call][LinkFrom] Failed to link aipp %s to the peer node %s", aipp->GetName().c_str(), out_in_anchors.second->GetOwnerNode()->GetName().c_str()); return INTERNAL_ERROR; } @@ -242,7 +251,7 @@ NodePtr AippOp::CreateAipp(const OutDataAnchorPtr &out_anchor, auto aipp_opdesc_ptr = MakeShared(current_name, AIPP); if (aipp_opdesc_ptr == nullptr) { REPORT_CALL_ERROR("E19999", "New OpDesc failed"); - GELOGE(OUT_OF_MEMORY, "Failed to alloc aipp desc, name %s", current_name.c_str()); + GELOGE(OUT_OF_MEMORY, "[New][OpDesc] failed, name %s", current_name.c_str()); return nullptr; } @@ -271,8 +280,8 @@ NodePtr AippOp::CreateAipp(const OutDataAnchorPtr &out_anchor, REPORT_CALL_ERROR("E19999", "Update the output desc from node:%s(%s) to aipp:%s(%s) failed", node_desc->GetName().c_str(), node_desc->GetType().c_str(), aipp_opdesc_ptr->GetName().c_str(), aipp_opdesc_ptr->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "Failed to update the output desc from node %s to aipp %s", node_desc->GetName().c_str(), - aipp_opdesc_ptr->GetName().c_str()); + GELOGE(INTERNAL_ERROR, "[Call][UpdateInputDesc] Failed to update the output desc from node %s to aipp %s", + node_desc->GetName().c_str(), aipp_opdesc_ptr->GetName().c_str()); return nullptr; } @@ -283,25 +292,33 @@ Status AippOp::AddAippAttrbutes(const OpDescPtr &op_desc, const std::string &aip GeAttrValue::NAMED_ATTRS aipp_attr; ConvertParamToAttr(aipp_attr); GE_CHK_BOOL_RET_STATUS(AttrUtils::SetNamedAttrs(op_desc, ATTR_NAME_AIPP, aipp_attr), - INTERNAL_ERROR, "Set name attrs for aipp node failed"); + INTERNAL_ERROR, "[Set][NamedAttrs] %s for aipp node:%s failed", ATTR_NAME_AIPP.c_str(), + op_desc->GetName().c_str()); GE_CHK_BOOL_RET_STATUS(AttrUtils::SetStr(op_desc, kAippConfigPath, aipp_cfg_path), - INTERNAL_ERROR, "Set config file path attr for aipp node failed"); + INTERNAL_ERROR, "[Set][Attr] config file path for aipp node:%s failed", + op_desc->GetName().c_str()); std::vector empty_names; GE_CHK_BOOL_RET_STATUS(AttrUtils::SetListStr(op_desc, ATTR_NAME_DATA_DUMP_ORIGIN_OP_NAMES, empty_names), - INTERNAL_ERROR, "Set ATTR_NAME_DATA_DUMP_ORIGIN_OP_NAMES attr for aipp node failed"); + INTERNAL_ERROR, "[Set][Attr] %s for aipp node:%s failed", + ATTR_NAME_DATA_DUMP_ORIGIN_OP_NAMES.c_str(), op_desc->GetName().c_str()); GE_CHK_BOOL_RET_STATUS(AttrUtils::SetInt(op_desc, kCurrentAippIndex, index), - INTERNAL_ERROR, "Set kCurrentAippIndex attr for aipp node failed"); + INTERNAL_ERROR, "[Set][Attr] %s for aipp node:%s failed", kCurrentAippIndex, + op_desc->GetName().c_str()); // add input/output desc GeTensorDesc tensor; - GE_CHK_GRAPH_STATUS_RET(op_desc->AddInputDesc("images", tensor), "Failed to add input images for aipp node"); + GE_CHK_GRAPH_STATUS_RET(op_desc->AddInputDesc("images", tensor), + "[Add][InputDesc] images for aipp node:%s failed", op_desc->GetName().c_str()); if (GetAippMode() == domi::AippOpParams::dynamic) { - GE_CHK_GRAPH_STATUS_RET(op_desc->AddOptionalInputDesc("params", tensor), "Failed to add params for aipp node"); + GE_CHK_GRAPH_STATUS_RET(op_desc->AddOptionalInputDesc("params", tensor), + "[Call][AddOptionalInputDesc] Failed to add params for aipp node:%s", + op_desc->GetName().c_str()); } - GE_CHK_GRAPH_STATUS_RET(op_desc->AddOutputDesc("features", tensor), "Failed to add output features for aipp node"); + GE_CHK_GRAPH_STATUS_RET(op_desc->AddOutputDesc("features", tensor), + "[Add][OutputDesc] features for aipp node:%s failed", op_desc->GetName().c_str()); return SUCCESS; } @@ -335,7 +352,7 @@ Status AippOp::GetAndCheckTarget(const ComputeGraphPtr &graph, int rank, NodePtr std::set &edge_indexes) { auto data_node = FindDataByIndex(graph, rank); if (data_node == nullptr) { - GELOGE(PARAM_INVALID, "Get target input node for rank %d failed", rank); + GELOGE(PARAM_INVALID, "[Call][FindDataByIndex] Get target input node for rank %d failed", rank); return PARAM_INVALID; } data_node_linked_aipp = data_node; @@ -345,7 +362,7 @@ Status AippOp::GetAndCheckTarget(const ComputeGraphPtr &graph, int rank, NodePtr if (ge::AttrUtils::GetStr(data_opdesc, ATTR_ATC_USER_DEFINE_DATATYPE, set_dt_str)) { ErrorManager::GetInstance().ATCReportErrMessage("E10034", {"opname"}, {data_opdesc->GetName()}); GELOGE(INTERNAL_ERROR, - "This input op [%s] is linked to aipp, can not be set to fp16, " + "[Get][Attr] This input op [%s] is linked to aipp, can not be set to fp16, " "please check your atc parameter --insert_op_conf, --input_fp16_nodes.", data_opdesc->GetName().c_str()); return PARAM_INVALID; @@ -364,7 +381,8 @@ Status AippOp::GetAndCheckTarget(const ComputeGraphPtr &graph, int rank, NodePtr if (!AttrUtils::SetNamedAttrs(data_opdesc, ATTR_NAME_AIPP, aipp_attr)) { REPORT_INNER_ERROR("E19999", "Set Attr:%s for op:%s(%s) failed", ATTR_NAME_AIPP.c_str(), data_opdesc->GetName().c_str(), data_opdesc->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "Set name attrs for Data node failed. id: %d", rank); + GELOGE(INTERNAL_ERROR, "[Set][Attr] %s for op:%s(%s) failed", ATTR_NAME_AIPP.c_str(), + data_opdesc->GetName().c_str(), data_opdesc->GetType().c_str()); return INTERNAL_ERROR; } @@ -397,15 +415,15 @@ Status AippOp::GetStaticTargetNode(const ComputeGraphPtr &graph, NodePtr &data_n REPORT_INNER_ERROR("E19999", "The data node %s has switchn node flag, but the value of attr:%s is empty, " "check invalid", data_node->GetName().c_str(), kMbatchSwitchnName); - GELOGE(INTERNAL_ERROR, "The data node %s has switchn node flag, but the value is empty", - data_node->GetName().c_str()); + GELOGE(INTERNAL_ERROR, "[Check][Param] The data node %s has switchn node flag, but the value of attr:%s is empty", + data_node->GetName().c_str(), kMbatchSwitchnName); return INTERNAL_ERROR; } auto switchn = graph->FindNode(related_node_name); if (switchn == nullptr) { REPORT_INNER_ERROR("E19999", "The data node %s has switchn node %s, but can not find it on the graph, " "check invalid", data_node->GetName().c_str(), related_node_name.c_str()); - GELOGE(INTERNAL_ERROR, "The data node %s has switchn node %s, but can not find it on the graph", + GELOGE(INTERNAL_ERROR, "[Check][Param] The data node %s has switchn node %s, but can not find it on the graph", data_node->GetName().c_str(), related_node_name.c_str()); return INTERNAL_ERROR; } @@ -474,7 +492,7 @@ Status AippOp::GetTargetPosition(ComputeGraphPtr graph, NodePtr &target_input, const uint32_t related_input_rank = aipp_params_->related_input_rank(); auto ret = GetAndCheckTarget(graph, related_input_rank, target_input, edge_indexes); if (ret != SUCCESS) { - GELOGE(ret, "Get target input node for rank %u failed", related_input_rank); + GELOGE(ret, "[Get][TargetInputNode] for rank %u failed", related_input_rank); return ret; } @@ -497,13 +515,14 @@ Status AippOp::GetTargetPosition(ComputeGraphPtr graph, NodePtr &target_input, REPORT_INNER_ERROR("E19999", "Subgraph:%s of op:%s(%s) not find in graph:%s, check invalid", name.c_str(), func_desc->GetName().c_str(), func_desc->GetType().c_str(), graph->GetName().c_str()); - GELOGE(GE_GRAPH_EMPTY_SUBGRAPH, "Subgraph not found, name: %s", name.c_str()); + GELOGE(GE_GRAPH_EMPTY_SUBGRAPH, "[Get][Subgraph] failed, Subgraph:%s of op:%s(%s) not find in graph:%s", + name.c_str(), func_desc->GetName().c_str(), func_desc->GetType().c_str(), graph->GetName().c_str()); return GE_GRAPH_EMPTY_SUBGRAPH; } auto data_node = FindDataByIndex(subgraph, related_input_rank); if (data_node == nullptr) { - GELOGE(PARAM_INVALID, "Get target input node for rank %d failed", related_input_rank); + GELOGE(PARAM_INVALID, "[Get][TargetInputNode] for rank %d failed", related_input_rank); return PARAM_INVALID; } @@ -699,14 +718,16 @@ Status AippOp::GenerateOpDesc(OpDescPtr op_desc) { (op_desc->AddInputDesc(GeTensorDesc()) != GRAPH_SUCCESS)) { REPORT_CALL_ERROR("E19999", "Add input desc into op:%s(%s) failed", op_desc->GetName().c_str(), op_desc->GetType().c_str()); - GELOGE(FAILED, "failed to add input desc"); + GELOGE(FAILED, "[Add][InputDesc] into op:%s(%s) failed", + op_desc->GetName().c_str(), op_desc->GetType().c_str()); return FAILED; } if (op_desc->AddOutputDesc(GeTensorDesc()) != GRAPH_SUCCESS) { REPORT_CALL_ERROR("E19999", "Add output desc into op:%s(%s) failed", op_desc->GetName().c_str(), op_desc->GetType().c_str()); - GELOGE(FAILED, "add output desc failed."); + GELOGE(FAILED, "[Add][OutputDesc] into op:%s(%s) failed", + op_desc->GetName().c_str(), op_desc->GetType().c_str()); return FAILED; } GeAttrValue::NAMED_ATTRS aipp_attrs; @@ -715,7 +736,8 @@ Status AippOp::GenerateOpDesc(OpDescPtr op_desc) { GE_IF_BOOL_EXEC(!AttrUtils::SetNamedAttrs(op_desc, ATTR_NAME_AIPP, aipp_attrs), REPORT_INNER_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed", ATTR_NAME_AIPP.c_str(), op_desc->GetName().c_str(), op_desc->GetType().c_str()); - GELOGE(FAILED, "failed to set ATTR_NAME_AIPP"); + GELOGE(FAILED, "[Set][Attr] %s to op:%s(%s) failed", ATTR_NAME_AIPP.c_str(), + op_desc->GetName().c_str(), op_desc->GetType().c_str()); return FAILED); return SUCCESS; @@ -791,7 +813,7 @@ Status AippOp::CreateAippData(const NodePtr &aipp_node) { auto ori_data_format = GetAndCheckFormat(); if (ori_data_format != FORMAT_NCHW && ori_data_format != FORMAT_NHWC) { string format_str = TypeUtils::FormatToSerialString(ori_data_format); - GELOGE(PARAM_INVALID, "when dynamic aipp, input_format must be NCHW or NHWC, but [%s] format is %s", + GELOGE(PARAM_INVALID, "[Check][Param] when dynamic aipp, input_format must be NCHW or NHWC, but [%s] format is %s", data_node->GetName().c_str(), format_str.c_str()); string reason = "format must be NCHW or NHWC in dynamic aipp process"; ErrorManager::GetInstance().ATCReportErrMessage("E19014", {"opname", "value", "reason"}, @@ -897,7 +919,8 @@ Status AippOp::AddNodeToGraph(const NodePtr &aipp_node, int64_t max_dynamic_aipp if (stat1 != GRAPH_SUCCESS || stat2 != GRAPH_SUCCESS || stat3 != GRAPH_SUCCESS) { REPORT_CALL_ERROR("E19999", "Add and Update InputDesc to op:%s(%s) failed, index:%d", aipp_node->GetName().c_str(), aipp_node->GetType().c_str(), kAippParamsInputIndex); - GELOGE(INTERNAL_ERROR, "node process desc failed!"); + GELOGE(INTERNAL_ERROR, "[Update][InputDesc] to op:%s(%s) failed, index:%d", + aipp_node->GetName().c_str(), aipp_node->GetType().c_str(), kAippParamsInputIndex); return INTERNAL_ERROR; } // aipp_node should have two input data but now tbe only one input @@ -907,7 +930,10 @@ Status AippOp::AddNodeToGraph(const NodePtr &aipp_node, int64_t max_dynamic_aipp aipp_data_node_ptr->GetName().c_str(), aipp_data_node_ptr->GetType().c_str(), kAippDataOutputIndex, aipp_node->GetName().c_str(), aipp_node->GetType().c_str(), kAippParamsInputIndex); - GELOGE(INTERNAL_ERROR, "Add Anchor anchor between aipp data node and aipp failed!"); + GELOGE(INTERNAL_ERROR, "[Add][Edge] between op:%s(%s)(out_index:%u) and op:%s(%s)(in_index:%u) failed", + aipp_data_node_ptr->GetName().c_str(), aipp_data_node_ptr->GetType().c_str(), + kAippDataOutputIndex, aipp_node->GetName().c_str(), aipp_node->GetType().c_str(), + kAippParamsInputIndex); return INTERNAL_ERROR; } return SUCCESS; diff --git a/ge/graph/preprocess/insert_op/util_insert_aipp_op.cc b/ge/graph/preprocess/insert_op/util_insert_aipp_op.cc index 3bc8e3e4..4164a872 100755 --- a/ge/graph/preprocess/insert_op/util_insert_aipp_op.cc +++ b/ge/graph/preprocess/insert_op/util_insert_aipp_op.cc @@ -69,23 +69,23 @@ Status InsertNewOpUtil::Parse(const char *conf_path) { return SUCCESS; } - GE_CHK_BOOL_RET_STATUS(ReadProtoFromText(conf_path, insert_op_conf_.get()), FAILED, "Read AIPP conf file error: %s", - conf_path); + GE_CHK_BOOL_RET_STATUS(ReadProtoFromText(conf_path, insert_op_conf_.get()), FAILED, + "[Read][Proto] from file:%s failed", conf_path); - GE_CHK_STATUS_RET(CheckPositionNotRepeat(), "Check insert position of op failed"); + GE_CHK_STATUS_RET(CheckPositionNotRepeat(), "[Check][InsertPosition] of op failed"); for (int i = 0; i < insert_op_conf_->aipp_op_size(); i++) { domi::AippOpParams *aipp_op_params = insert_op_conf_->mutable_aipp_op(i); std::unique_ptr aipp_op(new (std::nothrow) AippOp()); GE_CHECK_NOTNULL(aipp_op); - GE_CHK_STATUS_RET(aipp_op->Init(aipp_op_params), "Aipp op init failed."); + GE_CHK_STATUS_RET(aipp_op->Init(aipp_op_params), "[Call][Init] Aipp op init failed."); insert_ops_.push_back(std::move(aipp_op)); } for (auto &dynamic_op : insert_ops_) { GE_CHECK_NOTNULL(dynamic_op); - GE_CHK_STATUS_RET(dynamic_op->ValidateParams(), "Validate insert_op config file failed"); - GE_CHK_STATUS_RET(dynamic_op->SetDefaultParams(), "Set default value of insert_op failed"); + GE_CHK_STATUS_RET(dynamic_op->ValidateParams(), "[Call][ValidateParams] Validate insert_op config file failed"); + GE_CHK_STATUS_RET(dynamic_op->SetDefaultParams(), "[Call][SetDefaultParams] Set default value of insert_op failed"); } return SUCCESS; @@ -94,12 +94,13 @@ Status InsertNewOpUtil::Parse(const char *conf_path) { Status InsertNewOpUtil::InsertAippOps(ComputeGraphPtr &graph, std::string &aippConfigPath) { GE_CHECK_NOTNULL(graph); for (uint32_t index = 0; index < insert_ops_.size(); ++index) { - GE_CHK_STATUS_RET(insert_ops_[index]->InsertAippToGraph(graph, aippConfigPath, index), "insert op to graph failed"); + GE_CHK_STATUS_RET(insert_ops_[index]->InsertAippToGraph(graph, aippConfigPath, index), + "[Insert][Op] to graph failed"); } - GE_CHK_STATUS_RET(CheckGraph(graph), "after inserting all ops, check graph failed"); + GE_CHK_STATUS_RET(CheckGraph(graph), "[Check][Graph] failed after inserting all ops"); - GE_CHK_GRAPH_STATUS_RET(graph->TopologicalSorting(), "after insert dynamic op, sort graph failed"); + GE_CHK_GRAPH_STATUS_RET(graph->TopologicalSorting(), "[Sort][Graph] failed after insert dynamic op"); ClearNewOps(); @@ -189,7 +190,7 @@ Status InsertNewOpUtil::CheckPositionNotRepeat() { ret = CheckInputNamePositionNotRepeat(); } if (ret != SUCCESS) { - GELOGE(FAILED, "Check position not repeat failed."); + GELOGE(FAILED, "[Check][Position] not repeat failed."); return FAILED; } @@ -257,8 +258,10 @@ Status InsertNewOpUtil::GetAippParams(const std::unique_ptr const OpDescPtr tmpOpPtr = aipp_node->GetOpDesc(); GE_CHECK_NOTNULL(tmpOpPtr); GE_CHK_BOOL_RET_STATUS(AttrUtils::GetNamedAttrs(tmpOpPtr, ATTR_NAME_AIPP, aipp_attr), FAILED, - "Aipp node should contain param aipp!"); - GE_CHK_STATUS_RET(OpUtils::ConvertAippParams(aipp_attr, aippParams.get()), "get aipp params failed"); + "[Get][Attr] %s from Aipp node:%s failed", + ATTR_NAME_AIPP.c_str(), tmpOpPtr->GetName().c_str()); + GE_CHK_STATUS_RET(OpUtils::ConvertAippParams(aipp_attr, aippParams.get()), + "[Convert][AippParams] get aipp params failed"); return SUCCESS; } @@ -309,7 +312,8 @@ Status InsertNewOpUtil::FindMaxSizeNode(const ComputeGraphPtr &graph, const Node REPORT_INNER_ERROR("E19999", "Subgraph:%s of op:%s(%s) not find in graph:%s, check invalid", name.c_str(), func_desc->GetName().c_str(), func_desc->GetType().c_str(), graph->GetName().c_str()); - GELOGE(GE_GRAPH_EMPTY_SUBGRAPH, "Subgraph not found, name: %s", name.c_str()); + GELOGE(GE_GRAPH_EMPTY_SUBGRAPH, "[Get][SubGraph] failed, Subgraph:%s of op:%s(%s) not find in graph:%s", + name.c_str(), func_desc->GetName().c_str(), func_desc->GetType().c_str(), graph->GetName().c_str()); return GE_GRAPH_EMPTY_SUBGRAPH; } @@ -331,7 +335,8 @@ Status InsertNewOpUtil::FindMaxSizeNode(const ComputeGraphPtr &graph, const Node REPORT_INNER_ERROR("E19999", "Get Attr:%s of op:%s(%s) failed", ATTR_NAME_PARENT_NODE_INDEX.c_str(), src_op->GetName().c_str(), src_op->GetType().c_str()); - GELOGE(FAILED, "Parent index not found, name: %s", src_op->GetName().c_str()); + GELOGE(FAILED, "[Get][Attr] %s of op:%s(%s) failed", ATTR_NAME_PARENT_NODE_INDEX.c_str(), + src_op->GetName().c_str(), src_op->GetType().c_str()); return FAILED; } @@ -384,16 +389,16 @@ Status InsertNewOpUtil::UpdateCaseNode(const ComputeGraphPtr &graph, const NodeP if (ret != GRAPH_SUCCESS) { REPORT_CALL_ERROR("E19999", "Update OutputDesc to op:%s(%s) failed, index:0", data_opdesc->GetName().c_str(), data_opdesc->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "Failed to update data %s output using case %s", data->GetName().c_str(), - case_node->GetName().c_str()); + GELOGE(INTERNAL_ERROR, "[Update][OutputDesc] to op:%s(%s) failed, index:0", + data_opdesc->GetName().c_str(), data_opdesc->GetType().c_str()); return INTERNAL_ERROR; } ret = data_opdesc->UpdateInputDesc(0, *input_desc); if (ret != GRAPH_SUCCESS) { REPORT_CALL_ERROR("E19999", "Update InputDesc to op:%s(%s) failed, index:0", data_opdesc->GetName().c_str(), data_opdesc->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "Failed to update data %s input using case %s", data->GetName().c_str(), - case_node->GetName().c_str()); + GELOGE(INTERNAL_ERROR, "[Update][InputDesc] to op:%s(%s) failed, index:0", + data_opdesc->GetName().c_str(), data_opdesc->GetType().c_str()); return INTERNAL_ERROR; } @@ -416,14 +421,16 @@ Status InsertNewOpUtil::UpdatePrevNodeByAipp(NodePtr &node, std::set &s if (graph_ret != GRAPH_SUCCESS) { REPORT_CALL_ERROR("E19999", "Get input size of op:%s(%s), index:0, failed", aipp_op_desc->GetName().c_str(), aipp_op_desc->GetType().c_str()); - GELOGE(FAILED, "UpdateOutputDesc fail, graph_ret:%d", graph_ret); + GELOGE(FAILED, "[Get][InputSize] of op:%s(%s), index:0, failed", + aipp_op_desc->GetName().c_str(), aipp_op_desc->GetType().c_str()); return FAILED; } GELOGI("Get input size [%ld] from aipp [%s].", size, aipp_op_desc->GetName().c_str()); if (size == 0) { REPORT_CALL_ERROR("E19999", "Tensor size of op:%s(%s) is 0, input_index:0, check invalid", aipp_op_desc->GetName().c_str(), aipp_op_desc->GetType().c_str()); - GELOGE(FAILED, "Can not get size from aipp [%s]", aipp_op_desc->GetName().c_str()); + GELOGE(FAILED, "[Check][Param] Tensor size of op:%s(%s) is 0, input_index:0", + aipp_op_desc->GetName().c_str(), aipp_op_desc->GetType().c_str()); return FAILED; } (void)AttrUtils::SetInt(aipp_input, ATTR_NAME_INPUT_ORIGIN_SIZE, size); @@ -511,16 +518,16 @@ Status InsertNewOpUtil::UpdateDataBySwitchN(const NodePtr &switchn, const NodePt if (ret != GRAPH_SUCCESS) { REPORT_CALL_ERROR("E19999", "Update OutputDesc to op:%s(%s) failed, index:0", data_opdesc->GetName().c_str(), data_opdesc->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "Failed to update data %s output using switchn %s", data->GetName().c_str(), - switchn->GetName().c_str()); + GELOGE(INTERNAL_ERROR, "[Update][OutputDesc] to op:%s(%s) failed, index:0", + data_opdesc->GetName().c_str(), data_opdesc->GetType().c_str()); return INTERNAL_ERROR; } ret = data_opdesc->UpdateInputDesc(0, *input_desc); if (ret != GRAPH_SUCCESS) { REPORT_CALL_ERROR("E19999", "Update InputDesc to op:%s(%s) failed, index:0", data_opdesc->GetName().c_str(), data_opdesc->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "Failed to update data %s input using switchn %s", data->GetName().c_str(), - switchn->GetName().c_str()); + GELOGE(INTERNAL_ERROR, "[Update][InputDesc] to op:%s(%s) failed, index:0", + data_opdesc->GetName().c_str(), data_opdesc->GetType().c_str()); return INTERNAL_ERROR; } // Update attr _mbatch_origin_input_dims for data when it is linked to aipp @@ -563,8 +570,8 @@ Status InsertNewOpUtil::GetDataRelatedNode(NodePtr &node, std::map aipp_params(new (std::nothrow) domi::AippOpParams()); ge::GeAttrValue::NAMED_ATTRS aipp_attr; GE_CHK_BOOL_RET_STATUS(AttrUtils::GetNamedAttrs(data_op, ATTR_NAME_AIPP, aipp_attr), ACL_ERROR_GE_AIPP_NOT_EXIST, - "Data node do not contain param aipp!"); - GE_CHK_STATUS_RET(OpUtils::ConvertAippParams(aipp_attr, aipp_params.get()), "get aipp params failed"); + "[Get][Attr] %s from op:%s failed", ATTR_NAME_AIPP.c_str(), data_op->GetName().c_str()); + GE_CHK_STATUS_RET(OpUtils::ConvertAippParams(aipp_attr, aipp_params.get()), "[Get][AippParams] failed"); for (auto out_data_anchor : node->GetAllOutDataAnchors()) { GE_CHECK_NOTNULL(out_data_anchor); @@ -621,7 +628,8 @@ Status InsertNewOpUtil::GetAllAipps(const NodePtr &data_node, const NodePtr &nod REPORT_INNER_ERROR("E19999", "Subgraph:%s of op:%s(%s) not find in graph:%s, check invalid", name.c_str(), op->GetName().c_str(), op->GetType().c_str(), graph->GetName().c_str()); - GELOGE(GE_GRAPH_EMPTY_SUBGRAPH, "Subgraph not found, name: %s", name.c_str()); + GELOGE(GE_GRAPH_EMPTY_SUBGRAPH, "[Get][SubGraph] Subgraph:%s of op:%s(%s) not find in graph:%s", + name.c_str(), op->GetName().c_str(), op->GetType().c_str(), graph->GetName().c_str()); return GE_GRAPH_EMPTY_SUBGRAPH; } @@ -635,7 +643,8 @@ Status InsertNewOpUtil::GetAllAipps(const NodePtr &data_node, const NodePtr &nod REPORT_INNER_ERROR("E19999", "Get Attr:%s of op:%s(%s) failed", ATTR_NAME_PARENT_NODE_INDEX.c_str(), src_op->GetName().c_str(), src_op->GetType().c_str()); - GELOGE(FAILED, "Parent index not found, name: %s", src_op->GetName().c_str()); + GELOGE(FAILED, "[Get][Attr] %s of op:%s(%s) failed", + ATTR_NAME_PARENT_NODE_INDEX.c_str(), src_op->GetName().c_str(), src_op->GetType().c_str()); return FAILED; } auto data = node->GetInDataNodes().at(parent_index); @@ -774,10 +783,11 @@ Status InsertNewOpUtil::SetModelInputDims(NodePtr &data_node, NodePtr &aipp_node } GELOGD("After set N or H/W to -1, the model input dims: %s.", formats::JoinToString(model_input_dims).c_str()); if (!AttrUtils::SetListInt(data_opdesc, ATTR_NAME_INPUT_DIMS, model_input_dims)) { - REPORT_INNER_ERROR("E19999", "Set Attr:%s of op:%s(%s) failed", + REPORT_INNER_ERROR("E19999", "Set Attr:%s on op:%s(%s) failed", ATTR_NAME_INPUT_DIMS.c_str(), data_opdesc->GetName().c_str(), data_opdesc->GetType().c_str()); - GELOGE(FAILED, "SetListInt of %s failed.", ATTR_NAME_INPUT_DIMS.c_str()); + GELOGE(FAILED, "[Set][Attr] %s on op:%s(%s) failed", + ATTR_NAME_INPUT_DIMS.c_str(), data_opdesc->GetName().c_str(), data_opdesc->GetType().c_str()); return FAILED; } } diff --git a/ge/graph/preprocess/multi_batch_copy_graph.cc b/ge/graph/preprocess/multi_batch_copy_graph.cc index 329ba036..610b0137 100644 --- a/ge/graph/preprocess/multi_batch_copy_graph.cc +++ b/ge/graph/preprocess/multi_batch_copy_graph.cc @@ -79,7 +79,7 @@ NodePtr InsertMergeNodeToGraph(const std::string &name, size_t input_num, const OpDescPtr desc = MakeShared(); if (desc == nullptr) { REPORT_CALL_ERROR("E19999", "New OpDesc failed"); - GELOGE(OUT_OF_MEMORY, "Failed to insert merge node, name %s", name.c_str()); + GELOGE(OUT_OF_MEMORY, "[New][OpDesc] failed, name %s", name.c_str()); return nullptr; } desc->SetName(name); @@ -88,34 +88,35 @@ NodePtr InsertMergeNodeToGraph(const std::string &name, size_t input_num, const for (size_t i = 0; i < input_num; ++i) { auto ret = desc->AddInputDesc("x" + std::to_string(i), tensor_desc); GE_IF_BOOL_EXEC(ret != GRAPH_SUCCESS, - REPORT_CALL_ERROR("E19999", "Add input desc to op:%s(%s) failed, input desc name:%s,", + REPORT_CALL_ERROR("E19999", "Add input desc to op:%s(%s) failed, input desc name:%s", desc->GetName().c_str(), desc->GetType().c_str(), ("x" + std::to_string(i)).c_str()); - GELOGE(INTERNAL_ERROR, "Failed to create merge node %s, failed to add input %zu, error-code %u", - name.c_str(), i, ret); + GELOGE(INTERNAL_ERROR, "[Add][InputDesc] to op:%s(%s) failed, input desc name:%s", + desc->GetName().c_str(), desc->GetType().c_str(), ("x" + std::to_string(i)).c_str()); return nullptr); } auto ret = desc->AddOutputDesc("y", tensor_desc); GE_IF_BOOL_EXEC(ret != GRAPH_SUCCESS, - REPORT_CALL_ERROR("E19999", "Add output desc to op:%s(%s) failed, output desc name:%s,", + REPORT_CALL_ERROR("E19999", "Add output desc to op:%s(%s) failed, output desc name:%s", desc->GetName().c_str(), desc->GetType().c_str(), "y"); - GELOGE(INTERNAL_ERROR, "Failed to create merge node %s, failed to add output 'y', error-code %u", - name.c_str(), ret); + GELOGE(INTERNAL_ERROR, "[Add][OutputDesc] to op:%s(%s) failed, output desc name:y", + desc->GetName().c_str(), desc->GetType().c_str()); return nullptr); tensor_desc.SetDataType(DT_INT32); ret = desc->AddOutputDesc("value_index", tensor_desc); if (ret != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Add output desc to op:%s(%s) failed, output desc name:%s,", + REPORT_CALL_ERROR("E19999", "Add output desc to op:%s(%s) failed, output desc name:%s", desc->GetName().c_str(), desc->GetType().c_str(), "value_index"); - GELOGE(INTERNAL_ERROR, "Failed to create merge node %s, failed to add output 'value_index', error-code %u", - name.c_str(), ret); + GELOGE(INTERNAL_ERROR, "[Add][OutputDesc] to op:%s(%s) failed, output desc name:value_index", + desc->GetName().c_str(), desc->GetType().c_str()); return nullptr; } if (!AttrUtils::SetBool(desc, ATTR_INSERT_BY_MBATCH, true)) { REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed", ATTR_INSERT_BY_MBATCH.c_str(), desc->GetName().c_str(), desc->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "Failed to create merge node %s, failed to add attr", name.c_str()); + GELOGE(INTERNAL_ERROR, "[Set][Attr] %s to op:%s(%s) failed", ATTR_INSERT_BY_MBATCH.c_str(), + desc->GetName().c_str(), desc->GetType().c_str()); return nullptr; } return graph->AddNode(desc); @@ -126,16 +127,15 @@ NodePtr InsertCopyNode(const NodePtr &node, size_t n) { auto src_op_desc = node->GetOpDesc(); GE_IF_BOOL_EXEC(src_op_desc == nullptr, REPORT_INNER_ERROR("E19999", "Param opdesc in node is nullptr, check invalid"); - GELOGE(INTERNAL_ERROR, "Failed to copy node %s to %s, the OpDesc is null", - node->GetName().c_str(), name.c_str()); + GELOGE(INTERNAL_ERROR, "[Get][OpDesc] failed, src_op_desc is nullptr"); return nullptr); auto desc = AttrUtils::CopyOpDesc(src_op_desc); GE_IF_BOOL_EXEC(desc == nullptr, REPORT_CALL_ERROR("E19999", "Copy OpDesc from op:%s(%s) failed", src_op_desc->GetName().c_str(), src_op_desc->GetType().c_str()); - GELOGE(OUT_OF_MEMORY, "Failed to create op desc for copy node for node %s name %s", - node->GetName().c_str(), name.c_str()); + GELOGE(OUT_OF_MEMORY, "[Copy][OpDesc] from op:%s(%s) failed", + src_op_desc->GetName().c_str(), src_op_desc->GetType().c_str()); return nullptr); desc->SetName(name); @@ -156,8 +156,8 @@ NodePtr InsertCopyNode(const NodePtr &node, size_t n) { GE_IF_BOOL_EXEC(output_desc == nullptr, REPORT_INNER_ERROR("E19999", "Ouput desc of op:%s(%s) not exist, index:%u, check invalid", desc->GetName().c_str(), desc->GetType().c_str(), i); - GELOGE(INTERNAL_ERROR, "Failed to get output desc by index %u from node %s when copy from %s", i, - desc->GetName().c_str(), node->GetName().c_str()); + GELOGE(INTERNAL_ERROR, "[Call][MutableOutputDesc] Ouput desc of op:%s(%s) not exist, index:%u", + desc->GetName().c_str(), desc->GetType().c_str(), i); return nullptr); output_desc->CopyAttrsFrom(src_op_desc->GetOutputDesc(i)); @@ -166,7 +166,8 @@ NodePtr InsertCopyNode(const NodePtr &node, size_t n) { if (!AttrUtils::SetStr(desc, ATTR_NAME_BATCH_LABEL, batch_label)) { REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed", ATTR_NAME_BATCH_LABEL.c_str(), desc->GetName().c_str(), desc->GetType().c_str()); - GELOGE(FAILED, "set attr ATTR_NAME_BATCH_LABEL failed, node:%s.", name.c_str()); + GELOGE(FAILED, "[Set][Attr] %s to op:%s(%s) failed", ATTR_NAME_BATCH_LABEL.c_str(), + desc->GetName().c_str(), desc->GetType().c_str()); return nullptr; } @@ -189,7 +190,7 @@ NodePtr InsertConst(const std::string &name, const ComputeGraphPtr &graph) { auto desc = MakeShared(); if (desc == nullptr) { REPORT_CALL_ERROR("E19999", "New OpDesc failed"); - GELOGE(OUT_OF_MEMORY, "Failed to create const op %s, out of memory", name.c_str()); + GELOGE(OUT_OF_MEMORY, "[Create][ConstOp] %s failed, out of memory", name.c_str()); return nullptr; } desc->SetName(name); @@ -199,19 +200,22 @@ NodePtr InsertConst(const std::string &name, const ComputeGraphPtr &graph) { if (!AttrUtils::SetTensor(desc, ATTR_NAME_WEIGHTS, tensor)) { REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed", ATTR_NAME_WEIGHTS.c_str(), desc->GetName().c_str(), desc->GetType().c_str()); - GELOGE(OUT_OF_MEMORY, "Failed to init tensor value for const %s", name.c_str()); + GELOGE(OUT_OF_MEMORY, "[Set][Attr] %s to op:%s(%s) failed", ATTR_NAME_WEIGHTS.c_str(), + desc->GetName().c_str(), desc->GetType().c_str()); return nullptr; } if (!AttrUtils::SetBool(desc, ATTR_INSERT_BY_MBATCH, true)) { REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed", ATTR_INSERT_BY_MBATCH.c_str(), desc->GetName().c_str(), desc->GetType().c_str()); - GELOGE(OUT_OF_MEMORY, "Failed to set insert flag for const node %s", name.c_str()); + GELOGE(OUT_OF_MEMORY, "[Set][Attr] %s to op:%s(%s) failed", ATTR_INSERT_BY_MBATCH.c_str(), + desc->GetName().c_str(), desc->GetType().c_str()); return nullptr; } if (desc->AddOutputDesc(GeTensorDesc()) != GRAPH_SUCCESS) { REPORT_CALL_ERROR("E19999", "Add output desc to op:%s(%s) failed", desc->GetName().c_str(), desc->GetType().c_str()); - GELOGE(OUT_OF_MEMORY, "Failed to add output desc for const node %s", name.c_str()); + GELOGE(OUT_OF_MEMORY, "[Add][OutputDesc] to op:%s(%s) failed", + desc->GetName().c_str(), desc->GetType().c_str()); return nullptr; } return graph->AddNode(desc); @@ -234,7 +238,7 @@ Status MultiBatchGraphCopyer::CopyGraph() { } if (LabelStatus() != SUCCESS) { - GELOGE(INTERNAL_ERROR, "Failed to label status for all nodes."); + GELOGE(INTERNAL_ERROR, "[Label][Status] for all nodes failed."); return INTERNAL_ERROR; } @@ -257,7 +261,7 @@ Status MultiBatchGraphCopyer::CopyGraph() { PrunePass prune_pass; ret = prune_pass.Run(graph_); if (ret != SUCCESS) { - GELOGE(ret, "Failed to prune"); + GELOGE(ret, "[Run][PrunePass] failed."); return ret; } return CheckCopyResult(origin_data_nodes_); @@ -271,13 +275,13 @@ Status MultiBatchGraphCopyer::Init() { ret = RelinkConstCtrlEdge(); if (ret != SUCCESS) { - GELOGE(FAILED, "Relink const's control edge failed."); + GELOGE(FAILED, "[Relink][ConstCtrlEdge] failed."); return FAILED; } ret = ExtractUnchangedStructureOutofCycle(); if (ret != SUCCESS) { - GELOGE(FAILED, "Extract unchanged structure out of cycle failed."); + GELOGE(FAILED, "[Call][ExtractUnchangedStructureOutofCycle] failed."); return FAILED; } @@ -343,13 +347,13 @@ Status MultiBatchGraphCopyer::RelinkConstCtrlEdge() { Status MultiBatchGraphCopyer::ExtractUnchangedStructureOutofCycle() { map> frame_enter; if (GetEnterNodesGroupByFrame(frame_enter) != SUCCESS) { - GELOGE(FAILED, "Get enter nodes grouped by frame_name failed."); + GELOGE(FAILED, "[Call][GetEnterNodesGroupByFrame] failed."); return FAILED; } queue nodes_to_extract; if (GetNodeNeedExtract(frame_enter, nodes_to_extract) != SUCCESS) { - GELOGE(FAILED, "Get nodes needed to extract failed."); + GELOGE(FAILED, "[Call][GetNodeNeedExtract] failed."); return FAILED; } @@ -358,17 +362,17 @@ Status MultiBatchGraphCopyer::ExtractUnchangedStructureOutofCycle() { nodes_to_extract.pop(); OpDescPtr enter_desc = nullptr; if (MoveInEntersInDataAnchorDown(node, enter_desc) != SUCCESS) { - GELOGE(FAILED, "Move in enter nodes' in data anchors down of %s failed.", node->GetName().c_str()); + GELOGE(FAILED, "[Call][MoveInEntersInDataAnchorDown] for node:%s failed.", node->GetName().c_str()); return FAILED; } set out_nodes; if (InsertEnterAfterNode(node, enter_desc, out_nodes) != SUCCESS) { - GELOGE(FAILED, "Insert enter node after %s failed.", node->GetName().c_str()); + GELOGE(FAILED, "[Insert][EnterNode] after node:%s failed.", node->GetName().c_str()); return FAILED; } if (MoveCtrlEdgeToOutNodes(node, out_nodes) != SUCCESS) { - GELOGE(FAILED, "Move %s's control edge to out nodes failed.", node->GetName().c_str()); + GELOGE(FAILED, "[Call][MoveCtrlEdgeToOutNodes] for node:%s failed.", node->GetName().c_str()); return FAILED; } @@ -381,7 +385,7 @@ Status MultiBatchGraphCopyer::ExtractUnchangedStructureOutofCycle() { } if (DeleteEnterWithoutDataOut() != SUCCESS) { - GELOGE(FAILED, "Delete enter node without out data nodes failed."); + GELOGE(FAILED, "[Call][DeleteEnterWithoutDataOut] failed."); return FAILED; } @@ -399,10 +403,11 @@ Status MultiBatchGraphCopyer::GetEnterNodesGroupByFrame(mapGetName().c_str(), op_desc->GetType().c_str()); - GELOGE(FAILED, "Get attr frame_name of enter[%s] failed.", node->GetName().c_str()); + GELOGE(FAILED, "[Get][Attr] %s from op:%s(%s) failed", + ENTER_ATTR_FRAME_NAME.c_str(), op_desc->GetName().c_str(), op_desc->GetType().c_str()); return FAILED; } frame_enter[frame_name].emplace_back(node); @@ -611,7 +616,7 @@ Status MultiBatchGraphCopyer::LabelInBatchBranchStatus() { auto op_desc = data->GetOpDesc(); GE_IF_BOOL_EXEC(op_desc == nullptr, REPORT_INNER_ERROR("E19999", "op_desc in origin_data_nodes_ is nullptr, check invalid"); - GELOGE(PARAM_INVALID, "Op desc is nullptr."); + GELOGE(PARAM_INVALID, "[Get][OpDesc] failed, op_desc is nullptr."); return PARAM_INVALID); LabelStatusForData(data); if (!GetLocalOmgContext().dynamic_node_type.empty()) { @@ -686,7 +691,7 @@ void MultiBatchGraphCopyer::ResetEnterStatus(map> &frame Status MultiBatchGraphCopyer::LabelStatus() { if (LabelInBatchBranchStatus() != SUCCESS) { - GELOGE(PARAM_INVALID, "Failed to label no in batch branch"); + GELOGE(PARAM_INVALID, "[Call][LabelInBatchBranchStatus] failed."); return PARAM_INVALID; } @@ -751,18 +756,18 @@ Status MultiBatchGraphCopyer::CheckAndParseDynamicData(){ if (iter == data_name_order_.end()) { if (dynamic_type_ == DynamicType::kDynamicBatch) { auto ret = CheckDynamicBatchShape(data_shape_dims, data_name); - GE_IF_BOOL_EXEC(ret == false, GELOGE(PARAM_INVALID, "Failed to check dynamic batch shape of %s.", + GE_IF_BOOL_EXEC(ret == false, GELOGE(PARAM_INVALID, "[Check][DynamicBatchShape] of %s failed.", data_name.c_str()); return PARAM_INVALID); } else if (dynamic_type_ == DynamicType::kDynamicImageSize) { auto ret = CheckDynamicImageSizeShape(data_shape_dims, data_name, data_format); - GE_IF_BOOL_EXEC(ret == false, GELOGE(PARAM_INVALID, "Failed to check dynamic image size shape of %s.", + GE_IF_BOOL_EXEC(ret == false, GELOGE(PARAM_INVALID, "[Check][DynamicImageSizeShape] of %s failed.", data_name.c_str()); return PARAM_INVALID); } else if (dynamic_type_ == DynamicType::kDynamicDims) { ErrorManager::GetInstance().ATCReportErrMessage("E10001", {"parameter", "reason"}, {"--input_shape", "all dynamic data must be set in --input_shape"}); - GELOGE(INTERNAL_ERROR, "data: %s shape:%s must be set int --input_shape", + GELOGE(INTERNAL_ERROR, "[Check][Param] data:%s shape:%s must be set int --input_shape", node->GetName().c_str(), data_shape.ToString().c_str()); return INTERNAL_ERROR; } @@ -772,11 +777,11 @@ Status MultiBatchGraphCopyer::CheckAndParseDynamicData(){ } } auto ret = ParserDataToDynamicInfo(shapes_, data_name_and_shape, data_to_dynamic_info_); - GE_CHK_STATUS_RET(ret, "Failed to parse data to dynamic info."); + GE_CHK_STATUS_RET(ret, "[Call][ParserDataToDynamicInfo] failed."); if (!getnext_sink_dynamic_dims_ && unknown_shape_count == 0) { ErrorManager::GetInstance().ATCReportErrMessage("E10040"); - GELOGE(PARAM_INVALID, - "Need unknow shape data when user set --dynamic_batch_size, --dynamic_image_size or --dynamic_dims"); + GELOGE(PARAM_INVALID, "[Check][Param] Need unknow shape data " + "when user set --dynamic_batch_size, --dynamic_image_size or --dynamic_dims"); return PARAM_INVALID; } return SUCCESS; @@ -788,8 +793,8 @@ Status MultiBatchGraphCopyer::CreateNewNodes() { } else { shape_data_ = InsertGetDynamicDimsNode(); } - GE_IF_BOOL_EXEC(shape_data_ == nullptr, GELOGE(INTERNAL_ERROR, "Failed to create the shape node for multi batch"); - return INTERNAL_ERROR); + GE_IF_BOOL_EXEC(shape_data_ == nullptr, GELOGE(INTERNAL_ERROR, "[Create][TheShapeNode] for multi batch failed"); + return INTERNAL_ERROR); GE_CHECK_NOTNULL(shape_data_->GetOpDesc()); for (const auto &node : origin_all_nodes_) { @@ -818,12 +823,12 @@ Status MultiBatchGraphCopyer::CreateNewNodes() { GELOGD("Name: %s, type: %s, status: kNodeNotSupportNode.", node->GetName().c_str(), node->GetType().c_str()); break; default: - GELOGE(INTERNAL_ERROR, "Unexpected status %d on node %s", static_cast(branch_status), + GELOGE(INTERNAL_ERROR, "[Get][NodeStatus] Unexpected status %d on node %s", static_cast(branch_status), node->GetName().c_str()); break; } if (ret != SUCCESS) { - GELOGE(ret, "Failed to deal with node %s in multi-batch process", node->GetName().c_str()); + GELOGE(ret, "[DealWith][Node] %s in multi-batch process failed", node->GetName().c_str()); return ret; } } @@ -852,8 +857,9 @@ NodePtr MultiBatchGraphCopyer::InsertMergeNode(const NodePtr &node, int index) { auto merge_node_name = node->GetName() + "_ascend_mbatch_merge_" + std::to_string(index); auto merge_node = InsertMergeNodeToGraph(merge_node_name, shapes_.size(), node->GetOwnerComputeGraph()); - GE_IF_BOOL_EXEC(merge_node == nullptr, GELOGE(INTERNAL_ERROR, "Failed to create merge node for node %s, out index %d", - node->GetName().c_str(), index); + GE_IF_BOOL_EXEC(merge_node == nullptr, + GELOGE(INTERNAL_ERROR, "[Create][MergeNode] for node %s failed, out index %d", + node->GetName().c_str(), index); return nullptr); merge_nodes[index] = merge_node; GELOGI("Create merge node %s for node %s index %d", merge_node_name.c_str(), node->GetName().c_str(), index); @@ -889,7 +895,8 @@ NodePtr MultiBatchGraphCopyer::FindSwitchnNodeForDataEdge(const OutDataAnchorPtr REPORT_INNER_ERROR("E19999", "peer op_desc of op:%s(%s)'s out_index:%d anchor exist nullptr, " "check invalid", data_node->GetName().c_str(), data_node->GetType().c_str(), output_idx); - GELOGE(INTERNAL_ERROR, "Op desc should not be nullptr."); + GELOGE(INTERNAL_ERROR, "[Get][OpDesc] failed, peer op_desc of op:%s(%s)'s out_index:%d anchor exist nullptr", + data_node->GetName().c_str(), data_node->GetType().c_str(), output_idx); return nullptr; } if (getnext_nodes_to_switchn_.at(output_idx).empty()) { @@ -903,7 +910,10 @@ NodePtr MultiBatchGraphCopyer::FindSwitchnNodeForDataEdge(const OutDataAnchorPtr "check invalid", output_idx, data_node->GetName().c_str(), data_node->GetType().c_str(), getnext_nodes_to_switchn_.size(), referenced_index, getnext_nodes_to_switchn_.at(output_idx).size()); - GELOGE(INTERNAL_ERROR, "Output idx is %d, referenced index is %zu", output_idx, referenced_index); + GELOGE(INTERNAL_ERROR, "[Check][Param] output_index:%d of op:%s(%s) >= getnext_nodes_to_switchn_.size():%zu or " + "referenced_index:%zu >= getnext_nodes_to_switchn_.at(output_idx).size():%zu", output_idx, + data_node->GetName().c_str(), data_node->GetType().c_str(), getnext_nodes_to_switchn_.size(), + referenced_index, getnext_nodes_to_switchn_.at(output_idx).size()); return nullptr; } if (peer_in_anchor->GetOwnerNode()->GetOpDesc()->GetName() == origin_node->GetName()) { @@ -936,7 +946,7 @@ Status MultiBatchGraphCopyer::CopyInDataEdges(const NodePtr &origin_node, int ba switchn->GetName().c_str(), switchn->GetType().c_str(), batch_num, copyed_node->GetName().c_str(), copyed_node->GetType().c_str(), in_anchor->GetIdx()); - GELOGE(INTERNAL_ERROR, "Failed to add data edge between %s(%d) to %s(%d), error-code %u", + GELOGE(INTERNAL_ERROR, "[Add][DataEdge] between %s(%d) and %s(%d) failed, error-code %u", switchn->GetName().c_str(), batch_num, copyed_node->GetName().c_str(), in_anchor->GetIdx(), ret); return INTERNAL_ERROR; @@ -956,7 +966,7 @@ Status MultiBatchGraphCopyer::CopyInDataEdges(const NodePtr &origin_node, int ba src_batch_node->GetType().c_str(), origin_src_anchor->GetIdx(), copyed_node->GetName().c_str(), copyed_node->GetType().c_str(), in_anchor->GetIdx()); - GELOGE(INTERNAL_ERROR, "Failed to add data edge between %s(%d) to %s(%d), error-code %u", + GELOGE(INTERNAL_ERROR, "[Add][DataEdge] between %s(%d) and %s(%d) failed, error-code %u", src_batch_node->GetName().c_str(), batch_num, copyed_node->GetName().c_str(), in_anchor->GetIdx(), ret); return INTERNAL_ERROR; } @@ -972,7 +982,7 @@ Status MultiBatchGraphCopyer::CopyInDataEdges(const NodePtr &origin_node, int ba origin_src_node->GetType().c_str(), origin_src_anchor->GetIdx(), copyed_node->GetName().c_str(), copyed_node->GetType().c_str(), in_anchor->GetIdx()); - GELOGE(INTERNAL_ERROR, "Failed to add data edge between origin node %s(%d) to copyed %s(%d)", + GELOGE(INTERNAL_ERROR, "[Add][DataEdge] between origin node %s(%d) and copyed %s(%d) failed", origin_src_node->GetName().c_str(), origin_src_anchor->GetIdx(), copyed_node->GetName().c_str(), dst_anchor->GetIdx()); return INTERNAL_ERROR; @@ -994,7 +1004,7 @@ Status MultiBatchGraphCopyer::CopyInControlEdges(const NodePtr &node, int batch_ REPORT_CALL_ERROR("E19999", "Add ctrl edge between op:%s(%s) and op:%s(%s) failed", switchn_iter->second->GetName().c_str(), switchn_iter->second->GetType().c_str(), copyed_node->GetName().c_str(), copyed_node->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "Failed to add control edge between %s to %s, error-code %u", + GELOGE(INTERNAL_ERROR, "[Add][ControlEdge] between %s and %s failed, error-code %u", switchn_iter->second->GetName().c_str(), copyed_node->GetName().c_str(), ret); return INTERNAL_ERROR; } @@ -1011,7 +1021,7 @@ Status MultiBatchGraphCopyer::CopyInControlEdges(const NodePtr &node, int batch_ REPORT_CALL_ERROR("E19999", "Add ctrl edge between op:%s(%s) and op:%s(%s) failed", src_batch_node->GetName().c_str(), src_batch_node->GetType().c_str(), copyed_node->GetName().c_str(), copyed_node->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "Failed to add data edge between %s to %s, error-code %u", + GELOGE(INTERNAL_ERROR, "[Add][ControlEdge] between %s and %s failed, error-code %u", src_batch_node->GetName().c_str(), copyed_node->GetName().c_str(), ret); return INTERNAL_ERROR; } @@ -1024,7 +1034,7 @@ Status MultiBatchGraphCopyer::CopyInControlEdges(const NodePtr &node, int batch_ REPORT_CALL_ERROR("E19999", "Add ctrl edge between op:%s(%s) and op:%s(%s) failed", origin_src_node->GetName().c_str(), origin_src_node->GetType().c_str(), copyed_node->GetName().c_str(), copyed_node->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "Failed to add control edge from origin %s to copyed %s", + GELOGE(INTERNAL_ERROR, "[Add][ControlEdge] from origin %s to copyed %s failed", origin_src_node->GetName().c_str(), copyed_node->GetName().c_str()); return INTERNAL_ERROR; } @@ -1038,7 +1048,7 @@ NodePtr MultiBatchGraphCopyer::InsertShapeDataNode() { auto desc = MakeShared(); if (desc == nullptr) { REPORT_CALL_ERROR("E19999", "New OpDesc failed"); - GELOGE(OUT_OF_MEMORY, "Failed to create shape data node, out of memory"); + GELOGE(OUT_OF_MEMORY, "[New][OpDesc] failed, out of memory"); return nullptr; } string node_name = "ascend_mbatch_shape_data"; @@ -1054,21 +1064,24 @@ NodePtr MultiBatchGraphCopyer::InsertShapeDataNode() { if (ret != GRAPH_SUCCESS) { REPORT_CALL_ERROR("E19999", "Add input desc to op:%s(%s) failed", desc->GetName().c_str(), desc->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "Failed to add input desc for created data"); + GELOGE(INTERNAL_ERROR, "[Add][InputDesc] to op:%s(%s) failed", + desc->GetName().c_str(), desc->GetType().c_str()); return nullptr; } ret = desc->AddOutputDesc(tensor_desc); if (ret != GRAPH_SUCCESS) { REPORT_CALL_ERROR("E19999", "Add output desc into op:%s(%s) failed", desc->GetName().c_str(), desc->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "Failed to add output desc for created data"); + GELOGE(INTERNAL_ERROR, "[Add][OutputDesc] into op:%s(%s) failed", + desc->GetName().c_str(), desc->GetType().c_str()); return nullptr; } if (!AttrUtils::SetBool(desc, ATTR_INSERT_BY_MBATCH, true)) { REPORT_CALL_ERROR("E19999", "Set Attr:%s to node:%s(%s) failed", ATTR_INSERT_BY_MBATCH.c_str(), desc->GetName().c_str(), desc->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "Failed to add attr for created data"); + GELOGE(INTERNAL_ERROR, "[Set][Attr] %s to node:%s(%s) failed", + ATTR_INSERT_BY_MBATCH.c_str(), desc->GetName().c_str(), desc->GetType().c_str()); return nullptr; } @@ -1076,7 +1089,8 @@ NodePtr MultiBatchGraphCopyer::InsertShapeDataNode() { if (data_node == nullptr) { REPORT_CALL_ERROR("E19999", "Add node:%s(%s) to graph:%s failed", desc->GetName().c_str(), desc->GetType().c_str(), graph_->GetName().c_str()); - GELOGE(INTERNAL_ERROR, "Failed to add shape data node to graph"); + GELOGE(INTERNAL_ERROR, "[Add][Node] %s(%s) to graph:%s failed", + desc->GetName().c_str(), desc->GetType().c_str(), graph_->GetName().c_str()); return nullptr; } ret = GraphUtils::AppendInputNode(graph_, data_node); @@ -1084,7 +1098,8 @@ NodePtr MultiBatchGraphCopyer::InsertShapeDataNode() { REPORT_CALL_ERROR("E19999", "Append input node:%s(%s) to graph:%s failed", data_node->GetName().c_str(), data_node->GetType().c_str(), graph_->GetName().c_str()); - GELOGE(INTERNAL_ERROR, "Failed to append data node %s as input to graph", data_node->GetName().c_str()); + GELOGE(INTERNAL_ERROR, "[Append][InputNode] %s to graph:%s failed", + data_node->GetName().c_str(), graph_->GetName().c_str()); return nullptr; } @@ -1096,7 +1111,7 @@ NodePtr MultiBatchGraphCopyer::InsertGetDynamicDimsNode() { auto desc = MakeShared(); if (desc == nullptr) { REPORT_CALL_ERROR("E19999", "New OpDesc failed"); - GELOGE(OUT_OF_MEMORY, "Failed to create shape data node, out of memory"); + GELOGE(OUT_OF_MEMORY, "[New][OpDesc] failed, out of memory"); return nullptr; } string node_name = "ascend_mbatch_get_dynamic_dims_node"; @@ -1120,7 +1135,8 @@ NodePtr MultiBatchGraphCopyer::InsertGetDynamicDimsNode() { GE_IF_BOOL_EXEC(ret != GRAPH_SUCCESS, REPORT_CALL_ERROR("E19999", "Add input desc to op:%s(%s) failed", desc->GetName().c_str(), desc->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "Failed to add input desc for created data"); + GELOGE(INTERNAL_ERROR, "[Add][InputDesc] to op:%s(%s) failed", + desc->GetName().c_str(), desc->GetType().c_str()); return nullptr); continue; } @@ -1129,7 +1145,8 @@ NodePtr MultiBatchGraphCopyer::InsertGetDynamicDimsNode() { GE_IF_BOOL_EXEC(ret != GRAPH_SUCCESS, REPORT_CALL_ERROR("E19999", "Add input desc to op:%s(%s) failed", desc->GetName().c_str(), desc->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "Failed to add input desc for created data"); + GELOGE(INTERNAL_ERROR, "[Add][InputDesc] to op:%s(%s) failed", + desc->GetName().c_str(), desc->GetType().c_str()); return nullptr); } @@ -1138,13 +1155,15 @@ NodePtr MultiBatchGraphCopyer::InsertGetDynamicDimsNode() { GE_IF_BOOL_EXEC(ret != GRAPH_SUCCESS, REPORT_CALL_ERROR("E19999", "Add output desc to op:%s(%s) failed", desc->GetName().c_str(), desc->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "Failed to add output desc for created data"); + GELOGE(INTERNAL_ERROR, "[Add][OutputDesc] to op:%s(%s) failed", + desc->GetName().c_str(), desc->GetType().c_str()); return nullptr); if (!AttrUtils::SetBool(desc, ATTR_INSERT_BY_MBATCH, true)) { REPORT_CALL_ERROR("E19999", "Set Attr:%s to node:%s(%s) failed", ATTR_INSERT_BY_MBATCH.c_str(), desc->GetName().c_str(), desc->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "Failed to add attr for created data"); + GELOGE(INTERNAL_ERROR, "[Set][Attr] %s to node:%s(%s) failed", + ATTR_INSERT_BY_MBATCH.c_str(), desc->GetName().c_str(), desc->GetType().c_str()); return nullptr; } @@ -1152,7 +1171,8 @@ NodePtr MultiBatchGraphCopyer::InsertGetDynamicDimsNode() { if (data_node == nullptr) { REPORT_CALL_ERROR("E19999", "Add node:%s(%s) to graph:%s failed", desc->GetName().c_str(), desc->GetType().c_str(), graph_->GetName().c_str()); - GELOGE(INTERNAL_ERROR, "Failed to add shape data node to graph"); + GELOGE(INTERNAL_ERROR, "[Add][Node] %s(%s) to graph:%s failed", + desc->GetName().c_str(), desc->GetType().c_str(), graph_->GetName().c_str()); return nullptr; } ret = GraphUtils::AppendInputNode(graph_, data_node); @@ -1160,7 +1180,8 @@ NodePtr MultiBatchGraphCopyer::InsertGetDynamicDimsNode() { REPORT_CALL_ERROR("E19999", "Append input node:%s(%s) to graph:%s failed", data_node->GetName().c_str(), data_node->GetType().c_str(), graph_->GetName().c_str()); - GELOGE(INTERNAL_ERROR, "Failed to append data node %s as input to graph", data_node->GetName().c_str()); + GELOGE(INTERNAL_ERROR, "[Append][InputNode] %s(%s) to graph:%s failed", + data_node->GetName().c_str(), data_node->GetType().c_str(), graph_->GetName().c_str()); return nullptr; } @@ -1170,7 +1191,7 @@ NodePtr MultiBatchGraphCopyer::InsertGetDynamicDimsNode() { Status MultiBatchGraphCopyer::CheckArguments() { if (graph_ == nullptr) { REPORT_INNER_ERROR("E19999", "graph_ is nullptr, check invalid"); - GELOGE(PARAM_INVALID, "Failed to copy graph, the graph is null"); + GELOGE(PARAM_INVALID, "[Check][Param] graph_ is nullptr"); return PARAM_INVALID; } @@ -1186,7 +1207,7 @@ Status MultiBatchGraphCopyer::CheckCopyResult(const std::vector &start_ if (!IsAllDimsPositive(dims)) { ErrorManager::GetInstance().ATCReportErrMessage("E15004", {"opname", "shape"}, {node->GetName(), formats::ShapeToString(dims)}); - GELOGE(INTERNAL_ERROR, "Failed to copy multi batch graph, the node %s still has unknown shape %s", + GELOGE(INTERNAL_ERROR, "[Check][Param] Failed to copy multi batch graph, the node %s still has unknown shape %s", node->GetName().c_str(), formats::ShapeToString(dims).c_str()); return INTERNAL_ERROR; } @@ -1219,7 +1240,7 @@ Status MultiBatchGraphCopyer::LinkDataToMerge(const NodePtr &data, const NodePtr REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(index:%zu) and op:%s(%s)(index:%zu) failed", switchn->GetName().c_str(), switchn->GetType().c_str(), i, merge->GetName().c_str(), merge->GetType().c_str(), i); - GELOGE(INTERNAL_ERROR, "Failed to add edge between switchn %s(%zu) to merge %s(%zu), error-code %u", + GELOGE(INTERNAL_ERROR, "[Add][Edge] between switchn %s(%zu) and merge %s(%zu) failed, ret:%u", switchn->GetName().c_str(), i, merge->GetName().c_str(), i, ret); return INTERNAL_ERROR); } @@ -1232,8 +1253,8 @@ Status MultiBatchGraphCopyer::LinkNodeToMerge(const NodePtr &node, int out_index REPORT_INNER_ERROR("E19999", "Create merge node for node %s failed, " "the copyed nodes for it count %zu different with shape %zu, check invalid", node->GetName().c_str(), copyed_nodes.size(), shapes_.size()); - GELOGE(INTERNAL_ERROR, - "Failed to create merge node for node %s, the copyed nodes for it count %zu different with shape %zu", + GELOGE(INTERNAL_ERROR, "[Check][Param] Failed to create merge node for node %s, " + "the copyed nodes for it count %zu different with shape %zu", node->GetName().c_str(), copyed_nodes.size(), shapes_.size()); return INTERNAL_ERROR; } @@ -1248,7 +1269,7 @@ Status MultiBatchGraphCopyer::LinkNodeToMerge(const NodePtr &node, int out_index src_node->GetName().c_str(), const_name.c_str()); auto const_node = InsertConst(const_name, graph_); GE_IF_BOOL_EXEC(const_node == nullptr, - GELOGE(OUT_OF_MEMORY, "Failed to create const for node %s to connect to a merge node", + GELOGE(OUT_OF_MEMORY, "[Create][Const] for node:%s failed, which to connect to a merge node", src_node->GetName().c_str()); return OUT_OF_MEMORY); @@ -1257,8 +1278,8 @@ Status MultiBatchGraphCopyer::LinkNodeToMerge(const NodePtr &node, int out_index REPORT_CALL_ERROR("E19999", "Add ctrl edge between op:%s(%s) and op:%s(%s) failed", src_node->GetName().c_str(), src_node->GetType().c_str(), const_node->GetName().c_str(), const_node->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "Failed to add control edge from %s to %s", - src_node->GetName().c_str(), const_node->GetName().c_str()); + GELOGE(INTERNAL_ERROR, "[Add][ControlEdge] from %s to %s failed", + src_node->GetName().c_str(), const_node->GetName().c_str()); return INTERNAL_ERROR); src_node = const_node; @@ -1269,7 +1290,7 @@ Status MultiBatchGraphCopyer::LinkNodeToMerge(const NodePtr &node, int out_index src_node->GetName().c_str(), src_node->GetType().c_str(), out_index, merge->GetName().c_str(), merge->GetType().c_str(), i); GELOGE(INTERNAL_ERROR, - "Failed to add edge between copyed node %s(%d) to inserted merge node %s(%zu), error-code %u", + "[Add][Edge] between copyed node %s(%d) and inserted merge node %s(%zu) failed, error-code %u", copyed_nodes[i]->GetName().c_str(), out_index, merge->GetName().c_str(), i, ret); return INTERNAL_ERROR; } @@ -1281,11 +1302,11 @@ Status MultiBatchGraphCopyer::InsertSwitchNAndUpdateMaxShape(const NodePtr &node std::vector> dynamic_out_to_switchn; if (!getnext_sink_dynamic_dims_) { if (InsertSwitchNForData(node, kDataOutIndex, kDataOutIndex, dynamic_out_to_switchn) != SUCCESS) { - GELOGE(PARAM_INVALID, "Failed to insert switchn for %s.", node->GetName().c_str()); + GELOGE(PARAM_INVALID, "[Insert][SwitchN] for node:%s failed.", node->GetName().c_str()); return PARAM_INVALID; } if (UpdateMaxShapeToData(node, kDataOutIndex) != SUCCESS) { - GELOGE(PARAM_INVALID, "Failed to update max shape of %s.", node->GetName().c_str()); + GELOGE(PARAM_INVALID, "[Update][MaxShape] of node:%s failed.", node->GetName().c_str()); return PARAM_INVALID; } } else { @@ -1300,7 +1321,7 @@ Status MultiBatchGraphCopyer::InsertSwitchNAndUpdateMaxShape(const NodePtr &node getnext_sink_dynamic_out_mapping_.at(i).second); if (InsertSwitchNForData(node, getnext_sink_dynamic_out_mapping_.at(i).first, j, dynamic_out_to_switchn) != SUCCESS) { - GELOGE(PARAM_INVALID, "Failed to insert switchn for %s of %zu out anchor when referenced index is %zu", + GELOGE(PARAM_INVALID, "[Insert][SwitchN] for %s of %zu out anchor failed, when referenced index is %zu", node->GetName().c_str(), getnext_sink_dynamic_out_mapping_.at(i).first, j); return PARAM_INVALID; } @@ -1310,7 +1331,8 @@ Status MultiBatchGraphCopyer::InsertSwitchNAndUpdateMaxShape(const NodePtr &node for (size_t i = 0; i < getnext_sink_dynamic_out_mapping_.size(); ++i) { if(UpdateMaxShapeToData(node, i) != SUCCESS) { - GELOGE(PARAM_INVALID, "Failed to update %s max shape of %zu out anchor", node->GetName().c_str(), i); + GELOGE(PARAM_INVALID, "[Call][UpdateMaxShapeToData]Failed to update %s max shape of %zu out anchor", + node->GetName().c_str(), i); return PARAM_INVALID; } } @@ -1328,7 +1350,8 @@ Status MultiBatchGraphCopyer::UpdateShapeOfShapeNode(const NodePtr &node, size_t if (node->GetOpDesc()->UpdateOutputDesc(shape_index, output_desc) != SUCCESS) { REPORT_CALL_ERROR("E19999", "Update output desc to op:%s(%s) failed, index:%zu", node->GetName().c_str(), node->GetType().c_str(), shape_index); - GELOGE(FAILED, "Update output desc fail."); + GELOGE(FAILED, "[Update][OutputDesc] to op:%s(%s) failed, index:%zu", + node->GetName().c_str(), node->GetType().c_str(), shape_index); return FAILED; } return SUCCESS; @@ -1351,7 +1374,8 @@ Status MultiBatchGraphCopyer::UpdateMaxShapeToData(const NodePtr &node, size_t o } else { if (IsAllDimsPositive(data_shape.GetDims())) { // need to update shape of Shape_node - GE_CHK_STATUS_RET(UpdateShapeOfShapeNode(node, out_anchor_index), "Failed to update shape of shape node"); + GE_CHK_STATUS_RET(UpdateShapeOfShapeNode(node, out_anchor_index), + "[Update][ShapeOfShapeNode] %s failed, index:%zu", node->GetName().c_str(), out_anchor_index); return SUCCESS; } } @@ -1365,7 +1389,8 @@ Status MultiBatchGraphCopyer::UpdateMaxShapeToData(const NodePtr &node, size_t o REPORT_CALL_ERROR("E19999", "Op:%s(%s)'s shape:%s size will overflow after multi, check invalid", node->GetName().c_str(), node->GetType().c_str(), formats::ShapeToString(data_to_dynamic_info_[data_name].at(i)).c_str()); - GELOGE(PARAM_INVALID, "The shape %s size overflow", + GELOGE(PARAM_INVALID, "[Check][Param] Op:%s(%s)'s shape:%s size will overflow after multi", + node->GetName().c_str(), node->GetType().c_str(), formats::ShapeToString(data_to_dynamic_info_[data_name].at(i)).c_str()); return PARAM_INVALID; } @@ -1379,14 +1404,15 @@ Status MultiBatchGraphCopyer::UpdateMaxShapeToData(const NodePtr &node, size_t o // must not be error, the calc result has been checked in function InsertSwitchNForData (void)CalcShape(data_to_dynamic_info_.at(data_name).at(max_shape_index), data_shape); auto ret = NodeUtils::UpdateOutputShape(*node, out_anchor_index, data_shape); - GE_CHK_GRAPH_STATUS_RET(ret, "Failed to update output shape for data %s", node->GetName().c_str()); + GE_CHK_GRAPH_STATUS_RET(ret, "[Update][OutputShape] for data %s failed", node->GetName().c_str()); // getnext_sink not has input if (!getnext_sink_dynamic_dims_) { ret = NodeUtils::UpdateInputShape(*node, kDataInIndex, data_shape); - GE_CHK_GRAPH_STATUS_RET(ret, "Failed to update input shape for data %s", node->GetName().c_str()); + GE_CHK_GRAPH_STATUS_RET(ret, "[Update][InputShape] for data %s failed", node->GetName().c_str()); } else { // need to update shape of Shape_node when getnext_sink_dynamic - GE_CHK_STATUS_RET(UpdateShapeOfShapeNode(node, out_anchor_index), "Failed to update shape of shape node"); + GE_CHK_STATUS_RET(UpdateShapeOfShapeNode(node, out_anchor_index), + "[Update][ShapeOfShapeNode] %s failed, index:%zu", node->GetName().c_str(), out_anchor_index); } GELOGI("Update the data %s input/output shape to the max %s", node->GetName().c_str(), formats::ShapeToString(data_shape).c_str()); @@ -1413,7 +1439,7 @@ Status MultiBatchGraphCopyer::InsertSwitchNForData(const NodePtr &node, const si auto switchn_desc = MakeShared(); GE_IF_BOOL_EXEC(switchn_desc == nullptr, REPORT_CALL_ERROR("E19999", "New OpDesc failed"); - GELOGE(OUT_OF_MEMORY, "Failed to create switchn for data %s", node->GetName().c_str()); + GELOGE(OUT_OF_MEMORY, "[New][OpDesc] failed"); return OUT_OF_MEMORY); string switchn_name = node->GetName() + "_ascend_mbatch_switchn"; if (getnext_sink_dynamic_dims_) { @@ -1429,14 +1455,16 @@ Status MultiBatchGraphCopyer::InsertSwitchNForData(const NodePtr &node, const si REPORT_CALL_ERROR("E19999", "Add input desc to op:%s(%s) failed, input desc name:%s", switchn_desc->GetName().c_str(), switchn_desc->GetType().c_str(), "data"); - GELOGE(OUT_OF_MEMORY, "Failed to add input tensor desc for %s", switchn_desc->GetName().c_str()); + GELOGE(OUT_OF_MEMORY, "[Add][InputDesc] to op:%s(%s) failed, input desc name:data", + switchn_desc->GetName().c_str(), switchn_desc->GetType().c_str()); return OUT_OF_MEMORY); GeTensorDesc pred_tensor; GE_IF_BOOL_EXEC(switchn_desc->AddInputDesc("pred_value", pred_tensor) != GRAPH_SUCCESS, REPORT_CALL_ERROR("E19999", "Add input desc to op:%s(%s) failed, input desc name:%s", switchn_desc->GetName().c_str(), switchn_desc->GetType().c_str(), "pred_value"); - GELOGE(OUT_OF_MEMORY, "Failed to add input pred tensor desc for %s", switchn_desc->GetName().c_str()); + GELOGE(OUT_OF_MEMORY, "[Add][InputDesc] to op:%s(%s) failed, input desc name:pred_value", + switchn_desc->GetName().c_str(), switchn_desc->GetType().c_str()); return OUT_OF_MEMORY); std::vector input_dims_str; for (size_t i = 0; i < shapes_.size(); ++i) { @@ -1445,7 +1473,7 @@ Status MultiBatchGraphCopyer::InsertSwitchNForData(const NodePtr &node, const si auto shape = data_shape; auto ret = CalcShape(data_to_dynamic_info_.at(data_name).at(i), shape); if (ret != SUCCESS) { - GELOGE(ret, "Failed to calculate the batched shape for data node %s, the shapes may not match", + GELOGE(ret, "[Calc][Shape] Failed to calculate the batched shape for data node %s, the shapes may not match", node->GetName().c_str()); return ret; } @@ -1462,7 +1490,8 @@ Status MultiBatchGraphCopyer::InsertSwitchNForData(const NodePtr &node, const si REPORT_CALL_ERROR("E19999", "Set Attr:%s to output tensor of node:%s(%s) failed, index:%zu", ATTR_NAME_SWITCHN_PRED_VALUE.c_str(), node->GetName().c_str(), node->GetType().c_str(), out_anchor_index); - GELOGE(INTERNAL_ERROR, "Failed to add attr value on output %zu tensor", i); + GELOGE(INTERNAL_ERROR, "[Set][Attr] %s to output tensor of node:%s(%s) failed, index:%zu", + ATTR_NAME_SWITCHN_PRED_VALUE.c_str(), node->GetName().c_str(), node->GetType().c_str(), out_anchor_index); return INTERNAL_ERROR; } (void) AttrUtils::SetListInt(tensor, ATTR_NAME_COMBINED_DYNAMIC_DIMS, shape.GetDims()); @@ -1470,7 +1499,9 @@ Status MultiBatchGraphCopyer::InsertSwitchNForData(const NodePtr &node, const si REPORT_CALL_ERROR("E19999", "Add output desc to op:%s(%s) failed, output desc name:%s", switchn_desc->GetName().c_str(), switchn_desc->GetType().c_str(), ("output" + std::to_string(i)).c_str()); - GELOGE(GRAPH_FAILED, "Opdesc AddOutputDesc failed"); + GELOGE(GRAPH_FAILED, "[Add][OutputDesc] to op:%s(%s) failed, output desc name:%s", + switchn_desc->GetName().c_str(), switchn_desc->GetType().c_str(), + ("output" + std::to_string(i)).c_str()); return GRAPH_FAILED; } GELOGD("The switchn %s output index %zu, shape %s", switchn_desc->GetName().c_str(), i, shape.ToString().c_str()); @@ -1480,20 +1511,22 @@ Status MultiBatchGraphCopyer::InsertSwitchNForData(const NodePtr &node, const si REPORT_CALL_ERROR("E19999", "Set Attr:%s to node:%s(%s) failed", ATTR_USER_DESIGNEATE_SHAPE_ORDER.c_str(), switchn_desc->GetName().c_str(), switchn_desc->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "Failed to add user designate shape order attr on switchn node %s", - switchn_desc->GetName().c_str()); + GELOGE(INTERNAL_ERROR, "[Set][Attr] %s to node:%s(%s) failed", ATTR_USER_DESIGNEATE_SHAPE_ORDER.c_str(), + switchn_desc->GetName().c_str(), switchn_desc->GetType().c_str()); return INTERNAL_ERROR; } if (!AttrUtils::SetBool(switchn_desc, ATTR_INSERT_BY_MBATCH, true)) { REPORT_CALL_ERROR("E19999", "Set Attr:%s to node:%s(%s) failed", ATTR_INSERT_BY_MBATCH.c_str(), switchn_desc->GetName().c_str(), switchn_desc->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "Failed to add insert attr on switchn node %s", switchn_desc->GetName().c_str()); + GELOGE(INTERNAL_ERROR, "[Set][Attr] %s to node:%s(%s) failed", + ATTR_INSERT_BY_MBATCH.c_str(), switchn_desc->GetName().c_str(), switchn_desc->GetType().c_str()); return INTERNAL_ERROR; } if (!AttrUtils::SetStr(node->GetOpDesc(), kMbatchSwitchnName, switchn_desc->GetName())) { REPORT_CALL_ERROR("E19999", "Set Attr:%s to node:%s(%s) failed", kMbatchSwitchnName, node->GetName().c_str(), node->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "Failed to add switchn attr on data node %s", node->GetName().c_str()); + GELOGE(INTERNAL_ERROR, "[Set][Attr] %s to node:%s(%s) failed", + kMbatchSwitchnName, node->GetName().c_str(), node->GetType().c_str()); return INTERNAL_ERROR; } if (StampDynamicType(switchn_desc) != SUCCESS) { @@ -1506,7 +1539,8 @@ Status MultiBatchGraphCopyer::InsertSwitchNForData(const NodePtr &node, const si REPORT_CALL_ERROR("E19999", "Add node:%s(%s) to graph:%s failed", switchn_desc->GetName().c_str(), switchn_desc->GetType().c_str(), graph_->GetName().c_str()); - GELOGE(OUT_OF_MEMORY, "Failed to create switchn %s from desc", switchn_desc->GetName().c_str()); + GELOGE(OUT_OF_MEMORY, "[Add][Node] %s(%s) to graph:%s failed", + switchn_desc->GetName().c_str(), switchn_desc->GetType().c_str(), graph_->GetName().c_str()); return OUT_OF_MEMORY); if (!getnext_sink_dynamic_dims_) { data_nodes_to_switchn_[node.get()] = switchn; @@ -1553,7 +1587,8 @@ Status MultiBatchGraphCopyer::LinkGetDynamicDimsToNetOutput(const NodePtr &node) if (!AttrUtils::SetStr(node->GetOpDesc(), ATTR_ALL_GEARS_INFO, GetLocalOmgContext().dynamic_dims)) { REPORT_CALL_ERROR("E19999", "Set Attr:%s to node:%s(%s) failed", ATTR_ALL_GEARS_INFO.c_str(), node->GetName().c_str(), node->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "Failed to set all gears info attr on netoutput %s.", node->GetName().c_str()); + GELOGE(INTERNAL_ERROR, "[Set][Attr] %s to node:%s(%s) failed", + ATTR_ALL_GEARS_INFO.c_str(), node->GetName().c_str(), node->GetType().c_str()); return INTERNAL_ERROR; } } @@ -1562,7 +1597,8 @@ Status MultiBatchGraphCopyer::LinkGetDynamicDimsToNetOutput(const NodePtr &node) if (NodeUtils::AppendInputAnchor(node, input_index + 1) != GRAPH_SUCCESS) { REPORT_CALL_ERROR("E19999", "Append %zu input anchors to node:%s(%s) failed", input_index + 1, node->GetName().c_str(), node->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "Append input anchor of %s of %zu failed.", node->GetName().c_str(), input_index); + GELOGE(INTERNAL_ERROR, "[Append][InputAnchor] of node:%s failed, input_index:%zu.", + node->GetName().c_str(), input_index + 1); return INTERNAL_ERROR; } auto ret = @@ -1572,13 +1608,15 @@ Status MultiBatchGraphCopyer::LinkGetDynamicDimsToNetOutput(const NodePtr &node) REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(index:%d) and op:%s(%s)(index:%zu) failed", shape_data_->GetName().c_str(), shape_data_->GetType().c_str(), kDataOutIndex, node->GetName().c_str(), node->GetType().c_str(), input_index); - GELOGE(INTERNAL_ERROR, "Failed to link netoutput %s to getdynamicdims %s", - node->GetName().c_str(), shape_data_->GetName().c_str()); + GELOGE(INTERNAL_ERROR, "[Add][Edge] between op:%s(%s)(index:%d) and op:%s(%s)(index:%zu) failed", + shape_data_->GetName().c_str(), shape_data_->GetType().c_str(), kDataOutIndex, + node->GetName().c_str(), node->GetType().c_str(), input_index); return INTERNAL_ERROR); if (!AttrUtils::SetBool(node->GetOpDesc(), ATTR_GETNEXT_SINK_DYNMAIC, true)) { REPORT_CALL_ERROR("E19999", "Set Attr:%s to node:%s(%s) failed", ATTR_GETNEXT_SINK_DYNMAIC.c_str(), node->GetName().c_str(), node->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "Failed to set getnext sink dynamic attr on netoutput %s.", node->GetName().c_str()); + GELOGE(INTERNAL_ERROR, "[Set][Attr] %s to node:%s(%s) failed", + ATTR_GETNEXT_SINK_DYNMAIC.c_str(), node->GetName().c_str(), node->GetType().c_str()); return INTERNAL_ERROR; } } @@ -1591,7 +1629,7 @@ Status MultiBatchGraphCopyer::CopyNodeInBatchBranch(const NodePtr &node) { for (size_t i = 0; i < shapes_.size(); ++i) { auto copyed_node = InsertCopyNode(node, i); if (copyed_node == nullptr) { - GELOGE(INTERNAL_ERROR, "Failed to add node to graph when copy node %s", node->GetName().c_str()); + GELOGE(INTERNAL_ERROR, "[Add][Node] to graph failed, when copy node %s", node->GetName().c_str()); return INTERNAL_ERROR; } copyed_nodes.emplace_back(copyed_node); @@ -1608,7 +1646,8 @@ Status MultiBatchGraphCopyer::AddAttrForGetDynamicDims(const NodePtr &node) { REPORT_CALL_ERROR("E19999", "Set Attr:%s to node:%s(%s) failed", ATTR_GETNEXT_SINK_DATA_COUNT.c_str(), shape_data_->GetName().c_str(), shape_data_->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "set ATTR_GETNEXT_SINK_DATA_COUNT failed"); + GELOGE(INTERNAL_ERROR, "[Set][Attr] %s to node:%s(%s) failed", ATTR_GETNEXT_SINK_DATA_COUNT.c_str(), + shape_data_->GetName().c_str(), shape_data_->GetType().c_str()); return INTERNAL_ERROR; } vector shape_info; @@ -1627,7 +1666,8 @@ Status MultiBatchGraphCopyer::AddAttrForGetDynamicDims(const NodePtr &node) { REPORT_CALL_ERROR("E19999", "Set Attr:%s to node:%s(%s) failed", ATTR_GETNEXT_SINK_SHAPE_INFO.c_str(), shape_data_->GetName().c_str(), shape_data_->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "set ATTR_GETNEXT_SINK_SHAPE_INFO failed"); + GELOGE(INTERNAL_ERROR, "[Set][Attr] %s to node:%s(%s) failed", ATTR_GETNEXT_SINK_SHAPE_INFO.c_str(), + shape_data_->GetName().c_str(), shape_data_->GetType().c_str()); return INTERNAL_ERROR; } return SUCCESS; @@ -1643,14 +1683,14 @@ Status MultiBatchGraphCopyer::AddLinkForGetDynamicDims(const NodePtr &node) { shape_data_->GetName().c_str(), input_index); auto out_data_anchor = node->GetOutDataAnchor(out_index); auto ret = GraphUtils::AddEdge(out_data_anchor, shape_data_->GetInDataAnchor(input_index)); - GE_IF_BOOL_EXEC( - ret != GRAPH_SUCCESS, - REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(index:%zu) and op:%s(%s)(index:%zu) failed", - node->GetName().c_str(), node->GetType().c_str(), out_index, - shape_data_->GetName().c_str(), shape_data_->GetType().c_str(), input_index); - GELOGE(INTERNAL_ERROR, "Failed to link getnext %s to getdynamicdims %s", - node->GetName().c_str(), shape_data_->GetName().c_str()); - return INTERNAL_ERROR); + GE_IF_BOOL_EXEC(ret != GRAPH_SUCCESS, + REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(index:%zu) and op:%s(%s)(index:%zu) failed", + node->GetName().c_str(), node->GetType().c_str(), out_index, + shape_data_->GetName().c_str(), shape_data_->GetType().c_str(), input_index); + GELOGE(INTERNAL_ERROR, "[Add][Edge] between op:%s(%s)(index:%zu) and op:%s(%s)(index:%zu) failed", + node->GetName().c_str(), node->GetType().c_str(), out_index, + shape_data_->GetName().c_str(), shape_data_->GetType().c_str(), input_index); + return INTERNAL_ERROR); } return SUCCESS; } @@ -1666,7 +1706,8 @@ Status MultiBatchGraphCopyer::LinkEdges() { REPORT_INNER_ERROR("E19999", "swithn in data_nodes_to_switchn_ for op:%s(%s) is nullptr, check invalid", node->GetName().c_str(), node->GetType().c_str()); - GELOGE(PARAM_INVALID, "Switchn should not be nullptr for %s.", node->GetName().c_str()); + GELOGE(PARAM_INVALID, "[Check][Param]Switchn should not be nullptr for %s.", + node->GetName().c_str()); return OUT_OF_MEMORY); ret = LinkDataToSwitchN(node, switchn, kDataOutIndex); GE_CHK_STATUS_RET(ret, "Link data to switchn failed."); @@ -1674,21 +1715,21 @@ Status MultiBatchGraphCopyer::LinkEdges() { } else { if (IsGetNextType(node)) { GELOGD("Start add attr and link edge for %s.", node->GetName().c_str()); - GE_CHK_STATUS_RET(AddAttrForGetDynamicDims(node), "Failed to add attr for %s.", node->GetName().c_str()); - GE_CHK_STATUS_RET(AddLinkForGetDynamicDims(node), "Failed to add link for %s.", node->GetName().c_str()); + GE_CHK_STATUS_RET(AddAttrForGetDynamicDims(node), "[Add][Attr] for %s failed.", node->GetName().c_str()); + GE_CHK_STATUS_RET(AddLinkForGetDynamicDims(node), "[Add][Link] for %s failed.", node->GetName().c_str()); } for (size_t i = 0; i < getnext_nodes_to_switchn_.size(); ++i) { for (size_t j = 0; j < getnext_nodes_to_switchn_.at(i).size(); ++j) { if (getnext_nodes_to_switchn_.at(i).at(j).first == node.get()) { auto switchn = getnext_nodes_to_switchn_.at(i).at(j).second; - GE_CHK_STATUS_RET(LinkDataToSwitchN(node, switchn, i), "Link %s to %s failed.", node->GetName().c_str(), - switchn->GetName().c_str()); + GE_CHK_STATUS_RET(LinkDataToSwitchN(node, switchn, i), + "[Link][Data] %s to %s failed.", node->GetName().c_str(), switchn->GetName().c_str()); } } } } if (nodes_to_merge_nodes_.count(node.get()) > 0) { - GE_CHK_STATUS_RET(LinkToMerge(node), "Link %s to merge failed.", node->GetName().c_str()); + GE_CHK_STATUS_RET(LinkToMerge(node), "[Link][Node] %s to merge failed.", node->GetName().c_str()); } if (nodes_to_batch_nodes_.count(node.get()) > 0) { ret = LinkToNodeInBranch(node); @@ -1705,24 +1746,24 @@ Status MultiBatchGraphCopyer::LinkEdges() { Status MultiBatchGraphCopyer::LinkDataToSwitchN(const NodePtr &data, const NodePtr &switchn, const int &out_index) { auto ret = GraphUtils::AddEdge(shape_data_->GetOutDataAnchor(kDataOutIndex), switchn->GetInDataAnchor(kSwitchNPredIndex)); - GE_IF_BOOL_EXEC( - ret != GRAPH_SUCCESS, - REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(index:%d) and op:%s(%s)(index:%d) failed", - shape_data_->GetName().c_str(), shape_data_->GetType().c_str(), kDataOutIndex, - switchn->GetName().c_str(), switchn->GetType().c_str(), kSwitchNPredIndex); - GELOGE(INTERNAL_ERROR, "Failed to link shape data %s to switchn %s", - shape_data_->GetName().c_str(), switchn->GetName().c_str()); - return INTERNAL_ERROR); + GE_IF_BOOL_EXEC(ret != GRAPH_SUCCESS, + REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(index:%d) and op:%s(%s)(index:%d) failed", + shape_data_->GetName().c_str(), shape_data_->GetType().c_str(), kDataOutIndex, + switchn->GetName().c_str(), switchn->GetType().c_str(), kSwitchNPredIndex); + GELOGE(INTERNAL_ERROR, "[Add][Edge] between op:%s(%s)(index:%d) and op:%s(%s)(index:%d) failed", + shape_data_->GetName().c_str(), shape_data_->GetType().c_str(), kDataOutIndex, + switchn->GetName().c_str(), switchn->GetType().c_str(), kSwitchNPredIndex); + return INTERNAL_ERROR); ret = GraphUtils::AddEdge(data->GetOutDataAnchor(out_index), switchn->GetInDataAnchor(kSwitchNDataIndex)); - GE_IF_BOOL_EXEC( - ret != GRAPH_SUCCESS, - REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(index:%d) and op:%s(%s)(index:%d) failed", - data->GetName().c_str(), data->GetType().c_str(), out_index, - switchn->GetName().c_str(), switchn->GetType().c_str(), kSwitchNDataIndex); - GELOGE(INTERNAL_ERROR, "Failed to link data %s to switchn %s", - data->GetName().c_str(), switchn->GetName().c_str()); - return INTERNAL_ERROR); + GE_IF_BOOL_EXEC(ret != GRAPH_SUCCESS, + REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(index:%d) and op:%s(%s)(index:%d) failed", + data->GetName().c_str(), data->GetType().c_str(), out_index, + switchn->GetName().c_str(), switchn->GetType().c_str(), kSwitchNDataIndex); + GELOGE(INTERNAL_ERROR, "[Add][Edge] between op:%s(%s)(index:%d) and op:%s(%s)(index:%d) failed", + data->GetName().c_str(), data->GetType().c_str(), out_index, + switchn->GetName().c_str(), switchn->GetType().c_str(), kSwitchNDataIndex); + return INTERNAL_ERROR); return SUCCESS; } @@ -1766,7 +1807,7 @@ Status MultiBatchGraphCopyer::LinkToMerge(const NodePtr &node) { } REPORT_INNER_ERROR("E19999", "The merge node %s is created, index %zu, but can not find the src node, " "check invalid", merge_node->GetName().c_str(), i); - GELOGE(INTERNAL_ERROR, "The merge node %s is created, index %zu, but can not find the src node", + GELOGE(INTERNAL_ERROR, "[Check][Param] The merge node %s is created, index %zu, but can not find the src node", merge_node->GetName().c_str(), i); return INTERNAL_ERROR; } @@ -1806,7 +1847,7 @@ Status MultiBatchGraphCopyer::LinkToNodeOutBranch(const NodePtr &node) { "cause no merge node found, check invalid", in_node->GetName().c_str(), in_node->GetType().c_str(), src_out_anchor->GetIdx(), node->GetName().c_str(), node->GetType().c_str(), in_data_anchor->GetIdx()); - GELOGE(INTERNAL_ERROR, "Failed to link IO data edge from %s(%d) to %s(%d), no merge node found", + GELOGE(INTERNAL_ERROR, "[Check][Param] Failed to link IO data edge from %s(%d) to %s(%d), no merge node found", in_node->GetName().c_str(), src_out_anchor->GetIdx(), node->GetName().c_str(), in_data_anchor->GetIdx()); return INTERNAL_ERROR; } @@ -1816,7 +1857,7 @@ Status MultiBatchGraphCopyer::LinkToNodeOutBranch(const NodePtr &node) { "cause no merge node found, check invalid", in_node->GetName().c_str(), in_node->GetType().c_str(), src_out_anchor->GetIdx(), node->GetName().c_str(), node->GetType().c_str(), in_data_anchor->GetIdx()); - GELOGE(INTERNAL_ERROR, "Failed to link IO data edge from %s(%d) to %s(%d), no merge node found", + GELOGE(INTERNAL_ERROR, "[Check][Param] Failed to link IO data edge from %s(%d) to %s(%d), no merge node found", in_node->GetName().c_str(), src_out_anchor->GetIdx(), node->GetName().c_str(), in_data_anchor->GetIdx()); return INTERNAL_ERROR; } @@ -1825,8 +1866,9 @@ Status MultiBatchGraphCopyer::LinkToNodeOutBranch(const NodePtr &node) { REPORT_INNER_ERROR("E19999", "Unlink edge from %s(%s)(index:%d) to %s(%s)(index:%d) failed", in_node->GetName().c_str(), in_node->GetType().c_str(), src_out_anchor->GetIdx(), node->GetName().c_str(), node->GetType().c_str(), in_data_anchor->GetIdx()); - GELOGE(INTERNAL_ERROR, "Failed to unlink the control edge from %s(%d) to %s(%d)", in_node->GetName().c_str(), - src_out_anchor->GetIdx(), node->GetName().c_str(), in_data_anchor->GetIdx()); + GELOGE(INTERNAL_ERROR, "[Unlink][Edge] from %s(%s)(index:%d) to %s(%s)(index:%d) failed", + in_node->GetName().c_str(), in_node->GetType().c_str(), src_out_anchor->GetIdx(), + node->GetName().c_str(), node->GetType().c_str(), in_data_anchor->GetIdx()); return INTERNAL_ERROR; } ret = GraphUtils::AddEdge(merge_node->GetOutDataAnchor(kMergeDataOutIndex), in_data_anchor); @@ -1834,8 +1876,9 @@ Status MultiBatchGraphCopyer::LinkToNodeOutBranch(const NodePtr &node) { REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(index:%d) and op:%s(%s)(index:%d) failed", merge_node->GetName().c_str(), merge_node->GetType().c_str(), kMergeDataOutIndex, node->GetName().c_str(), node->GetType().c_str(), in_data_anchor->GetIdx()); - GELOGE(INTERNAL_ERROR, "Failed to add data edge from %s(%d) to %s(%d)", merge_node->GetName().c_str(), - src_out_anchor->GetIdx(), node->GetName().c_str(), in_data_anchor->GetIdx()); + GELOGE(INTERNAL_ERROR, "[Add][Edge] between op:%s(%s)(index:%d) and op:%s(%s)(index:%d) failed", + merge_node->GetName().c_str(), merge_node->GetType().c_str(), kMergeDataOutIndex, + node->GetName().c_str(), node->GetType().c_str(), in_data_anchor->GetIdx()); return INTERNAL_ERROR; } GELOGI("Link data edge from merge %s(from %s(%d)) to %s(%d)", merge_node->GetName().c_str(), @@ -1852,7 +1895,7 @@ Status MultiBatchGraphCopyer::LinkToNodeOutBranch(const NodePtr &node) { "check invalid", in_node->GetName().c_str(), in_node->GetType().c_str(), node->GetName().c_str(), node->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "Failed to link IO control edge from %s to %s, no merge node found", + GELOGE(INTERNAL_ERROR, "[Check][Param] Failed to link IO control edge from %s to %s, no merge node found", in_node->GetName().c_str(), node->GetName().c_str()); return INTERNAL_ERROR; } @@ -1862,7 +1905,7 @@ Status MultiBatchGraphCopyer::LinkToNodeOutBranch(const NodePtr &node) { "Failed to link IO control edge from %s(%s) to %s(%s), no merge node found, check invalid", in_node->GetName().c_str(), in_node->GetType().c_str(), node->GetName().c_str(), node->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "Failed to link IO control edge from %s to %s, no merge node found", + GELOGE(INTERNAL_ERROR, "[Check][Param] Failed to link IO control edge from %s to %s, no merge node found", in_node->GetName().c_str(), node->GetName().c_str()); return INTERNAL_ERROR; } @@ -1870,15 +1913,17 @@ Status MultiBatchGraphCopyer::LinkToNodeOutBranch(const NodePtr &node) { GE_IF_BOOL_EXEC(in_node->GetOutControlAnchor() == nullptr, REPORT_INNER_ERROR("E19999", "Out control anchor of op:%s(%s) is nullptr, check invalid", in_node->GetName().c_str(), in_node->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "Innode outputControlAnchor is null"); + GELOGE(INTERNAL_ERROR, "[Get][OutControlAnchor]Out control anchor of op:%s(%s) is nullptr", + in_node->GetName().c_str(), in_node->GetType().c_str()); return INTERNAL_ERROR); auto ret = in_node->GetOutControlAnchor()->Unlink(node->GetInControlAnchor()); GE_IF_BOOL_EXEC(ret != GRAPH_SUCCESS, REPORT_INNER_ERROR("E19999", "Unlink ctrl edge from %s(%s) to %s(%s) failed", in_node->GetName().c_str(), in_node->GetType().c_str(), node->GetName().c_str(), node->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "Failed to unlink the control edge from %s to %s", - in_node->GetName().c_str(), node->GetName().c_str()); + GELOGE(INTERNAL_ERROR, "[Unlink][CtrlEdge] from %s(%s) to %s(%s) failed", + in_node->GetName().c_str(), in_node->GetType().c_str(), + node->GetName().c_str(), node->GetType().c_str()); return INTERNAL_ERROR); ret = GraphUtils::AddEdge(merge_node->GetOutControlAnchor(), node->GetInControlAnchor()); GE_IF_BOOL_EXEC( @@ -1886,8 +1931,9 @@ Status MultiBatchGraphCopyer::LinkToNodeOutBranch(const NodePtr &node) { REPORT_CALL_ERROR("E19999", "Add ctrl edge between op:%s(%s) and op:%s(%s) failed", merge_node->GetName().c_str(), merge_node->GetType().c_str(), node->GetName().c_str(), node->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "Failed to add control edge from %s to %s", - merge_node->GetName().c_str(), node->GetName().c_str()); + GELOGE(INTERNAL_ERROR, "[Add][CtrlEdge] between op:%s(%s) and op:%s(%s) failed", + merge_node->GetName().c_str(), merge_node->GetType().c_str(), + node->GetName().c_str(), node->GetType().c_str()); return INTERNAL_ERROR); GELOGI("Link control edge from merge %s(from %s) to %s", merge_node->GetName().c_str(), in_node->GetName().c_str(), node->GetName().c_str()); @@ -1911,15 +1957,15 @@ Status ProcessMultiBatch(ComputeGraphPtr &graph) { std::vector getnext_nosink_nodes; std::vector getnext_sink_nodes; if (CheckSequenceOfOptions(graph, data_nodes, getnext_nosink_nodes, getnext_sink_nodes) != SUCCESS) { - GELOGE(PARAM_INVALID, "[Train_Dynamic] CheckSequenceOfOptions failed."); + GELOGE(PARAM_INVALID, "[Train_Dynamic][Check][SequenceOfOptions] failed."); return PARAM_INVALID; } if (UpdateNameOfInputShape(graph, data_nodes, getnext_nosink_nodes, getnext_sink_nodes) != SUCCESS) { - GELOGE(PARAM_INVALID, "[Train_Dynamic] UpdateNameForInputShapeOfOption failed."); + GELOGE(PARAM_INVALID, "[Train_Dynamic][Update][NameOfInputShape] failed."); return PARAM_INVALID; } if (DeleteIdentityInsertByAdapter(graph) != SUCCESS) { - GELOGE(PARAM_INVALID, "DeleteIdentityInsertByAdapter failed."); + GELOGE(PARAM_INVALID, "[Call][DeleteIdentityInsertByAdapter] failed."); return PARAM_INVALID; } @@ -1929,7 +1975,7 @@ Status ProcessMultiBatch(ComputeGraphPtr &graph) { return SUCCESS; } if (CheckNegativeCountOfOptions(shapes) != SUCCESS) { - GELOGE(PARAM_INVALID, "Input_shape and dynamic_dims should set correct params."); + GELOGE(PARAM_INVALID, "[Check][Param] Input_shape and dynamic_dims should set correct params."); return PARAM_INVALID; } @@ -1986,7 +2032,8 @@ void GetDynamicShapeByGraph(const ComputeGraphPtr &graph, const NodePtr &node, if (subgraph == nullptr) { REPORT_INNER_ERROR("E19999", "Get subgraph:%s from graph:%s failed", dynamic_branch_names[j].c_str(), graph->GetName().c_str()); - GELOGE(GE_GRAPH_EMPTY_SUBGRAPH, "Subgraph not found, name: %s", dynamic_branch_names[j].c_str()); + GELOGE(GE_GRAPH_EMPTY_SUBGRAPH, "[Get][SubGraph] %s from graph:%s failed", + dynamic_branch_names[j].c_str(), graph->GetName().c_str()); dynamic_output_dims.clear(); return; } @@ -1995,7 +2042,8 @@ void GetDynamicShapeByGraph(const ComputeGraphPtr &graph, const NodePtr &node, if (out_node == nullptr) { REPORT_INNER_ERROR("E19999", "No netoutput node exist in subgraph:%s, check invalid", subgraph->GetName().c_str()); - GELOGE(GE_GRAPH_GRAPH_NODE_NULL, "NetOutput not found, name: %s", dynamic_branch_names[j].c_str()); + GELOGE(GE_GRAPH_GRAPH_NODE_NULL, "[Check][Param] No netoutput node exist in subgraph:%s", + subgraph->GetName().c_str()); dynamic_output_dims.clear(); return; } @@ -2006,7 +2054,9 @@ void GetDynamicShapeByGraph(const ComputeGraphPtr &graph, const NodePtr &node, REPORT_INNER_ERROR("E19999", "op_desc of node in subgraph:%s is nullptr or input desc size:%zu <= %zu, check invalid", subgraph->GetName().c_str(), out_desc->GetInputsSize(), i); - GELOGE(GE_GRAPH_GRAPH_NODE_NULL, "Get Input desc failed, name: %s, index: %zu", out_node->GetName().c_str(), i); + GELOGE(GE_GRAPH_GRAPH_NODE_NULL, + "[Check][Param] op_desc of node in subgraph:%s is nullptr or input desc size:%zu <= %zu", + subgraph->GetName().c_str(), out_desc->GetInputsSize(), i); dynamic_output_dims.clear(); return; } @@ -2110,7 +2160,8 @@ Status GetDynamicOutputShape(ComputeGraphPtr &graph) { REPORT_CALL_ERROR("E19999", "Set Attr:%s to node:%s(%s) failed", ATTR_NAME_DYNAMIC_OUTPUT_DIMS.c_str(), net_output->GetName().c_str(), net_output->GetType().c_str()); - GELOGE(FAILED, "Set dynamic output dims attr failed"); + GELOGE(FAILED, "[Set][Attr] %s to node:%s(%s) failed", ATTR_NAME_DYNAMIC_OUTPUT_DIMS.c_str(), + net_output->GetName().c_str(), net_output->GetType().c_str()); return FAILED; } } diff --git a/ge/graph/preprocess/multi_batch_options.cc b/ge/graph/preprocess/multi_batch_options.cc index 6cb57e6b..3842d2f8 100644 --- a/ge/graph/preprocess/multi_batch_options.cc +++ b/ge/graph/preprocess/multi_batch_options.cc @@ -105,8 +105,9 @@ Status CheckSequenceOfData(ComputeGraphPtr &graph, const vector &data_n REPORT_INNER_ERROR("E19999", "Count:%zu of data_nodes in graph:%s should be equal to " "input_shape count:%zu from option, check invalid", data_nodes.size(), graph->GetName().c_str(), GetLocalOmgContext().user_input_dims.size()); - GELOGE(PARAM_INVALID, "The count of input shape:%zu should be equal to the count of data num:%zu.", - GetLocalOmgContext().user_input_dims.size(), data_nodes.size()); + GELOGE(PARAM_INVALID, "[Check][Param] Count:%zu of data_nodes in graph:%s should be equal to " + "input_shape count:%zu from option", + data_nodes.size(), graph->GetName().c_str(), GetLocalOmgContext().user_input_dims.size()); return PARAM_INVALID; } for (size_t i = 0; i < data_nodes.size(); ++i) { @@ -127,9 +128,11 @@ Status CheckSequenceOfData(ComputeGraphPtr &graph, const vector &data_n formats::JoinToString(output_shape).c_str(), GetLocalOmgContext().user_input_dims.at(i).first.c_str(), formats::JoinToString(dynamic_dims).c_str(), graph->GetName().c_str()); - GELOGE(PARAM_INVALID, "The output shape of %s is %s, the input shape from options of %s is %s.", + GELOGE(PARAM_INVALID, "[Check][Param] The output shape of %s is %s, " + "the input shape from options of %s is %s, graph:%s", data_node->GetName().c_str(), formats::JoinToString(output_shape).c_str(), - GetLocalOmgContext().user_input_dims.at(i).first.c_str(), formats::JoinToString(dynamic_dims).c_str()); + GetLocalOmgContext().user_input_dims.at(i).first.c_str(), + formats::JoinToString(dynamic_dims).c_str(), graph->GetName().c_str()); return PARAM_INVALID; } for (size_t j = 0; j < dynamic_dims.size(); ++j) { @@ -139,8 +142,10 @@ Status CheckSequenceOfData(ComputeGraphPtr &graph, const vector &data_n formats::JoinToString(dynamic_dims).c_str(), formats::JoinToString(output_shape).c_str(), data_node->GetName().c_str(), kDynmaicDims, j, graph->GetName().c_str()); - GELOGE(INTERNAL_ERROR, "Value of input shape %s should be equal to %s.", - formats::JoinToString(dynamic_dims).c_str(), formats::JoinToString(output_shape).c_str()); + GELOGE(INTERNAL_ERROR, "[Check][Param] Value of input shape %s from option and output shape %s of data op:%s " + "should be equal to %d, index:%zu, graph:%s", + formats::JoinToString(dynamic_dims).c_str(), formats::JoinToString(output_shape).c_str(), + data_node->GetName().c_str(), kDynmaicDims, j, graph->GetName().c_str()); return INTERNAL_ERROR; } } @@ -154,7 +159,8 @@ Status CheckSequenceOfGetnext(ComputeGraphPtr &graph, const vector &get REPORT_INNER_ERROR("E19999", "Not support dynamic dims when a graph with multi getnext nodes, graph:%s, " "num of getnext node:%zu, check invalid", graph->GetName().c_str(), getnext_sink_node.size()); - GELOGE(PARAM_INVALID, "Not support dynamic dims when a graph with multi getnext nodes."); + GELOGE(PARAM_INVALID, "[Check][Param] Not support dynamic dims when a graph with multi getnext nodes, graph:%s, " + "num of getnext node:%zu", graph->GetName().c_str(), getnext_sink_node.size()); return PARAM_INVALID; } auto data_node = getnext_sink_node.at(0); @@ -163,11 +169,12 @@ Status CheckSequenceOfGetnext(ComputeGraphPtr &graph, const vector &get GE_CHECK_NOTNULL(op_desc); size_t data_count = data_node->GetAllOutDataAnchors().size() / kDivisionConst; if (data_count != GetLocalOmgContext().user_input_dims.size()) { - REPORT_INNER_ERROR("E19999", "Output desc count of %s is %zu, should be equal to count of input shape: %zu, " + REPORT_INNER_ERROR("E19999", "Output desc count of %s is %zu, should be equal to count of input shape:%zu, " "graph:%s, check invalid", op_desc->GetName().c_str(), data_count, GetLocalOmgContext().user_input_dims.size(), graph->GetName().c_str()); - GELOGE(PARAM_INVALID, "Output count of %s is %zu, should be equal to count of input shape: %zu", - op_desc->GetName().c_str(), data_count, GetLocalOmgContext().user_input_dims.size()); + GELOGE(PARAM_INVALID, "[Check][Param] Output desc count of %s is %zu, " + "should be equal to count of input shape:%zu, graph:%s", op_desc->GetName().c_str(), + data_count, GetLocalOmgContext().user_input_dims.size(), graph->GetName().c_str()); return PARAM_INVALID; } for (size_t i = 0; i < data_count; ++i) { @@ -186,9 +193,10 @@ Status CheckSequenceOfGetnext(ComputeGraphPtr &graph, const vector &get formats::JoinToString(dynamic_dims).c_str(), GetLocalOmgContext().user_input_dims.at(i).first.c_str(), graph->GetName().c_str()); - GELOGE(PARAM_INVALID, "the output_shape of %s is %s, the input_shape from options of %s is %s.", - data_node->GetName().c_str(), formats::JoinToString(output_shape).c_str(), - GetLocalOmgContext().user_input_dims.at(i).first.c_str(), formats::JoinToString(dynamic_dims).c_str()); + GELOGE(PARAM_INVALID, "[Check][Param] The %zu output_shape of %s is %s not equal to the input_shape:%s " + "from options of %s, graph:%s", i, data_node->GetName().c_str(), + formats::JoinToString(output_shape).c_str(), formats::JoinToString(dynamic_dims).c_str(), + GetLocalOmgContext().user_input_dims.at(i).first.c_str(), graph->GetName().c_str()); return PARAM_INVALID; } for (size_t j = 0; j < dynamic_dims.size(); ++j) { @@ -198,8 +206,10 @@ Status CheckSequenceOfGetnext(ComputeGraphPtr &graph, const vector &get formats::JoinToString(dynamic_dims).c_str(), formats::JoinToString(output_shape).c_str(), data_node->GetName().c_str(), kDynmaicDims, j, graph->GetName().c_str()); - GELOGE(INTERNAL_ERROR, "value of input_shape %s should be equal to %s.", - formats::JoinToString(dynamic_dims).c_str(), formats::JoinToString(output_shape).c_str()); + GELOGE(INTERNAL_ERROR, "[Check][Param] Value of input shape %s from option and output shape %s of data op:%s " + "should be equal to %d, index:%zu, graph:%s", formats::JoinToString(dynamic_dims).c_str(), + formats::JoinToString(output_shape).c_str(), data_node->GetName().c_str(), kDynmaicDims, + j, graph->GetName().c_str()); return INTERNAL_ERROR; } } @@ -215,26 +225,26 @@ Status CheckSequenceOfOptions(ComputeGraphPtr &graph, vector &data_node } if (DistinguishGetNextAndData(graph, data_nodes, getnext_nosink_nodes, getnext_sink_nodes) != SUCCESS) { - GELOGE(PARAM_INVALID, "DistinguishGetNextAndData failed."); + GELOGE(PARAM_INVALID, "[Call][DistinguishGetNextAndData] failed."); return PARAM_INVALID; } if (GetLocalOmgContext().dynamic_node_type == DATA) { GELOGD("Users want data nodes to be dynamic."); if (CheckSequenceOfData(graph, data_nodes) != SUCCESS) { - GELOGE(PARAM_INVALID, "Failed to check sequence of data nodes."); + GELOGE(PARAM_INVALID, "[Check][Sequence] Of Data nodes failed."); return PARAM_INVALID; } } else { GELOGD("Users want getnext nodes to be dynamic."); if (!getnext_nosink_nodes.empty()) { if (CheckSequenceOfData(graph, getnext_nosink_nodes) != SUCCESS) { - GELOGE(PARAM_INVALID, "Failed to check sequence of getnext nosink nodes."); + GELOGE(PARAM_INVALID, "[Check][Sequence] of getnext nosink nodes failed."); return PARAM_INVALID; } } else { if (CheckSequenceOfGetnext(graph, getnext_sink_nodes) != SUCCESS) { - GELOGE(PARAM_INVALID, "Failed to check sequence of getnext sink nodes."); + GELOGE(PARAM_INVALID, "[Check][Sequence] of getnext sink nodes failed."); return PARAM_INVALID; } } @@ -248,8 +258,9 @@ Status UpdateNameOfData(ComputeGraphPtr &graph, const vector &data_node REPORT_INNER_ERROR("E19999", "Count:%zu of data_nodes in graph:%s should be equal to " "input_shape count:%zu from option, check invalid", data_nodes.size(), graph->GetName().c_str(), GetLocalOmgContext().user_input_dims.size()); - GELOGE(PARAM_INVALID, "count of data_nodes: %zu should be equal to input_shape count: %zu.", - data_nodes.size(), GetLocalOmgContext().user_input_dims.size()); + GELOGE(PARAM_INVALID, "[Check][Param] Count:%zu of data_nodes in graph:%s should be equal to " + "input_shape count:%zu from option", + data_nodes.size(), graph->GetName().c_str(), GetLocalOmgContext().user_input_dims.size()); return PARAM_INVALID; } for (size_t i = 0; i < data_nodes.size(); ++i) { @@ -265,7 +276,8 @@ Status UpdateNameOfGetnext(ComputeGraphPtr &graph, const vector &getnex REPORT_INNER_ERROR("E19999", "Not support dynamic dims when a graph with multi getnext nodes, graph:%s, " "num of getnext node:%zu, check invalid", graph->GetName().c_str(), getnext_sink_nodes.size()); - GELOGE(PARAM_INVALID, "Not support dynamic dims when a graph with multi getnext nodes."); + GELOGE(PARAM_INVALID, "[Check][Param] Not support dynamic dims when a graph with multi getnext nodes, graph:%s, " + "num of getnext node:%zu", graph->GetName().c_str(), getnext_sink_nodes.size()); return PARAM_INVALID; } auto input_node = getnext_sink_nodes.at(0); @@ -275,11 +287,12 @@ Status UpdateNameOfGetnext(ComputeGraphPtr &graph, const vector &getnex // user want getnext dynamic, just getnext or data+getnext_sink size_t data_count = input_node->GetAllOutDataAnchors().size() / kDivisionConst; if (data_count != GetLocalOmgContext().user_input_dims.size()) { - REPORT_INNER_ERROR("E19999", "Output desc count of %s is %zu, should be equal to count of input shape: %zu, " + REPORT_INNER_ERROR("E19999", "Output desc count of %s is %zu, should be equal to count of input shape:%zu, " "graph:%s, check invalid", op_desc->GetName().c_str(), data_count, GetLocalOmgContext().user_input_dims.size(), graph->GetName().c_str()); - GELOGE(PARAM_INVALID, "Output count of %s is %zu, should be equal to count of input shape: %zu", - op_desc->GetName().c_str(), data_count, GetLocalOmgContext().user_input_dims.size()); + GELOGE(PARAM_INVALID, "[Check][Param]Output desc count of %s is %zu, " + "should be equal to count of input shape:%zu, graph:%s", op_desc->GetName().c_str(), data_count, + GetLocalOmgContext().user_input_dims.size(), graph->GetName().c_str()); return PARAM_INVALID; } @@ -302,19 +315,21 @@ Status UpdateNameOfInputShape(ComputeGraphPtr &graph, const vector &dat if (GetLocalOmgContext().dynamic_node_type == DATA) { GELOGD("Users want data nodes to be dynamic."); if (UpdateNameOfData(graph, data_nodes) != SUCCESS) { - GELOGE(PARAM_INVALID, "Failed to update first value of input shape of data nodes."); + GELOGE(PARAM_INVALID, "[Call][UpdateNameOfData] update first value of input shape of data nodes failed."); return PARAM_INVALID; } } else { GELOGD("Users want getnext nodes to be dynamic."); if (!getnext_nosink_nodes.empty()) { if (UpdateNameOfData(graph, getnext_nosink_nodes) != SUCCESS) { - GELOGE(PARAM_INVALID, "Failed to update first value of input shape of getnext nosink nodes."); + GELOGE(PARAM_INVALID, + "[Call][UpdateNameOfData] update first value of input shape of getnext nosink nodes failed."); return PARAM_INVALID; } } else { if (UpdateNameOfGetnext(graph, getnext_sink_nodes) != SUCCESS) { - GELOGE(PARAM_INVALID, "Failed to update first value of input shape of getnext sink nodes."); + GELOGE(PARAM_INVALID, + "[Call][UpdateNameOfGetnext] update first value of input shape of getnext sink nodes failed."); return PARAM_INVALID; } } @@ -340,7 +355,8 @@ Status DeleteIdentityInsertByAdapter(ComputeGraphPtr &graph) { if (GraphUtils::RemoveNodeWithoutRelink(graph, dst_node) != GRAPH_SUCCESS) { REPORT_CALL_ERROR("E19999", "Remove node:%s(%s) from graph:%s failed", dst_node->GetName().c_str(), dst_node->GetType().c_str(), graph->GetName().c_str()); - GELOGE(FAILED, "Remove Identity node %s failed.", dst_node->GetName().c_str()); + GELOGE(FAILED, "[Remove][Node] %s(%s) from graph:%s failed", + dst_node->GetName().c_str(), dst_node->GetType().c_str(), graph->GetName().c_str()); return FAILED; } } @@ -365,8 +381,8 @@ Status CheckNegativeCountOfOptions(const std::vector> &shap if (shapes.at(i).size() != negative_count) { REPORT_INNER_ERROR("E19999", "gear num of dynamic_dims is %zu should be equal to num:%zu from option, " "check invalid", shapes.at(i).size(), negative_count); - GELOGE(PARAM_INVALID, "Each gear num of dynamic_dims is %zu should be equal to %zu.", shapes.at(i).size(), - negative_count); + GELOGE(PARAM_INVALID, "[Check][Param] gear num of dynamic_dims is %zu should be equal to num:%zu from option", + shapes.at(i).size(), negative_count); return PARAM_INVALID; } } @@ -443,7 +459,7 @@ Status ParserDataToDynamicInfo(const vector> &shapes, if (tmp_index >= dynamic_gear_info.size()) { ErrorManager::GetInstance().ATCReportErrMessage( "E10045", {"name", "shape"}, {data_name, formats::JoinToString(data_shape)}); - GELOGE(PARAM_INVALID, "Data: %s shape: %s make dynamic dims overflow", data_name.c_str(), + GELOGE(PARAM_INVALID, "[Check][Param] Data:%s shape:%s make dynamic dims overflow", data_name.c_str(), formats::JoinToString(data_shape).c_str()); return FAILED; } @@ -452,7 +468,8 @@ Status ParserDataToDynamicInfo(const vector> &shapes, } else { ErrorManager::GetInstance().ATCReportErrMessage( "E10046", {"name", "shape"}, {data_name, formats::JoinToString(data_shape)}); - GELOGE(PARAM_INVALID, "Dynamic dims num of data: %s shape: %s can not be more than one gear dynamic info size", + GELOGE(PARAM_INVALID, "[Check][Param] Dynamic dims num of data: %s shape: %s " + "can not be more than one gear dynamic info size", data_name.c_str(), formats::JoinToString(data_shape).c_str()); return FAILED; } @@ -477,7 +494,7 @@ Status CheckDynamicParams(const vector> &shapes) { ErrorManager::GetInstance().ATCReportErrMessage( "E10035", {"shapesize", "minshapesize"}, {std::to_string(shapes.size()), std::to_string(kMinShapesCount - 1)}); GELOGE(PARAM_INVALID, - "Input parameter[--dynamic_batch_size, --dynamic_image_size or --dynamic_dims]'s " + "[Check][Param] Input parameter[--dynamic_batch_size, --dynamic_image_size or --dynamic_dims]'s " "value size [%zu] must be greater than [%d].", shapes.size(), kMinShapesCount - 1); return PARAM_INVALID; @@ -486,7 +503,7 @@ Status CheckDynamicParams(const vector> &shapes) { ErrorManager::GetInstance().ATCReportErrMessage( "E10036", {"shapesize", "maxshapesize"}, {std::to_string(shapes.size()), std::to_string(kMaxShapesCount + 1)}); GELOGE(PARAM_INVALID, - "Input parameter[--dynamic_batch_size, --dynamic_image_size or --dynamic_dims]'s " + "[Check][Param] Input parameter[--dynamic_batch_size, --dynamic_image_size or --dynamic_dims]'s " "value size [%zu] must be less than [%d].", shapes.size(), kMaxShapesCount + 1); return PARAM_INVALID; @@ -498,7 +515,7 @@ Status CheckDynamicParams(const vector> &shapes) { ErrorManager::GetInstance().ATCReportErrMessage("E10037", {"shapesize1", "shapesize2"}, {std::to_string(shape_size), std::to_string(shape.size())}); GELOGE(PARAM_INVALID, - "Input parameter[--dynamic_batch_size, --dynamic_image_size or --dynamic_dims]'s " + "[Check][Param] Input parameter[--dynamic_batch_size, --dynamic_image_size or --dynamic_dims]'s " "value size must be same, first group's size is %zu and another's is %zu.", shape_size, shape.size()); return PARAM_INVALID; @@ -506,7 +523,7 @@ Status CheckDynamicParams(const vector> &shapes) { for (auto dim : shape) { if (dim <= 0) { ErrorManager::GetInstance().ATCReportErrMessage("E10038", {"dim"}, {std::to_string(dim)}); - GELOGE(PARAM_INVALID, "Invalid dim %ld, all dims must be greater than 0", dim); + GELOGE(PARAM_INVALID, "[Check][Param] Invalid dim %ld, all dims must be greater than 0", dim); return PARAM_INVALID; } } @@ -514,8 +531,8 @@ Status CheckDynamicParams(const vector> &shapes) { } if (shapes_set.size() != shapes.size()) { ErrorManager::GetInstance().ATCReportErrMessage("E10039"); - GELOGE(PARAM_INVALID, - "Input parameter[--dynamic_batch_size, --dynamic_image_size or --dynamic_dims] exist duplicate shapes."); + GELOGE(PARAM_INVALID, "[Check][Param] Input parameter[--dynamic_batch_size, " + "--dynamic_image_size or --dynamic_dims] exist duplicate shapes."); return PARAM_INVALID; } return SUCCESS; @@ -537,9 +554,8 @@ Status CalcShape(const std::vector &batch_shape, GeShape &data_shape) { "E19012", {"function", "reason"}, {"CalcShape", "the batch shape count " + std::to_string(batch_shape.size()) + " does not match the data shape " + data_shape.ToString()}); - GELOGE(PARAM_INVALID, - "Failed to calc tensor shape, the batch shape count %zu, does not match the data shape %s", - batch_shape.size(), data_shape.ToString().c_str()); + GELOGE(PARAM_INVALID, "[Check][Param] Failed to calc tensor shape, the batch shape count %zu, " + "does not match the data shape %s", batch_shape.size(), data_shape.ToString().c_str()); return PARAM_INVALID; } data_shape.SetDim(i, batch_shape[batch_shape_index++]); @@ -550,8 +566,8 @@ Status CalcShape(const std::vector &batch_shape, GeShape &data_shape) { ErrorManager::GetInstance().ATCReportErrMessage( "E19012", {"function", "reason"}, {"CalcShape", "the batch shape count " + std::to_string(batch_shape.size()) + " does not match the data shape " + data_shape.ToString()}); - GELOGE(PARAM_INVALID, "Failed to calc tensor shape, the batch shape count %zu, does not match the data shape %s", - batch_shape.size(), data_shape.ToString().c_str()); + GELOGE(PARAM_INVALID, "[Check][Param] Failed to calc tensor shape, the batch shape count %zu, " + "does not match the data shape %s", batch_shape.size(), data_shape.ToString().c_str()); return PARAM_INVALID; } return SUCCESS; @@ -578,7 +594,8 @@ Status StampDynamicType(const OpDescPtr &op_desc) { if (!AttrUtils::SetInt(op_desc, ATTR_DYNAMIC_TYPE, dynamic_type)) { REPORT_CALL_ERROR("E19999", "Set Attr:%s to node:%s(%s) failed", ATTR_DYNAMIC_TYPE.c_str(), op_desc->GetName().c_str(), op_desc->GetType().c_str()); - GELOGE(INTERNAL_ERROR, "Failed to add dynamic type attr for node %s", op_desc->GetName().c_str()); + GELOGE(INTERNAL_ERROR, "[Set][Attr] %s to node:%s(%s) failed", + ATTR_DYNAMIC_TYPE.c_str(), op_desc->GetName().c_str(), op_desc->GetType().c_str()); return INTERNAL_ERROR; } return SUCCESS; @@ -597,9 +614,8 @@ bool CheckDynamicBatchShape(const vector &shape, const string &data_nam if (shape[i] < 1) { ErrorManager::GetInstance().ATCReportErrMessage("E10018", {"index", "shape"}, {std::to_string(i), std::to_string(shape[i])}); - GELOGE(ge::PARAM_INVALID, - "Only batch N can be -1 when set --dynamic_batch_size, current data: %s shape[%zu] is %ld", - data_name.c_str(), i, shape[i]); + GELOGE(ge::PARAM_INVALID, "[Check][Param] Only batch N can be -1 when set --dynamic_batch_size, " + "current data: %s shape[%zu] is %ld", data_name.c_str(), i, shape[i]); return false; } } @@ -635,8 +651,8 @@ bool CheckDynamicImageSizeShape(const vector &shape, const string &data return true; } else { ErrorManager::GetInstance().ATCReportErrMessage("E10019"); - GELOGE(ge::PARAM_INVALID, - "--input_shape's shape is invalid, only height and width can be -1 when set --dynamic_image_size."); + GELOGE(ge::PARAM_INVALID, "[Check][Param] --input_shape's shape is invalid, only height and width can be -1 " + "when set --dynamic_image_size."); return false; } } diff --git a/metadef b/metadef index 567381fa..7cb171b9 160000 --- a/metadef +++ b/metadef @@ -1 +1 @@ -Subproject commit 567381faaff179106abafb264ba696f45c4d2b43 +Subproject commit 7cb171b9c511fec57ccc0ad746ef2126267fe18b diff --git a/parser b/parser index 9226f953..8d44bebf 160000 --- a/parser +++ b/parser @@ -1 +1 @@ -Subproject commit 9226f9532a3884490b03e48df5d7aa02611e21f4 +Subproject commit 8d44bebfeeb71b793bc7325acc95345090789e19