diff --git a/ge/common/auth/file_saver.cc b/ge/common/auth/file_saver.cc index 5adaed15..3c3b6197 100755 --- a/ge/common/auth/file_saver.cc +++ b/ge/common/auth/file_saver.cc @@ -111,8 +111,8 @@ Status FileSaver::SaveWithFileHeader(const std::string &file_path, const ModelFi } while (0); // Close file if (mmClose(fd) != 0) { // mmClose 0: success - GELOGE(FAILED, "[Close][File]Failed, error_code:%u.", ret); - REPORT_INNER_ERROR("E19999", "Close file failed, error_code:%u.", ret); + GELOGE(FAILED, "[Close][File]Failed, error_code:%u errmsg:%s", ret, strerror(errno)); + REPORT_INNER_ERROR("E19999", "Close file failed, error_code:%u errmsg:%s", ret, strerror(errno)); ret = FAILED; } return ret; @@ -148,7 +148,11 @@ Status FileSaver::SaveWithFileHeader(const std::string &file_path, const ModelFi } } while (0); // Close file - GE_CHK_BOOL_RET_STATUS(mmClose(fd) == EN_OK, FAILED, "Close file failed."); + if (mmClose(fd) != EN_OK) { + GELOGE(FAILED, "[Close][File]Failed, error_code:%u errmsg:%s", ret, strerror(errno)); + REPORT_CALL_ERROR("E19999", "Close file failed, error_code:%u errmsg:%s", ret, strerror(errno)); + ret = FAILED; + } return ret; } @@ -346,7 +350,7 @@ Status FileSaver::SaveWithFileHeader(const std::string &file_path, const ModelFi // Write partition data auto &cur_partition_datas = all_partition_datas[index]; for (const auto &partition_data : cur_partition_datas) { - GELOGI("GC:size[%u]", partition_data.size); + GELOGI("part_size[%u]", partition_data.size); GE_CHK_BOOL_TRUE_EXEC_WITH_LOG( WriteData(static_cast(partition_data.data), partition_data.size, fd) != SUCCESS, ret = FAILED; break); @@ -354,7 +358,11 @@ Status FileSaver::SaveWithFileHeader(const std::string &file_path, const ModelFi } } while (0); // Close file - GE_CHK_BOOL_RET_STATUS(mmClose(fd) == EN_OK, FAILED, "Close file failed."); + if (mmClose(fd) != 0) { // mmClose 0: success + GELOGE(FAILED, "[Close][File]Failed, error_code:%u errmsg:%s", ret, strerror(errno)); + REPORT_CALL_ERROR("E19999", "Close file failed, error_code:%u errmsg:%s", ret, strerror(errno)); + ret = FAILED; + } return ret; } @@ -377,8 +385,8 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status FileSaver::SaveToFile(co // Close file if (mmClose(fd) != 0) { // mmClose 0: success - GELOGE(FAILED, "[Close][File]Failed, error_code:%u.", ret); - REPORT_INNER_ERROR("E19999", "Close file failed, error_code:%u.", ret); + GELOGE(FAILED, "[Close][File]Failed, error_code:%u errmsg:%s", ret, strerror(errno)); + REPORT_CALL_ERROR("E19999", "Close file failed, error_code:%u errmsg:%s", ret, strerror(errno)); ret = FAILED; } return ret; diff --git a/ge/graph/build/graph_builder.cc b/ge/graph/build/graph_builder.cc index 47e25e8e..97b7608c 100644 --- a/ge/graph/build/graph_builder.cc +++ b/ge/graph/build/graph_builder.cc @@ -77,7 +77,7 @@ Status HandleSubgraphNode(NodePtr &src_node, OutDataAnchorPtr &src_out_anchor) { Status HandleSubgraphDataNode(NodePtr &src_node, OutDataAnchorPtr &src_out_anchor) { uint32_t index = 0; if (!AttrUtils::GetInt(src_node->GetOpDesc(), ATTR_NAME_PARENT_NODE_INDEX, index)) { - REPORT_INNER_ERROR("E19999", "get attr:%s failed from node:%s when HandleSubgraphDataNode", + REPORT_INNER_ERROR("E19999", "get attr:%s failed from node:%s", ATTR_NAME_PARENT_NODE_INDEX.c_str(), src_node->GetName().c_str()); GELOGE(FAILED, "Get attr ATTR_NAME_PARENT_NODE_INDEX failed, node:%s.", src_node->GetName().c_str()); return FAILED; @@ -111,7 +111,7 @@ Status GraphBuilder::CalcOpParam(const ge::ComputeGraphPtr &graph) { GE_CHECK_NOTNULL(graph); auto instance_ptr = ge::GELib::GetInstance(); if (instance_ptr == nullptr || !instance_ptr->InitFlag()) { - REPORT_INNER_ERROR("E19999", "check gelib instance null when CalcOpParam for graph:%s", + REPORT_INNER_ERROR("E19999", "check gelib instance null, graph:%s", graph->GetName().c_str()); GELOGE(GE_CLI_GE_NOT_INITIALIZED, "GraphBuilder: GE is not initialized"); return GE_CLI_GE_NOT_INITIALIZED; @@ -125,7 +125,7 @@ Status GraphBuilder::CalcOpParam(const ge::ComputeGraphPtr &graph) { (void)instance_ptr->DNNEngineManagerObj().GetDNNEngineName(node_ptr); kernel_lib_name = node_ptr->GetOpDesc()->GetOpKernelLibName(); if (kernel_lib_name.empty()) { - REPORT_INNER_ERROR("E19999", "op kernel lib is empty in node:%s(%s) when CalcOpParam", + REPORT_INNER_ERROR("E19999", "op kernel lib is empty in node:%s(%s)", node_ptr->GetName().c_str(), node_ptr->GetType().c_str()); GELOGE(INTERNAL_ERROR, "Get node:%s(%s) kernel lib failed.", node_ptr->GetName().c_str(), node_ptr->GetType().c_str()); @@ -135,7 +135,7 @@ Status GraphBuilder::CalcOpParam(const ge::ComputeGraphPtr &graph) { auto ret = SetInputSize(node_ptr); if (ret != SUCCESS) { - REPORT_CALL_ERROR("E19999", "Set node:%s(%s) inputDesc size failed when CalcOpParam", + REPORT_CALL_ERROR("E19999", "Set node:%s(%s) inputDesc size failed", node_ptr->GetName().c_str(), node_ptr->GetType().c_str()); GELOGE(ret, "Set node inputDesc size failed, node name is %s", node_ptr->GetName().c_str()); return ret; @@ -201,7 +201,7 @@ Status GraphBuilder::UpdateParentNodeOutputSize(const ge::ComputeGraphPtr &graph Status GraphBuilder::Build(ComputeGraphPtr &comp_graph, GeRootModelPtr &ge_root_model_ptr, uint64_t session_id) { if (comp_graph == nullptr) { - REPORT_INNER_ERROR("E19999", "check compute_graph nullptr when BuildGraph, session_id:%lu", session_id); + REPORT_INNER_ERROR("E19999", "check compute_graph nullptr, session_id:%lu", session_id); GELOGE(GE_GRAPH_PARAM_NULLPTR, "Graph build comp_graph is null."); return GE_GRAPH_PARAM_NULLPTR; } @@ -313,7 +313,7 @@ Status GraphBuilder::SetConstantInputOffset(ComputeGraphPtr &comp_graph) { std::vector weights = OpDescUtils::MutableWeights(peer_node); if (weights.empty()) { - REPORT_INNER_ERROR("E19999", "check weights size of node %s(%s) is empty when SetConstantInputOffset", + REPORT_INNER_ERROR("E19999", "check weights size of node %s(%s) is empty", node->GetName().c_str(), node->GetType().c_str()); GELOGE(FAILED, "weights size of node %s is empty", node->GetName().c_str()); return FAILED; @@ -649,7 +649,7 @@ Status GraphBuilder::SetInputSize(const ge::NodePtr &node_ptr) { Status GraphBuilder::UpdateDataInputSize(const ge::NodePtr &node_ptr) { const auto &op_desc = node_ptr->GetOpDesc(); if (op_desc == nullptr) { - REPORT_INNER_ERROR("E19999", "check op_desc is nullptr when UpdateDataInputSize"); + REPORT_INNER_ERROR("E19999", "check op_desc is nullptr"); GELOGE(FAILED, "Op desc is nullptr."); return FAILED; } @@ -667,7 +667,7 @@ Status GraphBuilder::UpdateDataInputSize(const ge::NodePtr &node_ptr) { int64_t real_dim_size = 0; ge::graphStatus graph_status = TensorUtils::GetTensorSizeInBytes(output_desc, real_dim_size); if (graph_status != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Get tensor size in bytes failed for op:%s(%s) index:0 when UpdateDataInputSize", + REPORT_CALL_ERROR("E19999", "Get tensor size in bytes failed for op:%s(%s) index:0", op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(FAILED, "Get tensor size in bytes failed."); return FAILED; @@ -676,7 +676,7 @@ Status GraphBuilder::UpdateDataInputSize(const ge::NodePtr &node_ptr) { ge::GeTensorDesc input_desc = op_desc->GetInputDesc(0); ge::TensorUtils::SetSize(input_desc, real_dim_size); if (op_desc->UpdateInputDesc(0, input_desc) != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Update input desc size failed for op:%s(%s) index:0 when UpdateDataInputSize", + REPORT_CALL_ERROR("E19999", "Update input desc size failed for op:%s(%s) index:0", op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(FAILED, "Update input desc size failed."); return FAILED; @@ -706,8 +706,7 @@ Status GraphBuilder::CalcDynShapeRootGraphDataSize(const ge::OpDescPtr &op_desc) int64_t real_dim_size = 0; ge::graphStatus graph_status = TensorUtils::GetTensorSizeInBytes(output_desc, real_dim_size); if (graph_status != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Get tensor size in bytes failed for op:%s(%s) index:0 " - "when CalcDynShapeRootGraphDataSize", + REPORT_CALL_ERROR("E19999", "Get tensor size in bytes failed for op:%s(%s) index:0 ", op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(FAILED, "Get tensor size in bytes failed."); return FAILED; @@ -716,8 +715,7 @@ Status GraphBuilder::CalcDynShapeRootGraphDataSize(const ge::OpDescPtr &op_desc) ge::TensorUtils::SetSize(output_desc, real_dim_size); GELOGI("Update dynamic shape graph data output size to [%ld].", real_dim_size); if (op_desc->UpdateOutputDesc(0, output_desc) != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Update output desc size failed for op:%s(%s) index:0 " - "when CalcDynShapeRootGraphDataSize", + REPORT_CALL_ERROR("E19999", "Update output desc size failed for op:%s(%s) index:0 ", op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(FAILED, "Update dynamic shape graph data output desc size failed."); return FAILED; @@ -736,7 +734,7 @@ Status GraphBuilder::SecondPartition(ge::ComputeGraphPtr &comp_graph) { GE_CHK_STATUS_RET(ret, "Graph partition Failed."); const auto &graph_2_subgraphlist = graph_partitioner_.GetSubGraphMap(); if (graph_2_subgraphlist.find(comp_graph) == graph_2_subgraphlist.end()) { - REPORT_INNER_ERROR("E19999", "find subgraphlis in graph:%s failed when SecondPartition", + REPORT_INNER_ERROR("E19999", "find subgraphlis in graph:%s failed", comp_graph->GetName().c_str()); GELOGE(FAILED, "Find subgraph failed."); return FAILED; @@ -766,7 +764,7 @@ Status GraphBuilder::AddOutputMemTypeForNode(const NodePtr &node) { mem_type); if (!AttrUtils::SetInt(src_desc->MutableOutputDesc(src_out_anchor->GetIdx()), ATTR_OUTPUT_MEMORY_TYPE, mem_type)) { - REPORT_INNER_ERROR("E19999", "Set Attr:%s for node:%s(%s) out_index:%u failed when AddOutputMemTypeForNode", + REPORT_INNER_ERROR("E19999", "Set Attr:%s for node:%s(%s) out_index:%u failed", ATTR_OUTPUT_MEMORY_TYPE.c_str(), src_desc->GetName().c_str(), src_desc->GetType().c_str(), src_out_anchor->GetIdx()); GELOGE(INTERNAL_ERROR, "Set out_memory_type attr for [%s:%d] failed.", src_desc->GetName().c_str(), diff --git a/ge/graph/build/label_allocator.cc b/ge/graph/build/label_allocator.cc index 3ab39838..b6ef8dc9 100644 --- a/ge/graph/build/label_allocator.cc +++ b/ge/graph/build/label_allocator.cc @@ -28,7 +28,7 @@ LabelAllocator::LabelAllocator(const ComputeGraphPtr &graph) : compute_graph_(gr Status LabelAllocator::AssignFunctionalLabels() { if (compute_graph_ == nullptr) { - REPORT_INNER_ERROR("E19999", "check param compute_graph nullptr when AssignFunctionalLabels"); + REPORT_INNER_ERROR("E19999", "check param compute_graph nullptr"); GELOGE(INTERNAL_ERROR, "ComputeGraph not set, Assign labels failed."); return INTERNAL_ERROR; } @@ -47,14 +47,14 @@ Status LabelAllocator::AssignFunctionalLabels() { for (auto node : functional_nodes) { LabelMakerPtr maker = LabelMakerFactory::Instance().Create(node->GetType(), compute_graph_, node); if (maker == nullptr) { - REPORT_CALL_ERROR("E19999", "Check Node:%s(%s) label maker not registed when AssignFunctionalLabels", + REPORT_CALL_ERROR("E19999", "Check Node:%s(%s) label maker not registed", node->GetName().c_str(), node->GetType().c_str()); GELOGE(INTERNAL_ERROR, "Node: %s label maker not registed.", node->GetType().c_str()); return INTERNAL_ERROR; } if (maker->Run(label_index) != SUCCESS) { - REPORT_CALL_ERROR("E19999", "Node:%s(%s) run label maker failed when AssignFunctionalLabels", + REPORT_CALL_ERROR("E19999", "Node:%s(%s) run label maker failed", node->GetName().c_str(), node->GetType().c_str()); GELOGE(INTERNAL_ERROR, "Node: %s run label maker failed.", node->GetType().c_str()); return INTERNAL_ERROR; @@ -68,7 +68,7 @@ Status LabelAllocator::AssignFunctionalLabels() { bool LabelAllocator::CollectFunctionalNode(ComputeGraphPtr &graph, std::set &functional_nodes) { if (graph == nullptr) { - REPORT_INNER_ERROR("E19999", "check param compute_graph nullptr when CollectFunctionalNode"); + REPORT_INNER_ERROR("E19999", "check param compute_graph nullptr"); GELOGE(INTERNAL_ERROR, "Sub ComputeGraph is null."); return false; } diff --git a/ge/graph/build/logical_stream_allocator.cc b/ge/graph/build/logical_stream_allocator.cc index 837b9454..88b4a97f 100644 --- a/ge/graph/build/logical_stream_allocator.cc +++ b/ge/graph/build/logical_stream_allocator.cc @@ -339,8 +339,8 @@ Status NodeStreamUpdatePass::Run(ComputeGraphPtr graph, const vectorengine_conf.id; if (!IsEngineSkip(*subgraph) && !HasAssignedStream(*subgraph)) { - REPORT_INNER_ERROR("E19999", "Subgraph %s has not yet been assigned a stream (engine: %s) " - " when run NodeStreamUpdatePass", subgraph->name.c_str(), engine_name.c_str()); + REPORT_INNER_ERROR("E19999", "Subgraph %s has not yet been assigned a stream (engine: %s)", + subgraph->name.c_str(), engine_name.c_str()); GELOGE(INTERNAL_ERROR, "Subgraph %s has not yet been assigned a stream (engine: %s).", subgraph->name.c_str(), engine_name.c_str()); return INTERNAL_ERROR; @@ -681,7 +681,7 @@ Status LogicalStreamAllocator::ConvertSubgraphs(const vector &s const string &engine_name = subgraph_info->GetEngineName(); auto engine_conf_iter = engine_confs.find(engine_name); if ((engine_conf_iter == engine_confs.end()) || (engine_conf_iter->second == nullptr)) { - REPORT_INNER_ERROR("E19999", "Engine conf of subgraph %s not found (engine name: %s) when ConvertSubgraphs", + REPORT_INNER_ERROR("E19999", "Engine conf of subgraph %s not found (engine name: %s)", subgraph_name.c_str(), engine_name.c_str()); GELOGE(INTERNAL_ERROR, "Engine conf of subgraph %s not found (engine name: %s).", subgraph_name.c_str(), engine_name.c_str()); diff --git a/ge/graph/build/memory/graph_mem_assigner.cc b/ge/graph/build/memory/graph_mem_assigner.cc index 9b53403a..3bbec914 100755 --- a/ge/graph/build/memory/graph_mem_assigner.cc +++ b/ge/graph/build/memory/graph_mem_assigner.cc @@ -119,7 +119,7 @@ Status GraphMemoryAssigner::AssignMemory() { if (variable_assigner == nullptr) { GELOGE(ge::FAILED, "[New][Object:VariableMemoryAssigner]graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); - REPORT_CALL_ERROR("E19999", "New Object:VariableMemoryAssigner failed when assign graph memory, " + REPORT_CALL_ERROR("E19999", "New Object:VariableMemoryAssigner failed, " "graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); return ge::FAILED; } @@ -141,7 +141,7 @@ ge::Status GraphMemoryAssigner::AssignVarAttr2Nodes() { if (variable_assigner == nullptr) { GELOGE(ge::FAILED, "[New][Object:VariableMemoryAssigner]graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); - REPORT_CALL_ERROR("E19999", "New Object:VariableMemoryAssigner failed when assign graph memory, " + REPORT_CALL_ERROR("E19999", "New Object:VariableMemoryAssigner failed, " "graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); return ge::FAILED; } @@ -157,7 +157,7 @@ ge::Status GraphMemoryAssigner::AssignMemory2HasRefAttrNode() { if (variable_assigner == nullptr) { GELOGE(ge::FAILED, "[New][Object:VariableMemoryAssigner]graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); - REPORT_CALL_ERROR("E19999", "New Object:VariableMemoryAssigner failed when assign graph memory, " + REPORT_CALL_ERROR("E19999", "New Object:VariableMemoryAssigner failed, " "graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); } if (variable_assigner->AssignMemory2HasRefAttrNode() != ge::SUCCESS) { @@ -172,7 +172,7 @@ ge::Status CalculateTensorRealSizeAndOutSize(const ge::ConstGeTensorDescPtr &out graphStatus graph_status = ge::TensorUtils::GetSize(*output_desc, out_size); if (graph_status != GRAPH_SUCCESS) { GELOGE(FAILED, "[Get][TensorSize]"); - REPORT_INNER_ERROR("E19999", "Get tensor size failed when %s", __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Get tensor size failed"); return FAILED; } @@ -223,8 +223,8 @@ ge::Status CalculateTensorRealSizeAndOutSize(const ge::ConstGeTensorDescPtr &out Status GraphMemoryAssigner::ReAssignMemory(bool is_loop_graph, map &mem_type_to_offset) { if (memory_offset_.empty()) { - REPORT_INNER_ERROR("E19999", "InnerData memory_offset_ empty, not expected when ReAssignMemory, " - "graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); + REPORT_INNER_ERROR("E19999", "InnerData memory_offset_ empty, not expected, graph_id:%u, graph_name:%s", + compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); GELOGE(FAILED, "[Check][InnerData:memory_offset_]empty is not expected, " "graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); return ge::FAILED; @@ -261,8 +261,8 @@ Status GraphMemoryAssigner::ReAssignMemory(bool is_loop_graph, map &mem_offset, size_t &zero_mem_copy_size) { BlockMemAssignerPtr priority_assigner = std::move(mem_assigner_->GetPriorityAssinger()); if (priority_assigner == nullptr) { - REPORT_INNER_ERROR("E19999", "InnerData priority_assigner nullptr, not expected when AssignZeroCopyMemory, " - "graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); + REPORT_INNER_ERROR("E19999", "InnerData priority_assigner nullptr, not expected, graph_id:%u, graph_name:%s", + compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); GELOGE(FAILED, "[Check][InnerData:priority_assigner]nullptr is invalid, " "graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); return ge::FAILED; @@ -286,8 +286,7 @@ Status GraphMemoryAssigner::AssignZeroCopyMemory(map &mem_offse zero_mem_copy_size = mem_offset[RT_MEMORY_HBM] - mem_offset_tmp; auto iter = memory_offset_.find(RT_MEMORY_HBM); if (iter == memory_offset_.end()) { - REPORT_INNER_ERROR("E19999", "InnerData memory_offset_ does not have type[HBM], " - "not expected when AssignZeroCopyMemory, " + REPORT_INNER_ERROR("E19999", "InnerData memory_offset_ does not have type[HBM], not expected, " "graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); GELOGE(FAILED, "[Check][InnerData]memory_offset_ does not have memory type[HBM]" "graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); @@ -347,8 +346,7 @@ uint32_t GetContinuousMemoryType(const OpDescPtr &op_desc) { Status GetMemorySize(const OpDescPtr &op_desc, const ge::ConstGeTensorDescPtr &output_desc, uint32_t continuous_type, int64_t &tensor_size, int64_t &nopadding_size) { if ((op_desc == nullptr) || (output_desc == nullptr)) { - REPORT_INNER_ERROR("E19999", "InnerData param op_desc or output_desc is nullptr, " - "not expected when GetMemorySize"); + REPORT_INNER_ERROR("E19999", "InnerData param op_desc or output_desc is nullptr, not expected"); GELOGE(FAILED, "[Check][Param]op_desc or output_desc is nullptr"); } tensor_size = 0; @@ -358,7 +356,7 @@ Status GetMemorySize(const OpDescPtr &op_desc, const ge::ConstGeTensorDescPtr &o int64_t attr_dim_index; bool get_attr_dim_flag = ge::AttrUtils::GetInt(op_desc, ATTR_NAME_REUSE_INPUT_ON_DIM_INDEX, attr_dim_index); if (!get_attr_dim_flag) { - REPORT_INNER_ERROR("E19999", "Get Attr:%s failed when GetMemorySize, op_name:%s", + REPORT_INNER_ERROR("E19999", "Get Attr:%s failed, op_name:%s", ATTR_NAME_REUSE_INPUT_ON_DIM_INDEX.c_str(), op_desc->GetName().c_str()); GELOGE(FAILED, "[Get][Attr:%s]fail for op_name:%s", ATTR_NAME_REUSE_INPUT_ON_DIM_INDEX.c_str(), op_desc->GetName().c_str()); @@ -475,8 +473,8 @@ Status GraphMemoryAssigner::ReAssignContinuousMemory(bool is_loop_graph) { nodes_stack.pop_back(); auto iter = node_2_continuous_type.find(node); if (iter == node_2_continuous_type.end()) { - REPORT_INNER_ERROR("E19999", "Inner data error when process continuous memory alloc for node:%s, " - "but has no continuous type", node->GetName().c_str()); + REPORT_INNER_ERROR("E19999", "Get ContinuousType from node_2_continuous_type map failed for node:%s", + node->GetName().c_str()); GELOGE(FAILED, "[Get][ContinuousType] find fail for node:%s", node->GetName().c_str()); return FAILED; } @@ -496,7 +494,7 @@ Status GraphMemoryAssigner::AssignContinuousInputMemory(const ge::NodePtr &node, auto iter = memory_offset_.find(memory_type); if (iter == memory_offset_.end()) { REPORT_INNER_ERROR("E19999", "find memory offset fail for mem_type:%ld, " - "when assign continuous input memory for node:%s, ", memory_type, node->GetName().c_str()); + "for node:%s, ", memory_type, node->GetName().c_str()); GELOGE(FAILED, "[Find][MemOffset]fail for mem_type:%ld, when AssignContinuousInputMemory for node:%s", memory_type, node->GetName().c_str()); return FAILED; @@ -511,7 +509,7 @@ Status GraphMemoryAssigner::AssignContinuousInputMemory(const ge::NodePtr &node, GE_CHECK_NOTNULL(op_desc); vector output_list_this = op_desc->GetOutputOffset(); if (output_list_this.empty()) { - REPORT_INNER_ERROR("E19999", "No output offset in node :%s, not expected when assign continuous input memory", + REPORT_INNER_ERROR("E19999", "No output offset in node :%s, not expected", node->GetName().c_str()); GELOGE(FAILED, "[Get][OutputOffset] empty is invalid, node:%s", node->GetName().c_str()); return FAILED; @@ -619,29 +617,26 @@ Status GraphMemoryAssigner::AssignContinuousInputMemory(const ge::NodePtr &node, Status GetFirstInputPeerOutOutputOffset(const ge::NodePtr &node, int64_t &mem_offset) { auto in_data_anchor_list = node->GetAllInDataAnchors(); if (in_data_anchor_list.empty()) { - REPORT_INNER_ERROR("E19999", "InAnchor list empty in node:%s, not expect when GetFirstInputPeerOutOutputOffset", + REPORT_INNER_ERROR("E19999", "InAnchor list empty in node:%s, not expect", node->GetName().c_str()); GELOGE(FAILED, "[Get][InAnchor]empty is invalid, node:%s", node->GetName().c_str()); return FAILED; } auto peer_out_data_anchor = in_data_anchor_list.at(0)->GetPeerOutAnchor(); GE_IF_BOOL_EXEC(peer_out_data_anchor == nullptr, - REPORT_INNER_ERROR("E19999", "PeerAcnhor is null, " - "not expect when GetFirstInputPeerOutOutputOffset for node:%s", + REPORT_INNER_ERROR("E19999", "PeerAcnhor is null, not expect for node:%s", node->GetName().c_str()); GELOGE(ge::FAILED, "[Check][PeerAnchor]null is invalid, node:%s", node->GetName().c_str()); return ge::FAILED); auto peer_op_desc = peer_out_data_anchor->GetOwnerNode()->GetOpDesc(); GE_IF_BOOL_EXEC(peer_op_desc == nullptr, - REPORT_INNER_ERROR("E19999", "PeerOpDesc is null, " - "not expect when GetFirstInputPeerOutOutputOffset for node:%s", + REPORT_INNER_ERROR("E19999", "PeerOpDesc is null, not expect for node:%s", node->GetName().c_str()); GELOGE(ge::FAILED, "[Check][PeerOpDesc]null is invalid, node:%s", node->GetName().c_str()); return ge::FAILED); vector in_node_output_offsets = peer_op_desc->GetOutputOffset(); if (peer_out_data_anchor->GetIdx() >= static_cast(in_node_output_offsets.size())) { - REPORT_INNER_ERROR("E19999", "PeerAnchorIndex:%d bigger than in_offset size:%lu, " - "judge invalid when GetFirstInputPeerOutOutputOffset for node:%s", + REPORT_INNER_ERROR("E19999", "PeerAnchorIndex:%d bigger than in_offset size:%lu, judge invalid for node:%s", peer_out_data_anchor->GetIdx(), in_node_output_offsets.size(), node->GetName().c_str()); GELOGE(FAILED, "[Check][Index:PeerOutDataAnchor]PeerIndex:%d bigger than in_offset size:%lu, node:%s", peer_out_data_anchor->GetIdx(), in_node_output_offsets.size(), node->GetName().c_str()); @@ -656,14 +651,12 @@ Status GraphMemoryAssigner::AssignContinuousOutputMemory(const ge::NodePtr &node GELOGI("Current node %s needs continuous output.", node->GetName().c_str()); auto out_op_desc = node->GetOpDesc(); GE_IF_BOOL_EXEC(out_op_desc == nullptr, - REPORT_INNER_ERROR("E19999", "OpDesc is null, " - "not expect when AssignContinuousOutputMemory for node:%s", + REPORT_INNER_ERROR("E19999", "OpDesc is null, not expect for node:%s", node->GetName().c_str()); GELOGE(ge::FAILED, "[Check][OpDesc]null is invalid, node:%s", node->GetName().c_str())); vector output_list = out_op_desc->GetOutputOffset(); if ((out_op_desc->GetOutputsSize() > output_list.size()) || (output_list.size() == 0)) { - REPORT_INNER_ERROR("E19999", "Output size:%zu more than output offset size:%zu, invalid in node:%s, " - "when AssignContinuousOutputMemory", + REPORT_INNER_ERROR("E19999", "Output size:%zu more than output offset size:%zu, invalid in node:%s", out_op_desc->GetOutputsSize(), output_list.size(), node->GetName().c_str()); GELOGE(ge::FAILED, "[Check][InnerData]Output size:%zu more than output offset size:%zu, invalid in node:%s", out_op_desc->GetOutputsSize(), output_list.size(), node->GetName().c_str()); @@ -732,8 +725,7 @@ Status GraphMemoryAssigner::ReAssignAtomicMemory(bool is_loop_graph) { auto mem_iter = memory_offset_.find(RT_MEMORY_HBM); if (mem_iter == memory_offset_.end()) { - REPORT_INNER_ERROR("E19999", "InnerData memory_offset_ does not have type[HBM], " - "not expected when ReAssignAtomicMemory, " + REPORT_INNER_ERROR("E19999", "InnerData memory_offset_ does not have type[HBM], not expected, " "graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); GELOGE(FAILED, "[Check][InnerData]memory_offset_ does not have memory type[HBM]" "graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); @@ -878,8 +870,7 @@ Status GraphMemoryAssigner::AssignAtomicOutputAndWorkspaceMemory(const ge::NodeP Status GraphMemoryAssigner::AssignConnectNetOutputAtomicMemory(vector &connect_netoutput_nodes) { auto iter = memory_offset_.find(RT_MEMORY_HBM); if (iter == memory_offset_.end()) { - REPORT_INNER_ERROR("E19999", "InnerData memory_offset_ does not have type[HBM], " - "not expected when AssignConnectNetOutputAtomicMemory, " + REPORT_INNER_ERROR("E19999", "InnerData memory_offset_ does not have type[HBM], not expected, " "graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); GELOGE(FAILED, "[Check][InnerData]memory_offset_ does not have memory type[HBM]" "graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); @@ -930,8 +921,7 @@ Status GraphMemoryAssigner::AssignReferenceMemory() { vector output_list = out_op_desc->GetOutputOffset(); if (out_op_desc->GetOutputsSize() > output_list.size()) { - REPORT_INNER_ERROR("E19999", "Output size:%zu more than output offset size:%zu, judge invalid in node:%s " - "when AssignReferenceMemory", + REPORT_INNER_ERROR("E19999", "Output size:%zu more than output offset size:%zu, judge invalid in node:%s", out_op_desc->GetOutputsSize(), output_list.size(), node->GetName().c_str()); GELOGE(ge::FAILED, "[Check][InnerData]Output size:%zu more than output offset size:%zu, invalid in node:%s", out_op_desc->GetOutputsSize(), output_list.size(), node->GetName().c_str()); @@ -1021,8 +1011,7 @@ Status GraphMemoryAssigner::AssignAtomicOutputMemory(const ge::NodePtr &node, ve auto output_list_size = static_cast(output_list.size()); auto iter = memory_offset_.find(RT_MEMORY_HBM); if (iter == memory_offset_.end()) { - REPORT_INNER_ERROR("E19999", "InnerData memory_offset_ does not have type[HBM], " - "not expected when AssignAtomicOutputMemory, " + REPORT_INNER_ERROR("E19999", "InnerData memory_offset_ does not have type[HBM], not expected, " "graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); GELOGE(FAILED, "[Check][InnerData]memory_offset_ does not have memory type[HBM]" "graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); @@ -1111,8 +1100,7 @@ Status GraphMemoryAssigner::AssignOrdinaryAtomicWorkspaceMemory(const ge::OpDesc GELOGI("Begin to reassign normal atomic memory, node = %s.", op_desc->GetName().c_str()); auto mem_type_iter = memory_offset_.find(RT_MEMORY_HBM); if (mem_type_iter == memory_offset_.end()) { - REPORT_INNER_ERROR("E19999", "InnerData memory_offset_ does not have type[HBM], " - "not expected when AssignOrdinaryAtomicWorkspaceMemory, " + REPORT_INNER_ERROR("E19999", "InnerData memory_offset_ does not have type[HBM], not expected, " "graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); GELOGE(FAILED, "[Check][InnerData]memory_offset_ does not have memory type[HBM]" "graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); @@ -1168,8 +1156,7 @@ Status GraphMemoryAssigner::AssignFusionAtomicWorkspaceMemory(const ge::OpDescPt GELOGI("Begin to reassign fusion atomic memory, node = %s.", op_desc->GetName().c_str()); auto mem_type_iter = memory_offset_.find(RT_MEMORY_HBM); if (mem_type_iter == memory_offset_.end()) { - REPORT_INNER_ERROR("E19999", "InnerData memory_offset_ does not have type[HBM], " - "not expected when AssignFusionAtomicWorkspaceMemory, " + REPORT_INNER_ERROR("E19999", "InnerData memory_offset_ does not have type[HBM], not expected, " "graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); GELOGE(FAILED, "[Check][InnerData]memory_offset_ does not have memory type[HBM]" "graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); @@ -1203,7 +1190,7 @@ Status GraphMemoryAssigner::AssignFusionAtomicWorkspaceMemory(const ge::OpDescPt sub_node_workspace_offset.insert(std::make_pair(iter.first, index_offset)); } if (!(op_desc->SetExtAttr(EXT_ATTR_ATOMIC_WORKSPACE_OFFSET, sub_node_workspace_offset))) { - REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for node:%s when AssignFusionAtomicWorkspaceMemory", + REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for node:%s", EXT_ATTR_ATOMIC_WORKSPACE_OFFSET.c_str(), op_desc->GetName().c_str()); GELOGE(FAILED, "[Set][Attr:%s]fail for node:%s.", EXT_ATTR_ATOMIC_WORKSPACE_OFFSET.c_str(), op_desc->GetName().c_str()); @@ -1269,8 +1256,8 @@ Status GraphMemoryAssigner::CheckOffset() { ge::Status GraphMemoryAssigner::SetInputOffset() { if (memory_offset_.empty()) { - REPORT_INNER_ERROR("E19999", "InnerData memory_offset_ empty, not expected when SetInputOffset, " - "graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); + REPORT_INNER_ERROR("E19999", "InnerData memory_offset_ empty, not expected, graph_id:%u, graph_name:%s", + compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); GELOGE(FAILED, "[Check][InnerData:memory_offset_]empty is not expected, " "graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); } @@ -1500,7 +1487,7 @@ ge::Status GraphMemoryAssigner::SetAtomicCleanAttr(const NodePtr &node, const ve (void) ge::AttrUtils::GetListInt(node_op_desc, ATTR_NAME_AUTOMIC_ADD_START, mem_start_vector); mem_start_vector.insert(mem_start_vector.end(), atomic_mem_start.begin(), atomic_mem_start.end()); GE_CHK_BOOL_EXEC(ge::AttrUtils::SetListInt(node_op_desc, ATTR_NAME_AUTOMIC_ADD_START, mem_start_vector), - REPORT_INNER_ERROR("E19999", "Set Attr:%s failed when SetAtomicCleanAttr, op_name:%s", + REPORT_INNER_ERROR("E19999", "Set Attr:%s failed, op_name:%s", ATTR_NAME_AUTOMIC_ADD_START.c_str(), node_op_desc->GetName().c_str()); GELOGE(FAILED, "[Set][Attr:%s]fail for op_name:%s", ATTR_NAME_AUTOMIC_ADD_START.c_str(), node_op_desc->GetName().c_str()); @@ -1511,7 +1498,7 @@ ge::Status GraphMemoryAssigner::SetAtomicCleanAttr(const NodePtr &node, const ve (void) ge::AttrUtils::GetListInt(node_op_desc, ATTR_NAME_AUTOMIC_ADD_MEM_SIZE, mem_size_vector); mem_size_vector.insert(mem_size_vector.end(), atomic_mem_size.begin(), atomic_mem_size.end()); GE_CHK_BOOL_EXEC(ge::AttrUtils::SetListInt(node_op_desc, ATTR_NAME_AUTOMIC_ADD_MEM_SIZE, mem_size_vector), - REPORT_INNER_ERROR("E19999", "Set Attr:%s failed when SetAtomicCleanAttr, op_name:%s", + REPORT_INNER_ERROR("E19999", "Set Attr:%s failed, op_name:%s", ATTR_NAME_AUTOMIC_ADD_MEM_SIZE.c_str(), node_op_desc->GetName().c_str()); GELOGE(FAILED, "[Set][Attr:%s]fail for op_name:%s", ATTR_NAME_AUTOMIC_ADD_MEM_SIZE.c_str(), node_op_desc->GetName().c_str()); diff --git a/ge/graph/build/memory/var_mem_assign_util.cc b/ge/graph/build/memory/var_mem_assign_util.cc index a817cdc1..4cbde2af 100755 --- a/ge/graph/build/memory/var_mem_assign_util.cc +++ b/ge/graph/build/memory/var_mem_assign_util.cc @@ -53,7 +53,7 @@ Status VarMemAssignUtil::AssignStaticMemory2Node(ge::ComputeGraphPtr &compute_gr GE_IF_BOOL_EXEC(ge::AttrUtils::GetStr(n->GetOpDesc(), REF_VAR_SRC_VAR_NAME, ref_var_src_var_name), continue); string node_name = n->GetName(); GE_IF_BOOL_EXEC(n->GetOpDesc()->GetAllOutputsDesc().empty(), - REPORT_INNER_ERROR("E19999", "check node:%s has no OutputDesc when AssignStaticMemory2Node", + REPORT_INNER_ERROR("E19999", "check node:%s has no OutputDesc", n->GetName().c_str()); GELOGE(FAILED, "node:%s has no OutputDesc.", n->GetName().c_str()); return FAILED); @@ -118,7 +118,7 @@ Status VarMemAssignUtil::SetOutVariableAttr(const ge::NodePtr &node, const ge::N GE_CHECK_NOTNULL(node->GetOpDesc()); output_list = node->GetOpDesc()->GetOutputOffset(); if (output_list.empty()) { - REPORT_INNER_ERROR("E19999", "check node:%s output_offset_list is empty when SetOutVariableAttr", + REPORT_INNER_ERROR("E19999", "check node:%s output_offset_list is empty", node->GetName().c_str()); GELOGE(PARAM_INVALID, "Output_list is empty"); return PARAM_INVALID; @@ -131,8 +131,8 @@ Status VarMemAssignUtil::SetOutVariableAttr(const ge::NodePtr &node, const ge::N int out_list_size = static_cast(output_list.size()); if (index >= out_list_size) { - REPORT_INNER_ERROR("E19999", "param index:%d >= output_list.size() %d in node %s, " - "check invalid when SetOutVariableAttr", index, out_list_size, node->GetName().c_str()); + REPORT_INNER_ERROR("E19999", "param index:%d >= output_list.size() %d in node %s, check invalid", + index, out_list_size, node->GetName().c_str()); GELOGE(FAILED, "index %d >= output_list.size() %d", index, out_list_size); return FAILED; } diff --git a/ge/graph/build/model_builder.cc b/ge/graph/build/model_builder.cc index 7e5e12ff..6f427683 100755 --- a/ge/graph/build/model_builder.cc +++ b/ge/graph/build/model_builder.cc @@ -116,14 +116,14 @@ Status ModelBuilder::CalcOutputSize(const ge::NodePtr &n) { int64_t size_temp = 0; graphStatus graph_status = TensorUtils::GetTensorMemorySizeInBytes(desc_temp, size_temp); if (graph_status != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Get tensor size in bytes failed for op:%s(%s) index:%u when CalcOutputSize", + REPORT_CALL_ERROR("E19999", "Get tensor size in bytes failed for op:%s(%s) index:%u", node_op_desc->GetName().c_str(), node_op_desc->GetType().c_str(), index); GELOGE(graph_status, "GetTensorMemorySizeInBytes failed!"); return FAILED; } TensorUtils::SetSize(desc_temp, size_temp); if (node_op_desc->UpdateOutputDesc(index, desc_temp) != SUCCESS) { - REPORT_CALL_ERROR("E19999", "Update Output desc size failed for op:%s(%s) index:%u when CalcOutputSize", + REPORT_CALL_ERROR("E19999", "Update Output desc size failed for op:%s(%s) index:%u", node_op_desc->GetName().c_str(), node_op_desc->GetType().c_str(), index); GELOGE(FAILED, "UpdateOutputDesc failed."); return FAILED; @@ -210,14 +210,14 @@ Status ModelBuilder::AdjustConstWeightSize(const ge::NodePtr &node, size_t &mem_ if (node->GetType() == CONSTANT) { vector weights = OpDescUtils::MutableWeights(node); if (weights.empty()) { - REPORT_INNER_ERROR("E19999", "Check weights size of node %s(%s) is empty when AdjustConstWeightSize", + REPORT_INNER_ERROR("E19999", "Check weights size of node %s(%s) is empty", node->GetName().c_str(), node->GetType().c_str()); GELOGE(FAILED, "weights size of node %s is empty", node->GetName().c_str()); return FAILED; } GeTensorPtr weight = weights[0]; if (weight == nullptr) { - REPORT_INNER_ERROR("E19999", "Check weight of node %s(%s) is nullptr when AdjustConstWeightSize", + REPORT_INNER_ERROR("E19999", "Check weight of node %s(%s) is nullptr", node->GetName().c_str(), node->GetType().c_str()); GELOGE(FAILED, "weights[0] is null."); return FAILED; @@ -360,9 +360,9 @@ Status ModelBuilder::AdjustInputTensorFlag() { auto input_desc = owner_node_op_desc->GetInputDesc(in_anchors->GetIdx()); ge::TensorUtils::SetInputTensor(input_desc, true); if (owner_node_op_desc->UpdateInputDesc(in_anchors->GetIdx(), input_desc) != SUCCESS) { - REPORT_CALL_ERROR("E19999", "Update Input desc size failed for op:%s(%s) index:%u when %s", + REPORT_CALL_ERROR("E19999", "Update Input desc size failed for op:%s(%s) index:%u", owner_node_op_desc->GetName().c_str(), owner_node_op_desc->GetType().c_str(), - in_anchors->GetIdx(), __FUNCTION__); + in_anchors->GetIdx()); GELOGE(FAILED, "UpdateOutputDesc failed."); return FAILED; } @@ -391,51 +391,51 @@ Status ModelBuilder::BuildModelDef(ge::Model &model) { max_mem_offset_ = mem_type_to_mem_offset_[RT_MEMORY_HBM]; GE_CHK_BOOL_EXEC(ge::AttrUtils::SetInt(&model, ATTR_MODEL_MEMORY_SIZE, max_mem_offset_), - REPORT_INNER_ERROR("E19999", "Set Attr:%s in model failed when %s", - ATTR_MODEL_MEMORY_SIZE.c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Set Attr:%s in model failed", + ATTR_MODEL_MEMORY_SIZE.c_str()); GELOGE(FAILED, "SetInt of ATTR_MODEL_MEMORY_SIZE failed."); return FAILED); if (mem_type_to_mem_offset_.find(RT_MEMORY_P2P_DDR) != mem_type_to_mem_offset_.end()) { p2p_mem_offset_ = mem_type_to_mem_offset_[RT_MEMORY_P2P_DDR]; } GE_CHK_BOOL_EXEC(ge::AttrUtils::SetInt(&model, ATTR_MODEL_P2P_MEMORY_SIZE, p2p_mem_offset_), - REPORT_INNER_ERROR("E19999", "Set Attr:%s in model failed when %s", - ATTR_MODEL_P2P_MEMORY_SIZE.c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Set Attr:%s in model failed", + ATTR_MODEL_P2P_MEMORY_SIZE.c_str()); GELOGE(FAILED, "SetInt of ATTR_MODEL_P2P_MEMORY_SIZE failed."); return FAILED); GE_CHK_BOOL_EXEC(ge::AttrUtils::SetInt(&model, ATTR_MODEL_WEIGHT_SIZE, weight_offset_), - REPORT_INNER_ERROR("E19999", "Set Attr:%s in model failed when %s", - ATTR_MODEL_WEIGHT_SIZE.c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Set Attr:%s in model failed", + ATTR_MODEL_WEIGHT_SIZE.c_str()); GELOGE(FAILED, "SetInt of ATTR_MODEL_WEIGHT_SIZE failed."); return FAILED); GE_CHK_BOOL_EXEC(ge::AttrUtils::SetInt(&model, ATTR_MODEL_STREAM_NUM, stream_num_), - REPORT_INNER_ERROR("E19999", "Set Attr:%s in model failed when %s", - ATTR_MODEL_STREAM_NUM.c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Set Attr:%s in model failed", + ATTR_MODEL_STREAM_NUM.c_str()); GELOGE(FAILED, "SetInt of ATTR_MODEL_STREAM_NUM failed."); return FAILED); GE_CHK_BOOL_EXEC(ge::AttrUtils::SetInt(&model, ATTR_MODEL_EVENT_NUM, event_num_), - REPORT_INNER_ERROR("E19999", "Set Attr:%s in model failed when %s", - ATTR_MODEL_EVENT_NUM.c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Set Attr:%s in model failed", + ATTR_MODEL_EVENT_NUM.c_str()); GELOGE(FAILED, "SetInt of ATTR_MODEL_EVENT_NUM failed."); return FAILED); GE_CHK_BOOL_EXEC(ge::AttrUtils::SetListInt(&model, ATTR_MODEL_HUGE_STREAM_LIST, huge_streams_), - REPORT_INNER_ERROR("E19999", "Set Attr:%s in model failed when %s", - ATTR_MODEL_HUGE_STREAM_LIST.c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Set Attr:%s in model failed", + ATTR_MODEL_HUGE_STREAM_LIST.c_str()); GELOGE(FAILED, "SetInt of ATTR_MODEL_HUGE_STREAM_LIST failed."); return FAILED); GE_CHK_BOOL_EXEC(ge::AttrUtils::SetInt(&model, ATTR_MODEL_LABEL_NUM, label_num_), - REPORT_INNER_ERROR("E19999", "Set Attr:%s in model failed when %s", - ATTR_MODEL_LABEL_NUM.c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Set Attr:%s in model failed", + ATTR_MODEL_LABEL_NUM.c_str()); GELOGE(FAILED, "SetInt of ATTR_MODEL_LABEL_NUM failed."); return FAILED); GE_CHK_BOOL_EXEC(ge::AttrUtils::SetInt(&model, ATTR_MODEL_ZERO_COPY_MEMORY_SIZE, zero_copy_mem_size_), - REPORT_INNER_ERROR("E19999", "Set Attr:%s in model failed when %s", - ATTR_MODEL_ZERO_COPY_MEMORY_SIZE.c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Set Attr:%s in model failed", + ATTR_MODEL_ZERO_COPY_MEMORY_SIZE.c_str()); GELOGE(FAILED, "SetInt of ATTR_MODEL_ZERO_COPY_MEMORY_SIZE failed."); return FAILED); GE_CHK_BOOL_EXEC(ge::AttrUtils::SetListStr(&model, ATTR_MODEL_OUT_NODES_NAME, GetLocalOmgContext().net_out_nodes), - REPORT_INNER_ERROR("E19999", "Set Attr:%s in model failed when %s", - ATTR_MODEL_OUT_NODES_NAME.c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Set Attr:%s in model failed", + ATTR_MODEL_OUT_NODES_NAME.c_str()); GELOGE(FAILED, "SetListStr of ATTR_MODEL_OUT_NODES_NAME failed."); return FAILED); GELOGI("For model, max_mem_offset_: %zu, p2p_mem_size: %zu, zero_copy_mem_size_: %zu", max_mem_offset_, @@ -443,8 +443,8 @@ Status ModelBuilder::BuildModelDef(ge::Model &model) { string fp_ceiling_mode; if (ge::GetContext().GetOption("ge.fpCeilingMode", fp_ceiling_mode) == SUCCESS) { if (!ge::AttrUtils::SetStr(&model, ATTR_FP_CEILING_MODE, fp_ceiling_mode)) { - REPORT_INNER_ERROR("E19999", "Set Attr:%s in model failed when %s", - ATTR_FP_CEILING_MODE.c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Set Attr:%s in model failed", + ATTR_FP_CEILING_MODE.c_str()); GELOGE(FAILED, "Failed to set attr ATTR_FP_CEILING_MODE"); return FAILED; } @@ -459,30 +459,30 @@ Status ModelBuilder::BuildModelDef(ge::Model &model) { int64_t core_type = (ge_core_type == kVectorCore) ? 1 : 0; GELOGI("core_type: %ld", core_type); if (!ge::AttrUtils::SetInt(&model, ATTR_MODEL_CORE_TYPE, core_type)) { - REPORT_INNER_ERROR("E19999", "Set Attr:%s in model failed when %s", - ATTR_MODEL_CORE_TYPE.c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Set Attr:%s in model failed", + ATTR_MODEL_CORE_TYPE.c_str()); GELOGE(FAILED, "SetInt of ATTR_CORE_TYPE failed."); } InitL1FusionOption(); GE_CHK_BOOL_EXEC(ge::AttrUtils::SetBool(&model, ATTR_NAME_SWITCH_FOR_L1_FUSION, is_l1_fusion_enable_), - REPORT_INNER_ERROR("E19999", "Set Attr:%s in model failed when %s", - ATTR_NAME_SWITCH_FOR_L1_FUSION.c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Set Attr:%s in model failed", + ATTR_NAME_SWITCH_FOR_L1_FUSION.c_str()); GELOGE(FAILED, "SetBool of ATTR_NAME_SWITCH_FOR_L1_FUSION failed."); return FAILED); const DumpProperties &dump_properties = DumpManager::GetInstance().GetDumpProperties(session_id_); bool is_op_debug = dump_properties.IsOpDebugOpen(); if (is_op_debug) { if (!ge::AttrUtils::SetBool(&model, ATTR_OP_DEBUG_FLAG, is_op_debug)) { - REPORT_INNER_ERROR("E19999", "Set Attr:%s in model failed when %s", - ATTR_OP_DEBUG_FLAG.c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Set Attr:%s in model failed", + ATTR_OP_DEBUG_FLAG.c_str()); GELOGE(FAILED, "SetBool of ATTR_OP_DEBUG_FLAG failed."); return FAILED; } uint32_t op_debug_mode = dump_properties.GetOpDebugMode(); GELOGI("Get op debug mode:%d", op_debug_mode); if (!ge::AttrUtils::SetInt(&model, ATTR_OP_DEBUG_MODE, op_debug_mode)) { - REPORT_INNER_ERROR("E19999", "Set Attr:%s in model failed when %s", - ATTR_OP_DEBUG_MODE.c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Set Attr:%s in model failed", + ATTR_OP_DEBUG_MODE.c_str()); GELOGE(FAILED, "SetBool of ATTR_OP_DEBUG_MODE failed."); return FAILED; } @@ -554,8 +554,8 @@ Status ModelBuilder::MergeWeights() { // If MutableTensor failed, weight is nullptr. (void)ge::AttrUtils::MutableTensor(op_desc, ATTR_NAME_WEIGHTS, weight); if (weight == nullptr) { - REPORT_INNER_ERROR("E19999", "Can't get const weight in op:%s(%s) when %s", - op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Can't get const weight in op:%s(%s)", + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(FAILED, "Can't get const op weight, name: %s", node->GetName().c_str()); return FAILED; } @@ -579,14 +579,14 @@ Status ModelBuilder::MergeWeights() { } if (weight_data.data() != nullptr) { GE_IF_BOOL_EXEC(base_addr == nullptr, - REPORT_INNER_ERROR("E19999", "Check weight in op:%s(%s) is nullptr when %s", - op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Check weight in op:%s(%s) is nullptr", + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(FAILED, "Base addr is nullptr."); return FAILED); if (weight_offset_ - offset < weight_data.size()) { - REPORT_INNER_ERROR("E19999", "left weight size not enough for op:%s(%s) left_size:%zu, weight_size:%zu when %s", + REPORT_INNER_ERROR("E19999", "left weight size not enough for op:%s(%s) left_size:%zu, weight_size:%zu", op_desc->GetName().c_str(), op_desc->GetType().c_str(), - weight_offset_ - offset, weight_data.size(), __FUNCTION__); + weight_offset_ - offset, weight_data.size()); GELOGE(FAILED, "left weight size not enough. left_size:%lu, weight_size:%lu", weight_offset_ - offset, weight_data.size()); return FAILED; @@ -599,8 +599,8 @@ Status ModelBuilder::MergeWeights() { SECUREC_MEM_MAX_LEN); if (err != EOK) { REPORT_CALL_ERROR("E19999", "mem copy failed. errret:%u, " - "dst_ptr:%lx, dst_size:%lu, src_ptr:%lx, src_size:%lu, when %s", - err, dst_ptr, SECUREC_MEM_MAX_LEN, src_ptr, SECUREC_MEM_MAX_LEN, __FUNCTION__); + "dst_ptr:%lx, dst_size:%lu, src_ptr:%lx, src_size:%lu,", + err, dst_ptr, SECUREC_MEM_MAX_LEN, src_ptr, SECUREC_MEM_MAX_LEN); GELOGE(FAILED, "mem copy failed. errret:%u, " "dst_ptr:%lx, dst_size:%lu, src_ptr:%lx, src_size:%lu", err, dst_ptr, SECUREC_MEM_MAX_LEN, src_ptr, SECUREC_MEM_MAX_LEN); @@ -613,8 +613,8 @@ Status ModelBuilder::MergeWeights() { auto err = memcpy_s(reinterpret_cast(dst_ptr), left_size, reinterpret_cast(src_ptr), left_size); if (err != EOK) { REPORT_CALL_ERROR("E19999", "mem copy failed. errret:%u, " - "dst_ptr:%lx, dst_size:%lu, src_ptr:%lx, src_size:%lu, when %s", - err, dst_ptr, SECUREC_MEM_MAX_LEN, src_ptr, SECUREC_MEM_MAX_LEN, __FUNCTION__); + "dst_ptr:%lx, dst_size:%lu, src_ptr:%lx, src_size:%lu,", + err, dst_ptr, SECUREC_MEM_MAX_LEN, src_ptr, SECUREC_MEM_MAX_LEN); GELOGE(FAILED, "mem copy failed. errret:%u, " "dst_ptr:%lx, dst_size:%lu, src_ptr:%lx, src_size:%lu", err, dst_ptr, SECUREC_MEM_MAX_LEN, src_ptr, SECUREC_MEM_MAX_LEN); @@ -699,8 +699,8 @@ Status ModelBuilder::SaveDataToModel(ge::Model &model, ge::GeModel &ge_model) { } GE_IF_BOOL_EXEC(tbe_kernel == nullptr, continue); if (tbe_name_set.count(tbe_kernel->GetName()) > 0) { - REPORT_INNER_ERROR("E19999", "tbe_kernel name %s can't be the same, judge for op:%s(%s), when %s", - tbe_kernel->GetName().c_str(), n->GetName().c_str(), n->GetType().c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "tbe_kernel name %s can't be the same, judge for op:%s(%s),", + tbe_kernel->GetName().c_str(), n->GetName().c_str(), n->GetType().c_str()); GELOGE(FAILED, "tbe_kernel name %s can't be the same", tbe_kernel->GetName().c_str()); return FAILED; } @@ -719,9 +719,8 @@ Status ModelBuilder::SaveDataToModel(ge::Model &model, ge::GeModel &ge_model) { node_op_desc->TryGetExtAttr(ge::OP_EXTATTR_CUSTAICPU_KERNEL, CustAICPUKernelPtr()); GE_IF_BOOL_EXEC(cust_aicpu_kernel == nullptr, continue); if (aicpu_name_set.count(cust_aicpu_kernel->GetName()) > 0) { - REPORT_INNER_ERROR("E19999", "aicpu_kernel name %s can't be the same, judge for op:%s(%s), when %s", - cust_aicpu_kernel->GetName().c_str(), n->GetName().c_str(), n->GetType().c_str(), - __FUNCTION__); + REPORT_INNER_ERROR("E19999", "aicpu_kernel name %s can't be the same, judge for op:%s(%s),", + cust_aicpu_kernel->GetName().c_str(), n->GetName().c_str(), n->GetType().c_str()); GELOGE(FAILED, "aicpu_kernel name %s can't be the same", cust_aicpu_kernel->GetName().c_str()); return FAILED; } @@ -744,7 +743,7 @@ Status ModelBuilder::SaveDataToModel(ge::Model &model, ge::GeModel &ge_model) { // Add task GeAttrValue::BYTES task_def_bytes; if (!AttrUtils::GetZeroCopyBytes(model, MODEL_ATTR_TASKS, task_def_bytes)) { - REPORT_CALL_ERROR("E19999", "Get attr:%s in model fail when %s", MODEL_ATTR_TASKS.c_str(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Get attr:%s in model failed", MODEL_ATTR_TASKS.c_str()); GELOGE(INTERNAL_ERROR, "Get zero copy bytes fail."); return INTERNAL_ERROR; } @@ -780,7 +779,7 @@ void ModelBuilder::SetModelVersion(ge::Model &model) { Status ModelBuilder::PreBuildModel() { if ((compute_graph_ == nullptr) || !(compute_graph_->IsValid())) { - REPORT_INNER_ERROR("E19999", "Check compute_graph no valid when %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Check compute_graph no valid"); GELOGE(FAILED, "Graph_ is not valid."); return FAILED; } @@ -860,7 +859,7 @@ Status ModelBuilder::CompileSingleOp() { // Create ge instance std::shared_ptr instance = ge::GELib::GetInstance(); if ((instance == nullptr) || !instance->InitFlag()) { - REPORT_INNER_ERROR("E19999", "Check GELib instance not init before when %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Check GELib instance not init before"); GELOGE(ge::GE_CLI_GE_NOT_INITIALIZED, "CompileSingleOp failed."); return ge::GE_CLI_GE_NOT_INITIALIZED; } @@ -882,8 +881,8 @@ Status ModelBuilder::CompileSingleOp() { (void)instance->DNNEngineManagerObj().GetDNNEngineName(node); kernel_lib_name = op_desc->GetOpKernelLibName(); if (kernel_lib_name.empty()) { - REPORT_INNER_ERROR("E19999", "Check kernel lib name empty of op:%s(%s) when %s", - node->GetName().c_str(), node->GetType().c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Check kernel lib name empty of op:%s(%s)", + node->GetName().c_str(), node->GetType().c_str()); GELOGE(ge::INTERNAL_ERROR, "Get node:%s(%s) kernel lib failed.", node->GetName().c_str(), node->GetType().c_str()); return ge::INTERNAL_ERROR; @@ -894,8 +893,8 @@ Status ModelBuilder::CompileSingleOp() { if (kernel_info != nullptr) { node_vector_map[kernel_lib_name].emplace_back(node); } else { - REPORT_INNER_ERROR("E19999", "Get ops kernel info store failed for op:%s(%s), op_kernel_name:%s, when %s", - node->GetName().c_str(), node->GetType().c_str(), kernel_lib_name.c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Get ops kernel info store failed for op:%s(%s), op_kernel_name:%s,", + node->GetName().c_str(), node->GetType().c_str(), kernel_lib_name.c_str()); GELOGE(ge::GE_GRAPH_PARAM_NULLPTR, "Get op %s ops kernel info store failed", node->GetName().c_str()); return ge::GE_GRAPH_PARAM_NULLPTR; } @@ -911,8 +910,8 @@ Status ModelBuilder::CompileSingleOp() { GELOGI("[GEPERFTRACE] The node size of compile op of %s is %zu", kernel_lib_name.c_str(), node_vector.size()); GE_TIMESTAMP_ADD(BatchCompileOp); if (ret != ge::SUCCESS) { - REPORT_CALL_ERROR("E19999", "Batch compile op failed, kernel lib name, node size:%zu, when %s", - node_vector.size(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Batch compile op failed, kernel lib name, node size:%zu,", + node_vector.size()); GELOGE(ret, "Compile op failed, kernel lib name is %s", kernel_lib_name.c_str()); return ret; } diff --git a/ge/graph/build/run_context.cc b/ge/graph/build/run_context.cc index c5fdfec1..eca8b31b 100644 --- a/ge/graph/build/run_context.cc +++ b/ge/graph/build/run_context.cc @@ -62,7 +62,7 @@ Status RunContextUtil::CreateRtModelResources(uint32_t stream_num, uint32_t even // Create rt model rtError_t rt_ret = rtModelCreate(&rt_model_, 0); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "call rtModelCreate fail, ret:%d, when %s", static_cast(rt_ret), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "call rtModelCreate failed, ret:%d,", static_cast(rt_ret)); GELOGE(RT_FAILED, "rtModelCreate failed. rt_ret = %d", static_cast(rt_ret)); return RT_FAILED; } @@ -72,8 +72,8 @@ Status RunContextUtil::CreateRtModelResources(uint32_t stream_num, uint32_t even rtStream_t stream = nullptr; rt_ret = rtStreamCreate(&stream, 0); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "call rtStreamCreate fail, ret:%d, index:%u, when %s", - static_cast(rt_ret), i, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "call rtStreamCreate failed, ret:%d, index:%u,", + static_cast(rt_ret), i); GELOGE(RT_FAILED, "rtStreamCreate failed. rt_ret = %d, index = %u", static_cast(rt_ret), i); return RT_FAILED; } @@ -81,8 +81,8 @@ Status RunContextUtil::CreateRtModelResources(uint32_t stream_num, uint32_t even rt_ret = rtModelBindStream(rt_model_, stream, 0); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "call rtModelBindStream fail, ret:%d, index:%u, when %s", - static_cast(rt_ret), i, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "call rtModelBindStream failed, ret:%d, index:%u,", + static_cast(rt_ret), i); GELOGE(RT_FAILED, "Bind stream and model failed. rt_ret = %d, index = %u", static_cast(rt_ret), i); return RT_FAILED; } @@ -95,8 +95,8 @@ Status RunContextUtil::CreateRtModelResources(uint32_t stream_num, uint32_t even rtEvent_t event = nullptr; rt_ret = rtEventCreateWithFlag(&event, create_flag); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "call rtEventCreate fail, ret:%d, index:%u, when %s", - static_cast(rt_ret), i, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "call rtEventCreate failed, ret:%d, index:%u,", + static_cast(rt_ret), i); GELOGE(RT_FAILED, "rtEventCreate failed. rt_ret = %d, index = %u", static_cast(rt_ret), i); return RT_FAILED; } @@ -108,8 +108,8 @@ Status RunContextUtil::CreateRtModelResources(uint32_t stream_num, uint32_t even rtLabel_t label = nullptr; rt_ret = rtLabelCreateV2(&label, rt_model_); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "call rtLabelCreateV2 fail, ret:%d, index:%u, when %s", - static_cast(rt_ret), i, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "call rtLabelCreateV2 failed, ret:%d, index:%u,", + static_cast(rt_ret), i); GELOGE(RT_FAILED, "rtLabelCreate failed. rt_ret = %d, index = %u", static_cast(rt_ret), i); return RT_FAILED; } @@ -161,15 +161,15 @@ Status RunContextUtil::CreateRunContext(Model &model, const ComputeGraphPtr &gra GELOGD("Begin to Create RunContext, session_id = %lu", session_id); // check params if (graph == nullptr) { - REPORT_INNER_ERROR("E19999", "Check param graph nullptr, session_id:%lu, when %s", session_id, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Check param graph nullptr, session_id:%lu,", session_id); GELOGE(PARAM_INVALID, "CreateRunContext param graph is null. session_id=%lu", session_id); return PARAM_INVALID; } uint32_t stream_num = 0; if (!AttrUtils::GetInt(&model, ATTR_MODEL_STREAM_NUM, stream_num)) { - REPORT_INNER_ERROR("Get Attr:%s fail for model, session_id:%lu, when %s", - ATTR_MODEL_STREAM_NUM.c_str(), session_id, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Get Attr:%s failed for model, session_id:%lu,", + ATTR_MODEL_STREAM_NUM.c_str(), session_id); GELOGE(INTERNAL_ERROR, "Get stream_num attr from model_def failed. session_id=%lu", session_id); return INTERNAL_ERROR; } @@ -177,8 +177,8 @@ Status RunContextUtil::CreateRunContext(Model &model, const ComputeGraphPtr &gra uint32_t event_num = 0; if (!AttrUtils::GetInt(&model, ATTR_MODEL_EVENT_NUM, event_num)) { - REPORT_INNER_ERROR("Get Attr:%s fail for model, session_id:%lu, when %s", - ATTR_MODEL_EVENT_NUM.c_str(), session_id, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Get Attr:%s failed for model, session_id:%lu,", + ATTR_MODEL_EVENT_NUM.c_str(), session_id); GELOGE(INTERNAL_ERROR, "Get event_num attr from model failed. session_id=%lu", session_id); return INTERNAL_ERROR; } @@ -186,8 +186,8 @@ Status RunContextUtil::CreateRunContext(Model &model, const ComputeGraphPtr &gra uint32_t label_num = 0; if (!AttrUtils::GetInt(&model, ATTR_MODEL_LABEL_NUM, label_num)) { - REPORT_INNER_ERROR("Get Attr:%s fail for model, session_id:%lu, when %s", - ATTR_MODEL_LABEL_NUM.c_str(), session_id, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Get Attr:%s failed for model, session_id:%lu,", + ATTR_MODEL_LABEL_NUM.c_str(), session_id); GELOGE(INTERNAL_ERROR, "Get label_num attr from model failed. session_id=%lu", session_id); return INTERNAL_ERROR; } diff --git a/ge/graph/build/stream_allocator.cc b/ge/graph/build/stream_allocator.cc index e1d1f937..8218588f 100644 --- a/ge/graph/build/stream_allocator.cc +++ b/ge/graph/build/stream_allocator.cc @@ -176,7 +176,7 @@ Status StreamAllocator::AssignLogicalStreams(const std::map &m auto gelib = GELib::GetInstance(); if (gelib == nullptr) { - REPORT_INNER_ERROR("E19999", "Check GELib instance nullptr when %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Check GELib instance nullptr"); GELOGE(FAILED, "Get GELib instance failed."); return FAILED; } @@ -291,8 +291,8 @@ Status StreamAllocator::AssignSingleStream() { } if (stream_num_ > 1) { - REPORT_INNER_ERROR("E19999", "The number of ts streams is %ld, only one is supported when %s", - stream_num_, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "The number of ts streams is %ld, only one is supported", + stream_num_); GELOGE(FAILED, "The number of ts streams is %ld, only one is supported.", stream_num_); return FAILED; } @@ -366,9 +366,9 @@ Status StreamAllocator::SetActiveStreamsByLabel() { } } GE_CHK_BOOL_EXEC(AttrUtils::SetListInt(node->GetOpDesc(), ATTR_NAME_ACTIVE_STREAM_LIST, activated_stream_list), - REPORT_INNER_ERROR("E19999", "Set Attr:%s for op:%s(%s) failed when %s", + REPORT_INNER_ERROR("E19999", "Set Attr:%s for op:%s(%s) failed", ATTR_NAME_ACTIVE_STREAM_LIST.c_str(), - node->GetName().c_str(), node->GetType().c_str(), __FUNCTION__); + node->GetName().c_str(), node->GetType().c_str()); GELOGE(FAILED, "SetListInt failed."); return FAILED); } @@ -419,9 +419,9 @@ Status StreamAllocator::SetActiveStreamsForSubgraphs() { } if (!AttrUtils::SetListInt(first_active_node->GetOpDesc(), ATTR_NAME_ACTIVE_STREAM_LIST, active_streams)) { - REPORT_INNER_ERROR("E19999", "Set Attr:%s for op:%s(%s) failed when %s", + REPORT_INNER_ERROR("E19999", "Set Attr:%s for op:%s(%s) failed", ATTR_NAME_ACTIVE_STREAM_LIST.c_str(), - first_active_node->GetName().c_str(), first_active_node->GetType().c_str(), __FUNCTION__); + first_active_node->GetName().c_str(), first_active_node->GetType().c_str()); GELOGE(FAILED, "Set active streams for node %s failed.", first_active_node->GetName().c_str()); return FAILED; } @@ -491,8 +491,8 @@ Status StreamAllocator::InsertOneEventInTwoNodes(const NodePtr &cur_node, const } if (next_stream_id == kInvalidStream) { - REPORT_INNER_ERROR("E19999", "Stream id of next_node %s(%s) should not be %ld when %s", - next_node->GetName().c_str(), next_node->GetType().c_str(), kInvalidStream, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Stream id of next_node %s(%s) should not be %ld", + next_node->GetName().c_str(), next_node->GetType().c_str(), kInvalidStream); GELOGE(FAILED, "Stream id of next_node %s should not be %ld", next_node->GetName().c_str(), kInvalidStream); return FAILED; } @@ -707,11 +707,11 @@ Status StreamAllocator::OptimizeByStreamActivate() { // No need to insert an event between node in stream(normal) and node in stream(stream true or false) bool StreamAllocator::IsRecvNodeActivatedBySendNode(const NodePtr &send_node_ptr, const NodePtr &recv_node_ptr) const { GE_CHECK_NOTNULL_EXEC(send_node_ptr->GetOpDesc(), - REPORT_INNER_ERROR("E19999", "Check param send_node_ptr nullptr when %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Check param send_node_ptr nullptr"); GELOGE(FAILED, "op desc is nullptr"); return false); GE_CHECK_NOTNULL_EXEC(recv_node_ptr->GetOpDesc(), - REPORT_INNER_ERROR("E19999", "Check param recv_node_ptr nullptr when %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Check param recv_node_ptr nullptr"); GELOGE(FAILED, "op desc is nullptr"); return false); auto cur_stream_id = send_node_ptr->GetOpDesc()->GetStreamId(); @@ -837,8 +837,8 @@ Status StreamAllocator::SplitStreams(vector> &split_streams) { continue; } if (stream_id > last_stream_id) { - REPORT_INNER_ERROR("E19999", "streamid(%ld) > last_stream_id(%ld), check invalid when %s", - stream_id, last_stream_id, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "streamid(%ld) > last_stream_id(%ld), check invalid", + stream_id, last_stream_id); GELOGE(FAILED, "SplitStreams:streamid(%ld) > last_stream_id(%ld)", stream_id, last_stream_id); return FAILED; } @@ -852,8 +852,8 @@ Status StreamAllocator::SplitStreams(vector> &split_streams) { stream_continuous_2_node_num_map[continuous_stream_label]++; // return error if (stream_continuous_2_node_num_map[continuous_stream_label] > max_node_num_one_stream) { - REPORT_INNER_ERROR("E19999", "Check node[%s] stream_id[%ld] continuous stream label[%s] unsatisfied when %s", - op_desc->GetName().c_str(), stream_id, continuous_stream_label.c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Check node[%s] stream_id[%ld] continuous stream label[%s] unsatisfied", + op_desc->GetName().c_str(), stream_id, continuous_stream_label.c_str()); GELOGE(FAILED, "SplitStreams:node[%s] stream_id[%ld] continuous stream label[%s] unsatisfied ", op_desc->GetName().c_str(), stream_id, continuous_stream_label.c_str()); return FAILED; @@ -1008,8 +1008,8 @@ Status StreamAllocator::UpdateActiveStreamsForSwitchNode(NodePtr &switch_node) { GE_CHECK_NOTNULL(op_desc); if (!AttrUtils::SetListInt(op_desc, ATTR_NAME_ACTIVE_STREAM_LIST, stream_ids)) { - REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s) when %s", ATTR_NAME_ACTIVE_STREAM_LIST.c_str(), - op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s)", ATTR_NAME_ACTIVE_STREAM_LIST.c_str(), + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(FAILED, "SetListInt failed."); return FAILED; } @@ -1024,8 +1024,8 @@ Status StreamAllocator::InsertActiveNodesAfterSwitch(NodePtr &switch_node, vecto vector ori_active_label_list; if (!AttrUtils::GetListStr(switch_desc, ATTR_NAME_ACTIVE_LABEL_LIST, ori_active_label_list) || ori_active_label_list.empty()) { - REPORT_INNER_ERROR("E19999", "Get Attr:%s fail for op:%s(%s) when %s", ATTR_NAME_ACTIVE_LABEL_LIST.c_str(), - switch_node->GetName().c_str(), switch_node->GetType().c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Get Attr:%s fail for op:%s(%s)", ATTR_NAME_ACTIVE_LABEL_LIST.c_str(), + switch_node->GetName().c_str(), switch_node->GetType().c_str()); GELOGE(INTERNAL_ERROR, "Get active label list of switch %s failed.", switch_node->GetName().c_str()); return INTERNAL_ERROR; } @@ -1049,8 +1049,8 @@ Status StreamAllocator::InsertActiveNodesAfterSwitch(NodePtr &switch_node, vecto for (auto &active_node : added_active_nodes) { GE_CHECK_NOTNULL(switch_node->GetOutControlAnchor()); if (switch_node->GetOutControlAnchor()->LinkTo(active_node->GetInControlAnchor()) != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Link from %s to %s failed when %s", - switch_node->GetName().c_str(), active_node->GetName().c_str(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Link from %s to %s failed", + switch_node->GetName().c_str(), active_node->GetName().c_str()); GELOGE(FAILED, "Link %s to %s failed.", switch_node->GetName().c_str(), active_node->GetName().c_str()); return FAILED; } @@ -1066,8 +1066,8 @@ Status StreamAllocator::UpdateActiveStreamsForActiveNode(const vector new_active_streams = active_streams; for (uint32_t logical_stream : active_streams) { if (static_cast(logical_stream) >= split_streams.size()) { - REPORT_INNER_ERROR("E19999", "Check logical stream:%u is out of range:%zu when %s", - logical_stream, split_streams.size(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Check logical stream:%u is out of range:%zu", + logical_stream, split_streams.size()); GELOGE(FAILED, "logical stream is out of range."); return FAILED; } @@ -1086,8 +1086,8 @@ Status StreamAllocator::UpdateActiveStreamsForActiveNode(const vectorGetOpDesc(), ATTR_NAME_ACTIVE_STREAM_LIST, new_active_streams)) { - REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s) when %s", ATTR_NAME_ACTIVE_STREAM_LIST.c_str(), - node->GetName().c_str(), node->GetType().c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s)", ATTR_NAME_ACTIVE_STREAM_LIST.c_str(), + node->GetName().c_str(), node->GetType().c_str()); GELOGE(FAILED, "Set active streams for node %s failed.", node->GetName().c_str()); return FAILED; } @@ -1128,8 +1128,8 @@ Status StreamAllocator::UpdateActiveStreamsForSubgraphs() const { new_active_streams.emplace(static_cast(new_split_stream)); active_streams.assign(new_active_streams.begin(), new_active_streams.end()); if (!AttrUtils::SetListInt(active_op, ATTR_NAME_ACTIVE_STREAM_LIST, active_streams)) { - REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s) when %s", ATTR_NAME_ACTIVE_STREAM_LIST.c_str(), - active_op->GetName().c_str(), active_op->GetType().c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s)", ATTR_NAME_ACTIVE_STREAM_LIST.c_str(), + active_op->GetName().c_str(), active_op->GetType().c_str()); GELOGE(FAILED, "Set active streams for node %s failed.", active_node->GetName().c_str()); return FAILED; } @@ -1198,8 +1198,8 @@ Status StreamAllocator::SetActiveStreamsForLoop() { NodePtr pre_switch_node = FindSwitchNodeBeforeLoopActiveNode(node); if (pre_switch_node == nullptr) { - REPORT_INNER_ERROR("E19999", "Find switch node before loop active node %s fail when %s", - node->GetName().c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Find switch node before loop active node %s fail", + node->GetName().c_str()); GELOGE(FAILED, "find switch node before loop active node %s failed", node->GetName().c_str()); return FAILED; } @@ -1207,9 +1207,9 @@ Status StreamAllocator::SetActiveStreamsForLoop() { if (!AttrUtils::GetListStr(node->GetOpDesc(), ATTR_NAME_ACTIVE_LABEL_LIST, activated_label_list) || activated_label_list.empty()) { GE_CHK_BOOL_EXEC(AttrUtils::SetListInt(node->GetOpDesc(), ATTR_NAME_ACTIVE_STREAM_LIST, loop_active_streams), - REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s) when %s", + REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s)", ATTR_NAME_ACTIVE_STREAM_LIST.c_str(), - node->GetName().c_str(), node->GetType().c_str(), __FUNCTION__); + node->GetName().c_str(), node->GetType().c_str()); GELOGE(FAILED, "SetListInt failed."); return FAILED); for (const auto &stream_id : loop_active_streams) { @@ -1256,8 +1256,8 @@ Status StreamAllocator::CheckStreamActived() const { uint32_t stream_id = static_cast(node->GetOpDesc()->GetStreamId()); auto iter = find(active_streams.begin(), active_streams.end(), stream_id); if (iter != active_streams.end()) { - REPORT_INNER_ERROR("E19999", "Node:%s(%s) cannot active its own stream %u, check invalid when %s", - node->GetName().c_str(), node->GetType().c_str(), stream_id, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Node:%s(%s) cannot active its own stream %u, check invalid ", + node->GetName().c_str(), node->GetType().c_str(), stream_id); GELOGE(FAILED, "Node %s cannot active its own stream %u.", node->GetName().c_str(), stream_id); return FAILED; } @@ -1375,7 +1375,7 @@ Status StreamAllocator::RefreshContinuousEvents() { for (size_t i = 0; i < send_events.size(); i++) { auto find_it = old_to_new_events.find(send_events[i]); if (find_it == old_to_new_events.end()) { - REPORT_INNER_ERROR("E19999", "Check invalid send event %u when %s", send_events[i], __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Check invalid send event %u", send_events[i]); GELOGE(FAILED, "RefreshContinuousEvents: invalid send event %u", send_events[i]); return FAILED; } @@ -1389,7 +1389,7 @@ Status StreamAllocator::RefreshContinuousEvents() { for (size_t i = 0; i < recv_events.size(); i++) { auto find_it = old_to_new_events.find(recv_events[i]); if (find_it == old_to_new_events.end()) { - REPORT_INNER_ERROR("E19999", "Check invalid recv event %u when %s", recv_events[i], __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Check invalid recv event %u", recv_events[i]); GELOGE(FAILED, "RefreshContinuousEvents: invalid recv event %u", recv_events[i]); return FAILED; } @@ -1427,9 +1427,9 @@ Status StreamAllocator::InsertSyncEventNodes() { int64_t temp_stream_id = node->GetOpDesc()->GetStreamId(); op_desc_ptr->SetStreamId(temp_stream_id); GE_CHK_BOOL_EXEC(AttrUtils::SetInt(op_desc_ptr, RECV_ATTR_EVENT_ID, event_id), - REPORT_INNER_ERROR("E19999", "Set Attr:%s for op:%s(%s) failed, event_id:%u, when %s", + REPORT_INNER_ERROR("E19999", "Set Attr:%s for op:%s(%s) failed, event_id:%u,", RECV_ATTR_EVENT_ID.c_str(), - node->GetName().c_str(), node->GetType().c_str(), event_id, __FUNCTION__); + node->GetName().c_str(), node->GetType().c_str(), event_id); GELOGE(FAILED, "SetInt failed."); return FAILED); (void)AttrUtils::SetListStr(op_desc_ptr, ATTR_NAME_DATA_DUMP_ORIGIN_OP_NAMES, @@ -1439,8 +1439,8 @@ Status StreamAllocator::InsertSyncEventNodes() { GE_CHECK_NOTNULL(recv_node->GetOutControlAnchor()); Status status = GraphUtils::AddEdge(recv_node->GetOutControlAnchor(), node->GetInControlAnchor()); if (status != SUCCESS) { - REPORT_INNER_ERROR("E19999", "Add edge from node %s to node %s failed when %s", - recv_node->GetName().c_str(), node->GetName().c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Add edge from node %s to node %s failed", + recv_node->GetName().c_str(), node->GetName().c_str()); GELOGE(status, "Add edge for node %s and node %s failed.", recv_node->GetName().c_str(), node->GetName().c_str()); return status; @@ -1476,8 +1476,8 @@ Status StreamAllocator::InsertSyncEventNodes() { GE_CHECK_NOTNULL(send_node->GetInControlAnchor()); Status status = GraphUtils::AddEdge(node->GetOutControlAnchor(), send_node->GetInControlAnchor()); if (status != SUCCESS) { - REPORT_INNER_ERROR("E19999", "Add edge from node %s to node %s failed when %s", - node->GetName().c_str(), send_node->GetName().c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Add edge from node %s to node %s failed", + node->GetName().c_str(), send_node->GetName().c_str()); GELOGE(status, "Add edge for node %s and node %s failed.", node->GetName().c_str(), send_node->GetName().c_str()); return status; @@ -1489,8 +1489,8 @@ Status StreamAllocator::InsertSyncEventNodes() { Status status = whole_graph_->InsertGraphEvents(); if (status != SUCCESS) { - REPORT_CALL_ERROR("E19999", "Insert Graph Events fail, graph:%s, when %s", - whole_graph_->GetName().c_str(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Insert Graph Events fail, graph:%s,", + whole_graph_->GetName().c_str()); GELOGE(status, "Graph ReorderEventNodes failed"); return status; } @@ -1542,8 +1542,8 @@ Status StreamAllocator::GetMaxStreamAndTask(bool huge_stream, uint32_t &max_stre } rtError_t ret = rtGetMaxStreamAndTask(stream_type, &max_stream_count, &max_task_count); if (ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "call rtGetMaxStreamAndTask fail, ret:%d, stream_type:%u, when %s", - static_cast(ret), stream_type, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "call rtGetMaxStreamAndTask fail, ret:%d, stream_type:%u,", + static_cast(ret), stream_type); GELOGE(FAILED, "Get max stream and task count by rts failed."); return FAILED; } @@ -1686,7 +1686,7 @@ Status StreamAllocator::AddActiveNodes(NodePtr &switch_node, const vectorGetOutControlAnchor()); if (switch_node->GetOutControlAnchor()->Unlink(node->GetInControlAnchor()) != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("Unlink %s to %s failed when %s", - switch_node->GetName().c_str(), node->GetName().c_str(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Unlink %s to %s failed", + switch_node->GetName().c_str(), node->GetName().c_str()); GELOGE(FAILED, "Unlink %s to %s failed.", switch_node->GetName().c_str(), node->GetName().c_str()); return FAILED; } GE_CHECK_NOTNULL(active_node->GetOutControlAnchor()); if (active_node->GetOutControlAnchor()->LinkTo(node->GetInControlAnchor()) != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("Link %s to %s failed when %s", - active_node->GetName().c_str(), node->GetName().c_str(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Link %s to %s failed", + active_node->GetName().c_str(), node->GetName().c_str()); GELOGE(FAILED, "Link %s to %s failed.", active_node->GetName().c_str(), node->GetName().c_str()); return FAILED; } @@ -1752,15 +1752,15 @@ Status StreamAllocator::AddActiveNodes(NodePtr &switch_node, const vector &streams = labeled_streams_[active_label]; vector active_streams(streams.begin(), streams.end()); if (!AttrUtils::SetListInt(active_node->GetOpDesc(), ATTR_NAME_ACTIVE_STREAM_LIST, active_streams)) { - REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s) when %s", ATTR_NAME_ACTIVE_STREAM_LIST.c_str(), - active_node->GetName().c_str(), active_node->GetType().c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s)", ATTR_NAME_ACTIVE_STREAM_LIST.c_str(), + active_node->GetName().c_str(), active_node->GetType().c_str()); GELOGE(FAILED, "SetListInt of %s failed.", ATTR_NAME_ACTIVE_STREAM_LIST.c_str()); return FAILED; } diff --git a/ge/graph/build/stream_graph_optimizer.cc b/ge/graph/build/stream_graph_optimizer.cc index 9fa33480..c71c31be 100644 --- a/ge/graph/build/stream_graph_optimizer.cc +++ b/ge/graph/build/stream_graph_optimizer.cc @@ -126,8 +126,8 @@ Status StreamGraphOptimizer::OptimizeStreamedSubGraph(const ComputeGraphPtr &com int64_t stream_id = op_desc->GetStreamId(); if (static_cast(stream_id) >= run_context.graphStreamList.size()) { REPORT_INNER_ERROR("E19999", "Check stream_id:%ld in op:%s(%s) is bigger than " - "run_context.graphStreamList.size():%zu when %s", stream_id, op_desc->GetName().c_str(), - op_desc->GetType().c_str(), run_context.graphStreamList.size(), __FUNCTION__); + "run_context.graphStreamList.size():%zu", stream_id, op_desc->GetName().c_str(), + op_desc->GetType().c_str(), run_context.graphStreamList.size()); GELOGE(FAILED, "stream_id %ld is bigger than run_context.graphStreamList.size() %zu", stream_id, run_context.graphStreamList.size()); return FAILED; diff --git a/ge/graph/build/task_generator.cc b/ge/graph/build/task_generator.cc index 25095d75..633f541c 100755 --- a/ge/graph/build/task_generator.cc +++ b/ge/graph/build/task_generator.cc @@ -71,7 +71,7 @@ Status TaskGenerator::GetTaskInfo(Model &model, ComputeGraphPtr &graph, uint64_t GELOGD("Begin to Get TaskInfo. session_id=%lu", session_id); // Check params if (graph == nullptr) { - REPORT_INNER_ERROR("E19999", "Check param graph is null, session_id:%lu, when %s", session_id, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Check param graph is null, session_id:%lu", session_id); GELOGE(PARAM_INVALID, "GetTaskInfo param graph is null. session_id=%lu", session_id); return PARAM_INVALID; } @@ -96,8 +96,8 @@ Status TaskGenerator::GetTaskInfo(Model &model, ComputeGraphPtr &graph, uint64_t op_name.push_back(iter.second); } GE_CHK_BOOL_EXEC(ge::AttrUtils::SetListStr(model, ATTR_MODEL_TASK_INDEX_OP_NAME, op_name), - REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for model:%s when %s", - ATTR_MODEL_TASK_INDEX_OP_NAME.c_str(), model.GetName().c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for model:%s", + ATTR_MODEL_TASK_INDEX_OP_NAME.c_str(), model.GetName().c_str()); GELOGE(FAILED, "SetListStr failed."); return FAILED); @@ -111,8 +111,8 @@ Status TaskGenerator::GetTaskInfo(Model &model, ComputeGraphPtr &graph, uint64_t for (const TaskDef &task_def_temp : task_def_list) { TaskDef *task_def = model_task_def.add_task(); if (task_def == nullptr) { - REPORT_INNER_ERROR("E19999", "Add task_def in ModelTaskDef fail, session_id:%lu, graph:%s, model:%s, when %s", - session_id, graph->GetName().c_str(), model.GetName().c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Add task_def in ModelTaskDef fail, session_id:%lu, graph:%s, model:%s", + session_id, graph->GetName().c_str(), model.GetName().c_str()); GELOGE(FAILED, "task_def is nullptr."); return FAILED; } @@ -133,44 +133,44 @@ Status TaskGenerator::AddModelTaskToModel(const ModelTaskDef &model_task_def, ui RunContext &run_context) { GE_CHK_BOOL_EXEC( AttrUtils::SetInt(model, MODEL_ATTR_TASK_GEN_BASE_ADDR, reinterpret_cast(run_context.dataMemBase)), - REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for model:%s when %s", - MODEL_ATTR_TASK_GEN_BASE_ADDR.c_str(), model.GetName().c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for model:%s", + MODEL_ATTR_TASK_GEN_BASE_ADDR.c_str(), model.GetName().c_str()); GELOGE(FAILED, "SetInt MODEL_ATTR_TASK_GEN_BASE_ADDR failed."); return FAILED); GE_CHK_BOOL_EXEC( AttrUtils::SetInt(model, MODEL_ATTR_TASK_GEN_WEIGHT_ADDR, reinterpret_cast(run_context.weightMemBase)), - REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for model:%s when %s", - MODEL_ATTR_TASK_GEN_WEIGHT_ADDR.c_str(), model.GetName().c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for model:%s", + MODEL_ATTR_TASK_GEN_WEIGHT_ADDR.c_str(), model.GetName().c_str()); GELOGE(FAILED, "SetInt MODEL_ATTR_TASK_GEN_WEIGHT_ADDR failed."); return FAILED); GE_CHK_BOOL_EXEC(AttrUtils::SetInt(model, ATTR_MODEL_TASK_GEN_VAR_ADDR, reinterpret_cast(var_mem_base_)), - REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for model:%s when %s", - ATTR_MODEL_TASK_GEN_VAR_ADDR.c_str(), model.GetName().c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for model:%s", + ATTR_MODEL_TASK_GEN_VAR_ADDR.c_str(), model.GetName().c_str()); GELOGE(FAILED, "SetInt ATTR_MODEL_TASK_GEN_VAR_ADDR failed."); return FAILED); GE_CHK_BOOL_EXEC(AttrUtils::SetInt(model, ATTR_MODEL_VAR_SIZE, var_mem_size_), - REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for model:%s when %s", - ATTR_MODEL_VAR_SIZE.c_str(), model.GetName().c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for model:%s", + ATTR_MODEL_VAR_SIZE.c_str(), model.GetName().c_str()); GELOGE(FAILED, "SetInt ATTR_MODEL_VAR_SIZE failed."); return FAILED); GE_CHK_BOOL_EXEC(AttrUtils::SetInt(model, MODEL_ATTR_SESSION_ID, session_id), - REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for mode:%s when %s", - MODEL_ATTR_SESSION_ID.c_str(), model.GetName().c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for mode:%s", + MODEL_ATTR_SESSION_ID.c_str(), model.GetName().c_str()); GELOGE(FAILED, "SetInt MODEL_ATTR_SESSION_ID failed."); return FAILED); size_t task_size = model_task_def.ByteSizeLong(); ge::Buffer serial_buff(task_size); if (!model_task_def.SerializePartialToArray(serial_buff.GetData(), static_cast(task_size))) { - REPORT_INNER_ERROR("E19999", "model_task_def's serialize failed, model name = %s, task_size=%zu when %s", - model.GetName().c_str(), task_size, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "model_task_def's serialize failed, model name = %s, task_size=%zu", + model.GetName().c_str(), task_size); GELOGE(FAILED, "model_task_def's serialize failed, model name = %s, task_size=%zu.", model.GetName().c_str(), task_size); return FAILED; } if (!AttrUtils::SetZeroCopyBytes(model, MODEL_ATTR_TASKS, std::move(serial_buff))) { - REPORT_INNER_ERROR("E19999", "Set model task to model failed, model name = %s, task_size=%zu when %s", - model.GetName().c_str(), task_size, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Set model task to model failed, model name = %s, task_size=%zu", + model.GetName().c_str(), task_size); GELOGE(FAILED, "Set model task to model failed, model name = %s, task_size=%zu.", model.GetName().c_str(), task_size); return FAILED; @@ -189,8 +189,8 @@ Status TaskGenerator::UpdateOpIsVarAttr(const OpDescPtr &op_desc, uint64_t sessi input_var.push_back(VarManager::Instance(session_id)->IsVarAddr(input)); } GE_CHK_BOOL_EXEC(AttrUtils::SetListBool(op_desc, kIsInputVar, input_var), - REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s) when %s", kIsInputVar, - op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s)", kIsInputVar, + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(FAILED, "SetListBool failed."); return FAILED); } @@ -202,8 +202,8 @@ Status TaskGenerator::UpdateOpIsVarAttr(const OpDescPtr &op_desc, uint64_t sessi output_var.push_back(VarManager::Instance(session_id)->IsVarAddr(output)); } GE_CHK_BOOL_EXEC(AttrUtils::SetListBool(op_desc, kIsOutputVar, output_var), - REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s) when %s", kIsOutputVar, - op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s)", kIsOutputVar, + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(FAILED, "SetListBool failed."); return FAILED); } @@ -279,7 +279,7 @@ Status TaskGenerator::GenerateTask(RunContext &run_context, ComputeGraphPtr &gra GELOGD("Beign to generate task, graph name is %s.", graph->GetName().c_str()); std::shared_ptr ge_lib = GELib::GetInstance(); if ((ge_lib == nullptr) || !ge_lib->InitFlag()) { - REPORT_INNER_ERROR("E19999", "Check GELib instance not init before when %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Check GELib instance not init before"); GELOGE(GE_CLI_GE_NOT_INITIALIZED, "GenerateTask failed."); return GE_CLI_GE_NOT_INITIALIZED; } @@ -347,8 +347,8 @@ Status TaskGenerator::GenerateTask(RunContext &run_context, ComputeGraphPtr &gra } auto kernel_info_store = ops_kernel_manager.GetOpsKernelInfoStore(op_kernel_lib_name); if (kernel_info_store == nullptr) { - REPORT_INNER_ERROR("E19999", "Get ops kernel info store failed for op:%s(%s), op_kernel_name:%s when %s", - node->GetName().c_str(), node->GetType().c_str(), op_kernel_lib_name.c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Get ops kernel info store failed for op:%s(%s), op_kernel_name:%s", + node->GetName().c_str(), node->GetType().c_str(), op_kernel_lib_name.c_str()); GELOGE(INTERNAL_ERROR, "No ops kernel store or ops kernel builder found. node:%s(%s), op_kernel_lib_name=%s.", name.c_str(), @@ -374,8 +374,8 @@ Status TaskGenerator::GenerateTask(RunContext &run_context, ComputeGraphPtr &gra auto ret = OpsKernelBuilderManager::Instance().GenerateTask(*node, run_context, task_def_list); GE_TIMESTAMP_ADD(GenerateTask); if (ret != SUCCESS) { - REPORT_CALL_ERROR("E19999", "Call OpsKernelBuilderManager GenerateTask fail for op:%s(%s) when %s", - node->GetName().c_str(), node->GetType().c_str(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call OpsKernelBuilderManager GenerateTask fail for op:%s(%s)", + node->GetName().c_str(), node->GetType().c_str()); GELOGE(ret, "Call %s to generate node[name:%s(%s), id:%ld, stream_id:%ld] task failed.", op_kernel_lib_name.c_str(), name.c_str(), type.c_str(), op_id, stream_id); return ret; @@ -452,9 +452,9 @@ Status TaskGenerator::GenerateTaskForFusionNode(FusionTaskInfo &fusion_task_info size_t task_list_size_before = task_def_list.size(); OpsKernelInfoStorePtr kernel_info_store = ops_kernel_manager.GetOpsKernelInfoStore(op_kernel_lib_name); if (kernel_info_store == nullptr) { - REPORT_INNER_ERROR("E19999", "Get ops kernel info store failed for op:%s(%s), op_kernel_name:%s when %s", + REPORT_INNER_ERROR("E19999", "Get ops kernel info store failed for op:%s(%s), op_kernel_name:%s", op_desc->GetName().c_str(), op_desc->GetType().c_str(), - op_kernel_lib_name.c_str(), __FUNCTION__); + op_kernel_lib_name.c_str()); GELOGE(INTERNAL_ERROR, "Fusion: No ops kernel store or ops kernel builder found. fusion_node:%s(%s), op_kernel_lib_name=%s.", fusion_node_name.c_str(), fusion_node_type.c_str(), op_kernel_lib_name.c_str()); @@ -472,8 +472,8 @@ Status TaskGenerator::GenerateTaskForFusionNode(FusionTaskInfo &fusion_task_info int64_t stream_id = op_desc->GetStreamId(); if (stream_id < 0 || stream_id >= (int64_t)run_context.graphStreamList.size()) { REPORT_INNER_ERROR("E19999", "Fusion: fusion_node[name:%s(%s), id:%ld] stream id is invalid, " - "stream list size=%zu, when %s", fusion_node_name.c_str(), fusion_node_type.c_str(), - op_id, run_context.graphStreamList.size(), __FUNCTION__); + "stream list size=%zu", fusion_node_name.c_str(), fusion_node_type.c_str(), + op_id, run_context.graphStreamList.size()); GELOGE(INTERNAL_ERROR, "Fusion: fusion_node[name:%s(%s), id:%ld] stream id is invalid, stream list size=%zu", fusion_node_name.c_str(), fusion_node_type.c_str(), op_id, run_context.graphStreamList.size()); return INTERNAL_ERROR; @@ -486,8 +486,8 @@ Status TaskGenerator::GenerateTaskForFusionNode(FusionTaskInfo &fusion_task_info ret = OpsKernelBuilderManager::Instance().GenerateTask(*fusion_node, run_context, task_def_list); if (ret != SUCCESS) { REPORT_CALL_ERROR("E19999", " Call %s to generate fusion_node:[fusion_node_name:%s(%s), " - "id:%ld, stream_id:%ld] task failed when %s", op_kernel_lib_name.c_str(), - fusion_node_name.c_str(), fusion_node_type.c_str(), op_id, stream_id, __FUNCTION__); + "id:%ld, stream_id:%ld] task failed", op_kernel_lib_name.c_str(), + fusion_node_name.c_str(), fusion_node_type.c_str(), op_id, stream_id); GELOGE(ret, "Fusion: Call %s to generate fusion_node:[fusion_node_name:%s(%s), " "id:%ld, stream_id:%ld] task failed.", @@ -500,9 +500,9 @@ Status TaskGenerator::GenerateTaskForFusionNode(FusionTaskInfo &fusion_task_info // if tasks is reduced if (task_list_size_after < task_list_size_before) { REPORT_INNER_ERROR("E19999", "InsertProfilingTask for fusion_node:[fusion_node_name:%s(%s), kernel_name:%s" - "id:%ld, stream_id:%ld] task, but task num from %zu to %zu, check invalid when %s", + "id:%ld, stream_id:%ld] task, but task num from %zu to %zu, check invalid", fusion_node_name.c_str(), fusion_node_type.c_str(), op_kernel_lib_name.c_str(), - op_id, stream_id, task_list_size_before, task_list_size_after, __FUNCTION__); + op_id, stream_id, task_list_size_before, task_list_size_after); GELOGE(FAILED, "Fusion: Call %s to generate fusion_node:[fusion_node_name:%s(%s), " "id:%ld, stream_id:%ld] task. but task num from %zu to %zu.", @@ -537,8 +537,8 @@ Status TaskGenerator::GenerateTaskForFusionNode(FusionTaskInfo &fusion_task_info Status TaskGenerator::UpdateAnchorStatus(const NodePtr &node) { if (NodeUtils::SetAllAnchorStatus(node) != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "SetAllAnchorStatus fail for op:%s(%s) when %s", - node->GetName().c_str(), node->GetType().c_str(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "SetAllAnchorStatus fail for op:%s(%s)", + node->GetName().c_str(), node->GetType().c_str()); GELOGE(INTERNAL_ERROR, "NodeUtils::SetAllAnchorStatus failed."); return INTERNAL_ERROR; } @@ -546,8 +546,8 @@ Status TaskGenerator::UpdateAnchorStatus(const NodePtr &node) { auto peer_anchor = anchor->GetPeerOutAnchor(); if (peer_anchor == nullptr) { if (AnchorUtils::SetStatus(anchor, ANCHOR_SUSPEND) != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Set in peer anchor status fail for op:%s(%s), anchor_index:%d, when %s", - node->GetName().c_str(), node->GetType().c_str(), anchor->GetIdx(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Set in peer anchor status fail for op:%s(%s), anchor_index:%d,", + node->GetName().c_str(), node->GetType().c_str(), anchor->GetIdx()); GELOGE(INTERNAL_ERROR, "AnchorUtils::SetStatus failed."); return INTERNAL_ERROR; } @@ -558,15 +558,15 @@ Status TaskGenerator::UpdateAnchorStatus(const NodePtr &node) { bool is_const = NodeUtils::GetConstOpType(peer_anchor->GetOwnerNode(), const_type); if (is_const && (const_type == CONSTANT)) { if (AnchorUtils::SetStatus(anchor, ANCHOR_CONST) != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Set in anchor CONST status fail for op:%s(%s), anchor_index:%d, when %s", - node->GetName().c_str(), node->GetType().c_str(), anchor->GetIdx(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Set in anchor CONST status fail for op:%s(%s), anchor_index:%d,", + node->GetName().c_str(), node->GetType().c_str(), anchor->GetIdx()); GELOGE(INTERNAL_ERROR, "AnchorUtils::SetStatus failed."); return INTERNAL_ERROR; } } else { if (AnchorUtils::SetStatus(anchor, ANCHOR_DATA) != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Set in anchor DATA status fail for op:%s(%s), anchor_index:%d, when %s", - node->GetName().c_str(), node->GetType().c_str(), anchor->GetIdx(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Set in anchor DATA status fail for op:%s(%s), anchor_index:%d,", + node->GetName().c_str(), node->GetType().c_str(), anchor->GetIdx()); GELOGE(INTERNAL_ERROR, "AnchorUtils::SetStatus failed."); return INTERNAL_ERROR; } @@ -579,15 +579,15 @@ Status TaskGenerator::UpdateAnchorStatus(const NodePtr &node) { Status TaskGenerator::MarkNodeAndSetIndex(ComputeGraphPtr &graph) { auto ge_lib = GELib::GetInstance(); if ((ge_lib == nullptr) || !ge_lib->InitFlag()) { - REPORT_INNER_ERROR("E19999", "Check GELib instance not init before when %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Check GELib instance not init before"); GELOGE(GE_CLI_GE_NOT_INITIALIZED, "GE is not initialized or is finalized."); return GE_CLI_GE_NOT_INITIALIZED; } const auto all_nodes = graph->GetNodes(graph->GetGraphUnknownFlag()); if (all_nodes.empty()) { - REPORT_INNER_ERROR("E19999", "Check param all_nodes empty in graph:%s when %s", - graph->GetName().c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Check param all_nodes empty in graph:%s", + graph->GetName().c_str()); GELOGE(GE_GRAPH_GRAPH_NODE_NULL, "Graph's node is empty"); return GE_GRAPH_GRAPH_NODE_NULL; } @@ -643,9 +643,9 @@ Status TaskGenerator::MarkFirstAndLastOps(const vector &ops, bool is_ for (auto &op_desc : continuous_ops) { string op_kernel_lib_name = op_desc->GetOpKernelLibName(); if (op_kernel_lib_name.empty()) { - REPORT_INNER_ERROR("E19999", "Get ops kernel info store failed for op:%s(%s), op_kernel_name:%s when %s", + REPORT_INNER_ERROR("E19999", "Get ops kernel info store failed for op:%s(%s), op_kernel_name:%s", op_desc->GetName().c_str(), op_desc->GetType().c_str(), - op_kernel_lib_name.c_str(), __FUNCTION__); + op_kernel_lib_name.c_str()); GELOGE(INTERNAL_ERROR, "node:%s(%s) get op kernel lib failed.", op_desc->GetName().c_str(), op_desc->GetType().c_str()); return INTERNAL_ERROR; @@ -662,15 +662,13 @@ Status TaskGenerator::MarkFirstAndLastOps(const vector &ops, bool is_ for (auto &it : first_and_last_ops) { auto &op_pair = it.second; GE_CHK_BOOL_EXEC(ge::AttrUtils::SetBool(op_pair.first, kIsFirstNode, true), - REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s) when %s", kIsFirstNode, - op_pair.first->GetName().c_str(), op_pair.first->GetType().c_str(), - __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s)", kIsFirstNode, + op_pair.first->GetName().c_str(), op_pair.first->GetType().c_str()); GELOGE(FAILED, "SetBool failed."); return FAILED); GE_CHK_BOOL_EXEC(ge::AttrUtils::SetBool(op_pair.second, kIsLastNode, true), - REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s) when %s", kIsLastNode, - op_pair.second->GetName().c_str(), op_pair.second->GetType().c_str(), - __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s)", kIsLastNode, + op_pair.second->GetName().c_str(), op_pair.second->GetType().c_str()); GELOGE(FAILED, "SetBool failed."); return FAILED); } @@ -1185,7 +1183,7 @@ Status TaskGenerator::SetUnknownShapeStream(RunContext &run_context, rtStream_t run_context.stream = stream; rtError_t rt_ret = rtModelBindStream(run_context.model, stream, 0); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtModelBindStream failed, ret:0x%X when %s", rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtModelBindStream failed, ret:0x%X", rt_ret); GELOGE(FAILED, "Call rt api failed, ret: 0x%X", rt_ret); GE_CHK_RT_RET(rtStreamDestroy(stream)); return FAILED; diff --git a/ge/graph/common/bcast.h b/ge/graph/common/bcast.h index 9b5b2538..a8399896 100644 --- a/ge/graph/common/bcast.h +++ b/ge/graph/common/bcast.h @@ -111,14 +111,14 @@ class BCast { const std::function &func) { Status ret; if (func == nullptr) { - REPORT_INNER_ERROR("E19999", "Check param func nullptr when %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Check param func nullptr"); GELOGE(domi::PARAM_INVALID, "Param func is null"); return domi::PARAM_INVALID; } // Min input num is 2 if (input.size() < kMinDimNum) { - REPORT_INNER_ERROR("E19999", "Param input.size():%zu < %zu, check invalid when %s", - input.size(), kMinDimNum, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Param input.size():%zu < %zu, check invalid", + input.size(), kMinDimNum); GELOGE(domi::PARAM_INVALID, "Input size is smaller than two."); return domi::PARAM_INVALID; } @@ -152,14 +152,14 @@ class BCast { Status BCastComputeCheck(const std::vector &input, std::vector &v_output, const std::function &func) { if (func == nullptr) { - REPORT_INNER_ERROR("E19999", "Check param func nullptr when %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Check param func nullptr"); GELOGE(PARAM_INVALID, "Param func is null"); return PARAM_INVALID; } // Min input num is 2 if (input.size() < kMinDimNum) { - REPORT_INNER_ERROR("E19999", "Param input.size():%zu < %zu, check invalid when %s", - input.size(), kMinDimNum, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Param input.size():%zu < %zu, check invalid", + input.size(), kMinDimNum); GELOGE(PARAM_INVALID, "Input size is smaller than two."); return PARAM_INVALID; } diff --git a/ge/graph/common/omg_util.cc b/ge/graph/common/omg_util.cc index 272707a5..7fe11f23 100644 --- a/ge/graph/common/omg_util.cc +++ b/ge/graph/common/omg_util.cc @@ -38,8 +38,8 @@ Status GetOriginalType(const ge::NodePtr &node, string &type) { GE_CHECK_NOTNULL(node->GetOpDesc()); bool ret = ge::AttrUtils::GetStr(node->GetOpDesc(), ATTR_NAME_FRAMEWORK_ORIGINAL_TYPE, type); if (!ret) { - REPORT_INNER_ERROR("E19999", "Get Attr:%s fail for op:%s(%s) when %s", ATTR_NAME_FRAMEWORK_ORIGINAL_TYPE.c_str(), - node->GetName().c_str(), node->GetType().c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Get Attr:%s fail for op:%s(%s)", ATTR_NAME_FRAMEWORK_ORIGINAL_TYPE.c_str(), + node->GetName().c_str(), node->GetType().c_str()); GELOGE(INTERNAL_ERROR, "Get FrameWorkOp original type [%s]", type.c_str()); return INTERNAL_ERROR; } @@ -59,8 +59,8 @@ Status SetStreamLabel(const ge::NodePtr &node, const std::string &label) { GE_CHECK_NOTNULL(tmp_desc); if (!AttrUtils::SetStr(tmp_desc, ge::ATTR_NAME_STREAM_LABEL, label)) { - REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s) when %s", ATTR_NAME_STREAM_LABEL.c_str(), - node->GetName().c_str(), node->GetType().c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s)", ATTR_NAME_STREAM_LABEL.c_str(), + node->GetName().c_str(), node->GetType().c_str()); GELOGE(FAILED, "Op: %s set ATTR_NAME_STREAM_LABEL failed", node->GetName().c_str()); return FAILED; } @@ -78,8 +78,8 @@ Status SetCycleEvent(const ge::NodePtr &node) { OpDescPtr tmp_desc = node->GetOpDesc(); GE_CHECK_NOTNULL(tmp_desc); if (!AttrUtils::SetBool(tmp_desc, ge::ATTR_NAME_STREAM_CYCLE_EVENT_FLAG, true)) { - REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s) when %s", ATTR_NAME_STREAM_CYCLE_EVENT_FLAG.c_str(), - node->GetName().c_str(), node->GetType().c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s)", ATTR_NAME_STREAM_CYCLE_EVENT_FLAG.c_str(), + node->GetName().c_str(), node->GetType().c_str()); GELOGE(FAILED, "Op: %s set ATTR_NAME_STREAM_CYCLE_EVENT_FLAG failed", node->GetName().c_str()); return FAILED; } @@ -98,8 +98,8 @@ Status SetActiveLabelList(const ge::NodePtr &node, const std::vectorGetOpDesc(); GE_CHECK_NOTNULL(tmp_desc); if (!AttrUtils::SetListStr(tmp_desc, ge::ATTR_NAME_ACTIVE_LABEL_LIST, active_label_list)) { - REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s) when %s", ATTR_NAME_ACTIVE_LABEL_LIST.c_str(), - node->GetName().c_str(), node->GetType().c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s)", ATTR_NAME_ACTIVE_LABEL_LIST.c_str(), + node->GetName().c_str(), node->GetType().c_str()); GELOGE(FAILED, "Op: %s set ATTR_NAME_ACTIVE_LABEL_LIST failed", node->GetName().c_str()); return FAILED; } @@ -118,8 +118,8 @@ Status SetSwitchBranchNodeLabel(const ge::NodePtr &node, const std::string &bran OpDescPtr tmp_desc = node->GetOpDesc(); GE_CHECK_NOTNULL(tmp_desc); if (!AttrUtils::SetStr(tmp_desc, ge::ATTR_NAME_SWITCH_BRANCH_NODE_LABEL, branch_label)) { - REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s) when %s", ATTR_NAME_SWITCH_BRANCH_NODE_LABEL.c_str(), - node->GetName().c_str(), node->GetType().c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s)", ATTR_NAME_SWITCH_BRANCH_NODE_LABEL.c_str(), + node->GetName().c_str(), node->GetType().c_str()); GELOGE(FAILED, "Op: %s set ATTR_NAME_SWITCH_BRANCH_NODE_LABEL failed", node->GetName().c_str()); return FAILED; } @@ -138,8 +138,8 @@ Status SetSwitchTrueBranchFlag(const ge::NodePtr &node, bool value) { OpDescPtr tmp_desc = node->GetOpDesc(); GE_CHECK_NOTNULL(tmp_desc); if (!AttrUtils::SetBool(tmp_desc, ge::ATTR_NAME_SWITCH_TRUE_BRANCH_FLAG, value)) { - REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s) when %s", ATTR_NAME_SWITCH_TRUE_BRANCH_FLAG.c_str(), - node->GetName().c_str(), node->GetType().c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s)", ATTR_NAME_SWITCH_TRUE_BRANCH_FLAG.c_str(), + node->GetName().c_str(), node->GetType().c_str()); GELOGE(FAILED, "Op: %s set ATTR_NAME_SWITCH_TRUE_BRANCH_FLAG failed", node->GetName().c_str()); return FAILED; } @@ -158,8 +158,8 @@ Status SetOriginalNodeName(const ge::NodePtr &node, const std::string &orig_name OpDescPtr tmp_desc = node->GetOpDesc(); GE_CHECK_NOTNULL(tmp_desc); if (!AttrUtils::SetStr(tmp_desc, ge::ATTR_NAME_ORIG_NODE_NAME, orig_name)) { - REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s) when %s", ATTR_NAME_ORIG_NODE_NAME.c_str(), - node->GetName().c_str(), node->GetType().c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s)", ATTR_NAME_ORIG_NODE_NAME.c_str(), + node->GetName().c_str(), node->GetType().c_str()); GELOGE(FAILED, "Op: %s set ATTR_NAME_ORIG_NODE_NAME failed", node->GetName().c_str()); return FAILED; } @@ -177,8 +177,8 @@ Status SetCyclicDependenceFlag(const ge::NodePtr &node) { OpDescPtr tmp_desc = node->GetOpDesc(); GE_CHECK_NOTNULL(tmp_desc); if (!AttrUtils::SetBool(tmp_desc, ge::ATTR_NAME_CYCLIC_DEPENDENCE_FLAG, true)) { - REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s) when %s", ATTR_NAME_CYCLIC_DEPENDENCE_FLAG.c_str(), - node->GetName().c_str(), node->GetType().c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s)", ATTR_NAME_CYCLIC_DEPENDENCE_FLAG.c_str(), + node->GetName().c_str(), node->GetType().c_str()); GELOGE(FAILED, "Op: %s set ATTR_NAME_CYCLIC_DEPENDENCE_FLAG failed", node->GetName().c_str()); return FAILED; } @@ -198,8 +198,8 @@ Status SetNextIteration(const ge::NodePtr &node, const std::string &next) { GE_CHECK_NOTNULL(tmp_desc); if (!AttrUtils::SetStr(tmp_desc, ge::ATTR_NAME_NEXT_ITERATION, next)) { - REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s) when %s", ATTR_NAME_NEXT_ITERATION.c_str(), - node->GetName().c_str(), node->GetType().c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s)", ATTR_NAME_NEXT_ITERATION.c_str(), + node->GetName().c_str(), node->GetType().c_str()); GELOGE(FAILED, "Op: %s set ATTR_NAME_NEXT_ITERATION failed", node->GetName().c_str()); return FAILED; } diff --git a/ge/graph/execute/graph_execute.cc b/ge/graph/execute/graph_execute.cc index 847374cc..d924302c 100755 --- a/ge/graph/execute/graph_execute.cc +++ b/ge/graph/execute/graph_execute.cc @@ -40,7 +40,7 @@ GraphExecutor::~GraphExecutor() { rtError_t rt_ret; rt_ret = rtFreeHost(buffer_addr); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtFreeHost failed, ret:0x%X when %s", rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtFreeHost failed, ret:0x%X", rt_ret); GELOGE(RT_FAILED, "[GraphManager] subgraph free buffer failed, ret: 0x%X", rt_ret); } } @@ -52,17 +52,17 @@ GraphExecutor::~GraphExecutor() { Status GraphExecutor::SetCondition(std::mutex *mutex, std::condition_variable *cond, std::shared_ptr listener) { if (mutex == nullptr) { - REPORT_INNER_ERROR("E19999", "Check param mutex nullptr when %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Check param mutex nullptr"); GELOGE(GE_GRAPH_PARAM_NULLPTR, "[SetCondition] input param mutex is nullptr."); return GE_GRAPH_PARAM_NULLPTR; } if (cond == nullptr) { - REPORT_INNER_ERROR("E19999", "Check param cond nullptr when %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Check param cond nullptr"); GELOGE(GE_GRAPH_PARAM_NULLPTR, "[SetCondition] input param cond is nullptr."); return GE_GRAPH_PARAM_NULLPTR; } if (listener == nullptr) { - REPORT_INNER_ERROR("E19999", "Check param listener nullptr when %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Check param listener nullptr"); GELOGE(GE_GRAPH_PARAM_NULLPTR, "[SetCondition] input param listener is nullptr."); return GE_GRAPH_PARAM_NULLPTR; } @@ -79,7 +79,7 @@ Status GraphExecutor::SetCondition(std::mutex *mutex, std::condition_variable *c Status GraphExecutor::SetGraphContext(GraphContextPtr graph_context_ptr) { if (graph_context_ptr == nullptr) { - REPORT_INNER_ERROR("E19999", "Check param graph_context_ptr nullptr when %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Check param graph_context_ptr nullptr"); GELOGE(GE_GRAPH_PARAM_NULLPTR, "[SetGraphContext] input param graph_context_ptr is nullptr"); return GE_GRAPH_PARAM_NULLPTR; } @@ -106,7 +106,7 @@ Status GraphExecutor::FreeInOutBuffer() { rtError_t rt_ret; rt_ret = rtFreeHost(*iter); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtFreeHost failed, ret:0x%X when %s", rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtFreeHost failed, ret:0x%X", rt_ret); GELOGE(RT_FAILED, "[GraphManager] subgraph free buffer failed, ret: 0x%X", rt_ret); (void)buffer_addr_.erase(buffer_addr_.begin(), iter); return GE_GRAPH_FREE_FAILED; @@ -152,8 +152,8 @@ Status GraphExecutor::MallocInOutBuffer(const std::vector &buffer_size void *tmp_buf = nullptr; rt_ret = rtMallocHost(&tmp_buf, buffer_size[i]); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMallocHost failed, size:%lu, ret:0x%X when %s", - buffer_size[i], rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMallocHost failed, size:%lu, ret:0x%X", + buffer_size[i], rt_ret); GELOGE(RT_FAILED, "[GraphManager] subgraph malloc buffer failed, ret: 0x%X", rt_ret); return GE_GRAPH_MALLOC_FAILED; } @@ -199,8 +199,8 @@ Status GraphExecutor::PrepareInputData(const std::vector &input_tensor rtError_t rt_ret = rtMemcpy(addrVec[i], bufferSizeVec[i], in_tensor->GetData().data(), in_tensor->GetData().size(), RT_MEMCPY_HOST_TO_HOST); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, dst_size:%lu, src_size:%zu, ret:0x%X when %s", - bufferSizeVec[i], in_tensor->GetData().size(), rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, dst_size:%lu, src_size:%zu, ret:0x%X", + bufferSizeVec[i], in_tensor->GetData().size(), rt_ret); GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); return RT_FAILED; } @@ -260,8 +260,8 @@ Status GraphExecutor::SyncExecuteModel(uint32_t model_id, const std::vectorResetResult() != SUCCESS) { - REPORT_CALL_ERROR("E19999", "Call graph_run_listener_.ResetResult fail, model_id:%u, when %s", - model_id, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call graph_run_listener_.ResetResult fail, model_id:%u", + model_id); GELOGE(GE_GRAPH_EXECUTE_FAILED, "Reset result failed"); return GE_GRAPH_EXECUTE_FAILED; } @@ -285,8 +285,8 @@ Status GraphExecutor::SyncExecuteModel(uint32_t model_id, const std::vectorGetResultCode(); if (result_code != SUCCESS && result_code != END_OF_SEQUENCE) { - REPORT_CALL_ERROR("E19999", "Graph_run_listener_ run fail, result:%u, model_id:%u, when %s", - result_code, model_id, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Graph_run_listener_ run fail, result:%u, model_id:%u", + result_code, model_id); GELOGE(GE_GRAPH_EXECUTE_FAILED, "[GraphExecutor] execute model failed, ret=%u, modelId=%u.", result_code, model_id); return GE_GRAPH_EXECUTE_FAILED; @@ -295,14 +295,14 @@ Status GraphExecutor::SyncExecuteModel(uint32_t model_id, const std::vector outBufTmp(new (std::nothrow) uint8_t[outputDataTmp.length]); if (outBufTmp == nullptr) { - REPORT_CALL_ERROR("E19999", "New output buffer fail, length:%lu, model:%u, when %s", - outputDataTmp.length, model_id, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "New output buffer fail, length:%lu, model:%u", + outputDataTmp.length, model_id); GELOGE(FAILED, "Failed to allocate memory."); return FAILED; } @@ -310,8 +310,8 @@ Status GraphExecutor::SyncExecuteModel(uint32_t model_id, const std::vectorGetSubgraphInstanceNames(); if (graph_names.empty() || graph_names.size() > kMaxCaseBranch) { - REPORT_INNER_ERROR("E19999", "Node:%s(%s) subgraph size: %zu, check invalid when %s", case_desc->GetName().c_str(), - case_desc->GetType().c_str(), graph_names.size(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Node:%s(%s) subgraph size: %zu, check invalid", case_desc->GetName().c_str(), + case_desc->GetType().c_str(), graph_names.size()); GELOGE(INTERNAL_ERROR, "Node: %s has invalid subgraph, graph size: %zu.", case_desc->GetName().c_str(), graph_names.size()); return FAILED; @@ -69,8 +69,8 @@ Status CaseOpLabelMaker::Run(uint32_t &label_index) { parent_node_->GetName() + "/StreamActive_" + std::to_string(index); // rtStreamActive NodePtr stream_active = AddStreamActive(graph, stream_active_name); if (stream_active == nullptr) { - REPORT_CALL_ERROR("E19999", "Add StreamActive node in graph:%s fail when %s", - graph->GetName().c_str(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Add StreamActive node in graph:%s fail", + graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "Subgraph: %s add stream active failed.", graph->GetName().c_str()); return FAILED; } @@ -79,8 +79,8 @@ Status CaseOpLabelMaker::Run(uint32_t &label_index) { std::string label_set_name = parent_node_->GetName() + "/LabelSet_" + std::to_string(index); // rtLabelSet NodePtr label = AddLabelSetEnter(graph, label_set_name, curr_label_index, stream_active); if (label == nullptr) { - REPORT_CALL_ERROR("E19999", "Add LabelSetEnter node in graph:%s fail when %s", - graph->GetName().c_str(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Add LabelSetEnter node in graph:%s fail", + graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "Subgraph: %s add label set failed.", graph->GetName().c_str()); return FAILED; } @@ -94,8 +94,8 @@ Status CaseOpLabelMaker::Run(uint32_t &label_index) { // middle node, add goto node to tail. std::string label_goto_name = parent_node_->GetName() + "/LabelGoto_" + std::to_string(index); // rtLabelGoto if (AddLabelGotoLeave(graph, label_goto_name, last_label_index) == nullptr) { - REPORT_CALL_ERROR("E19999", "Add LabelGotoLeave node in graph:%s fail when %s", - graph->GetName().c_str(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Add LabelGotoLeave node in graph:%s fail", + graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "Subgraph: %s add label goto failed.", graph->GetName().c_str()); return FAILED; } @@ -103,8 +103,8 @@ Status CaseOpLabelMaker::Run(uint32_t &label_index) { // last node, add label node to tail. std::string last_label_name = parent_node_->GetName() + "/LabelSet_Last"; // rtLabelSet if (AddLabelSetLeave(graph, last_label_name, last_label_index) == nullptr) { - REPORT_CALL_ERROR("E19999", "Add LabelSetLeave node in graph:%s fail when %s", - graph->GetName().c_str(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Add LabelSetLeave node in graph:%s fail", + graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "Subgraph: %s add label set failed.", graph->GetName().c_str()); return FAILED; } @@ -120,16 +120,16 @@ Status CaseOpLabelMaker::Run(uint32_t &label_index) { const GeTensorDesc &pred_desc = case_desc->GetInputDesc(kCasePredIndex); NodePtr switch_node = AddLabelSwitchEnter(first_graph, label_switch_name, pred_desc, switch_labels); if (switch_node == nullptr) { - REPORT_CALL_ERROR("E19999", "Add LabelSwitchEnter node in graph:%s fail when %s", - first_graph->GetName().c_str(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Add LabelSwitchEnter node in graph:%s fail", + first_graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "Subgraph: %s add label switch failed.", first_graph->GetName().c_str()); return FAILED; } // Link control edge to then branch head. if (GraphUtils::AddEdge(switch_node->GetOutControlAnchor(), first_label->GetInControlAnchor()) != SUCCESS) { - REPORT_CALL_ERROR("E19999", "Add ctrl edge from %s to %s in graph:%s fail when %s", switch_node->GetName().c_str(), - first_label->GetName().c_str(), first_graph->GetName().c_str(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Add ctrl edge from %s to %s in graph:%s fail", switch_node->GetName().c_str(), + first_label->GetName().c_str(), first_graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "LabelSwitchByIndex: Add ctrl edge to %s failed.", first_label->GetName().c_str()); return FAILED; } @@ -137,8 +137,8 @@ Status CaseOpLabelMaker::Run(uint32_t &label_index) { uint32_t parent_index = 0; // Case cond input is first. const std::string data_name = parent_node_->GetName() + "/SwitchIndexData"; if (AddLabelSwitchIndex(first_graph, data_name, pred_desc, switch_node, parent_index) == nullptr) { - REPORT_CALL_ERROR("E19999", "Add LabelSwitchIndex node in graph:%s fail when %s", - first_graph->GetName().c_str(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Add LabelSwitchIndex node in graph:%s fail", + first_graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "Subgraph: %s add switch input failed.", first_graph->GetName().c_str()); return FAILED; } diff --git a/ge/graph/label/if_label_maker.cc b/ge/graph/label/if_label_maker.cc index 655381f0..cf4cdd39 100644 --- a/ge/graph/label/if_label_maker.cc +++ b/ge/graph/label/if_label_maker.cc @@ -44,9 +44,9 @@ Status IfOpLabelMaker::Run(uint32_t &label_index) { const std::string else_branch_name = if_desc->GetSubgraphInstanceName(kElseBranchIndex); if (then_branch_name.empty() || else_branch_name.empty()) { REPORT_INNER_ERROR("E19999", "Node:%s(%s), check subgraph invalid, " - "then branch graph: %s, else branch graph: %s, when %s", + "then branch graph: %s, else branch graph: %s", if_desc->GetName().c_str(), if_desc->GetType().c_str(), - then_branch_name.c_str(), else_branch_name.c_str(), __FUNCTION__); + then_branch_name.c_str(), else_branch_name.c_str()); GELOGE(INTERNAL_ERROR, "Node: %s has invalid subgraph, then branch: %s, else branch: %s.", if_desc->GetName().c_str(), then_branch_name.c_str(), else_branch_name.c_str()); return FAILED; @@ -70,44 +70,44 @@ Status IfOpLabelMaker::Run(uint32_t &label_index) { NodePtr then_stream_active = AddStreamActive(then_sub_graph, then_active_name); if (then_stream_active == nullptr) { - REPORT_CALL_ERROR("E19999", "Add StreamActive node in graph:%s fail when %s", - then_sub_graph->GetName().c_str(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Add StreamActive node in graph:%s fail", + then_sub_graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "Subgraph: %s add stream active failed.", then_sub_graph->GetName().c_str()); return FAILED; } NodePtr then_enter_label = AddLabelSetEnter(then_sub_graph, then_label_name, then_enter_index, then_stream_active); if (then_enter_label == nullptr) { - REPORT_CALL_ERROR("E19999", "Add LabelSetEnter node in graph:%s fail when %s", - then_sub_graph->GetName().c_str(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Add LabelSetEnter node in graph:%s fail", + then_sub_graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "Subgraph: %s add label set failed.", then_sub_graph->GetName().c_str()); return FAILED; } if (AddLabelGotoLeave(then_sub_graph, then_leave_name, else_leave_index) == nullptr) { - REPORT_CALL_ERROR("E19999", "Add LabelGotoLeave node in graph:%s fail when %s", - then_sub_graph->GetName().c_str(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Add LabelGotoLeave node in graph:%s fail", + then_sub_graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "Subgraph: %s add label goto failed.", then_sub_graph->GetName().c_str()); return FAILED; } NodePtr else_stream_active = AddStreamActive(else_sub_graph, else_active_name); if (else_stream_active == nullptr) { - REPORT_CALL_ERROR("E19999", "Add StreamActive node in graph:%s fail when %s", - else_stream_active->GetName().c_str(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Add StreamActive node in graph:%s fail", + else_stream_active->GetName().c_str()); GELOGE(INTERNAL_ERROR, "Subgraph: %s add stream active failed.", else_sub_graph->GetName().c_str()); return FAILED; } if (AddLabelSetEnter(else_sub_graph, else_enter_name, else_enter_index, else_stream_active) == nullptr) { - REPORT_CALL_ERROR("E19999", "Add LabelSetEnter node in graph:%s fail when %s", - else_sub_graph->GetName().c_str(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Add LabelSetEnter node in graph:%s fail", + else_sub_graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "Subgraph: %s add label set failed.", else_sub_graph->GetName().c_str()); return FAILED; } if (AddLabelSetLeave(else_sub_graph, else_leave_name, else_leave_index) == nullptr) { - REPORT_CALL_ERROR("E19999", "Add LabelSetLeave node in graph:%s fail when %s", - else_sub_graph->GetName().c_str(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Add LabelSetLeave node in graph:%s fail", + else_sub_graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "Subgraph: %s add label set failed.", else_sub_graph->GetName().c_str()); return FAILED; } @@ -119,16 +119,16 @@ Status IfOpLabelMaker::Run(uint32_t &label_index) { const GeTensorDesc &pred_desc = if_desc->GetInputDesc(kIfPredIndex); NodePtr switch_node = AddLabelSwitchEnter(then_sub_graph, then_enter_name, pred_desc, switch_labels); if (switch_node == nullptr) { - REPORT_CALL_ERROR("E19999", "Add LabelSwitchEnter node in graph:%s fail when %s", - then_sub_graph->GetName().c_str(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Add LabelSwitchEnter node in graph:%s fail", + then_sub_graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "Subgraph: %s add label switch failed.", then_sub_graph->GetName().c_str()); return FAILED; } // Link control edge to then branch head. if (GraphUtils::AddEdge(switch_node->GetOutControlAnchor(), then_enter_label->GetInControlAnchor()) != SUCCESS) { - REPORT_CALL_ERROR("E19999", "Add ctrl edge from %s to %s in graph:%s fail when %s", switch_node->GetName().c_str(), - then_enter_label->GetName().c_str(), then_sub_graph->GetName().c_str(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Add ctrl edge from %s to %s in graph:%s fail", switch_node->GetName().c_str(), + then_enter_label->GetName().c_str(), then_sub_graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "LabelSwitchByIndex: Add ctrl edge to %s failed.", then_enter_label->GetName().c_str()); return FAILED; } @@ -136,8 +136,8 @@ Status IfOpLabelMaker::Run(uint32_t &label_index) { uint32_t parent_index = 0; // If cond input is first. const std::string data_name = parent_node_->GetName() + "/SwitchIndexData"; if (AddLabelSwitchIndex(then_sub_graph, data_name, pred_desc, switch_node, parent_index) == nullptr) { - REPORT_CALL_ERROR("E19999", "Add LabelSwitchIndex node in graph:%s fail when %s", - then_sub_graph->GetName().c_str(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Add LabelSwitchIndex node in graph:%s fail", + then_sub_graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "Subgraph: %s add switch input failed.", then_sub_graph->GetName().c_str()); return FAILED; } diff --git a/ge/graph/label/label_maker.cc b/ge/graph/label/label_maker.cc index 03d2e87e..156748e8 100644 --- a/ge/graph/label/label_maker.cc +++ b/ge/graph/label/label_maker.cc @@ -56,8 +56,8 @@ void LabelMaker::LinkToGraphHead(const ComputeGraphPtr &graph, const NodePtr &no } if (GraphUtils::AddEdge(node->GetOutControlAnchor(), n->GetInControlAnchor()) != SUCCESS) { - REPORT_CALL_ERROR("E19999", "Add ctrl edge from %s to %s in graph:%s fail when %s", node->GetName().c_str(), - n->GetName().c_str(), graph->GetName().c_str(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Add ctrl edge from %s to %s in graph:%s fail", node->GetName().c_str(), + n->GetName().c_str(), graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "Add ctrl edge from %s to %s failed.", node->GetName().c_str(), n->GetName().c_str()); } } @@ -80,8 +80,8 @@ void LabelMaker::LinkToGraphTail(const ComputeGraphPtr &graph, const NodePtr &no } if (GraphUtils::AddEdge(tail->GetOutControlAnchor(), node->GetInControlAnchor()) != SUCCESS) { - REPORT_CALL_ERROR("E19999", "Add ctrl edge from %s to %s in graph:%s fail when %s", tail->GetName().c_str(), - node->GetName().c_str(), graph->GetName().c_str(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Add ctrl edge from %s to %s in graph:%s fail", tail->GetName().c_str(), + node->GetName().c_str(), graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "Add ctrl edge from %s to %s failed.", tail->GetName().c_str(), node->GetName().c_str()); } return; @@ -100,7 +100,7 @@ NodePtr LabelMaker::AddStreamActive(const ComputeGraphPtr &graph, const std::str const auto &node_list = graph->GetDirectNode(); if (node_list.empty()) { - REPORT_INNER_ERROR("E19999", "Check param graph has no node when %s", graph->GetName().c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Check param graph:%s has no node", graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "LabelSet: Graph %s node is empty.", graph->GetName().c_str()); return nullptr; } @@ -136,7 +136,7 @@ NodePtr LabelMaker::AddLabelSetEnter(const ComputeGraphPtr &graph, const std::st const auto &node_list = graph->GetDirectNode(); if (node_list.empty()) { - REPORT_INNER_ERROR("E19999", "Check param graph has no node when %s", graph->GetName().c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Check param graph:%s has no node", graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "LabelSet: Graph %s node is empty.", graph->GetName().c_str()); return nullptr; } @@ -151,8 +151,8 @@ NodePtr LabelMaker::AddLabelSetEnter(const ComputeGraphPtr &graph, const std::st GE_CHECK_NOTNULL_EXEC(label_set, return nullptr); if (GraphUtils::AddEdge(label_set->GetOutControlAnchor(), stream_active->GetInControlAnchor()) != SUCCESS) { - REPORT_CALL_ERROR("E19999", "Add ctrl edge from %s to %s in graph:%s fail when %s", label_set->GetName().c_str(), - stream_active->GetName().c_str(), graph->GetName().c_str(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Add ctrl edge from %s to %s in graph:%s fail", label_set->GetName().c_str(), + stream_active->GetName().c_str(), graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "Add ctrl edge from %s to %s failed.", label_set->GetName().c_str(), stream_active->GetName().c_str()); return nullptr; @@ -201,7 +201,7 @@ NodePtr LabelMaker::AddLabelGotoEnter(const ComputeGraphPtr &graph, const std::s const auto &node_list = graph->GetDirectNode(); auto it = node_list.begin(); if (it == node_list.end()) { - REPORT_INNER_ERROR("E19999", "Check param graph has no node when %s", graph->GetName().c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Check param graph:%s has no node", graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "LabelGoto: Graph %s node is empty.", graph->GetName().c_str()); return nullptr; } @@ -214,8 +214,8 @@ NodePtr LabelMaker::AddLabelGotoEnter(const ComputeGraphPtr &graph, const std::s (void)AttrUtils::SetInt(op_desc, ATTR_NAME_LABEL_SWITCH_INDEX, index); NodePtr label_goto = graph->AddNodeFront(op_desc); if (label_goto == nullptr) { - REPORT_CALL_ERROR("E19999", "Add node:%s(%s) to graph:%s fail when %s", - op_desc->GetName().c_str(), op_desc->GetType().c_str(), graph->GetName().c_str(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Add node:%s(%s) to graph:%s fail", + op_desc->GetName().c_str(), op_desc->GetType().c_str(), graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "LabelGoto: Add to graph %s failed.", graph->GetName().c_str()); return nullptr; } @@ -264,7 +264,7 @@ NodePtr LabelMaker::AddLabelSwitchEnter(const ComputeGraphPtr &graph, const std: const auto &node_list = graph->GetDirectNode(); auto it = node_list.begin(); if (it == node_list.end()) { - REPORT_INNER_ERROR("E19999", "Check param graph has no node when %s", graph->GetName().c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Check param graph:%s has no node", graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "LabelSwitchByIndex: Graph %s node is empty.", graph->GetName().c_str()); return nullptr; } @@ -275,23 +275,23 @@ NodePtr LabelMaker::AddLabelSwitchEnter(const ComputeGraphPtr &graph, const std: GELOGI("LabelSwitchByIndex: Create node %s.", op_desc->GetName().c_str()); if (op_desc->AddInputDesc(desc) != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Add input desc into node:%s(%s) in graph:%s fail when %s", - op_desc->GetName().c_str(), op_desc->GetType().c_str(), graph->GetName().c_str(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Add input desc into node:%s(%s) in graph:%s fail", + op_desc->GetName().c_str(), op_desc->GetType().c_str(), graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "LabelSwitchByIndex: Add input desc failed."); return nullptr; } if (!AttrUtils::SetListInt(op_desc, ATTR_NAME_LABEL_SWITCH_LIST, labels)) { - REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s) when %s", ATTR_NAME_LABEL_SWITCH_LIST.c_str(), - op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s)", ATTR_NAME_LABEL_SWITCH_LIST.c_str(), + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(INTERNAL_ERROR, "LabelSwitchByIndex: Add %s failed.", ATTR_NAME_LABEL_SWITCH_INDEX.c_str()); return nullptr; } NodePtr label_switch = graph->AddNodeFront(op_desc); if (label_switch == nullptr) { - REPORT_CALL_ERROR("E19999", "Add node:%s(%s) to graph:%s ahead fail when %s", - op_desc->GetName().c_str(), op_desc->GetType().c_str(), graph->GetName().c_str(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Add node:%s(%s) to graph:%s ahead fail", + op_desc->GetName().c_str(), op_desc->GetType().c_str(), graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "LabelSwitchByIndex: Add to graph %s failed.", graph->GetName().c_str()); return nullptr; } @@ -318,15 +318,15 @@ NodePtr LabelMaker::AddLabelSwitchLeave(const ComputeGraphPtr &graph, const std: GELOGI("LabelSwitchByIndex: Create node %s.", op_desc->GetName().c_str()); if (op_desc->AddInputDesc(desc) != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Add input desc into node:%s(%s) in graph:%s fail when %s", - op_desc->GetName().c_str(), op_desc->GetType().c_str(), graph->GetName().c_str(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Add input desc into node:%s(%s) in graph:%s fail", + op_desc->GetName().c_str(), op_desc->GetType().c_str(), graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "LabelSwitchByIndex: Add input desc failed."); return nullptr; } if (!AttrUtils::SetListInt(op_desc, ATTR_NAME_LABEL_SWITCH_LIST, labels)) { - REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s) when %s", ATTR_NAME_LABEL_SWITCH_LIST.c_str(), - op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s)", ATTR_NAME_LABEL_SWITCH_LIST.c_str(), + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(INTERNAL_ERROR, "LabelSwitchByIndex: Add %s failed.", ATTR_NAME_LABEL_SWITCH_INDEX.c_str()); return nullptr; } @@ -358,21 +358,21 @@ NodePtr LabelMaker::AddLabelSwitchIndex(const ComputeGraphPtr &graph, const std: GELOGI("Data: Create node %s.", op_desc->GetName().c_str()); if (op_desc->AddInputDesc(desc) != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Add input desc into node:%s(%s) in graph:%s fail when %s", - op_desc->GetName().c_str(), op_desc->GetType().c_str(), graph->GetName().c_str(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Add input desc into node:%s(%s) in graph:%s fail", + op_desc->GetName().c_str(), op_desc->GetType().c_str(), graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "LabelSwitchByIndex: Add data input desc failed."); return nullptr; } if (op_desc->AddOutputDesc(desc) != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Add output desc into node:%s(%s) in graph:%s fail when %s", - op_desc->GetName().c_str(), op_desc->GetType().c_str(), graph->GetName().c_str(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Add output desc into node:%s(%s) in graph:%s fail", + op_desc->GetName().c_str(), op_desc->GetType().c_str(), graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "LabelSwitchByIndex: Add data output desc failed."); return nullptr; } if (!AttrUtils::SetInt(op_desc, ATTR_NAME_PARENT_NODE_INDEX, parent_index)) { - REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s) when %s", ATTR_NAME_PARENT_NODE_INDEX.c_str(), - op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s)", ATTR_NAME_PARENT_NODE_INDEX.c_str(), + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(INTERNAL_ERROR, "LabelSwitchByIndex: Add %s failed.", ATTR_NAME_PARENT_NODE_INDEX.c_str()); return nullptr; } @@ -382,8 +382,8 @@ NodePtr LabelMaker::AddLabelSwitchIndex(const ComputeGraphPtr &graph, const std: // Link control edge to graph head. if (GraphUtils::AddEdge(op_data->GetOutDataAnchor(0), sw_node->GetInDataAnchor(0)) != SUCCESS) { - REPORT_CALL_ERROR("E19999", "Add ctrl edge from %s to %s in graph:%s fail when %s", op_data->GetName().c_str(), - sw_node->GetName().c_str(), graph->GetName().c_str(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Add ctrl edge from %s to %s in graph:%s fail", op_data->GetName().c_str(), + sw_node->GetName().c_str(), graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "LabelSwitchByIndex: Add input edge to %s failed.", op_data->GetName().c_str()); return nullptr; } diff --git a/ge/graph/label/partitioned_call_label_maker.cc b/ge/graph/label/partitioned_call_label_maker.cc index a556e832..d9a89ef2 100644 --- a/ge/graph/label/partitioned_call_label_maker.cc +++ b/ge/graph/label/partitioned_call_label_maker.cc @@ -39,17 +39,17 @@ Status PartitionedCallLabelMaker::Run(uint32_t &label_index) { std::string sub_graph_name = call_desc->GetSubgraphInstanceName(kSubGraphIndex); if (sub_graph_name.empty()) { - REPORT_INNER_ERROR("E19999", "Node:%s(%s) subgraph_index:%d name is empty, check invalid when %s", - call_desc->GetName().c_str(), call_desc->GetType().c_str(), kSubGraphIndex, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Node:%s(%s) subgraph_index:%d name is empty, check invalid", + call_desc->GetName().c_str(), call_desc->GetType().c_str(), kSubGraphIndex); GELOGE(INTERNAL_ERROR, "Node: %s has no subgraph name.", sub_graph_name.c_str()); return FAILED; } ComputeGraphPtr sub_graph = parent_graph_->GetSubgraph(sub_graph_name); if (sub_graph == nullptr) { - REPORT_INNER_ERROR("E19999", "Node:%s(%s) subgraph_name:%s is not exist in parent_graph, check invalid when %s", + REPORT_INNER_ERROR("E19999", "Node:%s(%s) subgraph_name:%s is not exist in parent_graph, check invalid", call_desc->GetName().c_str(), call_desc->GetType().c_str(), - sub_graph_name.c_str(), __FUNCTION__); + sub_graph_name.c_str()); GELOGE(INTERNAL_ERROR, "Node: %s has no subgraph.", sub_graph_name.c_str()); return FAILED; } @@ -57,8 +57,8 @@ Status PartitionedCallLabelMaker::Run(uint32_t &label_index) { const std::string stream_active_name = parent_node_->GetName() + "/StreamActive"; // rtStreamActive NodePtr stream_active = AddStreamActive(sub_graph, stream_active_name); if (stream_active == nullptr) { - REPORT_CALL_ERROR("E19999", "Add StreamActive node in graph:%s fail when %s", - sub_graph->GetName().c_str(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Add StreamActive node in graph:%s fail", + sub_graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "Subgraph: %s add stream active node failed.", sub_graph->GetName().c_str()); return FAILED; } diff --git a/ge/graph/label/while_label_maker.cc b/ge/graph/label/while_label_maker.cc index 06c6d516..22e783e3 100644 --- a/ge/graph/label/while_label_maker.cc +++ b/ge/graph/label/while_label_maker.cc @@ -45,8 +45,8 @@ Status WhileOpLabelMaker::Run(uint32_t &label_index) { std::string body_name = while_desc->GetSubgraphInstanceName(kBodyBranchIndex); if (cond_name.empty() || body_name.empty()) { REPORT_INNER_ERROR("E19999", "Node:%s(%s) cond subgraph index:%d or body subgraph index:%d name is empty, " - "check invalid when %s", while_desc->GetName().c_str(), while_desc->GetType().c_str(), - kCondBranchIndex, kBodyBranchIndex, __FUNCTION__); + "check invalid", while_desc->GetName().c_str(), while_desc->GetType().c_str(), + kCondBranchIndex, kBodyBranchIndex); GELOGE(INTERNAL_ERROR, "Node: %s has invalid subgraph, cond branch: %s, body branch: %s.", while_desc->GetName().c_str(), cond_name.c_str(), body_name.c_str()); return FAILED; @@ -70,44 +70,44 @@ Status WhileOpLabelMaker::Run(uint32_t &label_index) { NodePtr cond_stream_active = AddStreamActive(cond_graph, cond_active_name); if (cond_stream_active == nullptr) { - REPORT_CALL_ERROR("E19999", "Add StreamActive node in graph:%s fail when %s", - cond_graph->GetName().c_str(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Add StreamActive node in graph:%s fail", + cond_graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "Subgraph: %s add stream active failed.", cond_graph->GetName().c_str()); return FAILED; } if (AddLabelSetEnter(cond_graph, cond_enter_name, cond_enter_index, cond_stream_active) == nullptr) { - REPORT_CALL_ERROR("E19999", "Add LabelSetEnter node in graph:%s fail when %s", - cond_graph->GetName().c_str(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Add LabelSetEnter node in graph:%s fail", + cond_graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "Subgraph: %s add label set failed.", cond_graph->GetName().c_str()); return FAILED; } NodePtr body_stream_active = AddStreamActive(body_graph, body_active_name); if (body_stream_active == nullptr) { - REPORT_CALL_ERROR("E19999", "Add StreamActive node in graph:%s fail when %s", - body_graph->GetName().c_str(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Add StreamActive node in graph:%s fail", + body_graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "Subgraph: %s add stream active failed.", body_graph->GetName().c_str()); return FAILED; } if (AddLabelSetEnter(body_graph, body_enter_name, body_enter_index, body_stream_active) == nullptr) { - REPORT_CALL_ERROR("E19999", "Add LabelSetEnter node in graph:%s fail when %s", - body_graph->GetName().c_str(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Add LabelSetEnter node in graph:%s fail", + body_graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "Subgraph: %s add label set failed.", body_graph->GetName().c_str()); return FAILED; } if (AddLabelGotoLeave(body_graph, goto_leave_name, cond_enter_index) == nullptr) { - REPORT_CALL_ERROR("E19999", "Add LabelGotoLeave node in graph:%s fail when %s", - body_graph->GetName().c_str(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Add LabelGotoLeave node in graph:%s fail", + body_graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "Subgraph: %s add label goto failed.", body_graph->GetName().c_str()); return FAILED; } if (AddLabelSetLeave(body_graph, body_leave_name, body_leave_index) == nullptr) { - REPORT_CALL_ERROR("E19999", "Add LabelSetLeave node in graph:%s fail when %s", - body_graph->GetName().c_str(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Add LabelSetLeave node in graph:%s fail", + body_graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "Subgraph: %s add label set failed.", body_graph->GetName().c_str()); return FAILED; } @@ -124,8 +124,8 @@ Status WhileOpLabelMaker::Run(uint32_t &label_index) { const std::vector switch_labels = {body_leave_index, body_enter_index}; NodePtr switch_node = AddLabelSwitchLeave(cond_graph, cond_leave_name, pred_desc, switch_labels); if (switch_node == nullptr) { - REPORT_CALL_ERROR("E19999", "Add LabelSwitchLeave node in graph:%s fail when %s", - cond_graph->GetName().c_str(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Add LabelSwitchLeave node in graph:%s fail", + cond_graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "Subgraph: %s add label switch failed.", cond_graph->GetName().c_str()); return FAILED; } @@ -141,9 +141,9 @@ Status WhileOpLabelMaker::Run(uint32_t &label_index) { InDataAnchorPtr in_anchor = all_in_data.at(kCondOutputIndex); GE_CHECK_NOTNULL(in_anchor); if (GraphUtils::AddEdge(in_anchor->GetPeerOutAnchor(), switch_node->GetInDataAnchor(kCondOutputIndex)) != SUCCESS) { - REPORT_CALL_ERROR("E19999", "Add ctrl edge from %s to %s in graph:%s fail when %s", + REPORT_CALL_ERROR("E19999", "Add ctrl edge from %s to %s in graph:%s fail", in_anchor->GetPeerOutAnchor()->GetOwnerNode()->GetName().c_str(), - switch_node->GetName().c_str(), cond_graph->GetName().c_str(), __FUNCTION__); + switch_node->GetName().c_str(), cond_graph->GetName().c_str()); GELOGE(FAILED, "Node: %s Add pred data input failed.", switch_node->GetName().c_str()); return FAILED; } diff --git a/ge/graph/load/graph_loader.cc b/ge/graph/load/graph_loader.cc index 24995d0c..cf95b271 100755 --- a/ge/graph/load/graph_loader.cc +++ b/ge/graph/load/graph_loader.cc @@ -52,15 +52,14 @@ Status GraphLoader::LoadModelOnline(uint32_t &model_id, const std::shared_ptr 0)) { REPORT_INNER_ERROR("E19999", "Param args_ is not nullptr or args_size_:%u > 0," - "check invalid when CpuTaskModelDequeue %s", args_size_, __FUNCTION__); + "check invalid", args_size_); GELOGE(FAILED, "Task already initialized, size: %u", args_size_); return FAILED; } @@ -60,8 +60,8 @@ Status CpuTaskModelDequeue::Init(uint32_t queue_id, uintptr_t &in_mbuf) { args_size_ = sizeof(MbufQueueInfo) + sizeof(uintptr_t); // sizeof(uintptr_t) for save in_mbuf. rtError_t status = rtMalloc(&args_, args_size_, RT_MEMORY_HBM); if (status != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%u, ret:0x%X, when CpuTaskModelDequeue %s", - args_size_, status, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%u, ret:0x%X", + args_size_, status); GELOGE(RT_FAILED, "Call rt malloc failed, status: 0x%x", status); return RT_ERROR_TO_GE_STATUS(status); } @@ -73,8 +73,8 @@ Status CpuTaskModelDequeue::Init(uint32_t queue_id, uintptr_t &in_mbuf) { queue_info.in_mbuf = in_mbuf; // Placeholder, input mbuf addr will save to this place. status = rtMemcpy(args_, args_size_, &queue_info, sizeof(MbufQueueInfo), RT_MEMCPY_HOST_TO_DEVICE); if (status != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%u, ret:0x%X, when CpuTaskModelDequeue %s", - args_size_, status, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%u, ret:0x%X", + args_size_, status); GELOGE(RT_FAILED, "Call rt memcpy failed, status: 0x%x", status); return RT_ERROR_TO_GE_STATUS(status); } @@ -85,15 +85,15 @@ Status CpuTaskModelDequeue::Init(uint32_t queue_id, uintptr_t &in_mbuf) { Status CpuTaskModelDequeue::Distribute() { if ((args_ == nullptr) || (args_size_ == 0) || (stream_ == nullptr)) { REPORT_INNER_ERROR("E19999", "Param args_ is nullptr or args_size_:%u is 0 or stream_ is nullptr," - "check invalid when CpuTaskModelDequeue %s", args_size_, __FUNCTION__); + "check invalid", args_size_); GELOGE(FAILED, "Task not initialized, distribute failed, size: %u", args_size_); return FAILED; } rtError_t status = rtCpuKernelLaunch(nullptr, kCpuTaskModelDequeue, kCoreDim, args_, args_size_, nullptr, stream_); if (status != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtCpuKernelLaunch failed, ret:0x%X, when CpuTaskModelDequeue %s", - status, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtCpuKernelLaunch failed, ret:0x%X", + status); GELOGE(RT_FAILED, "Call rt CpuKernelLaunch ModelDequeue failed, status: 0x%X", status); return RT_ERROR_TO_GE_STATUS(status); } @@ -112,7 +112,7 @@ Status CpuTaskModelDequeue::Distribute() { Status CpuTaskZeroCopy::Init(std::vector &mbuf_list, const map &outside_addrs) { if ((args_ != nullptr) || (args_size_ > 0)) { REPORT_INNER_ERROR("E19999", "Param args_ is not nullptr or args_size_:%u > 0," - "check invalid when CpuTaskZeroCopy %s", args_size_, __FUNCTION__); + "check invalid", args_size_); GELOGE(FAILED, "Task already initialized, size: %u", args_size_); return FAILED; } @@ -168,15 +168,15 @@ Status CpuTaskZeroCopy::Init(std::vector &mbuf_list, const map 0)) { REPORT_INNER_ERROR("E19999", "Param args_ is not nullptr or args_size_:%u > 0," - "check invalid when CpuTaskPrepareOutput %s", args_size_, __FUNCTION__); + "check invalid", args_size_); GELOGE(FAILED, "Task already initialized, size: %u", args_size_); return FAILED; } @@ -224,8 +224,8 @@ Status CpuTaskPrepareOutput::Init(uintptr_t addr, uint32_t size, uintptr_t in_mb args_size_ = sizeof(PrepareOutputInfo) + sizeof(uintptr_t); // sizeof(uintptr_t) for save out_mbuf. rtError_t status = rtMalloc(&args_, args_size_, RT_MEMORY_HBM); if (status != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%u, ret:0x%X, when CpuTaskPrepareOutput %s", - args_size_, status, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%u, ret:0x%X", + args_size_, status); GELOGE(RT_FAILED, "Call rt malloc failed, status: 0x%x", status); return RT_ERROR_TO_GE_STATUS(status); } @@ -240,8 +240,8 @@ Status CpuTaskPrepareOutput::Init(uintptr_t addr, uint32_t size, uintptr_t in_mb prepare.out_mbuf = out_mbuf; // Placeholder, output mbuf addr will save to this place. status = rtMemcpy(args_, args_size_, &prepare, sizeof(PrepareOutputInfo), RT_MEMCPY_HOST_TO_DEVICE); if (status != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%u, ret:0x%X, when CpuTaskPrepareOutput %s", - args_size_, status, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%u, ret:0x%X", + args_size_, status); GELOGE(RT_FAILED, "Call rt memcpy failed, status: 0x%x", status); return RT_ERROR_TO_GE_STATUS(status); } @@ -252,15 +252,15 @@ Status CpuTaskPrepareOutput::Init(uintptr_t addr, uint32_t size, uintptr_t in_mb Status CpuTaskPrepareOutput::Distribute() { if ((args_ == nullptr) || (args_size_ == 0) || (stream_ == nullptr)) { REPORT_INNER_ERROR("E19999", "Param args_ is nullptr or args_size_:%u is 0 or stream_ is nullptr," - "check invalid when CpuTaskPrepareOutput %s", args_size_, __FUNCTION__); + "check invalid", args_size_); GELOGE(FAILED, "Task not initialized, distribute failed, size: %u", args_size_); return FAILED; } rtError_t status = rtCpuKernelLaunch(nullptr, kCpuTaskPrepareOutput, kCoreDim, args_, args_size_, nullptr, stream_); if (status != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtCpuKernelLaunch failed, ret:0x%X, when CpuTaskPrepareOutput %s", - status, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtCpuKernelLaunch failed, ret:0x%X", + status); GELOGE(RT_FAILED, "Call rt CpuKernelLaunch PrepareOutput failed, status: 0x%X", status); return RT_ERROR_TO_GE_STATUS(status); } @@ -279,7 +279,7 @@ Status CpuTaskPrepareOutput::Distribute() { Status CpuTaskModelEnqueue::Init(uint32_t queue_id, uintptr_t out_mbuf) { if ((args_ != nullptr) || (args_size_ > 0)) { REPORT_INNER_ERROR("E19999", "Param args_ is not nullptr or args_size_:%u > 0," - "check invalid when CpuTaskModelEnqueue %s", args_size_, __FUNCTION__); + "check invalid", args_size_); GELOGE(FAILED, "Task already initialized, size: %u", args_size_); return FAILED; } @@ -288,8 +288,8 @@ Status CpuTaskModelEnqueue::Init(uint32_t queue_id, uintptr_t out_mbuf) { args_size_ = sizeof(MbufQueueInfo); rtError_t status = rtMalloc(&args_, args_size_, RT_MEMORY_HBM); if (status != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%u, ret:0x%X, when CpuTaskModelEnqueue %s", - args_size_, status, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%u, ret:0x%X", + args_size_, status); GELOGE(RT_FAILED, "Call rt malloc failed, status: 0x%x", status); return RT_ERROR_TO_GE_STATUS(status); } @@ -300,8 +300,8 @@ Status CpuTaskModelEnqueue::Init(uint32_t queue_id, uintptr_t out_mbuf) { queue_info.in_mbuf = out_mbuf; status = rtMemcpy(args_, args_size_, &queue_info, args_size_, RT_MEMCPY_HOST_TO_DEVICE); if (status != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%u, ret:0x%X, when CpuTaskModelEnqueue %s", - args_size_, status, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%u, ret:0x%X", + args_size_, status); GELOGE(RT_FAILED, "Call rt memcpy failed, status: 0x%x", status); return RT_ERROR_TO_GE_STATUS(status); } @@ -312,15 +312,15 @@ Status CpuTaskModelEnqueue::Init(uint32_t queue_id, uintptr_t out_mbuf) { Status CpuTaskModelEnqueue::Distribute() { if ((args_ == nullptr) || (args_size_ == 0) || (stream_ == nullptr)) { REPORT_INNER_ERROR("E19999", "Param args_ is nullptr or args_size_ is 0 or stream_ is nullptr, arg_size:%u," - "check invalid when CpuTaskModelEnqueue %s", args_size_, __FUNCTION__); + "check invalid", args_size_); GELOGE(FAILED, "Task not initialized, distribute failed, size: %u", args_size_); return FAILED; } rtError_t status = rtCpuKernelLaunch(nullptr, kCpuTaskModelEnqueue, kCoreDim, args_, args_size_, nullptr, stream_); if (status != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtCpuKernelLaunch failed, ret:0x%X, when CpuTaskModelEnqueue %s", - status, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtCpuKernelLaunch failed, ret:0x%X", + status); GELOGE(RT_FAILED, "Call rt CpuKernelLaunch ModelEnqueue failed, status: 0x%X", status); return RT_ERROR_TO_GE_STATUS(status); } @@ -337,7 +337,7 @@ Status CpuTaskModelEnqueue::Distribute() { /// Status CpuTaskActiveEntry::Init(rtStream_t stream) { if (stream == nullptr) { - REPORT_INNER_ERROR("E19999", "Param stream is nullptr, check invalid when CpuTaskActiveEntry %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Param stream is nullptr, check invalid"); GELOGE(FAILED, "Task active stream not valid"); return FAILED; } @@ -349,15 +349,15 @@ Status CpuTaskActiveEntry::Init(rtStream_t stream) { Status CpuTaskActiveEntry::Distribute() { if ((active_stream_ == nullptr) || (stream_ == nullptr)) { REPORT_INNER_ERROR("E19999", "Param stream is nullptr or active_stream_ is nullptr, " - "check invalid when CpuTaskActiveEntry %s", __FUNCTION__); + "check invalid"); GELOGE(FAILED, "Task not initialized, distribute failed, size: %u", args_size_); return FAILED; } rtError_t ret = rtStreamActive(active_stream_, stream_); if (ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtStreamActive failed, ret:0x%X, when CpuTaskActiveEntry %s", - ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtStreamActive failed, ret:0x%X", + ret); GELOGE(RT_FAILED, "Call rt StreamActive failed, ret: 0x%X", ret); return RT_ERROR_TO_GE_STATUS(ret); } @@ -375,7 +375,7 @@ Status CpuTaskActiveEntry::Distribute() { Status CpuTaskWaitEndGraph::Init(uint32_t model_id) { if ((args_ != nullptr) || (args_size_ > 0)) { REPORT_INNER_ERROR("E19999", "Param args_ is not nullptr or args_size_:%u > 0," - "check invalid when CpuTaskWaitEndGraph %s", args_size_, __FUNCTION__); + "check invalid", args_size_); GELOGE(FAILED, "Task already initialized, size: %u", args_size_); return FAILED; } @@ -383,8 +383,8 @@ Status CpuTaskWaitEndGraph::Init(uint32_t model_id) { args_size_ = sizeof(model_id); rtError_t status = rtMalloc(&args_, args_size_, RT_MEMORY_HBM); if (status != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%u, ret:0x%X, when CpuTaskWaitEndGraph %s", - args_size_, status, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%u, ret:0x%X", + args_size_, status); GELOGE(RT_FAILED, "Call rt malloc failed, status: 0x%x", status); return RT_ERROR_TO_GE_STATUS(status); } @@ -392,8 +392,8 @@ Status CpuTaskWaitEndGraph::Init(uint32_t model_id) { status = rtMemcpy(args_, args_size_, &model_id, args_size_, RT_MEMCPY_HOST_TO_DEVICE); if (status != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%u, ret:0x%X, when CpuTaskWaitEndGraph %s", - args_size_, status, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%u, ret:0x%X", + args_size_, status); GELOGE(RT_FAILED, "Call rt memcpy failed, status: 0x%x", status); return RT_ERROR_TO_GE_STATUS(status); } @@ -404,15 +404,15 @@ Status CpuTaskWaitEndGraph::Init(uint32_t model_id) { Status CpuTaskWaitEndGraph::Distribute() { if ((args_ == nullptr) || (args_size_ == 0) || (stream_ == nullptr)) { REPORT_INNER_ERROR("E19999", "Param args_ is nullptr or args_size_:%u is 0 or stream_ is nullptr," - "check invalid when CpuTaskWaitEndGraph %s", args_size_, __FUNCTION__); + "check invalid", args_size_); GELOGE(FAILED, "Task not initialized, distribute failed, size: %u", args_size_); return FAILED; } rtError_t status = rtCpuKernelLaunch(nullptr, kCpuTaskWaitEndGraph, kCoreDim, args_, args_size_, nullptr, stream_); if (status != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtCpuKernelLaunch failed, ret:0x%X, when CpuTaskWaitEndGraph %s", - status, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtCpuKernelLaunch failed, ret:0x%X", + status); GELOGE(RT_FAILED, "Call rt CpuKernelLaunch WaitEndGraph failed, status: 0x%X", status); return RT_ERROR_TO_GE_STATUS(status); } @@ -430,7 +430,7 @@ Status CpuTaskWaitEndGraph::Distribute() { Status CpuTaskModelRepeat::Init(uint32_t model_id) { if ((args_ != nullptr) || (args_size_ > 0)) { REPORT_INNER_ERROR("E19999", "Param args_ is not nullptr or args_size_:%u > 0," - "check invalid when CpuTaskModelRepeat %s", args_size_, __FUNCTION__); + "check invalid", args_size_); GELOGE(FAILED, "Task already initialized, size: %u", args_size_); return FAILED; } @@ -438,8 +438,8 @@ Status CpuTaskModelRepeat::Init(uint32_t model_id) { args_size_ = sizeof(model_id); rtError_t status = rtMalloc(&args_, args_size_, RT_MEMORY_HBM); if (status != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%u, ret:0x%X, when CpuTaskModelRepeat %s", - args_size_, status, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%u, ret:0x%X", + args_size_, status); GELOGE(RT_FAILED, "Call rt malloc failed, status: 0x%x", status); return RT_ERROR_TO_GE_STATUS(status); } @@ -447,8 +447,8 @@ Status CpuTaskModelRepeat::Init(uint32_t model_id) { status = rtMemcpy(args_, args_size_, &model_id, args_size_, RT_MEMCPY_HOST_TO_DEVICE); if (status != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%u, ret:0x%X, when CpuTaskModelRepeat %s", - args_size_, status, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%u, ret:0x%X", + args_size_, status); GELOGE(RT_FAILED, "Call rt memcpy failed, status: 0x%x", status); return RT_ERROR_TO_GE_STATUS(status); } @@ -459,15 +459,15 @@ Status CpuTaskModelRepeat::Init(uint32_t model_id) { Status CpuTaskModelRepeat::Distribute() { if ((args_ == nullptr) || (args_size_ == 0) || (stream_ == nullptr)) { REPORT_INNER_ERROR("E19999", "Param args_ is nullptr or args_size_:%u is 0 or stream_ is nullptr," - "check invalid when CpuTaskModelRepeat %s", args_size_, __FUNCTION__); + "check invalid", args_size_); GELOGE(FAILED, "Task not initialized, distribute failed, size: %u", args_size_); return FAILED; } rtError_t status = rtCpuKernelLaunch(nullptr, kCpuTaskModelRepeat, kCoreDim, args_, args_size_, nullptr, stream_); if (status != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtCpuKernelLaunch failed, ret:0x%X, when CpuTaskModelRepeat %s", - status, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtCpuKernelLaunch failed, ret:0x%X", + status); GELOGE(RT_FAILED, "Call rt CpuKernelLaunch ModelRepeat failed, status: 0x%x", status); return RT_ERROR_TO_GE_STATUS(status); } diff --git a/ge/graph/load/model_manager/data_dumper.cc b/ge/graph/load/model_manager/data_dumper.cc index 0a84b8f2..29b64268 100644 --- a/ge/graph/load/model_manager/data_dumper.cc +++ b/ge/graph/load/model_manager/data_dumper.cc @@ -325,7 +325,7 @@ Status DataDumper::GenerateOutput(aicpu::dump::Output &output, const OpDesc::Vis } int64_t output_size = 0; if (TensorUtils::GetTensorSizeInBytes(tensor_descs.at(index), output_size) != SUCCESS) { - REPORT_CALL_ERROR("E19999", "Get tensor size fail when DataDumper %s", __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Get tensor size fail"); GELOGE(PARAM_INVALID, "Get output size filed"); return PARAM_INVALID; } @@ -388,9 +388,9 @@ Status DataDumper::DumpOutputWithTask(const InnerDumpInfo &inner_dump_info, aicp const auto &output_descs = inner_dump_info.op->GetAllOutputsDesc(); const std::vector output_addrs = ModelUtils::GetOutputDataAddrs(*runtime_param_, inner_dump_info.op); if (output_descs.size() != output_addrs.size()) { - REPORT_INNER_ERROR("E19999", "output_desc size:%zu != output addr size:%zu in op:%s(%s) when DataDumper %s", + REPORT_INNER_ERROR("E19999", "output_desc size:%zu != output addr size:%zu in op:%s(%s)", output_descs.size(), output_addrs.size(), - inner_dump_info.op->GetName().c_str(), inner_dump_info.op->GetType().c_str(), __FUNCTION__); + inner_dump_info.op->GetName().c_str(), inner_dump_info.op->GetType().c_str()); GELOGE(PARAM_INVALID, "Invalid output desc addrs size %zu, op %s has %zu output desc.", output_addrs.size(), inner_dump_info.op->GetName().c_str(), output_descs.size()); return PARAM_INVALID; @@ -415,9 +415,8 @@ Status DataDumper::DumpOutputWithTask(const InnerDumpInfo &inner_dump_info, aicp GELOGI("[L1Fusion] DumpOutputWithTask[%s] output[%zu] is l1 addr.", inner_dump_info.op->GetName().c_str(), i); int64_t output_size = 0; if (TensorUtils::GetTensorSizeInBytes(output_descs.at(i), output_size) != SUCCESS) { - REPORT_CALL_ERROR("E19999", "Get output tensor size fail in op:%s(%s), index:%zu, when DataDumper %s", - inner_dump_info.op->GetName().c_str(), inner_dump_info.op->GetType().c_str(), i, - __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Get output tensor size fail in op:%s(%s), index:%zu", + inner_dump_info.op->GetName().c_str(), inner_dump_info.op->GetType().c_str(), i); GELOGE(PARAM_INVALID, "Get output size failed."); return PARAM_INVALID; } @@ -446,9 +445,9 @@ Status DataDumper::DumpOutput(const InnerDumpInfo &inner_dump_info, aicpu::dump: const std::vector output_addrs = ModelUtils::GetOutputDataAddrs(*runtime_param_, inner_dump_info.op); if (output_tensor == nullptr) { REPORT_INNER_ERROR("E19999", "output_desc tensor is nullptr in op:%s(%s), index:%u, " - "check invalid when DataDumper %s", + "check invalid", inner_dump_info.op->GetName().c_str(), inner_dump_info.op->GetType().c_str(), - inner_dump_info.output_anchor_index, __FUNCTION__); + inner_dump_info.output_anchor_index); GELOGE(PARAM_INVALID, "output_tensor is null, index: %d, size: %zu.", inner_dump_info.output_anchor_index, inner_dump_info.op->GetOutputsSize()); return PARAM_INVALID; @@ -473,8 +472,8 @@ Status DataDumper::DumpOutput(const InnerDumpInfo &inner_dump_info, aicpu::dump: // due to lhisi virtual addr bug, cannot use args now if (inner_dump_info.output_anchor_index >= static_cast(output_addrs.size())) { REPORT_INNER_ERROR("E19999", "output_anchor_index:%u >= output addr size:%zu in op:%s(%s), " - "check invalid when DataDumper %s", inner_dump_info.output_anchor_index, output_addrs.size(), - inner_dump_info.op->GetName().c_str(), inner_dump_info.op->GetType().c_str(), __FUNCTION__); + "check invalid", inner_dump_info.output_anchor_index, output_addrs.size(), + inner_dump_info.op->GetName().c_str(), inner_dump_info.op->GetType().c_str()); GELOGE(FAILED, "Index is out of range."); return FAILED; } @@ -501,7 +500,7 @@ Status DataDumper::GenerateInput(aicpu::dump::Input &input, const OpDesc::Vistor if (AttrUtils::GetInt(tensor_descs.at(index), ATTR_NAME_INPUT_ORIGIN_SIZE, input_size)) { GELOGI("Get aipp input size according to attr is %ld", input_size); } else if (TensorUtils::GetTensorSizeInBytes(tensor_descs.at(index), input_size) != SUCCESS) { - REPORT_CALL_ERROR("E19999", "Get tensor size fail when DataDumper %s", __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Get tensor size fail"); GELOGE(PARAM_INVALID, "Get input size filed"); return PARAM_INVALID; } @@ -557,9 +556,9 @@ Status DataDumper::DumpInput(const InnerDumpInfo &inner_dump_info, aicpu::dump:: const auto &input_descs = inner_dump_info.op->GetAllInputsDesc(); const std::vector input_addrs = ModelUtils::GetInputDataAddrs(*runtime_param_, inner_dump_info.op); if (input_descs.size() != input_addrs.size()) { - REPORT_INNER_ERROR("E19999", "input_desc size:%zu != input addr size:%zu in op:%s(%s) when DataDumper %s", + REPORT_INNER_ERROR("E19999", "input_desc size:%zu != input addr size:%zu in op:%s(%s)", input_descs.size(), input_addrs.size(), - inner_dump_info.op->GetName().c_str(), inner_dump_info.op->GetType().c_str(), __FUNCTION__); + inner_dump_info.op->GetName().c_str(), inner_dump_info.op->GetType().c_str()); GELOGE(PARAM_INVALID, "Invalid input desc addrs size %zu, op %s has %zu input desc.", input_addrs.size(), inner_dump_info.op->GetName().c_str(), input_descs.size()); return PARAM_INVALID; @@ -585,9 +584,8 @@ Status DataDumper::DumpInput(const InnerDumpInfo &inner_dump_info, aicpu::dump:: if (AttrUtils::GetInt(input_descs.at(i), ATTR_NAME_INPUT_ORIGIN_SIZE, input_size)) { GELOGI("Get aipp input size according to attr is %ld", input_size); } else if (TensorUtils::GetTensorSizeInBytes(input_descs.at(i), input_size) != SUCCESS) { - REPORT_CALL_ERROR("E19999", "Get input tensor size fail in op:%s(%s), index:%zu, when DataDumper %s", - inner_dump_info.op->GetName().c_str(), inner_dump_info.op->GetType().c_str(), i, - __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Get input tensor size fail in op:%s(%s), index:%zu", + inner_dump_info.op->GetName().c_str(), inner_dump_info.op->GetType().c_str(), i); GELOGE(PARAM_INVALID, "Get input size failed."); return PARAM_INVALID; } @@ -616,7 +614,7 @@ Status DataDumper::ExecuteLoadDumpInfo(aicpu::dump::OpMappingInfo &op_mapping_in size_t proto_size = op_mapping_info.ByteSizeLong(); bool ret = op_mapping_info.SerializeToString(&proto_str); if (!ret || proto_size == 0) { - REPORT_INNER_ERROR("E19999", "Serialize proto to string fail when DataDumper %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Serialize proto to string fail"); GELOGE(PARAM_INVALID, "Protobuf SerializeToString failed, proto size %zu.", proto_size); return PARAM_INVALID; } @@ -628,8 +626,8 @@ Status DataDumper::ExecuteLoadDumpInfo(aicpu::dump::OpMappingInfo &op_mapping_in rtError_t rt_ret = rtMalloc(&dev_mem_load_, proto_size, RT_MEMORY_HBM); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%zu, ret:0x%X, when DataDumper %s", - proto_size, rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%zu, ret:0x%X", + proto_size, rt_ret); GELOGE(RT_FAILED, "Call rtMalloc failed, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } @@ -637,15 +635,15 @@ Status DataDumper::ExecuteLoadDumpInfo(aicpu::dump::OpMappingInfo &op_mapping_in rt_ret = rtMemcpy(dev_mem_load_, proto_size, proto_str.c_str(), proto_size, RT_MEMCPY_HOST_TO_DEVICE); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret:0x%X, when DataDumper %s", - proto_size, rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret:0x%X", + proto_size, rt_ret); GELOGE(RT_FAILED, "Call rtMemcpy failed, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } rt_ret = rtDatadumpInfoLoad(dev_mem_load_, proto_size); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtDatadumpInfoLoad failed, ret:0x%X, when DataDumper %s", rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtDatadumpInfoLoad failed, ret:0x%X", rt_ret); GELOGE(RT_FAILED, "Call rtDatadumpInfoLoad failed, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } @@ -660,7 +658,7 @@ Status DataDumper::ExecuteUnLoadDumpInfo(aicpu::dump::OpMappingInfo &op_mapping_ size_t proto_size = op_mapping_info.ByteSizeLong(); bool ret = op_mapping_info.SerializeToString(&proto_str); if (!ret || proto_size == 0) { - REPORT_INNER_ERROR("E19999", "Serialize proto to string fail when DataDumper %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Serialize proto to string fail"); GELOGE(PARAM_INVALID, "Protobuf SerializeToString failed, proto size %zu.", proto_size); return PARAM_INVALID; } @@ -672,8 +670,8 @@ Status DataDumper::ExecuteUnLoadDumpInfo(aicpu::dump::OpMappingInfo &op_mapping_ rtError_t rt_ret = rtMalloc(&dev_mem_unload_, proto_size, RT_MEMORY_HBM); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%zu, ret:0x%X, when DataDumper %s", - proto_size, rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%zu, ret:0x%X", + proto_size, rt_ret); GELOGE(RT_FAILED, "Call rtMalloc failed, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } @@ -681,15 +679,15 @@ Status DataDumper::ExecuteUnLoadDumpInfo(aicpu::dump::OpMappingInfo &op_mapping_ rt_ret = rtMemcpy(dev_mem_unload_, proto_size, proto_str.c_str(), proto_size, RT_MEMCPY_HOST_TO_DEVICE); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret:0x%X, when DataDumper %s", - proto_size, rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret:0x%X", + proto_size, rt_ret); GELOGE(RT_FAILED, "Call rtMemcpy failed, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } rt_ret = rtDatadumpInfoLoad(dev_mem_unload_, proto_size); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtDatadumpInfoLoad failed, ret:0x%X, when DataDumper %s", rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtDatadumpInfoLoad failed, ret:0x%X", rt_ret); GELOGE(RT_FAILED, "Call rtDatadumpInfoLoad failed, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } @@ -974,7 +972,7 @@ Status DataDumper::DumpExceptionInfo(const std::vector exceptio std::unique_ptr proto_msg(new (std::nothrow) char[proto_size]); bool ret = dump_data.SerializeToArray(proto_msg.get(), proto_size); if (!ret || proto_size == 0) { - REPORT_INNER_ERROR("E19999", "Serialize proto to string fail when DataDumper %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Serialize proto to string fail"); GELOGE(PARAM_INVALID, "Dump data proto serialize failed"); return PARAM_INVALID; } diff --git a/ge/graph/load/model_manager/davinci_model.cc b/ge/graph/load/model_manager/davinci_model.cc index 9bc09508..78f4a64c 100755 --- a/ge/graph/load/model_manager/davinci_model.cc +++ b/ge/graph/load/model_manager/davinci_model.cc @@ -68,8 +68,8 @@ try { \ thread_id = std::thread(func, args); \ } catch (const std::system_error &e) { \ - REPORT_CALL_ERROR("E19999", "Create thread fail, ecode:%d, emsg:%s, when DavinciModel %s", \ - e.code().value(), e.what(), __FUNCTION__); \ + REPORT_CALL_ERROR("E19999", "Create thread fail, ecode:%d, emsg:%s", \ + e.code().value(), e.what()); \ GELOGE(FAILED, "Caught system_error with code:%d, meaning:%s", e.code().value(), e.what()); \ GELOGE(FAILED, "Thread creat FAIL, Please check the left resource!"); \ return FAILED; \ @@ -332,8 +332,8 @@ void DavinciModel::Shrink() { Status DavinciModel::InitWeightMem(void *dev_ptr, void *weight_ptr, size_t weight_size) { if (is_weight_mem_has_inited_) { - REPORT_INNER_ERROR("E19999", "Call InitWeightMem more than once, model_id:%u, check invalid when %s", - model_id_, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Call InitWeightMem more than once, model_id:%u, check invalid", + model_id_); GELOGE(FAILED, "call InitWeightMem more than once."); return FAILED; } @@ -345,7 +345,7 @@ Status DavinciModel::InitWeightMem(void *dev_ptr, void *weight_ptr, size_t weigh if ((weight_ptr != nullptr) && (weight_size < weights_size)) { REPORT_INNER_ERROR("E19999", "Param weight_ptr is nullptr or ge_model.weight.size:%zu < param weights_size:%zu, " - "model_id:%u, check invalid when %s", weight_size, weights_size, model_id_, __FUNCTION__); + "model_id:%u, check invalid", weight_size, weights_size, model_id_); GELOGE(FAILED, "Invalid mem param: weight_size=%zu totalsize=%zu.", weight_size, weights_size); return FAILED; } @@ -359,8 +359,8 @@ Status DavinciModel::InitWeightMem(void *dev_ptr, void *weight_ptr, size_t weigh if (weight_ptr == nullptr) { weights_mem_base_ = MallocWeightsMem(weights_size); if (weights_mem_base_ == nullptr) { - REPORT_CALL_ERROR("E19999", "MallocWeightsMem fail, weights_size:%zu, model_id:%u, check invalid when %s", - weights_size, model_id_, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "MallocWeightsMem fail, weights_size:%zu, model_id:%u, check invalid", + weights_size, model_id_); GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "Alloc weight memory failed. size: %zu", weights_size); return ACL_ERROR_GE_MEMORY_ALLOCATION; } @@ -379,8 +379,8 @@ Status DavinciModel::InitWeightMem(void *dev_ptr, void *weight_ptr, size_t weigh Status DavinciModel::InitFeatureMapAndP2PMem(void *dev_ptr, size_t mem_size) { if (is_feature_map_mem_has_inited_) { - REPORT_INNER_ERROR("E19999", "Call InitFeatureMapMem more than once, model_id:%u, check invalid when %s", - model_id_, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Call InitFeatureMapMem more than once, model_id:%u, check invalid", + model_id_); GELOGE(PARAM_INVALID, "call InitFeatureMapMem more than once"); return PARAM_INVALID; } @@ -391,7 +391,7 @@ Status DavinciModel::InitFeatureMapAndP2PMem(void *dev_ptr, size_t mem_size) { if ((dev_ptr != nullptr) && (mem_size < TotalMemSize())) { REPORT_INNER_ERROR("E19999", "Param dev_ptr is nullptr or mem_size:%zu < ge_model.mem_size:%zu, " - "model_id:%u, check invalid when %s", mem_size, TotalMemSize(), model_id_, __FUNCTION__); + "model_id:%u, check invalid", mem_size, TotalMemSize(), model_id_); GELOGE(PARAM_INVALID, "Invalid mem param: mem_size=%zu totalsize=%zu.", mem_size, TotalMemSize()); return PARAM_INVALID; } @@ -403,8 +403,8 @@ Status DavinciModel::InitFeatureMapAndP2PMem(void *dev_ptr, size_t mem_size) { if (TotalMemSize() && mem_base_ == nullptr) { mem_base_ = MallocFeatureMapMem(data_size); if (mem_base_ == nullptr) { - REPORT_CALL_ERROR("E19999", "MallocFeatureMapMem fail, data_size:%zu, model_id:%u, check invalid when %s", - data_size, model_id_, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "MallocFeatureMapMem fail, data_size:%zu, model_id:%u, check invalid", + data_size, model_id_); GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "Alloc feature map memory failed. size: %zu", data_size); return ACL_ERROR_GE_MEMORY_ALLOCATION; } @@ -421,8 +421,8 @@ Status DavinciModel::InitFeatureMapAndP2PMem(void *dev_ptr, size_t mem_size) { if (p2p_data_size != 0) { p2p_mem_base_ = MallocP2PMem(p2p_data_size); if (p2p_mem_base_ == nullptr) { - REPORT_CALL_ERROR("E19999", "MallocFeatureMapMem fail, p2p_data_size:%zu, model_id:%u, check invalid when %s", - p2p_data_size, model_id_, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "MallocFeatureMapMem fail, p2p_data_size:%zu, model_id:%u, check invalid", + p2p_data_size, model_id_); GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "Alloc p2p memory failed,size: %zu", p2p_data_size); return ACL_ERROR_GE_MEMORY_ALLOCATION; } @@ -444,8 +444,8 @@ Status DavinciModel::InitVariableMem() { if (TotalVarMemSize() && (var_mem_base_ == nullptr)) { Status ret = VarManager::Instance(session_id_)->MallocVarMemory(TotalVarMemSize()); if (ret != SUCCESS) { - REPORT_CALL_ERROR("E19999", "MallocVarMemory fail, var_size:%zu, model_id:%u, check invalid when %s", - TotalVarMemSize(), model_id_, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "MallocVarMemory fail, var_size:%zu, model_id:%u, check invalid", + TotalVarMemSize(), model_id_); GELOGE(ret, "Malloc variable memory failed."); return ret; } @@ -586,8 +586,8 @@ Status DavinciModel::SetTSDevice() { GELOGD("SetTSDevice: %u.", core_type); rtError_t rt_ret = rtSetTSDevice(core_type); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtSetTSDevice failed, core_type:%u, model_id:%u, when DavinciModel %s", - core_type, model_id_, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtSetTSDevice failed, core_type:%u, model_id:%u", + core_type, model_id_); GELOGE(RT_FAILED, "SetTSDevice failed, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } @@ -910,8 +910,8 @@ Status DavinciModel::InitNodes(const ComputeGraphPtr &compute_graph) { rtError_t rt_ret = rtMemcpy(addr, size, tensor_device_addrs.data(), size, RT_MEMCPY_HOST_TO_DEVICE); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret: 0x%X when DavinciModel %s", - size, rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret: 0x%X", + size, rt_ret); GELOGE(RT_FAILED, "rtMemcpy error, ret: 0x%X", rt_ret); GE_CHK_RT(rtFree(addr)); return RT_ERROR_TO_GE_STATUS(rt_ret); @@ -989,9 +989,9 @@ Status DavinciModel::InitDataOp(const ComputeGraphPtr &graph, const NodePtr &nod (output_offset_list.size() != virtual_addr_list.size())) { REPORT_INNER_ERROR( "E19999", "Check data fail in op:%s(%s), output_desc size:%zu output addr size:%zu output offset size:%zu " - "not equal or has empty, model_id:%u, when DavinciModel %s", + "not equal or has empty, model_id:%u", op_desc->GetName().c_str(), op_desc->GetType().c_str(), - output_size_list.size(), virtual_addr_list.size(), output_offset_list.size(), model_id_, __FUNCTION__); + output_size_list.size(), virtual_addr_list.size(), output_offset_list.size(), model_id_); GELOGE(PARAM_INVALID, "Data[%s] init failed: output size is %zu, virtual_addr size is %zu, offset size is %zu.", op_desc->GetName().c_str(), output_size_list.size(), virtual_addr_list.size(), output_offset_list.size()); return PARAM_INVALID; @@ -1111,9 +1111,9 @@ Status DavinciModel::InitNetOutput(const ComputeGraphPtr &graph, const NodePtr & GE_IF_BOOL_EXEC(input_offset_list.size() != virtual_addr_list.size(), REPORT_INNER_ERROR( "E19999", "Check data fail in op:%s(%s), input addr size:%zu input offset size:%zu " - "not equal, model_id:%u, when DavinciModel %s", + "not equal, model_id:%u", op_desc->GetName().c_str(), op_desc->GetType().c_str(), - virtual_addr_list.size(), input_offset_list.size(), model_id_, __FUNCTION__); + virtual_addr_list.size(), input_offset_list.size(), model_id_); GELOGE(PARAM_INVALID, "virtual_addr size should be equal to offset size."); return PARAM_INVALID;); if (input_size_list.empty() && virtual_addr_list.empty()) { @@ -1123,8 +1123,8 @@ Status DavinciModel::InitNetOutput(const ComputeGraphPtr &graph, const NodePtr & if (input_size_list.empty() || input_size_list.size() != virtual_addr_list.size()) { REPORT_INNER_ERROR( "E19999", "Check data fail in op:%s(%s), input_desc size:%zu input addr size:%zu not equal or has empty, " - "model_id:%u, when DavinciModel %s", op_desc->GetName().c_str(), op_desc->GetType().c_str(), - input_size_list.size(), virtual_addr_list.size(), model_id_, __FUNCTION__); + "model_id:%u", op_desc->GetName().c_str(), op_desc->GetType().c_str(), + input_size_list.size(), virtual_addr_list.size(), model_id_); GELOGE(PARAM_INVALID, "NetOutput[%s] init failed: Input size is %zu, Input addr is %zu", op_desc->GetName().c_str(), input_size_list.size(), virtual_addr_list.size()); return PARAM_INVALID; @@ -1222,9 +1222,9 @@ Status DavinciModel::GetGetDynamicDimsNodeInfo(const NodePtr &node) { auto in_anchor = node->GetAllInDataAnchors().at(get_dynamic_dims_index); auto peer_out_anchor = in_anchor->GetPeerOutAnchor(); if (peer_out_anchor == nullptr) { - REPORT_INNER_ERROR("E19999", "In anchor index:%zu in op:%s(%s) peer anchor is nullptr, model_id:%u, check invalid " - "when DavinciModel %s", get_dynamic_dims_index, - node->GetName().c_str(), node->GetType().c_str(), model_id_, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "In anchor index:%zu in op:%s(%s) peer anchor is nullptr, model_id:%u, check invalid", + get_dynamic_dims_index, + node->GetName().c_str(), node->GetType().c_str(), model_id_); GELOGE(PARAM_INVALID, "Out anchor of getdynmaicdims node should not be nullptr."); return PARAM_INVALID; } @@ -1237,17 +1237,17 @@ Status DavinciModel::GetGetDynamicDimsNodeInfo(const NodePtr &node) { auto input_size = ModelUtils::GetInputSize(node->GetOpDesc()); if (input_addr.empty() || input_size.empty()) { REPORT_INNER_ERROR("E19999", "input_addr size:%zu or input_length size:%zu in op:%s(%s) has empty, model_id:%u " - "check invalid when DavinciModel %s", input_addr.size(), input_size.size(), - node->GetName().c_str(), node->GetType().c_str(), model_id_, __FUNCTION__); + "check invalid", input_addr.size(), input_size.size(), + node->GetName().c_str(), node->GetType().c_str(), model_id_); GELOGE(PARAM_INVALID, "Not set output of %s", op_desc->GetName().c_str()); return PARAM_INVALID; } auto input_desc = node->GetOpDesc()->GetInputDescPtr(get_dynamic_dims_index); GE_CHECK_NOTNULL(input_desc); if (input_desc->GetShape().GetDims().empty()) { - REPORT_INNER_ERROR("E19999", "input_desc_index:%zu in op:%s(%s) shape dim is empty, model_id:%u, check invalid " - "when DavinciModel %s", get_dynamic_dims_index, - node->GetName().c_str(), node->GetType().c_str(), model_id_, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "input_desc_index:%zu in op:%s(%s) shape dim is empty, model_id:%u, check invalid", + get_dynamic_dims_index, + node->GetName().c_str(), node->GetType().c_str(), model_id_); GELOGE(PARAM_INVALID, "Not set output desc shape of %s.", op_desc->GetName().c_str()); return PARAM_INVALID; } @@ -1292,8 +1292,8 @@ Status DavinciModel::GetRealOutputSizeOfCase(const ComputeGraphPtr &graph, size_ for (const auto &name : func_desc->GetSubgraphInstanceNames()) { const auto &subgraph = graph->GetSubgraph(name); if (subgraph == nullptr) { - REPORT_INNER_ERROR("E19999", "Get name:%s subgraph in graph:%s fail, model_id:%u, check invalid " - "when DavinciModel %s", name.c_str(), graph->GetName().c_str(), model_id_, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Get name:%s subgraph in graph:%s fail, model_id:%u, check invalid", + name.c_str(), graph->GetName().c_str(), model_id_); GELOGE(GE_GRAPH_EMPTY_SUBGRAPH, "Subgraph not found, name: %s.", name.c_str()); return GE_GRAPH_EMPTY_SUBGRAPH; } @@ -1307,9 +1307,9 @@ Status DavinciModel::GetRealOutputSizeOfCase(const ComputeGraphPtr &graph, size_ GELOGD("Batch index of %s is %zu.", op_desc->GetName().c_str(), batch_index); if (batch_index > all_gears_info_.size()) { REPORT_INNER_ERROR("E19999", "Batch_index:%zu in op:%s(%s) > all_gears_info.size:%zu, model_id:%u, " - "check invalid when DavinciModel %s", batch_index, + "check invalid", batch_index, op_desc->GetName().c_str(), op_desc->GetType().c_str(), - all_gears_info_.size(), model_id_, __FUNCTION__); + all_gears_info_.size(), model_id_); GELOGE(PARAM_INVALID, "The value of ATTR_NAME_BATCH_LABEL is invalid."); return PARAM_INVALID; } @@ -1319,9 +1319,9 @@ Status DavinciModel::GetRealOutputSizeOfCase(const ComputeGraphPtr &graph, size_ GE_CHECK_NOTNULL(tensor_desc); int64_t data_size = 0; if (TensorUtils::GetTensorSizeInBytes(*tensor_desc, data_size) != GRAPH_SUCCESS) { - REPORT_INNER_ERROR("E19999", "Get input TensorSize in op:%s(%s) failed, input_index:%zu, model_id:%u" - "when DavinciModel %s", op_desc->GetName().c_str(), op_desc->GetType().c_str(), - input_index, model_id_, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Get input TensorSize in op:%s(%s) failed, input_index:%zu, model_id:%u", + op_desc->GetName().c_str(), op_desc->GetType().c_str(), + input_index, model_id_); GELOGE(FAILED, "Get tensor size in bytes failed."); return FAILED; } @@ -1363,9 +1363,9 @@ Status DavinciModel::GetGearAndRealOutShapeInfo(const ComputeGraphPtr &graph, co for (auto &it : dynamic_output_shape) { auto gear_index = static_cast(it[0]); if (gear_index > all_gears_info_.size()) { - REPORT_INNER_ERROR("E19999", "gear index:%zu in op:%s(%s) > all_gears_info.size:%zu in model:%u check invalid" - "when DavinciModel %s", gear_index, op_desc->GetName().c_str(), op_desc->GetType().c_str(), - all_gears_info_.size(), model_id_, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "gear index:%zu in op:%s(%s) > all_gears_info.size:%zu in model:%u " + "check invalid", gear_index, op_desc->GetName().c_str(), op_desc->GetType().c_str(), + all_gears_info_.size(), model_id_); GELOGE(PARAM_INVALID, "The value of cur index: %zu is invalid.", static_cast(it[0])); return PARAM_INVALID; } @@ -1414,8 +1414,8 @@ Status DavinciModel::GetLabelGotoAddr(uint32_t label_index, rtMemType_t mem_type } if (label_index >= label_list_.size()) { - REPORT_INNER_ERROR("E19999", "Param label index:%u >= label_list_.size:%zu in model:%u, check invalid" - "when DavinciModel %s", label_index, label_list_.size(), model_id_, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Param label index:%u >= label_list_.size:%zu in model:%u, check invalid", + label_index, label_list_.size(), model_id_); GELOGE(INTERNAL_ERROR, "Invalid label id:%u, label size:%zu", label_index, label_list_.size()); return INTERNAL_ERROR; } @@ -1425,8 +1425,8 @@ Status DavinciModel::GetLabelGotoAddr(uint32_t label_index, rtMemType_t mem_type arg_size = label_used.size() * sizeof(rtLabelDevInfo); rtError_t rt_ret = rtMalloc(&arg_addr, arg_size, mem_type); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%u, ret: 0x%X when DavinciModel %s", - arg_size, rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%u, ret: 0x%X", + arg_size, rt_ret); GELOGE(RT_FAILED, "Call rtMalloc failed, error: %#x", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } @@ -1434,7 +1434,7 @@ Status DavinciModel::GetLabelGotoAddr(uint32_t label_index, rtMemType_t mem_type label_goto_args_[label_index] = { arg_addr, arg_size }; rt_ret = rtLabelListCpy(label_used.data(), label_used.size(), arg_addr, arg_size); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtLabelListCpy failed, ret: 0x%X when DavinciModel %s", rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtLabelListCpy failed, ret: 0x%X", rt_ret); GELOGE(RT_FAILED, "Call rtLabelListCpy failed, error: %#x", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } @@ -1449,24 +1449,24 @@ Status DavinciModel::GetLabelGotoAddr(uint32_t label_index, rtMemType_t mem_type Status DavinciModel::InitLabelSet(const OpDescPtr &op_desc) { uint32_t label_index = 0; if (!AttrUtils::GetInt(op_desc, ATTR_NAME_LABEL_SWITCH_INDEX, label_index)) { - REPORT_INNER_ERROR("E19999", "Get Attr:%s in op:%s(%s) fail, model_id:%u, check invalid" - "when DavinciModel %s", ATTR_NAME_LABEL_SWITCH_INDEX.c_str(), - op_desc->GetName().c_str(), op_desc->GetType().c_str(), model_id_, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Get Attr:%s in op:%s(%s) fail, model_id:%u, check invalid", + ATTR_NAME_LABEL_SWITCH_INDEX.c_str(), + op_desc->GetName().c_str(), op_desc->GetType().c_str(), model_id_); GELOGE(INTERNAL_ERROR, "InitLabelSet: %s attr [%s] not exist.", op_desc->GetName().c_str(), ATTR_NAME_LABEL_SWITCH_INDEX.c_str()); return INTERNAL_ERROR; } if (label_index >= LabelNum()) { - REPORT_INNER_ERROR("E19999", "label_switch_index:%u in op:%s(%s) >= label_num:%u in model:%u, check invalid" - "when DavinciModel %s", label_index, op_desc->GetName().c_str(), op_desc->GetType().c_str(), - LabelNum(), model_id_, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "label_switch_index:%u in op:%s(%s) >= label_num:%u in model:%u, check invalid", + label_index, op_desc->GetName().c_str(), op_desc->GetType().c_str(), + LabelNum(), model_id_); GELOGE(INTERNAL_ERROR, "InitLabelSet: label index: %u >= label size: %u.", label_index, LabelNum()); return INTERNAL_ERROR; } if (label_id_indication_.count(label_index) > 0) { - REPORT_INNER_ERROR("E19999", "label_switch_index:%u in op:%s(%s) is already used in model:%u, check invalid" - "when DavinciModel %s", label_index, op_desc->GetName().c_str(), op_desc->GetType().c_str(), - model_id_, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "label_switch_index:%u in op:%s(%s) is already used in model:%u, check invalid", + label_index, op_desc->GetName().c_str(), op_desc->GetType().c_str(), + model_id_); GELOGE(INTERNAL_ERROR, "InitLabelSet: %s label index: %u already used.", op_desc->GetName().c_str(), label_index); return INTERNAL_ERROR; } @@ -1478,9 +1478,9 @@ Status DavinciModel::InitLabelSet(const OpDescPtr &op_desc) { } else if (stream_list_.size() > stream_id) { stream = stream_list_[stream_id]; } else { - REPORT_INNER_ERROR("E19999", "stream_id:%u in op:%s(%s) >= stream size:%zu in model:%u, check invalid" - "when DavinciModel %s", stream_id, op_desc->GetName().c_str(), op_desc->GetType().c_str(), - stream_list_.size(), model_id_, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "stream_id:%u in op:%s(%s) >= stream size:%zu in model:%u, check invalid", + stream_id, op_desc->GetName().c_str(), op_desc->GetType().c_str(), + stream_list_.size(), model_id_); GELOGE(INTERNAL_ERROR, "InitLabelSet: stream index: %u >= stream size: %zu.", stream_id, stream_list_.size()); return INTERNAL_ERROR; } @@ -1488,8 +1488,8 @@ Status DavinciModel::InitLabelSet(const OpDescPtr &op_desc) { rtLabel_t rt_label = nullptr; rtError_t rt_error = rtLabelCreateExV2(&rt_label, rt_model_handle_, stream); if (rt_error != RT_ERROR_NONE || rt_label == nullptr) { - REPORT_CALL_ERROR("E19999", "Call rtLabelCreateExV2 failed, ret: 0x%X when DavinciModel %s", - rt_error, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtLabelCreateExV2 failed, ret: 0x%X", + rt_error); GELOGE(INTERNAL_ERROR, "InitLabelSet: %s create label failed, error=0x%x.", op_desc->GetName().c_str(), rt_error); return INTERNAL_ERROR; } @@ -1529,8 +1529,8 @@ Status DavinciModel::SetQueIds(const std::vector &input_queue_ids, const std::vector &output_queue_ids) { if (input_queue_ids.empty() && output_queue_ids.empty()) { REPORT_INNER_ERROR("E19999", "Param input_queue_ids.size:%zu or output_queue_ids.size:%zu is empty, model_id:%u," - "check invalid when DavinciModel %s", input_queue_ids.size(), output_queue_ids.size(), - model_id_, __FUNCTION__); + "check invalid", input_queue_ids.size(), output_queue_ids.size(), + model_id_); GELOGE(ACL_ERROR_GE_EXEC_MODEL_QUEUE_ID_INVALID, "Param is empty"); return ACL_ERROR_GE_EXEC_MODEL_QUEUE_ID_INVALID; } @@ -1554,8 +1554,8 @@ Status DavinciModel::LoadWithQueue() { if (input_queue_ids_.size() != input_data_info_.size()) { REPORT_INNER_ERROR("E19999", "Param input_queue_ids_.size:%zu != input_data_info_.size:%zu, model_id:%u," - "check invalid when DavinciModel %s", input_queue_ids_.size(), input_data_info_.size(), - model_id_, __FUNCTION__); + "check invalid", input_queue_ids_.size(), input_data_info_.size(), + model_id_); GELOGE(ACL_ERROR_GE_EXEC_MODEL_QUEUE_ID_INVALID, "Input queue ids not match model: input_queue=%zu input_data=%zu", input_queue_ids_.size(), input_data_info_.size()); return ACL_ERROR_GE_EXEC_MODEL_QUEUE_ID_INVALID; @@ -1563,8 +1563,8 @@ Status DavinciModel::LoadWithQueue() { if (output_queue_ids_.size() != output_data_info_.size()) { REPORT_INNER_ERROR("E19999", "Param output_queue_ids_.size:%zu != output_data_info_.size:%zu, model_id:%u," - "check invalid when DavinciModel %s", output_queue_ids_.size(), output_data_info_.size(), - model_id_, __FUNCTION__); + "check invalid", output_queue_ids_.size(), output_data_info_.size(), + model_id_); GELOGE(ACL_ERROR_GE_EXEC_MODEL_QUEUE_ID_INVALID, "Output queue ids not match model: output_queue=%zu output_data=%zu", output_queue_ids_.size(), output_data_info_.size()); @@ -1613,7 +1613,7 @@ Status DavinciModel::BindInputQueue() { rtError_t rt_ret = rtModelBindQueue(rt_model_handle_, queue_id, RT_MODEL_INPUT_QUEUE); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtModelBindQueue failed, ret: 0x%X when DavinciModel %s", rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtModelBindQueue failed, ret: 0x%X", rt_ret); GELOGE(RT_FAILED, "Call rtModelBindQueue failed, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } @@ -1634,8 +1634,8 @@ Status DavinciModel::CpuModelDequeue(uint32_t queue_id) { GELOGI("Set CpuKernel model dequeue task enter."); std::shared_ptr dequeue_task = MakeShared(rt_entry_stream_); if (dequeue_task == nullptr) { - REPORT_CALL_ERROR("E19999", "New CpuTaskModelDequeue failed, model_id:%u, when DavinciModel %s", - model_id_, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "New CpuTaskModelDequeue failed, model_id:%u", + model_id_); GELOGE(MEMALLOC_FAILED, "Make CpuTaskModelDequeue task failed."); return MEMALLOC_FAILED; } @@ -1658,8 +1658,8 @@ Status DavinciModel::CpuTaskModelZeroCopy(std::vector &mbuf_list, GELOGI("Set CpuKernel model zero_copy task enter."); std::shared_ptr zero_copy = MakeShared(rt_entry_stream_); if (zero_copy == nullptr) { - REPORT_CALL_ERROR("E19999", "New CpuTaskZeroCopy failed, model_id:%u, when DavinciModel %s", - model_id_, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "New CpuTaskZeroCopy failed, model_id:%u", + model_id_); GELOGE(MEMALLOC_FAILED, "Make CpuTaskZeroCopy task failed."); return MEMALLOC_FAILED; } @@ -1682,16 +1682,16 @@ Status DavinciModel::BindOutputQueue() { for (size_t i = 0; i < output_queue_ids_.size(); ++i) { auto it = output_data_info_.find(i); if (it == output_data_info_.end()) { - REPORT_INNER_ERROR("E19999", "Index:%zu can't find in output_data_info_ size:%zu in model_id:%u, check invalid " - "when DavinciModel %s", i, output_data_info_.size(), model_id_, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Index:%zu can't find in output_data_info_ size:%zu in model_id:%u, check invalid", + i, output_data_info_.size(), model_id_); GELOGE(FAILED, "Output not match: tensor num=%zu, Queue id index=%zu", output_data_info_.size(), i); return FAILED; } uint32_t queue_id = output_queue_ids_[i]; if (it->second.GetDataInfo().empty()) { - REPORT_INNER_ERROR("E19999", "Index:%zu out_data_info in model:%u is empty, check invalid " - "when DavinciModel %s", i, model_id_, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Index:%zu out_data_info in model:%u is empty, check invalid", + i, model_id_); GELOGE(INTERNAL_ERROR, "the %zu output_queue not set data_info.", i); return INTERNAL_ERROR; } @@ -1702,8 +1702,8 @@ Status DavinciModel::BindOutputQueue() { rtError_t rt_ret = rtModelBindQueue(rt_model_handle_, queue_id, RT_MODEL_OUTPUT_QUEUE); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtModelBindQueue failed, queue_id:%u, ret: 0x%X when DavinciModel %s", - queue_id, rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtModelBindQueue failed, queue_id:%u, ret: 0x%X", + queue_id, rt_ret); GELOGE(RT_FAILED, "Call rtModelBindQueue failed, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } @@ -1725,16 +1725,16 @@ Status DavinciModel::BindOutputQueue() { Status DavinciModel::CpuModelPrepareOutput(uintptr_t addr, uint32_t size) { GELOGI("Set CpuKernel model enqueue task enter."); if (input_mbuf_list_.empty()) { - REPORT_INNER_ERROR("E19999", "input_mbuf_list_ is empty, model_id:%u, check invalid when %s", - model_id_, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "input_mbuf_list_ is empty, model_id:%u, check invalid", + model_id_); GELOGE(FAILED, "Need input mbuf for fill output mbuf head info."); return FAILED; } std::shared_ptr prepare_output = MakeShared(rt_entry_stream_); if (prepare_output == nullptr) { - REPORT_CALL_ERROR("E19999", "New CpuTaskPrepareOutput failed, model_id:%u, when DavinciModel %s", - model_id_, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "New CpuTaskPrepareOutput failed, model_id:%u", + model_id_); GELOGE(MEMALLOC_FAILED, "Make CpuTaskPrepareOutput task failed."); return MEMALLOC_FAILED; } @@ -1759,8 +1759,8 @@ Status DavinciModel::CpuActiveStream() { GELOGI("Set CpuKernel active stream task enter."); std::shared_ptr active_entry = MakeShared(rt_entry_stream_); if (active_entry == nullptr) { - REPORT_CALL_ERROR("E19999", "New CpuTaskActiveEntry failed, model_id:%u, when DavinciModel %s", - model_id_, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "New CpuTaskActiveEntry failed, model_id:%u", + model_id_); GELOGE(MEMALLOC_FAILED, "Make CpuTaskActiveEntry task failed."); return MEMALLOC_FAILED; } @@ -1782,8 +1782,8 @@ Status DavinciModel::CpuWaitEndGraph() { GELOGI("Set CpuKernel wait end graph task enter."); std::shared_ptr wait_endgraph = MakeShared(rt_entry_stream_); if (wait_endgraph == nullptr) { - REPORT_CALL_ERROR("E19999", "New CpuTaskWaitEndGraph failed, model_id:%u, when DavinciModel %s", - model_id_, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "New CpuTaskWaitEndGraph failed, model_id:%u", + model_id_); GELOGE(MEMALLOC_FAILED, "Make CpuTaskWaitEndGraph task failed."); return MEMALLOC_FAILED; } @@ -1802,8 +1802,8 @@ Status DavinciModel::BindEnqueue() { for (size_t i = 0; i < output_queue_ids_.size(); ++i) { auto it = output_data_info_.find(i); if (it == output_data_info_.end()) { - REPORT_INNER_ERROR("E19999", "Index:%zu can't find in output_data_info_ size:%zu in model_id:%u, check invalid " - "when DavinciModel %s", i, output_data_info_.size(), model_id_, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Index:%zu can't find in output_data_info_ size:%zu in model_id:%u, check invalid", + i, output_data_info_.size(), model_id_); GELOGE(FAILED, "Output not match: tensor num=%zu, Queue id index=%zu", output_data_info_.size(), i); return FAILED; } @@ -1820,8 +1820,8 @@ Status DavinciModel::CpuModelEnqueue(uint32_t queue_id, uintptr_t out_mbuf) { GELOGI("Set CpuKernel model enqueue task enter."); std::shared_ptr model_enqueue = MakeShared(rt_entry_stream_); if (model_enqueue == nullptr) { - REPORT_CALL_ERROR("E19999", "New CpuTaskModelEnqueue failed, model_id:%u, when DavinciModel %s", - model_id_, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "New CpuTaskModelEnqueue failed, model_id:%u", + model_id_); GELOGE(MEMALLOC_FAILED, "Make CpuTaskModelEnqueue task failed."); return MEMALLOC_FAILED; } @@ -1842,8 +1842,8 @@ Status DavinciModel::CpuModelRepeat() { GELOGI("Set CpuKernel repeat task enter."); std::shared_ptr model_repeat = MakeShared(rt_entry_stream_); if (model_repeat == nullptr) { - REPORT_CALL_ERROR("E19999", "New CpuTaskModelRepeat failed, model_id:%u, when DavinciModel %s", - model_id_, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "New CpuTaskModelRepeat failed, model_id:%u", + model_id_); GELOGE(MEMALLOC_FAILED, "Make CpuTaskModelRepeat task failed."); return MEMALLOC_FAILED; } @@ -1878,7 +1878,7 @@ Status DavinciModel::GetInputOutputDescInfo(vector &input_d vector &output_formats, bool by_dims) { if (input_addrs_list_.empty() || input_addrs_list_[0].size() != 1) { REPORT_INNER_ERROR("E19999", "input_addrs_list_ is empty or first member size != 1, model_id:%u, " - "check invalid when DavinciModel %s", model_id_, __FUNCTION__); + "check invalid", model_id_); GELOGE(FAILED, "OP List Pointer is null or input_desc size is not 1!"); return FAILED; } @@ -1989,9 +1989,9 @@ Status DavinciModel::InitAippType(uint32_t index, const OpDescPtr &op_desc, cons } else if (data_mode == "dynamic_aipp_conf") { aipp_type = DYNAMIC_AIPP_NODE; } else { - REPORT_INNER_ERROR("E19999", "Attr:%s data_mode:%s in op:%s(%s), model_id:%u, check invalid when DavinciModel %s", + REPORT_INNER_ERROR("E19999", "Attr:%s data_mode:%s in op:%s(%s), model_id:%u, check invalid", ATTR_DATA_RELATED_AIPP_MODE.c_str(), data_mode.c_str(), - op_desc->GetName().c_str(), op_desc->GetType().c_str(), model_id_, __FUNCTION__); + op_desc->GetName().c_str(), op_desc->GetType().c_str(), model_id_); GELOGE(ACL_ERROR_GE_AIPP_MODE_INVALID, "The info of aipp releated info %s is invalid with index %u.", data_mode.c_str(), index); return ACL_ERROR_GE_AIPP_MODE_INVALID; @@ -2143,8 +2143,8 @@ void DavinciModel::CreateOutput(uint32_t index, const OpDescPtr &op_desc, InputO /// netoutput input tensor desc GE_IF_BOOL_EXEC(op_desc->GetInputDescPtr(index) == nullptr, REPORT_INNER_ERROR("E19999", "input_desc index:%u in op:%s(%s) not exist, model_id:%u, " - "check invalid when DavinciModel %s", index, - op_desc->GetName().c_str(), op_desc->GetType().c_str(), model_id_, __FUNCTION__); + "check invalid", index, + op_desc->GetName().c_str(), op_desc->GetType().c_str(), model_id_); GELOGE(FAILED, "OpDesc GetInputDescPtr is nullptr"); return); Format format = op_desc->GetInputDescPtr(index)->GetFormat(); @@ -2236,7 +2236,7 @@ Status DavinciModel::CopyInputData(const InputData &input_data, bool device_data for (const auto &data : input_data_info_) { if (data.first >= blobs.size()) { REPORT_INNER_ERROR("E19999", "index:%u in input_data_info_ >= input_data.blobs.size:%zu, model_id:%u, " - "check invalid when DavinciModel %s", data.first, blobs.size(), model_id_, __FUNCTION__); + "check invalid", data.first, blobs.size(), model_id_); GELOGE(FAILED, "Blobs not match: blobs=%zu, tensor=%zu, index=%u, size=%ld, op_name(%s)", blobs.size(), input_data_info_.size(), data.first, data.second.GetDataInfo().at(0).first, data.second.GetOpName().c_str()); @@ -2386,12 +2386,12 @@ Status DavinciModel::SinkModelProfile() { try { reported_data = model_load_info.dump(kInteval, ' ', false, Json::error_handler_t::ignore); } catch (std::exception &e) { - REPORT_INNER_ERROR("E19999", "Convert model_load_info JSON to string failed, model_id:%u, reason:%s, " - "when DavinciModel %s", model_id_, e.what(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Convert model_load_info JSON to string failed, model_id:%u, reason:%s", + model_id_, e.what()); GELOGE(FAILED, "Failed to convert JSON to string, reason: %s.", e.what()); } catch (...) { - REPORT_INNER_ERROR("E19999", "Convert model_load_info JSON to string failed, model_id:%u, when DavinciModel %s", - model_id_, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Convert model_load_info JSON to string failed, model_id:%u", + model_id_); GELOGE(FAILED, "Failed to convert JSON to string."); } reported_data.append(",") @@ -2426,12 +2426,12 @@ Status DavinciModel::SinkTimeProfile(const InputData ¤t_data) { try { reported_data = model_time_info.dump(kInteval, ' ', false, Json::error_handler_t::ignore); } catch (std::exception &e) { - REPORT_INNER_ERROR("E19999", "Convert model_time_info JSON to string failed, model_id:%u, reason:%s, " - "when DavinciModel %s", model_id_, e.what(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Convert model_time_info JSON to string failed, model_id:%u, reason:%s", + model_id_, e.what()); GELOGE(FAILED, "Failed to convert JSON to string, reason: %s.", e.what()); } catch (...) { - REPORT_INNER_ERROR("E19999", "Convert model_time_info JSON to string failed, model_id:%u, when DavinciModel %s", - model_id_, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Convert model_time_info JSON to string failed, model_id:%u", + model_id_); GELOGE(FAILED, "Failed to convert JSON to string."); } reported_data.append(",") @@ -2499,8 +2499,8 @@ Status DavinciModel::CopyOutputData(uint32_t data_id, OutputData &output_data, r output_data.model_id = model_id_; if (output_data.blobs.size() != output_data_info_.size()) { REPORT_INNER_ERROR("E19999", "output_data.blobs.size:%zu != output_data_info.size:%zu, model_id:%u, " - "check invalid when DavinciModel %s", - output_data.blobs.size(), output_data_info_.size(), model_id_, __FUNCTION__); + "check invalid", + output_data.blobs.size(), output_data_info_.size(), model_id_); GELOGE(FAILED, "Output data buffer num=%zu not equal model data num=%zu", output_data.blobs.size(), output_data_info_.size()); return FAILED; @@ -2511,7 +2511,7 @@ Status DavinciModel::CopyOutputData(uint32_t data_id, OutputData &output_data, r for (const auto &output : output_data_info_) { if (output.first >= blobs.size()) { REPORT_INNER_ERROR("E19999", "index:%u in output_data_info_ >= output_data.blobs.size:%zu, model_id:%u, " - "check invalid when DavinciModel %s", output.first, blobs.size(), model_id_, __FUNCTION__); + "check invalid", output.first, blobs.size(), model_id_); GELOGE(FAILED, "Blobs not match: blobs=%zu, tensor=%zu, index=%u, size=%ld", blobs.size(), input_data_info_.size(), output.first, output.second.GetDataInfo().at(0).first); return FAILED; @@ -2531,8 +2531,8 @@ Status DavinciModel::CopyOutputData(uint32_t data_id, OutputData &output_data, r GELOGI("No need to check output data size."); } else if (buffer.length < mem_size) { REPORT_INNER_ERROR("E19999", "Buffer.length:%lu in output blob < mem_size:%lu in output_data_info, index:%u, " - "model_id:%u, check invalid when DavinciModel %s", buffer.length, mem_size, output.first, - model_id_, __FUNCTION__); + "model_id:%u, check invalid", buffer.length, mem_size, output.first, + model_id_); GELOGE(FAILED, "Tensor data size=%lu, buffer size=%lu", mem_size, buffer.length); return FAILED; } else if (buffer.length > mem_size) { @@ -2570,9 +2570,9 @@ Status DavinciModel::InitOutputTensorInfo(const OpDescPtr &op_desc) { auto ret = TensorUtils::GetTensorSizeInBytes(*input_desc, size); GE_IF_BOOL_EXEC(ret != GRAPH_SUCCESS, REPORT_INNER_ERROR("E19999", "Get input TensorSize in op:%s(%s) failed, input_index:%zu, " - "model_id:%u when DavinciModel %s", + "model_id:%u", op_desc->GetName().c_str(), op_desc->GetType().c_str(), i, - model_id_, __FUNCTION__); + model_id_); GELOGE(ret, "Get size from TensorDesc failed, op:%s, input id:%zu", op_desc->GetName().c_str(), i); return ret); const GeShape &shape = input_desc->GetShape(); @@ -2615,8 +2615,8 @@ Status DavinciModel::GenOutputTensorInfo(OutputData *output_data, vector data_buf(new (std::nothrow) uint8_t[output_buffer_size[i]]); if (data_buf == nullptr) { - REPORT_CALL_ERROR("E19999", "New buffer failed, size:%ld, model_id:%u when DavinciModel %s", - output_buffer_size[i], model_id_, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "New buffer failed, size:%ld, model_id:%u", + output_buffer_size[i], model_id_); GELOGE(GE_GRAPH_MALLOC_FAILED, "Malloc buffer failed."); return GE_GRAPH_MALLOC_FAILED; } @@ -3109,8 +3109,8 @@ Status DavinciModel::MallocKnownArgs() { if (total_args_size_ != 0) { rt_ret = rtMalloc(&args_, total_args_size_, mem_type); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%u, ret: 0x%X when DavinciModel %s", - total_args_size_, rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%u, ret: 0x%X", + total_args_size_, rt_ret); GELOGE(RT_FAILED, "Call rtMalloc failed, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } @@ -3119,8 +3119,8 @@ Status DavinciModel::MallocKnownArgs() { if (total_hybrid_args_size_ != 0) { rt_ret = rtMalloc(&hybrid_addrs_, total_hybrid_args_size_, mem_type); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%u, ret: 0x%X when DavinciModel %s", - total_hybrid_args_size_, rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%u, ret: 0x%X", + total_hybrid_args_size_, rt_ret); GELOGE(RT_FAILED, "Call rtMalloc failed, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } @@ -3130,8 +3130,8 @@ Status DavinciModel::MallocKnownArgs() { GELOGI("Begin to allocate fixed addr."); rt_ret = rtMalloc(&fixed_addrs_, total_fixed_addr_size_, mem_type); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%u, ret: 0x%X when DavinciModel %s", - total_hybrid_args_size_, rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%u, ret: 0x%X", + total_hybrid_args_size_, rt_ret); GELOGE(RT_FAILED, "Call rtMalloc failed, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } @@ -3380,8 +3380,8 @@ bool DavinciModel::CheckInputAndModelSize(const int64_t &input_size, const int64 // The input and model input size can not be exactly equal because user input is not definite. if ((input_size + kDataMemAlignSizeCompare) < op_size) { REPORT_INNER_ERROR("E19999", "input size:%ld from user add align:%u > input_op_size:%ld in model, model_id:%u, " - "check invalid when DavinciModel %s", - input_size, kDataMemAlignSizeCompare, op_size, model_id_, __FUNCTION__); + "check invalid", + input_size, kDataMemAlignSizeCompare, op_size, model_id_); GELOGE(ACL_ERROR_GE_PARAM_INVALID, "Input size [%ld] can not be smaller than op size [%ld] after 64-byte alignment", input_size, op_size); return false; @@ -3432,8 +3432,8 @@ Status DavinciModel::UpdateIoTaskArgs(const std::map & const vector &blobs, bool is_dynamic, const string &batch_label) { if (blobs.size() != data_info.size()) { REPORT_INNER_ERROR("E19999", "is_input:%d blob size:%ld from user != op_size:%ld in model, mode_id:%u" - "check invalid when DavinciModel %s", is_input, - blobs.size(), data_info.size(), model_id_, __FUNCTION__); + "check invalid", is_input, + blobs.size(), data_info.size(), model_id_); GELOGE(ACL_ERROR_GE_PARAM_INVALID, "Verify %s data num failed: model requires %zu, but user actually feeds %zu", is_input ? "input" : "output", data_info.size(), blobs.size()); return ACL_ERROR_GE_PARAM_INVALID; @@ -3442,8 +3442,8 @@ Status DavinciModel::UpdateIoTaskArgs(const std::map & for (const auto &data : data_info) { if (data.first >= blobs.size()) { // check data index. REPORT_INNER_ERROR("E19999", "is_input:%d, data index:%u from model >= blobs.size:%zu from user, mode_id:%u" - "check invalid when DavinciModel %s", is_input, - data.first, blobs.size(), model_id_, __FUNCTION__); + "check invalid", is_input, + data.first, blobs.size(), model_id_); GELOGE(ACL_ERROR_GE_PARAM_INVALID, "Verify %s data num failed: can not find No.%u data, because user only feeds %zu", is_input ? "input" : "output", data.first, blobs.size()); @@ -3453,8 +3453,8 @@ Status DavinciModel::UpdateIoTaskArgs(const std::map & const DataBuffer &buffer = blobs[data.first]; // index of data. if (buffer.data == nullptr) { REPORT_INNER_ERROR("E19999", "is_input:%d buffer from user is nullptr, index:%u, mode_id:%u" - "check invalid when DavinciModel %s", is_input, - data.first, model_id_, __FUNCTION__); + "check invalid", is_input, + data.first, model_id_); GELOGE(ACL_ERROR_GE_PARAM_INVALID, "data_buf.data is nullptr, index=%u", data.first); return ACL_ERROR_GE_PARAM_INVALID; } @@ -3472,8 +3472,8 @@ Status DavinciModel::UpdateIoTaskArgs(const std::map & GELOGI("[IMAS] Find addr %p need direct copy from user malloc input %p", basic_addr, buffer.data); rtError_t rt_ret = rtMemcpy(basic_addr, data_size, buffer.data, buffer.length, RT_MEMCPY_DEVICE_TO_DEVICE); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%lu, model_id:%u, when DavinciModel %s", - data_size, model_id_, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%lu, model_id:%u", + data_size, model_id_); GELOGE(rt_ret, "Non-zero copy data node copy failed"); return RT_ERROR_TO_GE_STATUS(rt_ret); } @@ -3556,17 +3556,17 @@ Status DavinciModel::InitConstant(const OpDescPtr &op_desc) { auto v_output_addr = ModelUtils::GetOutputDataAddrs(runtime_param_, op_desc); GE_IF_BOOL_EXEC(v_weights.empty() || v_output_size.empty() || v_output_addr.empty(), REPORT_INNER_ERROR("E19999", "weight.size:%zu output_length.size:%zu output_addr.size:%zu in " - "op:%s(%s) has empty, model_id:%u, check invalid when DavinciModel %s", + "op:%s(%s) has empty, model_id:%u, check invalid", v_weights.size(),v_output_size.size(), v_output_addr.size(), - op_desc->GetName().c_str(), op_desc->GetType().c_str() ,model_id_, __FUNCTION__); + op_desc->GetName().c_str(), op_desc->GetType().c_str() ,model_id_); GELOGE(PARAM_INVALID, "const op:%s not set output", op_desc->GetName().c_str()); return PARAM_INVALID;); GeTensor *tensor = const_cast(v_weights[0].get()); GE_IF_BOOL_EXEC(static_cast(v_output_size[0]) < tensor->GetData().size(), REPORT_INNER_ERROR("E19999", "Output size:%zu < weight size:%zu in op:%s(%s) model_id:%u, " - "check invalid when DavinciModel %s", v_output_size[0], tensor->GetData().size(), - op_desc->GetName().c_str(), op_desc->GetType().c_str() ,model_id_, __FUNCTION__); + "check invalid", v_output_size[0], tensor->GetData().size(), + op_desc->GetName().c_str(), op_desc->GetType().c_str() ,model_id_); GELOGE(PARAM_INVALID, "output size:%ld less than weight data size:%zu", v_output_size[0], tensor->GetData().size()); return PARAM_INVALID;); @@ -3616,8 +3616,8 @@ Status DavinciModel::InitTbeHandle(const OpDescPtr &op_desc) { auto kernel = ge_model_->GetTBEKernelStore().FindKernel(op_desc->GetName()); auto tbe_kernel = (kernel != nullptr) ? kernel : op_desc->TryGetExtAttr(OP_EXTATTR_NAME_TBE_KERNEL, TBEKernelPtr()); if (tbe_kernel == nullptr) { - REPORT_INNER_ERROR("E19999", "Get tbe_kernel for op:%s(%s) fail, model_id:%u, when DavinciModel %s", - op_desc->GetName().c_str(), op_desc->GetType().c_str() ,model_id_, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Get tbe_kernel for op:%s(%s) fail, model_id:%u", + op_desc->GetName().c_str(), op_desc->GetType().c_str() ,model_id_); GELOGE(INTERNAL_ERROR, "TBE: %s can't find tvm bin file!", op_desc->GetName().c_str()); return INTERNAL_ERROR; } @@ -3644,9 +3644,9 @@ Status DavinciModel::InitTbeHandle(const OpDescPtr &op_desc) { } else if (json_string == "RT_DEV_BINARY_MAGIC_ELF_AIVEC") { binary.magic = RT_DEV_BINARY_MAGIC_ELF_AIVEC; } else { - REPORT_INNER_ERROR("E19999", "Attr:%s value:%s in op:%s(%s), model_id:%u, check invalid when DavinciModel %s", + REPORT_INNER_ERROR("E19999", "Attr:%s value:%s in op:%s(%s), model_id:%u, check invalid", TVM_ATTR_NAME_MAGIC.c_str(), json_string.c_str(), - op_desc->GetName().c_str(), op_desc->GetType().c_str() ,model_id_, __FUNCTION__); + op_desc->GetName().c_str(), op_desc->GetType().c_str() ,model_id_); GELOGE(PARAM_INVALID, "TBE: Invalid parameter magic number! json: %s", json_string.c_str()); return PARAM_INVALID; } @@ -3737,10 +3737,10 @@ Status DavinciModel::InitStreamSwitch(const OpDescPtr &op_desc) { "GetInt ACTIVE_STREAM_LIST failed."); if (active_stream_list.size() != kTrueBranchStreamNum) { REPORT_INNER_ERROR("E19999", "Attr:%s active_stream_list.size:%zu in op:%s(%s) != kTrueBranchStreamNum:%u, " - "model_id:%u, check invalid when DavinciModel %s", + "model_id:%u, check invalid", ATTR_NAME_ACTIVE_STREAM_LIST.c_str(), active_stream_list.size(), op_desc->GetName().c_str(), op_desc->GetType().c_str(), - kTrueBranchStreamNum, model_id_, __FUNCTION__); + kTrueBranchStreamNum, model_id_); GELOGE(INTERNAL_ERROR, "Stream num of switch true branch must be %u.", kTrueBranchStreamNum); return INTERNAL_ERROR; } @@ -3755,9 +3755,9 @@ Status DavinciModel::InitStreamSwitch(const OpDescPtr &op_desc) { Status DavinciModel::InitStreamSwitchN(const OpDescPtr &op_desc) { std::vector active_stream_list; if (!AttrUtils::GetListInt(op_desc, ATTR_NAME_ACTIVE_STREAM_LIST, active_stream_list)) { - REPORT_INNER_ERROR("E19999", "Get Attr:%s from op:%s(%s) fail, model_id:%u, when DavinciModel %s", + REPORT_INNER_ERROR("E19999", "Get Attr:%s from op:%s(%s) fail, model_id:%u", ATTR_NAME_ACTIVE_STREAM_LIST.c_str(), - op_desc->GetName().c_str(), op_desc->GetType().c_str(), model_id_, __FUNCTION__); + op_desc->GetName().c_str(), op_desc->GetType().c_str(), model_id_); GELOGE(INTERNAL_ERROR, "StreamSwitchNOp get attr ACTIVE_STREAM failed."); return INTERNAL_ERROR; } @@ -3769,9 +3769,9 @@ Status DavinciModel::InitStreamSwitchN(const OpDescPtr &op_desc) { uint32_t batch_num = 0; if (!AttrUtils::GetInt(op_desc, ATTR_NAME_BATCH_NUM, batch_num)) { - REPORT_INNER_ERROR("E19999", "Get Attr:%s from op:%s(%s) fail, model_id:%u, when DavinciModel %s", + REPORT_INNER_ERROR("E19999", "Get Attr:%s from op:%s(%s) fail, model_id:%u", ATTR_NAME_BATCH_NUM.c_str(), - op_desc->GetName().c_str(), op_desc->GetType().c_str(), model_id_, __FUNCTION__); + op_desc->GetName().c_str(), op_desc->GetType().c_str(), model_id_); GELOGE(FAILED, "Failed to get attr ATTR_NAME_BATCH_NUM, StreamSwitchN: %s.", op_desc->GetName().c_str()); return FAILED; } @@ -3789,9 +3789,9 @@ Status DavinciModel::SetDynamicBatchInfo(const OpDescPtr &op_desc, uint32_t batc std::vector batch_shape; const std::string attr_name = ATTR_NAME_PRED_VALUE + "_" + std::to_string(i); if (!AttrUtils::GetListInt(op_desc, attr_name, batch_shape)) { - REPORT_INNER_ERROR("E19999", "Get Attr:%s from op:%s(%s) fail, model_id:%u, when DavinciModel %s", + REPORT_INNER_ERROR("E19999", "Get Attr:%s from op:%s(%s) fail, model_id:%u", attr_name.c_str(), - op_desc->GetName().c_str(), op_desc->GetType().c_str(), model_id_, __FUNCTION__); + op_desc->GetName().c_str(), op_desc->GetType().c_str(), model_id_); GELOGE(FAILED, "Get attr ATTR_NAME_PRED_VALUE failed, Node: %s", op_desc->GetName().c_str()); batch_info_.clear(); return FAILED; @@ -3936,8 +3936,8 @@ Status DavinciModel::NnExecute(rtStream_t stream, bool async_mode, const InputDa // Add active entry stream for special env. Status DavinciModel::AddHeadStream() { if (active_stream_list_.empty()) { - REPORT_INNER_ERROR("E19999", "active_stream_list is empty in model:%u, check invalid when DavinciModel %s", - model_id_, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "active_stream_list is empty in model:%u, check invalid", + model_id_); GELOGE(INTERNAL_ERROR, "Active stream is empty, stream list size: %zu, stream indication size: %zu.", stream_list_.size(), active_stream_indication_.size()); return INTERNAL_ERROR; @@ -3957,8 +3957,8 @@ Status DavinciModel::AddHeadStream() { for (auto s : active_stream_list_) { std::shared_ptr active_entry = MakeShared(rt_head_stream_); if (active_entry == nullptr) { - REPORT_CALL_ERROR("E19999", "New CpuTaskActiveEntry failed, model_id:%u, when DavinciModel %s", - model_id_, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "New CpuTaskActiveEntry failed, model_id:%u", + model_id_); GELOGE(MEMALLOC_FAILED, "Make CpuTaskActiveEntry task failed."); return MEMALLOC_FAILED; } @@ -4090,8 +4090,8 @@ Status DavinciModel::TransAllVarData(ComputeGraphPtr &graph, uint32_t graph_id) rtContext_t ctx = nullptr; rtError_t rt_ret = rtCtxGetCurrent(&ctx); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtCtxGetCurrent failed, model_id:%u, when DavinciModel %s", - model_id_, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtCtxGetCurrent failed, model_id:%u", + model_id_); GELOGE(RT_FAILED, "Failed to get current context, error_code is: 0x%X.", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } @@ -4125,7 +4125,7 @@ void DavinciModel::SetDataDumperArgs(const ComputeGraphPtr &graph, const map infos = ge::StringUtils::Split(input, ':'); if (infos.size() != kAippInfoNum) { REPORT_INNER_ERROR("E19999", "Attr:%s in op:%s(%s), aipp input size:%zu != kAippInfoNum:%u, model_id:%u, " - "check invalid when DavinciModel %s", ATTR_NAME_AIPP_INPUTS.c_str(), + "check invalid", ATTR_NAME_AIPP_INPUTS.c_str(), op_desc->GetName().c_str(), op_desc->GetType().c_str(), infos.size(), kAippInfoNum, - model_id_, __FUNCTION__); + model_id_); GELOGE(ACL_ERROR_GE_AIPP_MODE_INVALID, "origin input str is invalid[%zu, %u].", infos.size(), kAippInfoNum); return ACL_ERROR_GE_AIPP_MODE_INVALID; } @@ -4212,8 +4212,8 @@ Status DavinciModel::InitOrigInputInfo(uint32_t index, const OpDescPtr &op_desc) Status DavinciModel::GetOrigInputInfo(uint32_t index, OriginInputInfo &orig_input_info) const { const auto it = orig_input_info_.find(index); if (it == orig_input_info_.end()) { - REPORT_INNER_ERROR("E19999", "Get index:%u from orig_input_info_ fail, model_id:%u, when DavinciModel %s", - index, model_id_, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Get index:%u from orig_input_info_ fail, model_id:%u", + index, model_id_); GELOGE(ACL_ERROR_GE_AIPP_NOT_EXIST, "there is not AIPP related with index %u.", index); return ACL_ERROR_GE_AIPP_NOT_EXIST; } @@ -4231,8 +4231,8 @@ void DavinciModel::ParseAIPPInfo(std::string in_out_info, InputOutputDims &dims_ std::vector infos = ge::StringUtils::Split(in_out_info, ':'); if (infos.size() != kAippInfoNum) { REPORT_INNER_ERROR("E19999", "in_out_info:%s size:%zu != kAippInfoNum:%u, model_id:%u, " - "check invalid when DavinciModel %s", in_out_info.c_str(), infos.size(), kAippInfoNum, - model_id_, __FUNCTION__); + "check invalid", in_out_info.c_str(), infos.size(), kAippInfoNum, + model_id_); GELOGE(ACL_ERROR_GE_AIPP_MODE_INVALID, "origin input str is invalid[%zu, %u].", infos.size(), kAippInfoNum); return; } @@ -4295,8 +4295,8 @@ Status DavinciModel::GetAllAippInputOutputDims(uint32_t index, vector &output_dims) const { const auto it = aipp_dims_info_.find(index); if (it == aipp_dims_info_.end()) { - REPORT_INNER_ERROR("E19999", "Get index:%u from aipp_dims_info_ fail, model_id:%u, when DavinciModel %s", - index, model_id_, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Get index:%u from aipp_dims_info_ fail, model_id:%u", + index, model_id_); GELOGE(ACL_ERROR_GE_AIPP_NOT_EXIST, "there is not AIPP related with index %u.", index); return ACL_ERROR_GE_AIPP_NOT_EXIST; } @@ -4328,8 +4328,8 @@ Status DavinciModel::InitL1DataDumperArgs() { if (rtDumpAddrSet(rt_model_handle_, l1_fusion_addr_, kDumpL1FusionOpMByteSize, kDumpFlagOfL1Fusion) != RT_ERROR_NONE) { // l1_fusion_addr_ will be free when DavinciModel destruct - REPORT_CALL_ERROR("E19999", "Call rtDumpAddrSet failed, model_id:%u, when DavinciModel %s", - model_id_, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtDumpAddrSet failed, model_id:%u", + model_id_); GELOGE(FAILED, "Call rtDumpAddrSet failed"); return FAILED; } diff --git a/ge/graph/load/model_manager/model_manager.cc b/ge/graph/load/model_manager/model_manager.cc index 0d920604..84259731 100755 --- a/ge/graph/load/model_manager/model_manager.cc +++ b/ge/graph/load/model_manager/model_manager.cc @@ -100,15 +100,15 @@ Status ModelManager::KernelLaunchEx(aicpu::FWKAdapter::FWKOperateType op_type, u auto kernel_size = sizeof(uint64_t) * (v_aicpu_kernel.size()); rtError_t rt_ret = rtMalloc(&aicpu_kernel_addr, kernel_size, RT_MEMORY_HBM); GE_IF_BOOL_EXEC(rt_ret != RT_ERROR_NONE, - REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%zu, ret: 0x%X when ModelManager %s", - kernel_size, rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%zu, ret: 0x%X", + kernel_size, rt_ret); GELOGE(RT_FAILED, "rtMalloc error, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret);) rt_ret = rtMemcpy(aicpu_kernel_addr, kernel_size, v_aicpu_kernel.data(), kernel_size, RT_MEMCPY_HOST_TO_DEVICE); GE_IF_BOOL_EXEC(rt_ret != RT_ERROR_NONE, - REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret: 0x%X when ModelManager %s", - kernel_size, rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret: 0x%X", + kernel_size, rt_ret); GELOGE(RT_FAILED, "rtMemcpy to input_output_addr_ error: 0x%X", rt_ret); GE_CHK_RT(rtFree(aicpu_kernel_addr)); return RT_ERROR_TO_GE_STATUS(rt_ret);) uint64_t kernel_id_addr = static_cast(reinterpret_cast(aicpu_kernel_addr)); @@ -120,8 +120,8 @@ Status ModelManager::KernelLaunchEx(aicpu::FWKAdapter::FWKOperateType op_type, u rtError_t rt_ret = rtMalloc(&(devicebase), sizeof(STR_FWK_OP_KERNEL), RT_MEMORY_HBM); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%zu, ret: 0x%X when ModelManager %s", - sizeof(STR_FWK_OP_KERNEL), rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%zu, ret: 0x%X", + sizeof(STR_FWK_OP_KERNEL), rt_ret); GELOGE(RT_FAILED, "malloc device memory failed. ret: 0x%X", rt_ret); GE_IF_BOOL_EXEC(aicpu_kernel_addr != nullptr, GE_CHK_RT(rtFree(aicpu_kernel_addr))); return RT_ERROR_TO_GE_STATUS(rt_ret); @@ -130,8 +130,8 @@ Status ModelManager::KernelLaunchEx(aicpu::FWKAdapter::FWKOperateType op_type, u rt_ret = rtMemcpy(devicebase, sizeof(STR_FWK_OP_KERNEL), ¶m_base, sizeof(STR_FWK_OP_KERNEL), RT_MEMCPY_HOST_TO_DEVICE); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret: 0x%X when ModelManager %s", - sizeof(STR_FWK_OP_KERNEL), rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret: 0x%X", + sizeof(STR_FWK_OP_KERNEL), rt_ret); GELOGE(RT_FAILED, "memory copy to device failed. ret: 0x%X", rt_ret); GE_IF_BOOL_EXEC(aicpu_kernel_addr != nullptr, GE_CHK_RT(rtFree(aicpu_kernel_addr))); GE_CHK_RT(rtFree(devicebase)); @@ -141,7 +141,7 @@ Status ModelManager::KernelLaunchEx(aicpu::FWKAdapter::FWKOperateType op_type, u rtStream_t stream = nullptr; rt_ret = rtStreamCreate(&stream, 0); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtStreamCreate failed, ret: 0x%X when ModelManager %s", rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtStreamCreate failed, ret: 0x%X", rt_ret); GELOGE(RT_FAILED, "create stream failed. ret: 0x%X", rt_ret); GE_IF_BOOL_EXEC(aicpu_kernel_addr != nullptr, GE_CHK_RT(rtFree(aicpu_kernel_addr))); GE_CHK_RT(rtFree(devicebase)); @@ -150,7 +150,7 @@ Status ModelManager::KernelLaunchEx(aicpu::FWKAdapter::FWKOperateType op_type, u rt_ret = rtKernelLaunchEx(devicebase, sizeof(STR_FWK_OP_KERNEL), 0, stream); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtKernelLaunchEx failed, ret: 0x%X when ModelManager %s", rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtKernelLaunchEx failed, ret: 0x%X", rt_ret); GELOGE(RT_FAILED, "rtKernelLaunchEx failed. ret: 0x%X", rt_ret); GE_IF_BOOL_EXEC(aicpu_kernel_addr != nullptr, GE_CHK_RT(rtFree(aicpu_kernel_addr))); GE_CHK_RT(rtFree(devicebase)); @@ -159,8 +159,8 @@ Status ModelManager::KernelLaunchEx(aicpu::FWKAdapter::FWKOperateType op_type, u } rt_ret = rtStreamSynchronize(stream); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtStreamSynchronize failed, ret: 0x%X when ModelManager %s", - rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtStreamSynchronize failed, ret: 0x%X", + rt_ret); GELOGE(RT_FAILED, "rtStreamSynchronize failed. ret: 0x%X", rt_ret); GE_IF_BOOL_EXEC(aicpu_kernel_addr != nullptr, GE_CHK_RT(rtFree(aicpu_kernel_addr))); GE_CHK_RT(rtFree(devicebase)); @@ -170,7 +170,7 @@ Status ModelManager::KernelLaunchEx(aicpu::FWKAdapter::FWKOperateType op_type, u if (aicpu_kernel_addr != nullptr) { rt_ret = rtFree(aicpu_kernel_addr); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtFree failed, ret: 0x%X when ModelManager %s", rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtFree failed, ret: 0x%X", rt_ret); GELOGE(RT_FAILED, "free memory failed. ret: 0x%X", rt_ret); GE_CHK_RT(rtFree(devicebase)); GE_CHK_RT(rtStreamDestroy(stream)); @@ -179,14 +179,14 @@ Status ModelManager::KernelLaunchEx(aicpu::FWKAdapter::FWKOperateType op_type, u } rt_ret = rtFree(devicebase); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtFree failed, ret: 0x%X when ModelManager %s", rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtFree failed, ret: 0x%X", rt_ret); GELOGE(RT_FAILED, "free memory failed. ret: 0x%X", rt_ret); GE_CHK_RT(rtStreamDestroy(stream)); return RT_ERROR_TO_GE_STATUS(rt_ret); } rt_ret = rtStreamDestroy(stream); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtStreamDestroy failed, ret: 0x%X when ModelManager %s", rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtStreamDestroy failed, ret: 0x%X", rt_ret); GELOGE(RT_FAILED, "rtStreamDestroy failed. ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } @@ -233,8 +233,8 @@ ge::Status ModelManager::DestroyAicpuSessionForInfer(uint32_t model_id) { auto it = model_map_.find(model_id); if (it == model_map_.end()) { - REPORT_INNER_ERROR("E19999", "Param model_id:%u can't find in model_map, check invalid when ModelManager %s", - model_id, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Param model_id:%u can't find in model_map, check invalid", + model_id); GELOGE(ACL_ERROR_GE_EXEC_MODEL_ID_INVALID, "model id %u does not exists.", model_id); return ACL_ERROR_GE_EXEC_MODEL_ID_INVALID; } @@ -252,8 +252,8 @@ ge::Status ModelManager::DestroyAicpuKernel(uint64_t session_id, uint32_t model_ Status ret = KernelLaunchEx(aicpu::FWKAdapter::FWKOperateType::FWK_ADPT_KERNEL_DESTROY, session_id, model_id, sub_model_id); if (ret != SUCCESS) { - REPORT_CALL_ERROR("E19999", "Call KernelLaunchEx fail, model_id:%u, sub_model_id:%u, session_id:%lu, " - "when ModelManager %s", model_id, sub_model_id, session_id, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call KernelLaunchEx fail, model_id:%u, sub_model_id:%u, session_id:%lu", + model_id, sub_model_id, session_id); GELOGE(FAILED, "Destroy aicpu kernel failed."); return FAILED; } @@ -311,7 +311,7 @@ bool ModelManager::IsNeedHybridLoad(ge::GeRootModel &ge_root_model) { auto root_graph = ge_root_model.GetRootGraph(); if (root_graph == nullptr) { REPORT_INNER_ERROR("E19999", "root graph in param ge_root_model is nullptr, model_id:%u, " - "check invalid when ModelManager %s", ge_root_model.GetModelId(), __FUNCTION__); + "check invalid", ge_root_model.GetModelId()); GELOGE(FAILED, "no model on root model"); return false; } @@ -340,7 +340,7 @@ Status ModelManager::LoadModelOnline(uint32_t &model_id, const shared_ptr davinci_model = MakeShared(0, listener); if (davinci_model == nullptr) { - REPORT_CALL_ERROR("E19999", "New DavinciModel fail, model_id:%u, when ModelManager %s", model_id, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "New DavinciModel fail, model_id:%u", model_id); GELOGE(FAILED, "davinci_model is nullptr"); return FAILED; } @@ -405,8 +405,8 @@ Status ModelManager::DeleteModel(uint32_t id) { } else if (hybrid_model_it != hybrid_model_map_.end()) { (void)hybrid_model_map_.erase(hybrid_model_it); } else { - REPORT_INNER_ERROR("E19999", "model_id:%u not exist in model_map, check invalid when ModelManager %s", - id, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "model_id:%u not exist in model_map, check invalid", + id); GELOGE(ACL_ERROR_GE_EXEC_MODEL_ID_INVALID, "model id %u does not exists.", id); return ACL_ERROR_GE_EXEC_MODEL_ID_INVALID; } @@ -453,8 +453,7 @@ Status ModelManager::DataInput(const InputData &input_data, OutputData &output_d Status status = data_wrap->Init(input_data, output_data); if (status != SUCCESS) { - REPORT_CALL_ERROR("E19999", "Init InputDataWrapper failed, input data index: %u, when ModelManager %s", - input_data.index, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Init InputDataWrapper failed, input data index: %u", input_data.index); GELOGE(domi::PUSH_DATA_FAILED, "Init InputDataWrapper failed, input data index: %u.", input_data.index); return domi::PUSH_DATA_FAILED; } @@ -471,8 +470,7 @@ Status ModelManager::DataInput(const InputData &input_data, OutputData &output_d DataInputer *inputer = model->GetDataInputer(); GE_CHECK_NOTNULL(inputer); if (inputer->Push(data_wrap) != SUCCESS) { - REPORT_CALL_ERROR("E19999", "DataInputer queue is full, please call again later, model_id %u, when ModelManager %s", - model_id, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "DataInputer queue is full, please call again later, model_id %u", model_id); GELOGE(domi::DATA_QUEUE_ISFULL, "Data queue is full, please call again later, model_id %u ", model_id); return domi::DATA_QUEUE_ISFULL; } @@ -487,8 +485,8 @@ Status ModelManager::GetCurDynamicDims(const vector> &user_real_ GELOGD("Start get cur dynamic dims."); if (user_real_input_dims.size() != user_input_dims.size()) { REPORT_INNER_ERROR("E19999", "Param user_real_input_dims.size:%zu != user_input_dims.size:%zu, " - "check invalid when ModelManager %s", - user_real_input_dims.size(), user_input_dims.size(), __FUNCTION__); + "check invalid", + user_real_input_dims.size(), user_input_dims.size()); GELOGE(INTERNAL_ERROR, "The input count of user: %zu should be equal to the data count of graph: %zu", user_real_input_dims.size(), user_input_dims.size()); @@ -498,8 +496,8 @@ Status ModelManager::GetCurDynamicDims(const vector> &user_real_ for (size_t i = 0; i < user_input_dims.size(); ++i) { if (user_real_input_dims[i].size() != user_input_dims[i].second.size()) { REPORT_INNER_ERROR("E19999", "Param user_real_input_dims[%zu].size:%zu != user_input_dims[%zu].size:%zu, " - "check invalid when ModelManager %s", i, user_real_input_dims[i].size(), - i, user_input_dims[i].second.size(), __FUNCTION__); + "check invalid", i, user_real_input_dims[i].size(), + i, user_input_dims[i].second.size()); GELOGE(INTERNAL_ERROR, "The shape size: %zu of dynamic input: %s should be equal to the shape size of input shape: %zu.", user_real_input_dims[i].size(), user_input_dims[i].first.c_str(), user_input_dims[i].second.size()); @@ -521,8 +519,8 @@ Status ModelManager::GetCurDynamicDims(const vector> &user_real_ } } if (!cur_dynamic_dims_valid) { - REPORT_INNER_ERROR("E19999", "cur dynamic dims is %s, not exist in options, check invalid " - "when ModelManager %s", formats::JoinToString(cur_dynamic_dims).c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "cur dynamic dims is %s, not exist in options, check invalid", + formats::JoinToString(cur_dynamic_dims).c_str()); GELOGE(INTERNAL_ERROR, "Cur dynamic dims is %s, not exist in options.", formats::JoinToString(cur_dynamic_dims).c_str()); return INTERNAL_ERROR; @@ -674,8 +672,8 @@ Status ModelManager::HandleCommand(const Command &command) { auto iter = cmds.find(command.cmd_type); if (iter == cmds.end()) { - REPORT_INNER_ERROR("E19999", "Unsupported command:%s check when ModelManager %s", - command.cmd_type.c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Unsupported command:%s check", + command.cmd_type.c_str()); GELOGE(PARAM_INVALID, "Unsupported command: %s", command.cmd_type.c_str()); return PARAM_INVALID; } else { @@ -687,8 +685,8 @@ Status ModelManager::GetModelByCmd(const Command &command, std::shared_ptr &davinci_model) { if (command.cmd_params.size() < kCmdParSize) { REPORT_INNER_ERROR("E19999", "command.cmd_params.size:%zu < kCmdParSize:%u, command_type:%s, " - "check invalid when ModelManager %s", command.cmd_params.size(), kCmdParSize, - command.cmd_type.c_str(), __FUNCTION__); + "check invalid", command.cmd_params.size(), kCmdParSize, + command.cmd_type.c_str()); GELOGE(PARAM_INVALID, "When the cmd_type is '%s', the size of cmd_params must larger than 2.", command.cmd_type.c_str()); return PARAM_INVALID; @@ -701,18 +699,18 @@ Status ModelManager::GetModelByCmd(const Command &command, try { model_id = std::stoi(value); } catch (std::invalid_argument &) { - REPORT_INNER_ERROR("E19999", "%s param:%s, check invalid when ModelManager %s", PROFILE_MODEL_ID.c_str(), - value.c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "%s param:%s, check invalid", PROFILE_MODEL_ID.c_str(), + value.c_str()); GELOGE(PARAM_INVALID, "Model id: %s is invalid.", value.c_str()); return PARAM_INVALID; } catch (std::out_of_range &) { - REPORT_INNER_ERROR("E19999", "%s param:%s, check out of range when ModelManager %s", PROFILE_MODEL_ID.c_str(), - value.c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "%s param:%s, check out of range", PROFILE_MODEL_ID.c_str(), + value.c_str()); GELOGE(PARAM_INVALID, "Model id: %s is out of range.", value.c_str()); return PARAM_INVALID; } catch (...) { - REPORT_INNER_ERROR("E19999", "%s param:%s, check cannot change to int when ModelManager %s", - PROFILE_MODEL_ID.c_str(), value.c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "%s param:%s, check cannot change to int", + PROFILE_MODEL_ID.c_str(), value.c_str()); GELOGE(FAILED, "Model id: %s cannot change to int.", value.c_str()); return FAILED; } @@ -721,14 +719,14 @@ Status ModelManager::GetModelByCmd(const Command &command, GE_CHECK_NOTNULL(model_manager); davinci_model = model_manager->GetModel(static_cast(model_id)); if (davinci_model == nullptr) { - REPORT_INNER_ERROR("E19999", "GetModel from model_manager fail, model_id:%u, when ModelManager %s", - model_id, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "GetModel from model_manager fail, model_id:%u", + model_id); GELOGE(FAILED, "Model id: %d is invaild or model is not loaded.", model_id); return FAILED; } } else { - REPORT_INNER_ERROR("E19999", "Fisrt cmd_param not %s, check invalid when ModelManager %s", - PROFILE_MODEL_ID.c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Fisrt cmd_param not %s, check invalid", + PROFILE_MODEL_ID.c_str()); GELOGE(FAILED, "The model_id parameter is not found in the command."); return FAILED; } @@ -792,14 +790,14 @@ Status ModelManager::HandleProfFinalizeCommand(const Command &command) { */ Status ModelManager::HandleProfStartCommand(const Command &command) { if (command.cmd_params.size() < kProfStartCmdParaSize) { - REPORT_INNER_ERROR("E19999", "command.cmd_params.size:%zu < %zu, check invalid when ModelManager %s", - command.cmd_params.size(), kProfStartCmdParaSize, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "command.cmd_params.size:%zu < %zu, check invalid", + command.cmd_params.size(), kProfStartCmdParaSize); GELOGE(PARAM_INVALID, "When the cmd_type is 'profile start', the size of cmd_params must larger than 2."); return PARAM_INVALID; } if (command.cmd_params.size() > kProfCmdParaMaxSize) { - REPORT_INNER_ERROR("E19999", "command.cmd_params.size:%zu > %zu, check invalid when ModelManager %s", - command.cmd_params.size(), kProfCmdParaMaxSize, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "command.cmd_params.size:%zu > %zu, check invalid", + command.cmd_params.size(), kProfCmdParaMaxSize); GELOGE(PARAM_INVALID, "Command para size[%zu] larger than max[1000].", command.cmd_params.size()); return PARAM_INVALID; } @@ -822,14 +820,14 @@ Status ModelManager::HandleProfStartCommand(const Command &command) { Status ModelManager::HandleProfStopCommand(const Command &command) { if (command.cmd_params.size() < kProfStartCmdParaSize) { - REPORT_INNER_ERROR("E19999", "command.cmd_params.size:%zu < %zu, check invalid when ModelManager %s", - command.cmd_params.size(), kProfStartCmdParaSize, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "command.cmd_params.size:%zu < %zu, check invalid", + command.cmd_params.size(), kProfStartCmdParaSize); GELOGE(PARAM_INVALID, "When the cmd_type is 'profile stop', the size of cmd_params must larger than 2."); return PARAM_INVALID; } if (command.cmd_params.size() > kProfCmdParaMaxSize) { - REPORT_INNER_ERROR("E19999", "command.cmd_params.size:%zu > %zu, check invalid when ModelManager %s", - command.cmd_params.size(), kProfCmdParaMaxSize, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "command.cmd_params.size:%zu > %zu, check invalid", + command.cmd_params.size(), kProfCmdParaMaxSize); GELOGE(PARAM_INVALID, "Command para size[%zu] larger than max[1000].", command.cmd_params.size()); return PARAM_INVALID; } @@ -855,8 +853,8 @@ static Status ParserPara(const Command &command, const string &dump_key, string if (iter != command.cmd_params.end()) { ++iter; if (iter == command.cmd_params.end()) { - REPORT_INNER_ERROR("E19999", "dump_key:%s can't find in command.param, check invalid when ModelManager %s", - dump_key.c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "dump_key:%s can't find in command.param, check invalid", + dump_key.c_str()); GELOGE(PARAM_INVALID, "Invalid access."); return PARAM_INVALID; } @@ -867,8 +865,8 @@ static Status ParserPara(const Command &command, const string &dump_key, string Status ModelManager::HandleDumpCommand(const Command &command) { if (command.cmd_params.size() % kDumpCmdPairSize != 0) { - REPORT_INNER_ERROR("E19999", "command.cmd_params.size:%zu MOD 2 != 0, check invalid when ModelManager %s", - command.cmd_params.size(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "command.cmd_params.size:%zu MOD 2 != 0, check invalid", + command.cmd_params.size()); GELOGE(PARAM_INVALID, "When the cmd_type is 'dump', the size of cmd_params must be a even number."); return PARAM_INVALID; } @@ -1085,7 +1083,7 @@ Status ModelManager::GenSessionId(uint64_t &session_id) { mmTimeval tv; if (mmGetTimeOfDay(&tv, nullptr) != 0) { - REPORT_CALL_ERROR("E19999", "Call mmGetTimeOfDay fail when ModelManager %s", __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call mmGetTimeOfDay fail"); GELOGE(INTERNAL_ERROR, "Failed to get current time."); return INTERNAL_ERROR; } @@ -1130,7 +1128,7 @@ Status ModelManager::LoadModelOffline(uint32_t &model_id, const ModelData &model GeModelPtr ge_model = model_helper.GetGeModel(); shared_ptr davinci_model = MakeShared(model.priority, listener); if (davinci_model == nullptr) { - REPORT_CALL_ERROR("E19999", "New DavinciModel fail when ModelManager %s", __FUNCTION__); + REPORT_CALL_ERROR("E19999", "New DavinciModel fail"); GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "Make shared failed"); return ACL_ERROR_GE_MEMORY_ALLOCATION; } @@ -1146,7 +1144,7 @@ Status ModelManager::LoadModelOffline(uint32_t &model_id, const ModelData &model int32_t device_id = 0; rtError_t rt_ret = rtGetDevice(&device_id); if (rt_ret != RT_ERROR_NONE || device_id < 0) { - REPORT_CALL_ERROR("E19999", "Call rtGetDevice failed, ret = 0x%X, when ModelManager %s", rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtGetDevice failed, ret = 0x%X", rt_ret); GELOGE(rt_ret, "Call rtGetDevice failed, ret = 0x%X, device_id = %d.", rt_ret, device_id); return RT_ERROR_TO_GE_STATUS(rt_ret); } @@ -1205,7 +1203,7 @@ Status ModelManager::LoadModelWithQ(uint32_t &model_id, const ModelData &model_d shared_ptr davinci_model = MakeShared(model_data.priority, nullptr); if (davinci_model == nullptr) { - REPORT_CALL_ERROR("E19999", "New DavinciModel fail when ModelManager %s", __FUNCTION__); + REPORT_CALL_ERROR("E19999", "New DavinciModel fail"); GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "create model failed."); return ACL_ERROR_GE_MEMORY_ALLOCATION; } @@ -1326,8 +1324,8 @@ Status ModelManager::LoadCustAicpuSo(const OpDescPtr &op_desc, const string &so_ rtContext_t rt_cur_ctx = nullptr; auto rt_error = rtCtxGetCurrent(&rt_cur_ctx); if (rt_error != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtCtxGetCurrent failed, ret = 0x%X, when ModelManager %s", - rt_error, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtCtxGetCurrent failed, ret = 0x%X", + rt_error); GELOGE(RT_FAILED, "get current context failed, runtime result is %d", static_cast(rt_error)); return RT_FAILED; } @@ -1363,8 +1361,8 @@ Status ModelManager::LaunchKernelCustAicpuSo(const string &kernel_name) { rtContext_t rt_cur_ctx = nullptr; auto rt_error = rtCtxGetCurrent(&rt_cur_ctx); if (rt_error != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtCtxGetCurrent failed, ret = 0x%X, when ModelManager %s", - rt_error, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtCtxGetCurrent failed, ret = 0x%X", + rt_error); GELOGE(RT_FAILED, "get current context failed, runtime result is %d", static_cast(rt_error)); return RT_FAILED; } @@ -1390,16 +1388,16 @@ Status ModelManager::LaunchKernelCustAicpuSo(const string &kernel_name) { status = rtMalloc(&d_aicpu_data, aicpu_data_length, RT_MEMORY_HBM); if (status != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%u, ret = 0x%X, when ModelManager %s", - aicpu_data_length, status, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%u, ret = 0x%X", + aicpu_data_length, status); GELOGE(RT_FAILED, "Call rt failed, status: 0x%x", status); return RT_ERROR_TO_GE_STATUS(status); } allocated_mem.push_back(d_aicpu_data); status = rtMalloc(&d_so_name, so_name.size(), RT_MEMORY_HBM); if (status != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMalloc fail, size:%zu, ret = 0x%X, when ModelManager %s", - so_name.size(), status, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMalloc fail, size:%zu, ret = 0x%X", + so_name.size(), status); GELOGE(RT_FAILED, "Call rt failed, status: 0x%x", status); return RT_ERROR_TO_GE_STATUS(status); } @@ -1422,8 +1420,8 @@ Status ModelManager::LaunchKernelCustAicpuSo(const string &kernel_name) { uint32_t args_size = sizeof(CustAicpuSoBuf) * v_cust_so.size(); status = rtMalloc(&args, args_size, RT_MEMORY_HBM); if (status != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMalloc fail, size:%u, ret = 0x%X, when ModelManager %s", - args_size, status, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMalloc fail, size:%u, ret = 0x%X", + args_size, status); GELOGE(RT_FAILED, "Call rt failed, status: 0x%x", status); return RT_ERROR_TO_GE_STATUS(status); } @@ -1438,8 +1436,8 @@ Status ModelManager::LaunchKernelCustAicpuSo(const string &kernel_name) { uint32_t batch_args_size = sizeof(BatchLoadOpFromBufArgs); status = rtMalloc(&batch_args, batch_args_size, RT_MEMORY_HBM); if (status != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMalloc fail, size:%u, ret = 0x%X, when ModelManager %s", - batch_args_size, status, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMalloc fail, size:%u, ret = 0x%X", + batch_args_size, status); GELOGE(RT_FAILED, "Call rt failed, status: 0x%x", status); return RT_ERROR_TO_GE_STATUS(status); } @@ -1452,8 +1450,8 @@ Status ModelManager::LaunchKernelCustAicpuSo(const string &kernel_name) { status = rtStreamSynchronize(stream); if (status != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtStreamSynchronize fail, ret = 0x%X, when ModelManager %s", - status, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtStreamSynchronize fail, ret = 0x%X", + status); GELOGE(RT_FAILED, "Call rt stream sync failed, status: 0x%x", status); return RT_ERROR_TO_GE_STATUS(status); } @@ -1498,8 +1496,7 @@ Status ModelManager::GetModelMemAndWeightSize(const ModelData &model, size_t &me auto partition_table = reinterpret_cast(model_data); if (partition_table->num == 1) { - REPORT_INNER_ERROR("E19999", "partition_table num in model_data is 1, check invalid when ModelManager %s", - __FUNCTION__); + REPORT_INNER_ERROR("E19999", "partition_table num in model_data is 1, check invalid"); GELOGE(ACL_ERROR_GE_PARAM_INVALID, "om model is error,please use executable om model"); return ACL_ERROR_GE_PARAM_INVALID; } @@ -1566,8 +1563,7 @@ ge::Status ModelManager::SyncExecuteModel(uint32_t model_id, const vector &outputs) { auto model = GetHybridModel(model_id); if (model == nullptr) { - REPORT_INNER_ERROR("E19999", "partition_table num in model_data is 1, check invalid when ModelManager %s", - __FUNCTION__); + REPORT_INNER_ERROR("E19999", "partition_table num in model_data is 1, check invalid"); GELOGE(FAILED, "Hybrid model not found. model id = %u.", model_id); return FAILED; } @@ -1596,8 +1592,8 @@ Status ModelManager::EnableExceptionDump(const std::map &options if (iter->second == "1") { rtError_t rt_ret = rtSetTaskFailCallback(reinterpret_cast(ExceptionCallback)); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtSetTaskFailCallback fail, ret = 0x%X, when ModelManager %s", - rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtSetTaskFailCallback fail, ret = 0x%X", + rt_ret); GELOGE(RT_FAILED, "rtSetTaskFailCallback failed"); return RT_ERROR_TO_GE_STATUS(rt_ret); } @@ -1645,8 +1641,8 @@ Status ModelManager::LaunchKernelCheckAicpuOp(std::vector &aicpu_op // malloc sysOpInfoList in SysOpCheckInfo status = rtMalloc(&d_req_op_list, op_nums * sizeof(SysOpInfo), RT_MEMORY_HBM); if (status != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMalloc fail, size:%zu, ret = 0x%X, when ModelManager %s", - op_nums * sizeof(SysOpInfo), status, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMalloc fail, size:%zu, ret = 0x%X", + op_nums * sizeof(SysOpInfo), status); GELOGE(RT_FAILED, "Call rt failed, status: 0x%x", status); return RT_ERROR_TO_GE_STATUS(status); } @@ -1655,8 +1651,8 @@ Status ModelManager::LaunchKernelCheckAicpuOp(std::vector &aicpu_op // malloc sysOpInfoList in SysOpCheckResp status = rtMalloc(&d_res_op_list, op_nums * sizeof(SysOpInfo), RT_MEMORY_HBM); if (status != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMalloc fail, size:%zu, ret = 0x%X, when ModelManager %s", - op_nums * sizeof(SysOpInfo), status, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMalloc fail, size:%zu, ret = 0x%X", + op_nums * sizeof(SysOpInfo), status); GELOGE(RT_FAILED, "Call rt failed, status: 0x%x", status); return RT_ERROR_TO_GE_STATUS(status); } @@ -1665,8 +1661,8 @@ Status ModelManager::LaunchKernelCheckAicpuOp(std::vector &aicpu_op // malloc returnCodeList in SysOpCheckResp status = rtMalloc(&d_ret_code_list, op_nums * sizeof(ReturnCode), RT_MEMORY_HBM); if (status != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMalloc fail, size:%zu, ret = 0x%X, when ModelManager %s", - op_nums * sizeof(ReturnCode), status, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMalloc fail, size:%zu, ret = 0x%X", + op_nums * sizeof(ReturnCode), status); GELOGE(RT_FAILED, "Call rt failed, status: 0x%x", status); return RT_ERROR_TO_GE_STATUS(status); } @@ -1678,8 +1674,8 @@ Status ModelManager::LaunchKernelCheckAicpuOp(std::vector &aicpu_op void *d_op_type_name = nullptr; status = rtMalloc(&d_op_type_name, op_type.length(), RT_MEMORY_HBM); if (status != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMalloc fail, size:%lu, ret = 0x%X, when ModelManager %s", - op_type.length(), status, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMalloc fail, size:%lu, ret = 0x%X", + op_type.length(), status); GELOGE(RT_FAILED, "Call rt failed, status: 0x%x", status); return RT_ERROR_TO_GE_STATUS(status); } @@ -1697,8 +1693,8 @@ Status ModelManager::LaunchKernelCheckAicpuOp(std::vector &aicpu_op void *d_op_type_name = nullptr; status = rtMalloc(&d_op_type_name, op_type.size(), RT_MEMORY_HBM); if (status != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMalloc fail, size:%lu, ret = 0x%X, when ModelManager %s", - op_type.length(), status, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMalloc fail, size:%lu, ret = 0x%X", + op_type.length(), status); GELOGE(RT_FAILED, "Call rt failed, status: 0x%x", status); return RT_ERROR_TO_GE_STATUS(status); } @@ -1727,8 +1723,8 @@ Status ModelManager::LaunchKernelCheckAicpuOp(std::vector &aicpu_op uint32_t args_size = sizeof(SysOpCheckInfo) + sizeof(SysOpCheckResp); status = rtMalloc(&args, args_size, RT_MEMORY_HBM); if (status != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMalloc fail, size:%u, ret = 0x%X, when ModelManager %s", - args_size, status, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMalloc fail, size:%u, ret = 0x%X", + args_size, status); GELOGE(RT_FAILED, "Call rt failed, status: 0x%x", status); return RT_ERROR_TO_GE_STATUS(status); } @@ -1744,8 +1740,8 @@ Status ModelManager::LaunchKernelCheckAicpuOp(std::vector &aicpu_op status = rtStreamSynchronize(stream); if (status != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtStreamSynchronize fail, ret = 0x%X, when ModelManager %s", - status, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtStreamSynchronize fail, ret = 0x%X", + status); GELOGE(RT_FAILED, "Call rt stream sync failed, status: 0x%x", status); GE_CHK_RT(rtStreamDestroy(stream)); return RT_ERROR_TO_GE_STATUS(status); @@ -1779,8 +1775,8 @@ Status ModelManager::LaunchKernelCheckAicpuOp(std::vector &aicpu_op sizeof(SysOpInfo) * res_op_nums, RT_MEMCPY_DEVICE_TO_HOST)); if (res_ret_code_list.size() != res_aicpu_op_info_list.size() || res_ret_code_list.size() != res_op_nums) { REPORT_INNER_ERROR("E19999", "res_ret_code_list.size:%zu res_aicpu_op_info_list.size:%zu res_op_nums:%lu " - "not equal, check invalid when ModelManager %s", - res_ret_code_list.size(), res_aicpu_op_info_list.size(), res_op_nums, __FUNCTION__); + "not equal, check invalid", + res_ret_code_list.size(), res_aicpu_op_info_list.size(), res_op_nums); GELOGE(FAILED, "Number of retcode is not equal to number of op type."); GE_CHK_RT(rtStreamDestroy(stream)); return FAILED; @@ -1804,8 +1800,8 @@ Status ModelManager::LaunchKernelCheckAicpuOp(std::vector &aicpu_op "<0: op_type, 1: format, 2: datatype> \n"; } fail_reason += "not support."; - REPORT_INNER_ERROR("E19999", "Check aicpu op_type failed, details:%s when ModelManager %s", - fail_reason.c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Check aicpu op_type failed, details:%s", + fail_reason.c_str()); GELOGE(FAILED, "Check aicpu op_type failed. details: %s", fail_reason.c_str()); GE_CHK_RT(rtStreamDestroy(stream)); return FAILED; diff --git a/ge/graph/load/model_manager/model_utils.cc b/ge/graph/load/model_manager/model_utils.cc index b72293ee..80bdec9b 100755 --- a/ge/graph/load/model_manager/model_utils.cc +++ b/ge/graph/load/model_manager/model_utils.cc @@ -26,8 +26,8 @@ do { \ if (SIZE <= static_cast(OFFSET)) { \ REPORT_INNER_ERROR("E19999", \ - "Node:%s(%s) offset:%ld out of range size:%lu, check invalid when ModelUtils %s", \ - OP->GetName().c_str(), OP->GetType().c_str(), OFFSET, SIZE, __FUNCTION__); \ + "Node:%s(%s) offset:%ld out of range size:%lu, check invalid", \ + OP->GetName().c_str(), OP->GetType().c_str(), OFFSET, SIZE); \ GELOGE(OUT_OF_MEMORY, "Node: %s, memory out of range[%lu: %ld]", OP->GetName().c_str(), SIZE, OFFSET); \ return {}; \ } \ @@ -308,9 +308,9 @@ vector ModelUtils::GetInputDataAddrs(const RuntimeParam &model_param, Co vector v_memory_type; bool has_mem_type_attr = ge::AttrUtils::GetListInt(op_desc, ATTR_NAME_INPUT_MEM_TYPE_LIST, v_memory_type); if (has_mem_type_attr && (v_memory_type.size() != inputs_size)) { - REPORT_INNER_ERROR("E19999", "Attr:%s, memory_type.size:%zu != input_desc.size:%zu, op:%s(%s), check invalid " - "when ModelUtils %s", ATTR_NAME_INPUT_MEM_TYPE_LIST.c_str(), v_memory_type.size(), inputs_size, - op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Attr:%s, memory_type.size:%zu != input_desc.size:%zu, op:%s(%s), check invalid", + ATTR_NAME_INPUT_MEM_TYPE_LIST.c_str(), v_memory_type.size(), inputs_size, + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(PARAM_INVALID, "Fusion: check input size failed, op: %s, input v_memory_type size: %zu input numbers: %zu", op_desc->GetName().c_str(), v_memory_type.size(), inputs_size); return v_input_data_addr; @@ -390,7 +390,7 @@ Status ModelUtils::GetVarAddr(const RuntimeParam &model_param, const ConstOpDesc switch (mem_type) { case RT_MEMORY_RDMA_HBM: if (offset < 0) { - REPORT_INNER_ERROR("E19999", "Param offset:%ld < 0, check invalid when ModelUtils %s", offset, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Param offset:%ld < 0, check invalid", offset); GELOGE(PARAM_INVALID, "rdma var addr is invalid, addr=%p", reinterpret_cast(static_cast(offset))); return PARAM_INVALID; @@ -402,8 +402,8 @@ Status ModelUtils::GetVarAddr(const RuntimeParam &model_param, const ConstOpDesc var_addr = model_param.var_base + offset - model_param.logic_var_base; break; default: - REPORT_INNER_ERROR("E19999", "Get mem_type:%d for offset:%ld is unsupported, check invalid when ModelUtils %s", - mem_type, offset, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Get mem_type:%d for offset:%ld is unsupported, check invalid", + mem_type, offset); GELOGE(PARAM_INVALID, "unsupported memory type %u", mem_type); return PARAM_INVALID; } @@ -429,9 +429,9 @@ vector ModelUtils::GetOutputDataAddrs(const RuntimeParam &model_param, C vector v_memory_type; bool has_mem_type_attr = ge::AttrUtils::GetListInt(op_desc, ATTR_NAME_OUTPUT_MEM_TYPE_LIST, v_memory_type); if (has_mem_type_attr && (v_memory_type.size() != outputs_size)) { - REPORT_INNER_ERROR("E19999", "Attr:%s, memory_type.size:%zu != output_desc.size:%zu, op:%s(%s), check invalid " - "when ModelUtils %s", ATTR_NAME_OUTPUT_MEM_TYPE_LIST.c_str(), v_memory_type.size(), outputs_size, - op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Attr:%s, memory_type.size:%zu != output_desc.size:%zu, op:%s(%s), check invalid", + ATTR_NAME_OUTPUT_MEM_TYPE_LIST.c_str(), v_memory_type.size(), outputs_size, + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(PARAM_INVALID, "Fusion: check output size failed, op: %s, output v_memory_type size: %lu output numbers: %zu", op_desc->GetName().c_str(), v_memory_type.size(), outputs_size); @@ -580,7 +580,7 @@ Status ModelUtils::GetRtAddress(const RuntimeParam ¶m, uintptr_t logic_addr, param.var_size); } else if (logic_addr != 0) { mem_addr = nullptr; - REPORT_INNER_ERROR("E19999", "Check param logic addr:0x%lx abnormal when ModelUtils %s", logic_addr, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Check param logic addr:0x%lx abnormal", logic_addr); GELOGE(PARAM_INVALID, "The logic addr:0x%lx is abnormal", logic_addr); return PARAM_INVALID; } diff --git a/ge/graph/load/model_manager/task_info/end_graph_task_info.cc b/ge/graph/load/model_manager/task_info/end_graph_task_info.cc index a8b042d3..d3c98684 100644 --- a/ge/graph/load/model_manager/task_info/end_graph_task_info.cc +++ b/ge/graph/load/model_manager/task_info/end_graph_task_info.cc @@ -27,7 +27,7 @@ namespace ge { Status EndGraphTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *davinci_model) { GELOGI("InitEndGraphTaskInfo Init Start."); if (davinci_model == nullptr) { - REPORT_INNER_ERROR("E19999", "Check param davinci_model nullptr when EndGraphTaskInfo %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Check param davinci_model nullptr"); GELOGE(PARAM_INVALID, "davinci_model is null!"); return PARAM_INVALID; } @@ -50,7 +50,7 @@ Status EndGraphTaskInfo::Distribute() { GELOGI("Start to call rtEndGraphEx"); rtError_t rt_ret = rtEndGraphEx(model_, stream_, kDumpFlag); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtEndGraphEx failed, ret:0x%X, when EndGraphTaskInfo %s", rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtEndGraphEx failed, ret:0x%X", rt_ret); GELOGE(RT_FAILED, "Call rtEndGraphEx failed, ret: 0x%x", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } @@ -58,7 +58,7 @@ Status EndGraphTaskInfo::Distribute() { GELOGI("Start to call rtEndGraph"); rtError_t rt_ret = rtEndGraph(model_, stream_); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtEndGraph failed, ret:0x%X, when EndGraphTaskInfo %s", rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtEndGraph failed, ret:0x%X", rt_ret); GELOGE(RT_FAILED, "Call rtEndGraph failed, ret: 0x%x", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } @@ -68,8 +68,8 @@ Status EndGraphTaskInfo::Distribute() { uint32_t stream_id = 0; rtError_t rt_ret = rtModelGetTaskId(davinci_model_->GetRtModelHandle(), &task_id, &stream_id); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtModelGetTaskId failed, ret:0x%X, when EndGraphTaskInfo %s", - rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtModelGetTaskId failed, ret:0x%X", + rt_ret); GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } diff --git a/ge/graph/load/model_manager/task_info/event_record_task_info.cc b/ge/graph/load/model_manager/task_info/event_record_task_info.cc index d8a7a82c..13dae9ee 100755 --- a/ge/graph/load/model_manager/task_info/event_record_task_info.cc +++ b/ge/graph/load/model_manager/task_info/event_record_task_info.cc @@ -23,7 +23,7 @@ namespace ge { Status EventRecordTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *davinci_model) { GELOGI("EventRecordTaskInfo Init Start."); if (davinci_model == nullptr) { - REPORT_INNER_ERROR("E19999", "Check param davinci_model nullptr when EventRecordTaskInfo %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Check param davinci_model nullptr"); GELOGE(PARAM_INVALID, "davinci_model is null!"); return PARAM_INVALID; } @@ -35,8 +35,8 @@ Status EventRecordTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *da const auto &eventList = davinci_model->GetEventList(); if (task_def.event_id() >= eventList.size()) { - REPORT_INNER_ERROR("E19999", "Task event_id:%u > model event size:%zu, check invalid when EventRecordTaskInfo %s", - task_def.event_id(), eventList.size(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Task event_id:%u > model event size:%zu, check invalid", + task_def.event_id(), eventList.size()); GELOGE(INTERNAL_ERROR, "event list size:%zu, cur:%u!", eventList.size(), task_def.event_id()); return INTERNAL_ERROR; } @@ -50,8 +50,8 @@ Status EventRecordTaskInfo::Distribute() { GELOGI("EventRecordTaskInfo Distribute Start."); rtError_t rt_ret = rtEventRecord(event_, stream_); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtEventRecord failed, ret:0x%X, when EventRecordTaskInfo %s", - rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtEventRecord failed, ret:0x%X", + rt_ret); GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } diff --git a/ge/graph/load/model_manager/task_info/event_wait_task_info.cc b/ge/graph/load/model_manager/task_info/event_wait_task_info.cc index 4c9ad412..8fae9225 100755 --- a/ge/graph/load/model_manager/task_info/event_wait_task_info.cc +++ b/ge/graph/load/model_manager/task_info/event_wait_task_info.cc @@ -23,7 +23,7 @@ namespace ge { Status EventWaitTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *davinci_model) { GELOGI("EventWaitTaskInfo Init Start."); if (davinci_model == nullptr) { - REPORT_INNER_ERROR("E19999", "Check param davinci_model nullptr when EventWaitTaskInfo %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Check param davinci_model nullptr"); GELOGE(PARAM_INVALID, "davinci_model is null!"); return PARAM_INVALID; } @@ -35,8 +35,8 @@ Status EventWaitTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *davi const auto &eventList = davinci_model->GetEventList(); if (task_def.event_id() >= eventList.size()) { - REPORT_INNER_ERROR("E19999", "Task event_id:%u > model event size:%zu, check invalid when EventWaitTaskInfo %s", - task_def.event_id(), eventList.size(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Task event_id:%u > model event size:%zu, check invalid", + task_def.event_id(), eventList.size()); GELOGE(INTERNAL_ERROR, "event list size:%zu, cur:%u!", eventList.size(), task_def.event_id()); return INTERNAL_ERROR; } @@ -51,16 +51,16 @@ Status EventWaitTaskInfo::Distribute() { GELOGI("EventWaitTaskInfo Distribute Start."); rtError_t rt_ret = rtStreamWaitEvent(stream_, event_); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtStreamWaitEvent failed, ret:0x%X, when EventWaitTaskInfo %s", - rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtStreamWaitEvent failed, ret:0x%X", + rt_ret); GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } rt_ret = rtEventReset(event_, stream_); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtEventReset failed, ret:0x%X, when EventWaitTaskInfo %s", - rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtEventReset failed, ret:0x%X", + rt_ret); GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } diff --git a/ge/graph/load/model_manager/task_info/fusion_start_task_info.cc b/ge/graph/load/model_manager/task_info/fusion_start_task_info.cc index ab52b093..b47ac097 100755 --- a/ge/graph/load/model_manager/task_info/fusion_start_task_info.cc +++ b/ge/graph/load/model_manager/task_info/fusion_start_task_info.cc @@ -23,7 +23,7 @@ namespace ge { Status FusionStartTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *davinci_model) { GELOGI("FusionStartTaskInfo Init Start."); if (davinci_model == nullptr) { - REPORT_INNER_ERROR("E19999", "Check param davinci_model nullptr when FusionStartTaskInfo %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Check param davinci_model nullptr"); GELOGE(PARAM_INVALID, "davinci_model is null!"); return PARAM_INVALID; } @@ -40,8 +40,8 @@ Status FusionStartTaskInfo::Distribute() { GELOGI("FusionStartTaskInfo Distribute Start."); rtError_t rt_ret = rtKernelFusionStart(stream_); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtKernelFusionStart failed, ret:0x%X, when FusionStartTaskInfo %s", - rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtKernelFusionStart failed, ret:0x%X", + rt_ret); GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } diff --git a/ge/graph/load/model_manager/task_info/fusion_stop_task_info.cc b/ge/graph/load/model_manager/task_info/fusion_stop_task_info.cc index 5786583e..6188cfc8 100755 --- a/ge/graph/load/model_manager/task_info/fusion_stop_task_info.cc +++ b/ge/graph/load/model_manager/task_info/fusion_stop_task_info.cc @@ -23,7 +23,7 @@ namespace ge { Status FusionStopTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *davinci_model) { GELOGI("FusionStopTaskInfo Init Start."); if (davinci_model == nullptr) { - REPORT_INNER_ERROR("E19999", "Check param davinci_model nullptr when FusionStopTaskInfo %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Check param davinci_model nullptr"); GELOGE(PARAM_INVALID, "davinci_model is null!"); return PARAM_INVALID; } @@ -40,8 +40,7 @@ Status FusionStopTaskInfo::Distribute() { GELOGI("FusionStopTaskInfo Distribute Start."); rtError_t rt_ret = rtKernelFusionEnd(stream_); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtKernelFusionEnd failed, ret:0x%X, when FusionStopTaskInfo %s", - rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtKernelFusionEnd failed, ret:0x%X", rt_ret); GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } diff --git a/ge/graph/load/model_manager/task_info/hccl_task_info.cc b/ge/graph/load/model_manager/task_info/hccl_task_info.cc index 0f8ca164..7a435f91 100644 --- a/ge/graph/load/model_manager/task_info/hccl_task_info.cc +++ b/ge/graph/load/model_manager/task_info/hccl_task_info.cc @@ -30,7 +30,7 @@ HcclTaskInfo::~HcclTaskInfo() { if (private_def_ != nullptr) { rtError_t ret = rtFreeHost(private_def_); if (ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtFreeHost failed, ret:0x%X, when HcclTaskInfo %s", ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtFreeHost failed, ret:0x%X", ret); GELOGE(RT_FAILED, "Call rtFree Fail, ret = 0x%X.", ret); } private_def_ = nullptr; @@ -42,7 +42,7 @@ HcclTaskInfo::~HcclTaskInfo() { Status HcclTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *davinci_model) { GELOGI("HcclTaskInfo Init Start."); if (davinci_model == nullptr) { - REPORT_INNER_ERROR("E19999", "Check param davinci_model nullptr when HcclTaskInfo %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Check param davinci_model nullptr"); GELOGE(PARAM_INVALID, "davinci_model is null!"); return PARAM_INVALID; } @@ -69,30 +69,30 @@ Status HcclTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *davinci_m // Only in Horovod scenario should get the inputName and GeShape ret = HcomOmeUtil::GetHorovodInputs(op_desc, kernel_hccl_infos_); if (ret != SUCCESS) { - REPORT_CALL_ERROR("E19999", "Call GetHorovodInputs fail for op:%s(%s), when HcclTaskInfo %s", - op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call GetHorovodInputs fail for op:%s(%s)", + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(ret, "davinci_model: GetHorovodInputs fail! domi error: %u", ret); return ret; } Status dmrt = HcomOmeUtil::GetHcclDataType(op_desc, kernel_hccl_infos_); if (dmrt != SUCCESS) { - REPORT_CALL_ERROR("E19999", "Call GetHcclDataType fail for op:%s(%s), when HcclTaskInfo %s", - op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call GetHcclDataType fail for op:%s(%s)", + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(dmrt, "davinci_model: GetHcomDataType fail! domi error: %u", dmrt); return dmrt; } dmrt = HcomOmeUtil::GetHcclCount(op_desc, kernel_hccl_infos_); if (dmrt != SUCCESS) { - REPORT_CALL_ERROR("E19999", "Call GetHcclCount fail for op:%s(%s), when HcclTaskInfo %s", - op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call GetHcclCount fail for op:%s(%s)", + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(dmrt, "davinci_model: GetHcomCount fail! domi error: %u", dmrt); return dmrt; } // Only HCOMBROADCAST and HVDCALLBACKBROADCAST need to get the rootId dmrt = HcomOmeUtil::GetAllRootId(op_desc, kernel_hccl_infos_); if (dmrt != SUCCESS) { - REPORT_CALL_ERROR("E19999", "Call GetAllRootId fail for op:%s(%s), when HcclTaskInfo %s", - op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call GetAllRootId fail for op:%s(%s)", + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(dmrt, "davinci_model: Get rootId fail! domi error: %u", dmrt); return dmrt; } @@ -179,16 +179,16 @@ Status HcclTaskInfo::CreateStream(int64_t stream_num, DavinciModel *davinci_mode rtError_t rt_ret = rtStreamCreateWithFlags(&stream, davinci_model->Priority(), RT_STREAM_PERSISTENT | RT_STREAM_FORCE_COPY); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtStreamCreateWithFlags failed, ret:0x%X, stream_idx:%ld, stream_num:%ld, " - "when HcclTaskInfo %s", rt_ret, i, stream_num, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtStreamCreateWithFlags failed, ret:0x%X, stream_idx:%ld, stream_num:%ld", + rt_ret, i, stream_num); GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } // Create slave stream, inactive by default, activated by hccl rt_ret = rtModelBindStream(davinci_model->GetRtModelHandle(), stream, RT_MODEL_WAIT_ACTIVE_STREAM); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtModelBindStream failed, ret:0x%X, stream_idx:%ld, stream_num:%ld, " - "when HcclTaskInfo %s", rt_ret, i, stream_num, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtModelBindStream failed, ret:0x%X, stream_idx:%ld, stream_num:%ld", + rt_ret, i, stream_num); GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); (void)rtStreamDestroy(stream); return RT_ERROR_TO_GE_STATUS(rt_ret); @@ -206,7 +206,7 @@ Status HcclTaskInfo::CreateStream(int64_t stream_num, DavinciModel *davinci_mode Status HcclTaskInfo::Distribute() { GELOGI("HcclTaskInfo Distribute Start. begin to call function LoadTask in hccl."); if (ops_kernel_store_ == nullptr) { - REPORT_INNER_ERROR("E19999", "Check param ops_kernel_store_ nullptr when HcclTaskInfo %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Check param ops_kernel_store_ nullptr"); GELOGE(INTERNAL_ERROR, "ops kernel store is null."); return INTERNAL_ERROR; } @@ -216,7 +216,7 @@ Status HcclTaskInfo::Distribute() { TransToGETaskInfo(ge_task); auto result = ops_kernel_info_store->LoadTask(ge_task); if (result != HCCL_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Call ops_kernel_info_store LoadTask fail when HcclTaskInfo %s", __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call ops_kernel_info_store LoadTask fail"); GELOGE(INTERNAL_ERROR, "davinci_model : load task fail, return ret: %u", result); return INTERNAL_ERROR; } @@ -332,8 +332,8 @@ void HcclTaskInfo::GetPrivateDefByTaskDef(const domi::TaskDef &task) { private_def_len_ = private_def_temp.size(); rtError_t ret = rtMallocHost(&private_def_, private_def_len_); if (ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMallocHost failed, ret:0x%X, size:%u, when HcclTaskInfo %s", - ret, private_def_len_, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMallocHost failed, ret:0x%X, size:%u", + ret, private_def_len_); GELOGE(RT_FAILED, "Call rtMallocHost Fail, ret = 0x%X.", ret); return; } @@ -341,8 +341,8 @@ void HcclTaskInfo::GetPrivateDefByTaskDef(const domi::TaskDef &task) { ret = rtMemcpy(private_def_, private_def_len_, task.private_def().c_str(), private_def_len_, RT_MEMCPY_HOST_TO_HOST); if (ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, ret:0x%X, size:%u, when HcclTaskInfo %s", - ret, private_def_len_, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, ret:0x%X, size:%u", + ret, private_def_len_); GELOGE(RT_FAILED, "Call rtMemcpy Fail, ret = 0x%X.", ret); return; } diff --git a/ge/graph/load/model_manager/task_info/kernel_ex_task_info.cc b/ge/graph/load/model_manager/task_info/kernel_ex_task_info.cc index 2c0da343..de987d86 100644 --- a/ge/graph/load/model_manager/task_info/kernel_ex_task_info.cc +++ b/ge/graph/load/model_manager/task_info/kernel_ex_task_info.cc @@ -75,15 +75,15 @@ Status KernelExTaskInfo::InitTaskExtInfo(const std::string &ext_info, const OpDe } auto rt_ret = rtMalloc(&ext_info_addr_, ext_handle->GetExtInfoLen(), RT_MEMORY_HBM); GE_IF_BOOL_EXEC(rt_ret != RT_ERROR_NONE, - REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%zu, ret:0x%X, when KernelExTaskInfo %s", - ext_info.size(), rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%zu, ret:0x%X", + ext_info.size(), rt_ret); GELOGE(RT_FAILED, "rtMalloc ext_info error: 0x%X, size=%zu", rt_ret, ext_info.size()); return RT_ERROR_TO_GE_STATUS(rt_ret);) rt_ret = rtMemcpy(ext_info_addr_, ext_handle->GetExtInfoLen(), ext_handle->GetExtInfo(), ext_handle->GetExtInfoLen(), RT_MEMCPY_HOST_TO_DEVICE); GE_IF_BOOL_EXEC(rt_ret != RT_ERROR_NONE, - REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret:0x%X, when KernelExTaskInfo %s", - ext_handle->GetExtInfoLen(), rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret:0x%X", + ext_handle->GetExtInfoLen(), rt_ret); GELOGE(RT_FAILED, "rtMemcpy ext_info error: 0x%X, size=%zu", rt_ret, ext_info.size()); return RT_ERROR_TO_GE_STATUS(rt_ret);) return SUCCESS; @@ -105,8 +105,8 @@ Status KernelExTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *davin uint32_t op_index = kernel_ex_def.op_index(); OpDescPtr op_desc = davinci_model_->GetOpByIndex(op_index); if (op_desc == nullptr) { - REPORT_INNER_ERROR("E19999", "Can't get op_desc from davinci_model by index:%u when KernelExTaskInfo %s", - op_index, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Can't get op_desc from davinci_model by index:%u", + op_index); GELOGE(INTERNAL_ERROR, "Init aicpu task info error, index is out of range!"); return INTERNAL_ERROR; } @@ -115,8 +115,7 @@ Status KernelExTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *davin STR_FWK_OP_KERNEL fwk_op_kernel = {0}; if (sizeof(STR_FWK_OP_KERNEL) < kernel_ex_def.args_size()) { REPORT_INNER_ERROR("E19999", "Param kernel_ex_def.args_size():%u > sizeof(STR_FWK_OP_KERNEL):%zu, " - "check invalid when KernelExTaskInfo %s", kernel_ex_def.args_size(), sizeof(STR_FWK_OP_KERNEL), - __FUNCTION__); + "check invalid", kernel_ex_def.args_size(), sizeof(STR_FWK_OP_KERNEL)); GELOGE(FAILED, "sizeof STR_FWK_OP_KERNEL is: %zu, but args_size is: %u", sizeof(STR_FWK_OP_KERNEL), kernel_ex_def.args_size()); return FAILED; @@ -124,8 +123,8 @@ Status KernelExTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *davin errno_t sec_ret = memcpy_s(&fwk_op_kernel, sizeof(STR_FWK_OP_KERNEL), kernel_ex_def.args().data(), kernel_ex_def.args_size()); if (sec_ret != EOK) { - REPORT_CALL_ERROR("E19999", "Call memcpy_s fail, size:%zu, ret:0x%X, when KernelExTaskInfo %s", - sizeof(STR_FWK_OP_KERNEL), sec_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call memcpy_s fail, size:%zu, ret:0x%X", + sizeof(STR_FWK_OP_KERNEL), sec_ret); GELOGE(FAILED, "memcpy failed, ret: %d", sec_ret); return FAILED; } @@ -147,17 +146,16 @@ Status KernelExTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *davin uint64_t kernel_id = fwk_op_kernel.fwkKernelBase.fwk_kernel.kernelID; GE_IF_BOOL_EXEC(ModelManager::GetInstance()->CreateAicpuKernel(session_id, davinci_model->Id(), davinci_model->SubModelId(), kernel_id) != SUCCESS, - REPORT_CALL_ERROR("E19999", "CreateAicpuKernel fail, session_id:%lu, model_id:%u, kernel_id:%lu " - "when KernelExTaskInfo %s", - session_id, davinci_model->Id(), kernel_id, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "CreateAicpuKernel fail, session_id:%lu, model_id:%u, kernel_id:%lu", + session_id, davinci_model->Id(), kernel_id); GELOGE(FAILED, "CreateAicpuKernel error."); return FAILED;) // 2.3 Create session GE_CHECK_NOTNULL(ModelManager::GetInstance()); ret = ModelManager::GetInstance()->CreateAicpuSession(session_id); GE_IF_BOOL_EXEC(ret != SUCCESS, - REPORT_CALL_ERROR("E19999", "CreateAicpuSession fail, session_id:%lu when KernelExTaskInfo %s", - session_id, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "CreateAicpuSession fail, session_id:%lu", + session_id); GELOGE(ret, "CreateAicpuSession error. session id: %lu", session_id); return ret;) @@ -169,8 +167,8 @@ Status KernelExTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *davin void *workspace_base_addr = nullptr; rtError_t rt_ret = rtMalloc(&workspace_base_addr, kernel_ex_def.task_info_size(), RT_MEMORY_HBM); GE_IF_BOOL_EXEC(rt_ret != RT_ERROR_NONE, - REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%u, ret:0x%X, when KernelExTaskInfo %s", - kernel_ex_def.task_info_size(), rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%u, ret:0x%X", + kernel_ex_def.task_info_size(), rt_ret); GELOGE(RT_FAILED, "rtMalloc error, ret: Ox%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret);); rt_ret = rtMemcpy(workspace_base_addr, kernel_ex_def.task_info_size(), kernel_ex_def.task_info().data(), @@ -183,16 +181,16 @@ Status KernelExTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *davin rt_ret = rtMalloc(&kernel_buf_, kernel_buf_size_, RT_MEMORY_HBM); GE_IF_BOOL_EXEC(rt_ret != RT_ERROR_NONE, - REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, ret:0x%X, size:%u, when KernelExTaskInfo %s", - rt_ret, kernel_buf_size_, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, ret:0x%X, size:%u", + rt_ret, kernel_buf_size_); GELOGE(RT_FAILED, "rtMalloc error: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret);) rt_ret = rtMemcpy(kernel_buf_, kernel_buf_size_, static_cast(&fwk_op_kernel), kernel_buf_size_, RT_MEMCPY_HOST_TO_DEVICE); GE_IF_BOOL_EXEC(rt_ret != RT_ERROR_NONE, - REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, ret:0x%X, size:%u, when KernelExTaskInfo %s", - rt_ret, kernel_buf_size_, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, ret:0x%X, size:%u", + rt_ret, kernel_buf_size_); GELOGE(RT_FAILED, "rtMemcpy error, ret: Ox%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret);) @@ -211,8 +209,8 @@ Status KernelExTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *davin const vector workspace_data_addrs = ModelUtils::GetWorkspaceDataAddrs(rts_param, op_desc); if (workspace_data_addrs.empty()) { - REPORT_CALL_ERROR("E19999", "workspace_data_addrs is empty in op:%s(%s), check invalid when KernelExTaskInfo %s", - op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "workspace_data_addrs is empty in op:%s(%s), check invalid", + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(FAILED, "workspace_data_addrs is empty."); return FAILED; } @@ -228,15 +226,15 @@ Status KernelExTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *davin if (addrs_size > 0) { rtError_t rt_ret = rtMalloc(&input_output_addr_, addrs_size, RT_MEMORY_HBM); GE_IF_BOOL_EXEC(rt_ret != RT_ERROR_NONE, - REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, ret:0x%X, size:%lu, when KernelExTaskInfo %s", - rt_ret, addrs_size, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, ret:0x%X, size:%lu", + rt_ret, addrs_size); GELOGE(RT_FAILED, "rtMalloc error, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret);) rt_ret = rtMemcpy(input_output_addr_, addrs_size, io_addrs.data(), addrs_size, RT_MEMCPY_HOST_TO_DEVICE); GE_IF_BOOL_EXEC(rt_ret != RT_ERROR_NONE, - REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, ret:0x%X, size:%lu, when KernelExTaskInfo %s", - rt_ret, addrs_size, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, ret:0x%X, size:%lu", + rt_ret, addrs_size); GELOGE(RT_FAILED, "rtMemcpy to input_output_addr_ error: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret);) @@ -257,16 +255,16 @@ Status KernelExTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *davin // 4. Return result rtError_t rt_ret = rtMalloc(&kernel_buf_, sizeof(STR_FWK_OP_KERNEL), RT_MEMORY_HBM); GE_IF_BOOL_EXEC(rt_ret != RT_ERROR_NONE, - REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, ret:0x%X, size:%zu, when KernelExTaskInfo %s", - rt_ret, sizeof(STR_FWK_OP_KERNEL), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, ret:0x%X, size:%zu", + rt_ret, sizeof(STR_FWK_OP_KERNEL)); GELOGE(RT_FAILED, "rtMalloc error: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret);) rt_ret = rtMemcpy(kernel_buf_, sizeof(STR_FWK_OP_KERNEL), static_cast(&fwk_op_kernel), sizeof(STR_FWK_OP_KERNEL), RT_MEMCPY_HOST_TO_DEVICE); GE_IF_BOOL_EXEC(rt_ret != RT_ERROR_NONE, - REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, ret:0x%X, size:%zu, when KernelExTaskInfo %s", - rt_ret, sizeof(STR_FWK_OP_KERNEL), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, ret:0x%X, size:%zu", + rt_ret, sizeof(STR_FWK_OP_KERNEL)); GELOGE(RT_FAILED, "rtMemcpy error, ret: Ox%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret);) @@ -288,8 +286,8 @@ Status KernelExTaskInfo::CalculateArgs(const domi::TaskDef &task_def, DavinciMod uint32_t op_index = kernel_ex_def.op_index(); OpDescPtr op_desc = davinci_model->GetOpByIndex(op_index); if (op_desc == nullptr) { - REPORT_INNER_ERROR("E19999", "Can't get op_desc from davinci_model by index:%u when KernelExTaskInfo %s", - op_index, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Can't get op_desc from davinci_model by index:%u", + op_index); GELOGE(INTERNAL_ERROR, "Init aicpu task info error, index is out of range!"); return INTERNAL_ERROR; } @@ -308,8 +306,8 @@ Status KernelExTaskInfo::CalculateArgs(const domi::TaskDef &task_def, DavinciMod uint32_t output_index = davinci_model->GetFixedAddrOutputIndex(peer_input_name); if (output_index > outputs_size) { REPORT_INNER_ERROR("E19999", "The output size[%zu] and output index[%u] in op:%s(%s) are inconsistent, " - "check invalid when KernelExTaskInfo %s", outputs_size, output_index, - op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + "check invalid", outputs_size, output_index, + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(FAILED, "The output size[%zu] and output index[%u] are inconsistent.", outputs_size, output_index); return FAILED; } @@ -337,8 +335,8 @@ void KernelExTaskInfo::SetIoAddrs(const OpDescPtr &op_desc) { uint32_t output_index = davinci_model_->GetFixedAddrOutputIndex(peer_input_name); if (output_index > output_data_addrs.size()) { REPORT_INNER_ERROR("E19999", "The output data addr size[%zu] and output index[%u] in op:%s(%s) are inconsistent" - ", check invalid when KernelExTaskInfo %s", output_data_addrs.size(), output_index, - op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + ", check invalid", output_data_addrs.size(), output_index, + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(FAILED, "The output data addr size[%zu] and output index[%u] are inconsistent.", output_data_addrs.size(), output_index); return; @@ -369,25 +367,25 @@ Status KernelExTaskInfo::CopyTaskInfo(const domi::KernelExDef &kernel_def, const const vector workspace_data_sizes = ModelUtils::GetWorkspaceSize(op_desc); const vector workspace_data_addrs = ModelUtils::GetWorkspaceDataAddrs(rts_param, op_desc); if (workspace_data_addrs.empty() || workspace_data_sizes.empty()) { - REPORT_INNER_ERROR("E19999", "Node:%s(%s) workspace addr:%zu or size:%zu empty, check invalid " - "when KernelExTaskInfo %s", op_desc->GetName().c_str(), op_desc->GetType().c_str(), - workspace_data_addrs.size(), workspace_data_sizes.size(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Node:%s(%s) workspace addr:%zu or size:%zu empty, check invalid", + op_desc->GetName().c_str(), op_desc->GetType().c_str(), + workspace_data_addrs.size(), workspace_data_sizes.size()); GELOGE(FAILED, "Node:%s invalid workspace, addrs is %zu, size is %zu.", op_desc->GetName().c_str(), workspace_data_addrs.size(), workspace_data_sizes.size()); return FAILED; } if (workspace_data_addrs[0] == nullptr) { - REPORT_INNER_ERROR("E19999", "Node:%s(%s) workspace addr is nullptr, check invalid when KernelExTaskInfo %s", - op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Node:%s(%s) workspace addr is nullptr, check invalid", + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(FAILED, "Node:%s workspace addrs is null.", op_desc->GetName().c_str()); return FAILED; } if (workspace_data_sizes[0] < static_cast(kernel_def.task_info_size())) { - REPORT_INNER_ERROR("E19999", "Node:%s(%s) workspace size:%ld < task info size:%d, check invalid " - "when KernelExTaskInfo %s", op_desc->GetName().c_str(), op_desc->GetType().c_str(), - workspace_data_sizes[0], kernel_def.task_info_size(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Node:%s(%s) workspace size:%ld < task info size:%d, check invalid", + op_desc->GetName().c_str(), op_desc->GetType().c_str(), + workspace_data_sizes[0], kernel_def.task_info_size()); GELOGE(FAILED, "Node:%s workspace size is %ld, task info size is %d.", op_desc->GetName().c_str(), workspace_data_sizes[0], kernel_def.task_info_size()); return FAILED; @@ -396,8 +394,8 @@ Status KernelExTaskInfo::CopyTaskInfo(const domi::KernelExDef &kernel_def, const rtError_t rt_ret = rtMemcpy(workspace_data_addrs[0], kernel_def.task_info_size(), kernel_def.task_info().data(), kernel_def.task_info_size(), RT_MEMCPY_HOST_TO_DEVICE); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, ret:0x%X, size:%d, when KernelExTaskInfo %s", - rt_ret, kernel_def.task_info_size(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, ret:0x%X, size:%d", + rt_ret, kernel_def.task_info_size()); GELOGE(RT_FAILED, "rtMemcpy error: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } @@ -409,14 +407,14 @@ Status KernelExTaskInfo::Distribute() { GELOGI("KernelExTaskInfo Distribute Start."); rtError_t rt_ret = rtKernelLaunchEx(kernel_buf_, kernel_buf_size_, dump_flag_, stream_); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtKernelLaunchEx failed, ret:0x%X when KernelExTaskInfo %s", - rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtKernelLaunchEx failed, ret:0x%X", + rt_ret); GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } if (davinci_model_ == nullptr) { - REPORT_INNER_ERROR("E19999", "Check param davinci_model nullptr when KernelExTaskInfo %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Check param davinci_model nullptr"); GELOGE(PARAM_INVALID, "davinci_model_ is null."); return PARAM_INVALID; } @@ -425,8 +423,8 @@ Status KernelExTaskInfo::Distribute() { uint32_t stream_id = 0; // for profiling rt_ret = rtModelGetTaskId(davinci_model_->GetRtModelHandle(), &task_id, &stream_id); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtModelGetTaskId failed, ret:0x%X when KernelExTaskInfo %s", - rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtModelGetTaskId failed, ret:0x%X", + rt_ret); GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } diff --git a/ge/graph/load/model_manager/task_info/kernel_task_info.cc b/ge/graph/load/model_manager/task_info/kernel_task_info.cc index ecbcb7a4..4485515a 100755 --- a/ge/graph/load/model_manager/task_info/kernel_task_info.cc +++ b/ge/graph/load/model_manager/task_info/kernel_task_info.cc @@ -95,9 +95,9 @@ Status KernelTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *davinci rtError_t rt_ret = rtGetFunctionByName(const_cast(kernel_def.stub_func().c_str()), &stub_func_); GE_IF_BOOL_EXEC(rt_ret != RT_ERROR_NONE, REPORT_CALL_ERROR("E19999", "Call rtGetFunctionByName failed for op:%s(%s), " - "bin_file_key:%s, ret:0x%X, when KernelTaskInfo %s", + "bin_file_key:%s, ret:0x%X", op_desc_->GetName().c_str(), op_desc_->GetType().c_str(), - kernel_def.stub_func().c_str(), rt_ret, __FUNCTION__); + kernel_def.stub_func().c_str(), rt_ret); GELOGE(RT_FAILED, "execute rtGetFunctionByName failed. stub_func: %s", kernel_def.stub_func().c_str()); return RT_ERROR_TO_GE_STATUS(rt_ret);); @@ -109,17 +109,17 @@ Status KernelTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *davinci rtError_t rt_ret = rtGetFunctionByName(bin_file_key, &stub_func_); GE_IF_BOOL_EXEC(rt_ret != RT_ERROR_NONE, REPORT_CALL_ERROR("E19999", "Call rtGetFunctionByName failed for op:%s(%s), " - "bin_file_key:%s, ret:0x%X, when KernelTaskInfo %s", + "bin_file_key:%s, ret:0x%X", op_desc_->GetName().c_str(), op_desc_->GetType().c_str(), - bin_file_key, rt_ret, __FUNCTION__); + bin_file_key, rt_ret); GELOGE(RT_FAILED, "execute rtGetFunctionByName failed. bin_file_key: %s", bin_file_key); return RT_ERROR_TO_GE_STATUS(rt_ret);); } if (context.origin_op_index_size() > CC_FUSION_OP_MAX) { REPORT_INNER_ERROR("E19999", "context.origin_op_index_size():%d is more than CC_FUSION_OP_MAX(%d), op:%s(%s) ," - "check invalid when KernelTaskInfo %s", context.origin_op_index_size(), CC_FUSION_OP_MAX, - op_desc_->GetName().c_str(), op_desc_->GetType().c_str(), __FUNCTION__); + "check invalid", context.origin_op_index_size(), CC_FUSION_OP_MAX, + op_desc_->GetName().c_str(), op_desc_->GetType().c_str()); GELOGE(PARAM_INVALID, "context.origin_op_index_size() is more than CC_FUSION_OP_MAX(%d)", CC_FUSION_OP_MAX); return PARAM_INVALID; } @@ -133,8 +133,8 @@ Status KernelTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *davinci uint16_t *args_offset_tmp = reinterpret_cast(const_cast(context.args_offset().data())); if (context.args_offset().size() / sizeof(uint16_t) < 1) { REPORT_INNER_ERROR("E19999", "context.args_offset().size():%zu / sizeof(uint16_t) less than 1, op:%s(%s) ," - "check invalid when KernelTaskInfo %s", context.args_offset().size(), - op_desc_->GetName().c_str(), op_desc_->GetType().c_str(), __FUNCTION__); + "check invalid", context.args_offset().size(), + op_desc_->GetName().c_str(), op_desc_->GetType().c_str()); GELOGE(FAILED, "context.args_offset().size() / sizeof(uint16_t) less than 1"); return FAILED; } @@ -147,8 +147,8 @@ Status KernelTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *davinci ret = InitAicpuTask(context.op_index(), kernel_def); } else { if (kernel_def.args().empty() || args_size_ == 0) { - REPORT_INNER_ERROR("E19999", "kernel_def.args() is empty, op:%s(%s), check invalid when KernelTaskInfo %s", - op_desc_->GetName().c_str(), op_desc_->GetType().c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "kernel_def.args() is empty, op:%s(%s), check invalid", + op_desc_->GetName().c_str(), op_desc_->GetType().c_str()); GELOGE(FAILED, "args is null."); return FAILED; } @@ -181,8 +181,8 @@ void KernelTaskInfo::UpdateSKTTaskId() { if (davinci_model_ != nullptr) { rtError_t rt_ret = rtModelGetTaskId(davinci_model_->GetRtModelHandle(), &task_id, &stream_id); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtModelGetTaskId failed, ret:0x%X, when KernelTaskInfo %s", - rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtModelGetTaskId failed, ret:0x%X", + rt_ret); GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); return; } @@ -201,8 +201,8 @@ void KernelTaskInfo::UpdateTaskId() { if (davinci_model_ != nullptr) { rtError_t rt_ret = rtModelGetTaskId(davinci_model_->GetRtModelHandle(), &task_id, &stream_id); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtModelGetTaskId failed, ret:0x%X, when KernelTaskInfo %s", - rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtModelGetTaskId failed, ret:0x%X", + rt_ret); GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); return; } @@ -258,8 +258,8 @@ Status KernelTaskInfo::SuperKernelLaunch() { static_cast(skt_info.last_sm_desc), skt_info.last_stream, skt_info.last_dump_flag); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtKernelLaunchWithFlag failed, ret:0x%X, when KernelTaskInfo %s", - rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtKernelLaunchWithFlag failed, ret:0x%X", + rt_ret); GELOGE(RT_FAILED, "SuperKernelLaunch: Call rt api failed, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } @@ -272,8 +272,8 @@ Status KernelTaskInfo::SuperKernelLaunch() { // Init super kernel factory Status ge_ret = factory->Init(); if (ge_ret != SUCCESS) { - REPORT_CALL_ERROR("E19999", "Call SuperKernelFactory init fail, ret:0x%X, when KernelTaskInfo %s", - ge_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call SuperKernelFactory init fail, ret:0x%X", + ge_ret); GELOGE(ge_ret, "SuperKernelLaunch: SuperKernelFactory init failed"); return ge_ret; } @@ -281,8 +281,8 @@ Status KernelTaskInfo::SuperKernelLaunch() { std::unique_ptr superKernel = nullptr; ge_ret = factory->FuseKernels(skt_kernel_list, skt_arg_list, skt_info.last_block_dim, superKernel); if (ge_ret != SUCCESS) { - REPORT_CALL_ERROR("E19999", "Call SuperKernelFactory FuseKernels fail, ret:0x%X, when KernelTaskInfo %s", - ge_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call SuperKernelFactory FuseKernels fail, ret:0x%X", + ge_ret); GELOGE(ge_ret, "SuperKernelLaunch: fuse call failed"); return ge_ret; } @@ -290,8 +290,8 @@ Status KernelTaskInfo::SuperKernelLaunch() { skt_dump_flag_ = GetDumpFlag(); ge_ret = superKernel->Launch(skt_info.last_stream, skt_dump_flag_); if (ge_ret != SUCCESS) { - REPORT_CALL_ERROR("E19999", "Call SuperKernelFactory Launch fail, ret:0x%X, when KernelTaskInfo %s", - ge_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call SuperKernelFactory Launch fail, ret:0x%X", + ge_ret); GELOGE(ge_ret, "SuperKernelLaunch: launch failed"); return ge_ret; } @@ -330,14 +330,14 @@ Status KernelTaskInfo::SaveSuperKernelInfo() { bool KernelTaskInfo::IsMarkedLastNode() { if (davinci_model_ == nullptr) { - REPORT_INNER_ERROR("E19999", "Check param davinci_model nullptr when KernelTaskInfo %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Check param davinci_model nullptr"); GELOGE(PARAM_INVALID, "davinci_model is null!"); return false; } OpDescPtr op_desc = davinci_model_->GetOpByIndex(ctx_.opIndex); if (op_desc == nullptr) { - REPORT_INNER_ERROR("E19999", "Can't get op_desc from davinci_model by index:%u when KernelTaskInfo %s", - ctx_.opIndex, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Can't get op_desc from davinci_model by index:%u", + ctx_.opIndex); GELOGE(INTERNAL_ERROR, "InitTVMTaskInfo error, index is out of range!"); return false; } @@ -348,14 +348,14 @@ bool KernelTaskInfo::IsMarkedLastNode() { bool KernelTaskInfo::IsMarkedFirstNode() { if (davinci_model_ == nullptr) { - REPORT_INNER_ERROR("E19999", "Check param davinci_model nullptr when KernelTaskInfo %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Check param davinci_model nullptr"); GELOGE(PARAM_INVALID, "davinci_model is null!"); return false; } OpDescPtr op_desc = davinci_model_->GetOpByIndex(ctx_.opIndex); if (op_desc == nullptr) { - REPORT_INNER_ERROR("E19999", "Can't get op_desc from davinci_model by index:%u when KernelTaskInfo %s", - ctx_.opIndex, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Can't get op_desc from davinci_model by index:%u", + ctx_.opIndex); GELOGE(INTERNAL_ERROR, "InitTVMTaskInfo error, index is out of range!"); return false; } @@ -396,8 +396,8 @@ Status KernelTaskInfo::SuperKernelDistribute() { rtError_t rt_ret = rtKernelLaunchWithFlag(stub_func_, block_dim_, args_, args_size_, static_cast(sm_desc_), stream_, dump_flag_); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtKernelLaunchWithFlag failed, ret:0x%X, when KernelTaskInfo %s", - rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtKernelLaunchWithFlag failed, ret:0x%X", + rt_ret); GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); return rt_ret; } @@ -460,7 +460,7 @@ Status KernelTaskInfo::Distribute() { } if (rt_ret != RT_ERROR_NONE) { REPORT_CALL_ERROR("E19999", "Call rtKernelLaunchWithFlag or rtCpuKernelLaunchWithFlag failed, " - "ret:0x%X, when KernelTaskInfo %s", rt_ret, __FUNCTION__); + "ret:0x%X", rt_ret); GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } @@ -497,8 +497,8 @@ Status KernelTaskInfo::CopyNoncontinuousArgs(uint16_t offset) { // copy io addr errno_t sec_ret = memcpy_s(args_addr.get() + offset, addr_size, io_addrs.data(), addr_size); if (sec_ret != EOK) { - REPORT_CALL_ERROR("E19999", "Call memcpy_s fail, size:%zu, ret:0x%X, when KernelTaskInfo %s", - addr_size, sec_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call memcpy_s fail, size:%zu, ret:0x%X", + addr_size, sec_ret); GELOGE(FAILED, "memcpy failed, ret: %d", sec_ret); return FAILED; } @@ -506,8 +506,8 @@ Status KernelTaskInfo::CopyNoncontinuousArgs(uint16_t offset) { // copy args to device rtError_t rt_ret = rtMemcpy(args_, args_size_, args_addr.get(), args_size_, RT_MEMCPY_HOST_TO_DEVICE); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%u, ret:0x%X, when KernelTaskInfo %s", - args_size_, rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%u, ret:0x%X", + args_size_, rt_ret); GELOGE(RT_FAILED, "Call rt api(rtMemcpy) failed, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } @@ -556,7 +556,7 @@ Status KernelTaskInfo::Release() { ret = (sm_desc_ != nullptr) ? rtMemFreeManaged(sm_desc_) : RT_ERROR_NONE; if (ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMemFreeManaged failed, ret:0x%X, when KernelTaskInfo %s", ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMemFreeManaged failed, ret:0x%X", ret); GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", static_cast(ret)); return RT_ERROR_TO_GE_STATUS(ret); } @@ -587,16 +587,16 @@ Status KernelTaskInfo::UpdateL2Data(const domi::KernelDef &kernel_def) { rtError_t rt_ret = rtMemAllocManaged(&sm_desc_, sm_desc.size(), RT_MEMORY_SPM); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMemAllocManaged failed, ret:0x%X, when KernelTaskInfo %s", - rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMemAllocManaged failed, ret:0x%X", + rt_ret); GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } rt_ret = rtMemcpy(sm_desc_, sm_desc.size(), sm_desc.data(), sm_desc.size(), RT_MEMCPY_HOST_TO_DEVICE); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret:0x%X, when KernelTaskInfo %s", - sm_desc.size(), rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret:0x%X", + sm_desc.size(), rt_ret); GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } @@ -643,8 +643,8 @@ Status KernelTaskInfo::InitTVMTask(uint16_t offset, const domi::KernelDef &kerne args_addr = std::unique_ptr(new (std::nothrow) uint8_t[args_size_]); errno_t sec_ret = memcpy_s(args_addr.get(), args_size_, kernel_def.args().data(), args_size_); if (sec_ret != EOK) { - REPORT_CALL_ERROR("E19999", "Call memcpy_s fail, size:%u, ret:0x%X, when KernelTaskInfo %s", - args_size_, sec_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call memcpy_s fail, size:%u, ret:0x%X", + args_size_, sec_ret); GELOGE(FAILED, "memcpy failed, ret: %d", sec_ret); return FAILED; } @@ -687,8 +687,8 @@ Status KernelTaskInfo::InitTVMTask(uint16_t offset, const domi::KernelDef &kerne // malloc args memory rt_ret = rtMalloc(&args_, args_size_, RT_MEMORY_HBM); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%u, ret:0x%X, when KernelTaskInfo %s", - args_size_, rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%u, ret:0x%X", + args_size_, rt_ret); GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } @@ -696,17 +696,16 @@ Status KernelTaskInfo::InitTVMTask(uint16_t offset, const domi::KernelDef &kerne // copy orign args rt_ret = rtMemcpy(args_, args_size_, kernel_def.args().data(), args_size_, RT_MEMCPY_HOST_TO_DEVICE); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%u, ret:0x%X, when KernelTaskInfo %s", - args_size_, rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%u, ret:0x%X", + args_size_, rt_ret); GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } if ((args_size_ <= offset) || (args_size_ - offset < kAddrLen * tensor_device_addrs.size())) { REPORT_INNER_ERROR("E19999", "offset:%u >= kernelInfo.argsSize:%u or copy content:%zu beyond applied memory:%u, " - "check invalid, when KernelTaskInfo %s", - offset, args_size_, kAddrLen * tensor_device_addrs.size(), args_size_ - offset, - __FUNCTION__); + "check invalid", + offset, args_size_, kAddrLen * tensor_device_addrs.size(), args_size_ - offset); GELOGE(FAILED, "offset >= kernelInfo.argsSize or copy content beyond applied memory."); return FAILED; } @@ -715,16 +714,16 @@ Status KernelTaskInfo::InitTVMTask(uint16_t offset, const domi::KernelDef &kerne rt_ret = rtMemcpy(static_cast(args_) + offset, args_size_ - offset, tensor_device_addrs.data(), kAddrLen * tensor_device_addrs.size(), RT_MEMCPY_HOST_TO_DEVICE); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%u, ret:0x%X, when KernelTaskInfo %s", - args_size_ - offset, rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%u, ret:0x%X", + args_size_ - offset, rt_ret); GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } sec_ret = memcpy_s(args_addr.get() + offset, args_size_ - offset, tensor_device_addrs.data(), kAddrLen * tensor_device_addrs.size()); if (sec_ret != EOK) { - REPORT_CALL_ERROR("E19999", "Call memcpy_s failed, size:%u, ret:0x%X, when KernelTaskInfo %s", - args_size_ - offset, sec_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call memcpy_s failed, size:%u, ret:0x%X", + args_size_ - offset, sec_ret); GELOGE(FAILED, "memcpy failed, ret: %d", sec_ret); return FAILED; } @@ -769,8 +768,8 @@ Status KernelTaskInfo::InitAICPUCustomTask(uint32_t op_index, const domi::Kernel GELOGI("Do InitAICPUCustomTask"); OpDescPtr op_desc = davinci_model_->GetOpByIndex(op_index); if (op_desc == nullptr) { - REPORT_INNER_ERROR("E19999", "Can't get op_desc from davinci_model by index:%u when KernelTaskInfo %s", - op_index, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Can't get op_desc from davinci_model by index:%u", + op_index); GELOGE(INTERNAL_ERROR, "index is out of range, index: %u", op_index); return INTERNAL_ERROR; } @@ -781,17 +780,17 @@ Status KernelTaskInfo::InitAICPUCustomTask(uint32_t op_index, const domi::Kernel const uint32_t kCustomAicpuArgsLen = 5; ctx_.argsOffset = new (std::nothrow) uint16_t[kCustomAicpuArgsLen](); if (ctx_.argsOffset == nullptr) { - REPORT_CALL_ERROR("E19999", "New ctx_.argsOffset fail, size:%u, op:%s(%s), when KernelTaskInfo %s", - kCustomAicpuArgsLen, op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "New ctx_.argsOffset fail, size:%u, op:%s(%s)", + kCustomAicpuArgsLen, op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(PARAM_INVALID, "ctx_.argsOffset is null!"); return PARAM_INVALID; } if (context.args_offset().size() / sizeof(uint16_t) < kCustomAicpuArgsLen) { REPORT_INNER_ERROR("E19999", "context.args_offset().size():%zu / sizeof(uint16_t) is less than " - "kCustomAicpuArgsLen:%u, op:%s(%s), check invalid when KernelTaskInfo %s", + "kCustomAicpuArgsLen:%u, op:%s(%s), check invalid", context.args_offset().size(), kCustomAicpuArgsLen, - op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(PARAM_INVALID, "context.args_offset().size() / sizeof(uint16_t) is less than kCustomAicpuArgsLen"); return PARAM_INVALID; } @@ -812,32 +811,32 @@ Status KernelTaskInfo::InitAICPUCustomTask(uint32_t op_index, const domi::Kernel // attrHandle Buffer buffer; if (!AttrUtils::GetBytes(op_desc, ATTR_NAME_OPATTR, buffer)) { - REPORT_INNER_ERROR("E19999", "Get Attr:%s in op:%s(%s) fail when KernelTaskInfo %s", ATTR_NAME_OPATTR.c_str(), - op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Get Attr:%s in op:%s(%s) fail", ATTR_NAME_OPATTR.c_str(), + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(FAILED, "can't find opattr bytes!."); return FAILED; } uint32_t op_attr_size = buffer.GetSize(); if (op_attr_size == 0) { - REPORT_INNER_ERROR("E19999", "Attr:%s in op:%s(%s) size is 0, check invalid when KernelTaskInfo %s", - ATTR_NAME_OPATTR.c_str(), op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Attr:%s in op:%s(%s) size is 0, check invalid", + ATTR_NAME_OPATTR.c_str(), op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(PARAM_INVALID, "param op_attr_size is out of range"); return PARAM_INVALID; } rtError_t rt_ret = rtMalloc(&custom_info_.attr_handle, op_attr_size, RT_MEMORY_HBM); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMalloc failed for op:%s(%s), size:%u, ret:0x%X, when KernelTaskInfo %s", - op_desc->GetName().c_str(), op_desc->GetType().c_str(), op_attr_size, rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMalloc failed for op:%s(%s), size:%u, ret:0x%X", + op_desc->GetName().c_str(), op_desc->GetType().c_str(), op_attr_size, rt_ret); GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } rt_ret = rtMemcpy(custom_info_.attr_handle, op_attr_size, buffer.GetData(), op_attr_size, RT_MEMCPY_HOST_TO_DEVICE); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed for op:%s(%s), size:%u, ret:0x%X, when KernelTaskInfo %s", - op_desc->GetName().c_str(), op_desc->GetType().c_str(), op_attr_size, rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed for op:%s(%s), size:%u, ret:0x%X", + op_desc->GetName().c_str(), op_desc->GetType().c_str(), op_attr_size, rt_ret); GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } @@ -848,9 +847,9 @@ Status KernelTaskInfo::InitAICPUCustomTask(uint32_t op_index, const domi::Kernel for (uint32_t i = 0; i < kCustomAicpuArgsLen; ++i) { if (kernel_def.args().size() < ((size_t)ctx_.argsOffset[i] + sizeof(uint64_t))) { REPORT_INNER_ERROR("E19999", "ctx.argsOffset[%u]: %u + sizeof(uint64_t): %zu >= kernelDef.args().size():%zu, " - "op:%s(%s) check invalid when KernelTaskInfo %s", i, (uint32_t)ctx_.argsOffset[i], + "op:%s(%s) check invalid", i, (uint32_t)ctx_.argsOffset[i], sizeof(uint64_t), kernel_def.args().size(), - op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(FAILED, "ctx.argsOffset[%u]: %u + sizeof(uint64_t): %zu >= kernelDef.args().size():%zu", i, (uint32_t)ctx_.argsOffset[i], sizeof(uint64_t), kernel_def.args().size()); return FAILED; @@ -869,8 +868,8 @@ Status KernelTaskInfo::InitAICPUCustomTask(uint32_t op_index, const domi::Kernel rt_ret = rtMalloc(&args_, args_size_, RT_MEMORY_HBM); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMalloc failed for op:%s(%s), size:%u, ret:0x%X, when KernelTaskInfo %s", - op_desc->GetName().c_str(), op_desc->GetType().c_str(), args_size_, rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMalloc failed for op:%s(%s), size:%u, ret:0x%X", + op_desc->GetName().c_str(), op_desc->GetType().c_str(), args_size_, rt_ret); GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } @@ -878,9 +877,9 @@ Status KernelTaskInfo::InitAICPUCustomTask(uint32_t op_index, const domi::Kernel rt_ret = rtMemcpy(args_, kernel_def.args_size(), kernel_def.args().data(), kernel_def.args_size(), RT_MEMCPY_HOST_TO_DEVICE); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed for op:%s(%s), size:%u, ret:0x%X, when KernelTaskInfo %s", + REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed for op:%s(%s), size:%u, ret:0x%X", op_desc->GetName().c_str(), op_desc->GetType().c_str(), - kernel_def.args_size(), rt_ret, __FUNCTION__); + kernel_def.args_size(), rt_ret); GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } @@ -895,7 +894,7 @@ Status KernelTaskInfo::InitAICPUCustomTask(uint32_t op_index, const domi::Kernel Status KernelTaskInfo::InitCceTask(const domi::KernelDef &kernel_def) { GELOGI("Do InitCCETask"); if (davinci_model_ == nullptr) { - REPORT_INNER_ERROR("E19999", "Check param davinci_model nullptr when KernelTaskInfo %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Check param davinci_model nullptr"); GELOGE(PARAM_INVALID, "davinci_model is null!"); return PARAM_INVALID; } @@ -910,8 +909,7 @@ Status KernelTaskInfo::InitCceTask(const domi::KernelDef &kernel_def) { if (context.is_flowtable()) { if (flowtable.empty()) { - REPORT_INNER_ERROR("E19999", "kernel_def.flowtable is empty, check invalid when KernelTaskInfo %s", - __FUNCTION__); + REPORT_INNER_ERROR("E19999", "kernel_def.flowtable is empty, check invalid"); GELOGE(FAILED, "flowtable is null."); return FAILED; } @@ -946,8 +944,8 @@ Status KernelTaskInfo::InitCceTask(const domi::KernelDef &kernel_def) { // args rtError_t rt_ret = rtMalloc(&args_, kernel_def.args_size(), RT_MEMORY_HBM); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%u, ret:0x%X, when KernelTaskInfo %s", - kernel_def.args_size(), rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%u, ret:0x%X", + kernel_def.args_size(), rt_ret); GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } @@ -956,8 +954,8 @@ Status KernelTaskInfo::InitCceTask(const domi::KernelDef &kernel_def) { rt_ret = rtMemcpy(args_, kernel_def.args_size(), kernel_def.args().data(), kernel_def.args_size(), RT_MEMCPY_HOST_TO_DEVICE); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%u, ret:0x%X, when KernelTaskInfo %s", - kernel_def.args_size(), rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%u, ret:0x%X", + kernel_def.args_size(), rt_ret); GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } @@ -966,16 +964,16 @@ Status KernelTaskInfo::InitCceTask(const domi::KernelDef &kernel_def) { if (!sm_desc.empty()) { rt_ret = rtMemAllocManaged(&sm_desc_, sm_desc.size(), RT_MEMORY_SPM); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMemAllocManaged failed, ret:0x%X, when KernelTaskInfo %s", - rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMemAllocManaged failed, ret:0x%X", + rt_ret); GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } rt_ret = rtMemcpy(sm_desc_, sm_desc.size(), sm_desc.data(), sm_desc.size(), RT_MEMCPY_HOST_TO_DEVICE); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret:0x%X, when KernelTaskInfo %s", - sm_desc.size(), rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret:0x%X", + sm_desc.size(), rt_ret); GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } @@ -990,8 +988,8 @@ Status KernelTaskInfo::InitAicpuTask(uint32_t op_index, const domi::KernelDef &k OpDescPtr op_desc = davinci_model_->GetOpByIndex(op_index); if (op_desc == nullptr) { - REPORT_INNER_ERROR("E19999", "Can't get op_desc from davinci_model by index:%u when KernelTaskInfo %s", - op_index, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Can't get op_desc from davinci_model by index:%u", + op_index); GELOGE(INTERNAL_ERROR, "index is out of range, index: %u", op_index); return INTERNAL_ERROR; } @@ -1009,8 +1007,8 @@ Status KernelTaskInfo::InitAicpuTask(uint32_t op_index, const domi::KernelDef &k GE_PRINT_DYNAMIC_MEMORY(new, "cce task physical memory.", sizeof(uint8_t) * args_size_) errno_t sec_ret = memcpy_s(args_addr.get(), args_size_, kernel_def.args().data(), args_size_); if (sec_ret != EOK) { - REPORT_CALL_ERROR("E19999", "Call memcpy_s fail, size:%u, ret:0x%X, when KernelTaskInfo %s", - args_size_, sec_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call memcpy_s fail, size:%u, ret:0x%X", + args_size_, sec_ret); GELOGE(FAILED, "memcpy failed, ret: %d", sec_ret); return FAILED; } @@ -1045,8 +1043,8 @@ Status KernelTaskInfo::InitAicpuTask(uint32_t op_index, const domi::KernelDef &k auto addrs_size = sizeof(uint64_t) * io_addrs.size(); sec_ret = memcpy_s(reinterpret_cast(io_addr), addrs_size, io_addrs.data(), addrs_size); if (sec_ret != EOK) { - REPORT_CALL_ERROR("E19999", "Call memcpy_s fail, size:%lu, ret:0x%X, when KernelTaskInfo %s", - addrs_size, sec_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call memcpy_s fail, size:%lu, ret:0x%X", + addrs_size, sec_ret); GELOGE(FAILED, "memcpy failed, ret: %d", sec_ret); return FAILED; } @@ -1055,8 +1053,8 @@ Status KernelTaskInfo::InitAicpuTask(uint32_t op_index, const domi::KernelDef &k // malloc device memory for args rtError_t rt_ret = rtMalloc(static_cast(&args_), args_size_, RT_MEMORY_HBM); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMalloc failed for op:%s(%s), size:%u, ret:0x%X, when KernelTaskInfo %s", - op_desc->GetName().c_str(), op_desc->GetType().c_str(), args_size_, rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMalloc failed for op:%s(%s), size:%u, ret:0x%X", + op_desc->GetName().c_str(), op_desc->GetType().c_str(), args_size_, rt_ret); GELOGE(RT_FAILED, "Call rt api(rtMalloc) failed, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } @@ -1065,8 +1063,8 @@ Status KernelTaskInfo::InitAicpuTask(uint32_t op_index, const domi::KernelDef &k // copy args to device rt_ret = rtMemcpy(args_, args_size_, args_addr.get(), args_size_, RT_MEMCPY_HOST_TO_DEVICE); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed for op:%s(%s), size:%u, ret:0x%X, when KernelTaskInfo %s", - op_desc->GetName().c_str(), op_desc->GetType().c_str(), args_size_, rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed for op:%s(%s), size:%u, ret:0x%X", + op_desc->GetName().c_str(), op_desc->GetType().c_str(), args_size_, rt_ret); GELOGE(RT_FAILED, "Call rt api(rtMemcpy) failed, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } @@ -1138,18 +1136,18 @@ Status KernelTaskInfo::InitAicpuTaskExtInfo(const std::string &ext_info) { } auto rt_ret = rtMalloc(&aicpu_ext_info_addr_, ext_handle->GetExtInfoLen(), RT_MEMORY_HBM); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMalloc failed for op:%s(%s), size:%zu, ret:0x%X, when KernelTaskInfo %s", + REPORT_CALL_ERROR("E19999", "Call rtMalloc failed for op:%s(%s), size:%zu, ret:0x%X", op_desc_->GetName().c_str(), op_desc_->GetType().c_str(), - ext_handle->GetExtInfoLen(), rt_ret, __FUNCTION__); + ext_handle->GetExtInfoLen(), rt_ret); GELOGE(RT_FAILED, "rtMalloc ext_info error: 0x%X, size=%zu", rt_ret, ext_info.size()); return RT_ERROR_TO_GE_STATUS(rt_ret); } rt_ret = rtMemcpy(aicpu_ext_info_addr_, ext_handle->GetExtInfoLen(), ext_handle->GetExtInfo(), ext_handle->GetExtInfoLen(), RT_MEMCPY_HOST_TO_DEVICE); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed for op:%s(%s), size:%zu, ret:0x%X, when KernelTaskInfo %s", + REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed for op:%s(%s), size:%zu, ret:0x%X", op_desc_->GetName().c_str(), op_desc_->GetType().c_str(), - ext_handle->GetExtInfoLen(), rt_ret, __FUNCTION__); + ext_handle->GetExtInfoLen(), rt_ret); GELOGE(RT_FAILED, "rtMemcpy ext_info error: 0x%X, size=%zu", rt_ret, ext_info.size()); return RT_ERROR_TO_GE_STATUS(rt_ret); } @@ -1167,8 +1165,8 @@ Status KernelTaskInfo::StoreInputOutputTensor(const std::vector &input_d // inputDescs rtError_t rt_ret = rtMalloc(&custom_info_.input_descs, sizeof(opTensor_t) * input_size, RT_MEMORY_HBM); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%zu, ret:0x%X, when KernelTaskInfo %s", - sizeof(opTensor_t) * input_size, rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%zu, ret:0x%X", + sizeof(opTensor_t) * input_size, rt_ret); GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } @@ -1177,8 +1175,8 @@ Status KernelTaskInfo::StoreInputOutputTensor(const std::vector &input_d rt_ret = rtMemcpy(static_cast(custom_info_.input_descs) + i, sizeof(opTensor_t), const_cast(&input_descs[i]), sizeof(opTensor_t), RT_MEMCPY_HOST_TO_DEVICE); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret:0x%X, when KernelTaskInfo %s", - sizeof(opTensor_t), rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret:0x%X", + sizeof(opTensor_t), rt_ret); GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } @@ -1187,8 +1185,8 @@ Status KernelTaskInfo::StoreInputOutputTensor(const std::vector &input_d // inputAddrs rt_ret = rtMalloc(&custom_info_.input_addrs, sizeof(opTensor_t) * input_size, RT_MEMORY_HBM); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%zu, ret:0x%X, when KernelTaskInfo %s", - sizeof(opTensor_t) * input_size, rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%zu, ret:0x%X", + sizeof(opTensor_t) * input_size, rt_ret); GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } @@ -1197,8 +1195,8 @@ Status KernelTaskInfo::StoreInputOutputTensor(const std::vector &input_d rt_ret = rtMemcpy(custom_info_.input_addrs, kAddrLen * input_size, &input_data_addrs[0], kAddrLen * input_size, RT_MEMCPY_HOST_TO_DEVICE); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret:0x%X, when KernelTaskInfo %s", - kAddrLen * input_size, rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret:0x%X", + kAddrLen * input_size, rt_ret); GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } @@ -1207,8 +1205,8 @@ Status KernelTaskInfo::StoreInputOutputTensor(const std::vector &input_d // outputDescs rt_ret = rtMalloc(&custom_info_.output_descs, sizeof(opTensor_t) * output_size, RT_MEMORY_HBM); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%zu, ret:0x%X, when KernelTaskInfo %s", - sizeof(opTensor_t) * output_size, rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%zu, ret:0x%X", + sizeof(opTensor_t) * output_size, rt_ret); GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } @@ -1216,8 +1214,8 @@ Status KernelTaskInfo::StoreInputOutputTensor(const std::vector &input_d rt_ret = rtMemcpy(static_cast(custom_info_.output_descs) + i, sizeof(opTensor_t), const_cast(&input_descs[i]), sizeof(opTensor_t), RT_MEMCPY_HOST_TO_DEVICE); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret:0x%X, when KernelTaskInfo %s", - sizeof(opTensor_t), rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret:0x%X", + sizeof(opTensor_t), rt_ret); GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } @@ -1226,8 +1224,8 @@ Status KernelTaskInfo::StoreInputOutputTensor(const std::vector &input_d // outputAddrs rt_ret = rtMalloc(&custom_info_.output_addrs, sizeof(opTensor_t) * output_size, RT_MEMORY_HBM); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%zu, ret:0x%X, when KernelTaskInfo %s", - sizeof(opTensor_t) * output_size, rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%zu, ret:0x%X", + sizeof(opTensor_t) * output_size, rt_ret); GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } @@ -1236,8 +1234,8 @@ Status KernelTaskInfo::StoreInputOutputTensor(const std::vector &input_d rt_ret = rtMemcpy(custom_info_.output_addrs, kAddrLen * output_size, &output_data_addrs[0], kAddrLen * output_size, RT_MEMCPY_HOST_TO_DEVICE); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret:0x%X, when KernelTaskInfo %s", - kAddrLen * output_size, rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret:0x%X", + kAddrLen * output_size, rt_ret); GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } @@ -1254,16 +1252,15 @@ Status KernelTaskInfo::SetContext(const domi::KernelDef &kernel_def) { ctx_.isFlowtable = context.is_flowtable(); ctx_.argsCount = context.args_count(); if (ctx_.argsCount == 0) { - REPORT_INNER_ERROR("E19999", "kernel_def.context.args_count is 0, check invalid when KernelTaskInfo %s", - __FUNCTION__); + REPORT_INNER_ERROR("E19999", "kernel_def.context.args_count is 0, check invalid"); GELOGE(INTERNAL_ERROR, "check argsCount fail:%u.", ctx_.argsCount); return INTERNAL_ERROR; } if (context.args_offset().size() / sizeof(uint16_t) < ctx_.argsCount) { REPORT_INNER_ERROR("E19999", "param [context.args_offset().size():%zu / sizeof(uint16_t)] " - "is less than [ctx_.argsCount:%u], check invalid when KernelTaskInfo %s", - context.args_offset().size(), ctx_.argsCount, __FUNCTION__); + "is less than [ctx_.argsCount:%u], check invalid", + context.args_offset().size(), ctx_.argsCount); GELOGE(PARAM_INVALID, "param [context.args_offset().size() / sizeof(uint16_t)] is less than [ctx_.argsCount]"); return PARAM_INVALID; } @@ -1271,8 +1268,8 @@ Status KernelTaskInfo::SetContext(const domi::KernelDef &kernel_def) { // ctx_.argsOffset stores the offset of the internal information of agrs_, equal to the ctx_.argsCount ctx_.argsOffset = new (std::nothrow) uint16_t[ctx_.argsCount](); if (ctx_.argsOffset == nullptr) { - REPORT_CALL_ERROR("E19999", "New ctx_.argsOffset fail, size:%u, when KernelTaskInfo %s", - ctx_.argsCount, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "New ctx_.argsOffset fail, size:%u", + ctx_.argsCount); GELOGE(PARAM_INVALID, "(param [ctx_.argsOffset] must not be null."); return PARAM_INVALID; } @@ -1290,7 +1287,7 @@ void KernelTaskInfo::FreeRtMem(void **ptr) { } rtError_t ret = rtFree(*ptr); if (ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtFree failed, ret:0x%X, when KernelTaskInfo %s", ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtFree failed, ret:0x%X", ret); GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", ret); } @@ -1338,8 +1335,8 @@ Status KernelTaskInfo::CceUpdateKernelArgs(const domi::KernelContext &context, u if (handle == nullptr) { error = mmDlerror(); GE_IF_BOOL_EXEC(error == nullptr, error = ""); - REPORT_INNER_ERROR("E19999", "Failed in dlopen:%s, dlerror:%s, when KernelTaskInfo %s", - canonicalPath.c_str(), error, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Failed in dlopen:%s, dlerror:%s", + canonicalPath.c_str(), error); GELOGE(GE_PLGMGR_SO_NOT_EXIST, "Failed in dlopen %s! ", error); return FAILED; } @@ -1348,8 +1345,8 @@ Status KernelTaskInfo::CceUpdateKernelArgs(const domi::KernelContext &context, u auto cceUpdateKernelArgs = (ccStatus_t(*)(ccOpContext &, uint64_t, uint64_t, uint64_t, void *, uint64_t, void *))mmDlsym(handle, const_cast(update_kernel_args.c_str())); if (cceUpdateKernelArgs == nullptr) { - REPORT_INNER_ERROR("E19999", "No symbol:%s in %s, check invalid when KernelTaskInfo %s", - update_kernel_args.c_str(), canonicalPath.c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "No symbol:%s in %s, check invalid", + update_kernel_args.c_str(), canonicalPath.c_str()); GELOGE(FAILED, "Failed to invoke function ccUpdateKernelArgs"); if (mmDlclose(handle) != 0) { error = mmDlerror(); @@ -1374,8 +1371,8 @@ Status KernelTaskInfo::CceUpdateKernelArgs(const domi::KernelContext &context, u return FAILED; } if (cc_ret != CC_STATUS_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Call cceUpdateKernelArgs fail, ret:0x%X, when KernelTaskInfo %s", - cc_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call cceUpdateKernelArgs fail, ret:0x%X", + cc_ret); GELOGE(CCE_FAILED, "Call cce api failed, ret: 0x%X", cc_ret); return CCE_FAILED; } @@ -1389,8 +1386,8 @@ Status KernelTaskInfo::SetFlowtable(std::string &flowtable, const domi::KernelDe if (context.is_flowtable()) { rtError_t rt_ret = rtMalloc(&flowtable_, flowtable.size(), RT_MEMORY_HBM); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%zu, ret:0x%X, when KernelTaskInfo %s", - flowtable.size(), rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%zu, ret:0x%X", + flowtable.size(), rt_ret); GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } @@ -1398,8 +1395,8 @@ Status KernelTaskInfo::SetFlowtable(std::string &flowtable, const domi::KernelDe rt_ret = rtMemcpy(flowtable_, flowtable.size(), flowtable.data(), flowtable.size(), RT_MEMCPY_HOST_TO_DEVICE); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret:0x%X, when KernelTaskInfo %s", - flowtable.size(), rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret:0x%X", + flowtable.size(), rt_ret); GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } @@ -1411,9 +1408,9 @@ Status KernelTaskInfo::SetFlowtable(std::string &flowtable, const domi::KernelDe ((reinterpret_cast(const_cast(context.args_offset().data())))[0] + sizeof(uint64_t))) { REPORT_INNER_ERROR( "E19999", "(context.args_offset().data()))[0]:%u + sizeof(uint64_t):%zu > " - "kernelDef.args().size():%zu, check invalid when %s", + "kernelDef.args().size():%zu, check invalid", (uint32_t)((reinterpret_cast(const_cast(context.args_offset().data())))[0]), - sizeof(uint64_t), kernel_def.args().size(), __FUNCTION__); + sizeof(uint64_t), kernel_def.args().size()); GELOGE(FAILED, "(context.args_offset().data()))[0]:%u + sizeof(uint64_t):%zu > kernelDef.args().size():%zu", (uint32_t)((reinterpret_cast(const_cast(context.args_offset().data())))[0]), sizeof(uint64_t), kernel_def.args().size()); diff --git a/ge/graph/load/model_manager/task_info/label_goto_ex_task_info.cc b/ge/graph/load/model_manager/task_info/label_goto_ex_task_info.cc index dbd7af25..b858259e 100755 --- a/ge/graph/load/model_manager/task_info/label_goto_ex_task_info.cc +++ b/ge/graph/load/model_manager/task_info/label_goto_ex_task_info.cc @@ -38,17 +38,17 @@ Status LabelGotoExTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *da const domi::LabelGotoExDef &label_goto = task_def.label_goto_ex(); OpDescPtr op_desc = davinci_model->GetOpByIndex(label_goto.op_index()); if (op_desc == nullptr) { - REPORT_INNER_ERROR("E19999", "Can't get op_desc from davinci_model by index:%u when LabelGotoExTaskInfo %s", - label_goto.op_index(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Can't get op_desc from davinci_model by index:%u", + label_goto.op_index()); GELOGE(INTERNAL_ERROR, "Task op index:%u out of range!", label_goto.op_index()); return INTERNAL_ERROR; } uint32_t label_index = 0; if (!AttrUtils::GetInt(op_desc, ATTR_NAME_LABEL_SWITCH_INDEX, label_index)) { - REPORT_INNER_ERROR("E19999", "Get Attr:%s in op:%s(%s) fail when LabelGotoExTaskInfo %s", + REPORT_INNER_ERROR("E19999", "Get Attr:%s in op:%s(%s) fail", ATTR_NAME_LABEL_SWITCH_INDEX.c_str(), - op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(INTERNAL_ERROR, "LabelGotoExTaskInfo: %s attr [%s] not exist.", op_desc->GetName().c_str(), ATTR_NAME_LABEL_SWITCH_INDEX.c_str()); return INTERNAL_ERROR; @@ -61,8 +61,8 @@ Status LabelGotoExTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *da rtError_t rt_ret = rtMalloc(&index_value_, sizeof(uint64_t), memory_type); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMalloc failed for op:%s(%s), size:%lu, ret:0x%X, when LabelGotoExTaskInfo %s", - op_desc->GetName().c_str(), op_desc->GetType().c_str(), sizeof(uint64_t), rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMalloc failed for op:%s(%s), size:%lu, ret:0x%X", + op_desc->GetName().c_str(), op_desc->GetType().c_str(), sizeof(uint64_t), rt_ret); GELOGE(RT_FAILED, "Call rtMalloc failed, error: %#x", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } @@ -70,8 +70,8 @@ Status LabelGotoExTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *da uint64_t branch_index = 0; rt_ret = rtMemcpy(index_value_, sizeof(uint64_t), &branch_index, sizeof(uint64_t), RT_MEMCPY_HOST_TO_DEVICE); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed for op:%s(%s), size:%lu, ret:0x%X, when LabelGotoExTaskInfo %s", - op_desc->GetName().c_str(), op_desc->GetType().c_str(), sizeof(uint64_t), rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed for op:%s(%s), size:%lu, ret:0x%X", + op_desc->GetName().c_str(), op_desc->GetType().c_str(), sizeof(uint64_t), rt_ret); GELOGE(RT_FAILED, "Call rtMemcpy failed, error: %#x", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } @@ -85,15 +85,15 @@ Status LabelGotoExTaskInfo::Distribute() { GE_CHECK_NOTNULL(args_); GE_CHECK_NOTNULL(index_value_); if (args_size_ == 0) { - REPORT_INNER_ERROR("E19999", "Param args_size_ is 0, check fail when LabelGotoExTaskInfo %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Param args_size_ is 0, check fail"); GELOGE(PARAM_INVALID, "branch max: %u, args size: %u invalid.", kGotoBranchMax, args_size_); return PARAM_INVALID; } rtError_t rt_ret = rtLabelSwitchByIndex(index_value_, kGotoBranchMax, args_, stream_); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtLabelSwitchByIndex failed, ret:0x%X, when LabelGotoExTaskInfo %s", - rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtLabelSwitchByIndex failed, ret:0x%X", + rt_ret); GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } diff --git a/ge/graph/load/model_manager/task_info/label_set_task_info.cc b/ge/graph/load/model_manager/task_info/label_set_task_info.cc index b72a001f..c8cb7975 100644 --- a/ge/graph/load/model_manager/task_info/label_set_task_info.cc +++ b/ge/graph/load/model_manager/task_info/label_set_task_info.cc @@ -32,17 +32,17 @@ Status LabelSetTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *davin const domi::LabelSetDef &label_set = task_def.label_set(); OpDescPtr op_desc = davinci_model->GetOpByIndex(label_set.op_index()); if (op_desc == nullptr) { - REPORT_INNER_ERROR("E19999", "Can't get op_desc from davinci_model by index:%u when LabelSetTaskInfo %s", - label_set.op_index(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Can't get op_desc from davinci_model by index:%u", + label_set.op_index()); GELOGE(INTERNAL_ERROR, "Task op index:%u out of range!", label_set.op_index()); return INTERNAL_ERROR; } uint32_t label_index = 0; if (!AttrUtils::GetInt(op_desc, ATTR_NAME_LABEL_SWITCH_INDEX, label_index)) { - REPORT_INNER_ERROR("E19999", "Get Attr:%s in op:%s(%s) fail when LabelSetTaskInfo %s", + REPORT_INNER_ERROR("E19999", "Get Attr:%s in op:%s(%s) fail", ATTR_NAME_LABEL_SWITCH_INDEX.c_str(), - op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(INTERNAL_ERROR, "LabelSetTaskInfo: %s attr [%s] not exist.", op_desc->GetName().c_str(), ATTR_NAME_LABEL_SWITCH_INDEX.c_str()); return INTERNAL_ERROR; @@ -51,8 +51,8 @@ Status LabelSetTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *davin const vector &label_list = davinci_model->GetLabelList(); if (label_index >= label_list.size()) { REPORT_INNER_ERROR("E19999", "lable_index:%u >= label_list.size():%zu in model, op:%s(%s), " - "check invalid when LabelSetTaskInfo %s", label_index, label_list.size(), - op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + "check invalid", label_index, label_list.size(), + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(INTERNAL_ERROR, "LabelSetTaskInfo: Invalid label id:%u, label size:%zu", label_index, label_list.size()); return INTERNAL_ERROR; } @@ -66,8 +66,8 @@ Status LabelSetTaskInfo::Distribute() { GELOGI("LabelSetTaskInfo Distribute Start."); rtError_t rt_ret = rtLabelSet(label_, stream_); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtLabelSet failed, ret:0x%X, when LabelSetTaskInfo %s", - rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtLabelSet failed, ret:0x%X", + rt_ret); GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } diff --git a/ge/graph/load/model_manager/task_info/label_switch_by_index_task_info.cc b/ge/graph/load/model_manager/task_info/label_switch_by_index_task_info.cc index 0953f598..b7ffdb84 100644 --- a/ge/graph/load/model_manager/task_info/label_switch_by_index_task_info.cc +++ b/ge/graph/load/model_manager/task_info/label_switch_by_index_task_info.cc @@ -39,8 +39,8 @@ Status LabelSwitchByIndexTaskInfo::Init(const domi::TaskDef &task_def, DavinciMo const domi::LabelSwitchByIndexDef &label_switch = task_def.label_switch_by_index(); OpDescPtr op_desc = davinci_model->GetOpByIndex(label_switch.op_index()); if (op_desc == nullptr) { - REPORT_INNER_ERROR("E19999", "Can't get op_desc from davinci_model by index:%u when LabelSwitchByIndexTaskInfo %s", - label_switch.op_index(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Can't get op_desc from davinci_model by index:%u", + label_switch.op_index()); GELOGE(INTERNAL_ERROR, "Task op index:%u out of range!", label_switch.op_index()); return INTERNAL_ERROR; } @@ -50,8 +50,8 @@ Status LabelSwitchByIndexTaskInfo::Init(const domi::TaskDef &task_def, DavinciMo auto input_data_addr = ModelUtils::GetInputDataAddrs(davinci_model->GetRuntimeParam(), op_desc); if (input_data_addr.size() != kLabelSwitchIndexNum) { REPORT_INNER_ERROR("E19999", "input_data_addr size:%zu != kLabelSwitchIndexNum:%u, op:%s(%s), " - "check invalid when LabelSwitchByIndexTaskInfo %s", input_data_addr.size(), kLabelSwitchIndexNum, - op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + "check invalid", input_data_addr.size(), kLabelSwitchIndexNum, + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(INTERNAL_ERROR, "LabelSwitchByIndexTaskInfo: %s invalid addr size: %zu, num: %u!", op_desc->GetName().c_str(), input_data_addr.size(), kLabelSwitchIndexNum); return INTERNAL_ERROR; @@ -67,9 +67,9 @@ Status LabelSwitchByIndexTaskInfo::Init(const domi::TaskDef &task_def, DavinciMo vector label_idx_list; if (!AttrUtils::GetListInt(op_desc, ATTR_NAME_LABEL_SWITCH_LIST, label_idx_list)) { - REPORT_INNER_ERROR("E19999", "Get Attr:%s in op:%s(%s) fail when LabelSwitchByIndexTaskInfo %s", + REPORT_INNER_ERROR("E19999", "Get Attr:%s in op:%s(%s) fail", ATTR_NAME_LABEL_SWITCH_LIST.c_str(), - op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(INTERNAL_ERROR, "LabelSwitchByIndexTaskInfo: %s Get attr %s failed.", op_desc->GetName().c_str(), ATTR_NAME_LABEL_SWITCH_LIST.c_str()); return INTERNAL_ERROR; @@ -77,9 +77,9 @@ Status LabelSwitchByIndexTaskInfo::Init(const domi::TaskDef &task_def, DavinciMo if (label_idx_list.empty() || label_idx_list.size() != branch_max_) { REPORT_INNER_ERROR("E19999", "label_idx_list in op:%s(%s) is empty, or size:%zu != branch_max_:%u" - "check invalid when LabelSwitchByIndexTaskInfo %s", + "check invalid", op_desc->GetName().c_str(), op_desc->GetType().c_str(), - label_idx_list.size(), branch_max_, __FUNCTION__); + label_idx_list.size(), branch_max_); GELOGE(INTERNAL_ERROR, "LabelSwitchByIndexTaskInfo: %s label index size: %zu, task branch max: %u.", op_desc->GetName().c_str(), label_idx_list.size(), branch_max_); return INTERNAL_ERROR; @@ -91,8 +91,8 @@ Status LabelSwitchByIndexTaskInfo::Init(const domi::TaskDef &task_def, DavinciMo uint32_t label_id = label_idx_list[idx]; if (label_id >= label_list.size()) { REPORT_INNER_ERROR("E19999", "label_id:%u in op:%s(%s) >= label_list.size():%zu in model" - "check invalid when LabelSwitchByIndexTaskInfo %s", label_id, - op_desc->GetName().c_str(), op_desc->GetType().c_str(), label_list.size(), __FUNCTION__); + "check invalid", label_id, + op_desc->GetName().c_str(), op_desc->GetType().c_str(), label_list.size()); GELOGE(INTERNAL_ERROR, "LabelSwitchByIndexTaskInfo: %s index: %zu, label index: %u, model label size: %zu.", op_desc->GetName().c_str(), idx, label_id, label_list.size()); return INTERNAL_ERROR; @@ -106,17 +106,16 @@ Status LabelSwitchByIndexTaskInfo::Init(const domi::TaskDef &task_def, DavinciMo args_size_ = branch_max_ * sizeof(rtLabelDevInfo); rtError_t rt_ret = rtMalloc(&args_, args_size_, memory_type); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMalloc failed for op:%s(%s), size:%u, ret:0x%X, " - "when LabelSwitchByIndexTaskInfo %s", - op_desc->GetName().c_str(), op_desc->GetType().c_str(), args_size_, rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMalloc failed for op:%s(%s), size:%u, ret:0x%X", + op_desc->GetName().c_str(), op_desc->GetType().c_str(), args_size_, rt_ret); GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } rt_ret = rtLabelListCpy(label_used.data(), label_used.size(), args_, args_size_); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtLabelListCpy failed, ret:0x%X, when LabelSwitchByIndexTaskInfo %s", - rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtLabelListCpy failed, ret:0x%X", + rt_ret); GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } @@ -131,15 +130,15 @@ Status LabelSwitchByIndexTaskInfo::Distribute() { GE_CHECK_NOTNULL(index_value_); if (branch_max_ == 0 || args_size_ == 0) { REPORT_INNER_ERROR("E19999", "branch_max_:%u or args_size_:%u is 0" - "check invalid when LabelSwitchByIndexTaskInfo %s", branch_max_, args_size_, __FUNCTION__); + "check invalid", branch_max_, args_size_); GELOGE(PARAM_INVALID, "branch max: %u, args size: %u invalid.", branch_max_, args_size_); return PARAM_INVALID; } rtError_t rt_ret = rtLabelSwitchByIndex(index_value_, branch_max_, args_, stream_); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtLabelSwitchByIndex failed, ret:0x%X, when LabelSwitchByIndexTaskInfo %s", - rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtLabelSwitchByIndex failed, ret:0x%X", + rt_ret); GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } @@ -158,8 +157,8 @@ Status LabelSwitchByIndexTaskInfo::CalculateArgs(const domi::TaskDef &task_def, GELOGI("Calc opType[%s] args size. Node name is [%s]", op_desc->GetType().c_str(), op_desc->GetName().c_str()); if (op_desc->GetInputsSize() != kLabelSwitchIndexNum) { REPORT_INNER_ERROR("E19999", "input size:%zu in op:%s(%s) != kLabelSwitchIndexNum" - "check invalid when LabelSwitchByIndexTaskInfo %s", op_desc->GetInputsSize(), - op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + "check invalid", op_desc->GetInputsSize(), + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(FAILED, "Label switch op only have one data input. Now input size is %zu", op_desc->GetInputsSize()); return FAILED; } diff --git a/ge/graph/load/model_manager/task_info/memcpy_addr_async_task_info.cc b/ge/graph/load/model_manager/task_info/memcpy_addr_async_task_info.cc index 8e53ba0a..960862b4 100755 --- a/ge/graph/load/model_manager/task_info/memcpy_addr_async_task_info.cc +++ b/ge/graph/load/model_manager/task_info/memcpy_addr_async_task_info.cc @@ -36,8 +36,8 @@ Status MemcpyAddrAsyncTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel const auto &memcpy_async = task_def.memcpy_async(); OpDescPtr op_desc = davinci_model->GetOpByIndex(memcpy_async.op_index()); if (op_desc == nullptr) { - REPORT_INNER_ERROR("E19999", "Can't get op_desc from davinci_model by index:%u when MemcpyAddrAsyncTaskInfo %s", - memcpy_async.op_index(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Can't get op_desc from davinci_model by index:%u", + memcpy_async.op_index()); GELOGE(INTERNAL_ERROR, "Task op index:%u out of range", memcpy_async.op_index()); return INTERNAL_ERROR; } @@ -63,9 +63,9 @@ Status MemcpyAddrAsyncTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel GELOGI("memory_type: %u", memory_type); rtError_t rt_ret = rtMalloc(&args_, args_size + kAlignBytes, memory_type); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMalloc failed for op:%s(%s), size:%lu, ret:0x%X, " - "when MemcpyAddrAsyncTaskInfo %s", op_desc->GetName().c_str(), op_desc->GetType().c_str(), - args_size + kAlignBytes, rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMalloc failed for op:%s(%s), size:%lu, ret:0x%X", + op_desc->GetName().c_str(), op_desc->GetType().c_str(), + args_size + kAlignBytes, rt_ret); GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } @@ -76,9 +76,8 @@ Status MemcpyAddrAsyncTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel static_cast(args_align_) + args_size, dst_, io_addrs.size()); rt_ret = rtMemcpy(args_align_, args_size, io_addrs.data(), args_size, RT_MEMCPY_HOST_TO_DEVICE); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed for op:%s(%s), size:%zu, ret:0x%X, " - "when MemcpyAddrAsyncTaskInfo %s", op_desc->GetName().c_str(), op_desc->GetType().c_str(), - args_size, rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed for op:%s(%s), size:%zu, ret:0x%X", + op_desc->GetName().c_str(), op_desc->GetType().c_str(), args_size, rt_ret); GELOGE(RT_FAILED, "Call rt api for src failed, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } @@ -99,8 +98,8 @@ Status MemcpyAddrAsyncTaskInfo::Distribute() { rtError_t rt_ret = rtMemcpyAsync(reinterpret_cast(reinterpret_cast(args_align_) + sizeof(void *)), dst_max_, args_align_, count_, static_cast(kind_), stream_); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMemcpyAsync failed, size:%lu, ret:0x%X, when MemcpyAddrAsyncTaskInfo %s", - dst_max_, rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMemcpyAsync failed, size:%lu, ret:0x%X", + dst_max_, rt_ret); GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } diff --git a/ge/graph/load/model_manager/task_info/memcpy_async_task_info.cc b/ge/graph/load/model_manager/task_info/memcpy_async_task_info.cc index 6120b5e3..0bc8fb8d 100755 --- a/ge/graph/load/model_manager/task_info/memcpy_async_task_info.cc +++ b/ge/graph/load/model_manager/task_info/memcpy_async_task_info.cc @@ -36,8 +36,8 @@ Status MemcpyAsyncTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *da dst_max_ = memcpy_async.dst_max(); OpDescPtr op_desc = davinci_model_->GetOpByIndex(memcpy_async.op_index()); if (op_desc == nullptr) { - REPORT_INNER_ERROR("E19999", "Can't get op_desc from davinci_model by index:%u when MemcpyAsyncTaskInfo %s", - memcpy_async.op_index(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Can't get op_desc from davinci_model by index:%u", + memcpy_async.op_index()); GELOGE(INTERNAL_ERROR, "Task op index:%u out of range", memcpy_async.op_index()); return INTERNAL_ERROR; } @@ -88,8 +88,8 @@ Status MemcpyAsyncTaskInfo::Distribute() { rtError_t rt_ret = rtMemcpyAsync(dst_, dst_max_, src_, count_, static_cast(kind_), stream_); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMemcpyAsync failed, size:%lu, ret:0x%X, when MemcpyAsyncTaskInfo %s", - dst_max_, rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMemcpyAsync failed, size:%lu, ret:0x%X", + dst_max_, rt_ret); GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } diff --git a/ge/graph/load/model_manager/task_info/model_exit_task_info.cc b/ge/graph/load/model_manager/task_info/model_exit_task_info.cc index 1cd89f22..f0e3dfb7 100644 --- a/ge/graph/load/model_manager/task_info/model_exit_task_info.cc +++ b/ge/graph/load/model_manager/task_info/model_exit_task_info.cc @@ -24,7 +24,7 @@ namespace ge { Status ModelExitTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *davinci_model) { GELOGI("InitModelExitTaskInfo Init Start."); if (davinci_model == nullptr) { - REPORT_INNER_ERROR("E19999", "Check param davinci_model nullptr when ModelExitTaskInfo %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Check param davinci_model nullptr"); GELOGE(PARAM_INVALID, "davinci_model is null!"); return PARAM_INVALID; } @@ -44,8 +44,8 @@ Status ModelExitTaskInfo::Distribute() { GELOGI("ModelExitTaskInfo Distribute Start."); rtError_t rt_ret = rtModelExit(model_, stream_); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtModelExit failed, ret:0x%X, when ModelExitTaskInfo %s", - rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtModelExit failed, ret:0x%X", + rt_ret); GELOGE(RT_FAILED, "Call rtModelExit failed, ret: 0x%x", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } diff --git a/ge/graph/load/model_manager/task_info/profiler_trace_task_info.cc b/ge/graph/load/model_manager/task_info/profiler_trace_task_info.cc index 5b92310d..4e829182 100755 --- a/ge/graph/load/model_manager/task_info/profiler_trace_task_info.cc +++ b/ge/graph/load/model_manager/task_info/profiler_trace_task_info.cc @@ -23,7 +23,7 @@ namespace ge { Status ProfilerTraceTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *davinci_model) { GELOGI("ProfilerTraceTaskInfo Init Start."); if (davinci_model == nullptr) { - REPORT_INNER_ERROR("E19999", "Check param davinci_model nullptr when ProfilerTraceTaskInfo %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Check param davinci_model nullptr"); GELOGE(PARAM_INVALID, "davinci_model is null!"); return PARAM_INVALID; } @@ -47,8 +47,8 @@ Status ProfilerTraceTaskInfo::Distribute() { rtError_t rt_ret = rtProfilerTrace(log_id_, notify_, flat_, stream_); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtProfilerTrace failed, ret:0x%X, when ProfilerTraceTaskInfo %s", - rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtProfilerTrace failed, ret:0x%X", + rt_ret); GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } diff --git a/ge/graph/load/model_manager/task_info/stream_active_task_info.cc b/ge/graph/load/model_manager/task_info/stream_active_task_info.cc index 8597a4ef..4ab4951d 100755 --- a/ge/graph/load/model_manager/task_info/stream_active_task_info.cc +++ b/ge/graph/load/model_manager/task_info/stream_active_task_info.cc @@ -26,7 +26,7 @@ namespace ge { Status StreamActiveTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *davinci_model) { GELOGI("StreamActiveTaskInfo Init Start."); if (davinci_model == nullptr) { - REPORT_INNER_ERROR("E19999", "Check param davinci_model nullptr when StreamActiveTaskInfo %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Check param davinci_model nullptr"); GELOGE(PARAM_INVALID, "davinci_model is null!"); return PARAM_INVALID; } @@ -46,17 +46,17 @@ Status StreamActiveTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *d GE_CHECK_NOTNULL(op_desc); std::vector active_stream_index_list; if (!AttrUtils::GetListInt(op_desc, ATTR_NAME_ACTIVE_STREAM_LIST, active_stream_index_list)) { - REPORT_INNER_ERROR("E19999", "Get Attr:%s in op:%s(%s) fail when StreamActiveTaskInfo %s", + REPORT_INNER_ERROR("E19999", "Get Attr:%s in op:%s(%s) fail", ATTR_NAME_ACTIVE_STREAM_LIST.c_str(), - op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(INTERNAL_ERROR, "StreamActiveOp get attr ACTIVE_STREAM fail, node name:%s.", op_desc->GetName().c_str()); return INTERNAL_ERROR; } if (internal_index >= active_stream_index_list.size()) { REPORT_INNER_ERROR("E19999", "flowctrl index:%u >= active_stream_list size:%zu in op:%s(%s), " - "check invalid when StreamActiveTaskInfo %s", internal_index, active_stream_index_list.size(), - op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + "check invalid", internal_index, active_stream_index_list.size(), + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(INTERNAL_ERROR, "InitStreamSwitchTaskInfo stream id index invalid. index:%u, list size:%zu.", internal_index, active_stream_index_list.size()); return INTERNAL_ERROR; @@ -64,9 +64,8 @@ Status StreamActiveTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *d if (active_stream_index_list[internal_index] >= davinci_model->GetStreamList().size()) { REPORT_INNER_ERROR("E19999", "active_stream_index:%u in op:%s(%s) >= stream size:%zu in model, " - "check invalid when StreamActiveTaskInfo %s", active_stream_index_list[internal_index], - op_desc->GetName().c_str(), op_desc->GetType().c_str(), davinci_model->GetStreamList().size(), - __FUNCTION__); + "check invalid", active_stream_index_list[internal_index], + op_desc->GetName().c_str(), op_desc->GetType().c_str(), davinci_model->GetStreamList().size()); GELOGE(INTERNAL_ERROR, "InitStreamSwitchTaskInfo stream index invalid. index:%u, stream list size:%zu.", active_stream_index_list[internal_index], davinci_model->GetStreamList().size()); return INTERNAL_ERROR; @@ -84,8 +83,8 @@ Status StreamActiveTaskInfo::Distribute() { GELOGI("StreamActiveTaskInfo Distribute Start."); rtError_t rt_ret = rtStreamActive(active_stream_, stream_); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtStreamActive failed, ret:0x%X, when StreamActiveTaskInfo %s", - rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtStreamActive failed, ret:0x%X", + rt_ret); GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } diff --git a/ge/graph/load/model_manager/task_info/stream_switch_task_info.cc b/ge/graph/load/model_manager/task_info/stream_switch_task_info.cc index 44f8011d..33dfacf7 100644 --- a/ge/graph/load/model_manager/task_info/stream_switch_task_info.cc +++ b/ge/graph/load/model_manager/task_info/stream_switch_task_info.cc @@ -31,7 +31,7 @@ const uint32_t kTrueBranchStreamNum = 1; Status StreamSwitchTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *davinci_model) { GELOGI("StreamSwitchTaskInfo Init Start."); if (davinci_model == nullptr) { - REPORT_INNER_ERROR("E19999", "Check param davinci_model nullptr when StreamSwitchTaskInfo %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Check param davinci_model nullptr"); GELOGE(PARAM_INVALID, "davinci_model is null!"); return PARAM_INVALID; } @@ -50,9 +50,9 @@ Status StreamSwitchTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *d SetInputAndValuePtr(davinci_model, input_data_addr); uint32_t cond = 0; if (!AttrUtils::GetInt(op_desc, ATTR_NAME_STREAM_SWITCH_COND, cond)) { - REPORT_INNER_ERROR("E19999", "Get Attr:%s in op:%s(%s) fail when StreamSwitchTaskInfo %s", + REPORT_INNER_ERROR("E19999", "Get Attr:%s in op:%s(%s) fail", ATTR_NAME_STREAM_SWITCH_COND.c_str(), - op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(INTERNAL_ERROR, "StreamSwitchOp get attr STREAM_SWITCH_COND fail."); return INTERNAL_ERROR; } @@ -61,8 +61,8 @@ Status StreamSwitchTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *d size_t input_size = op_desc->GetInputsSize(); if (input_data_addr.size() != STREAM_SWITCH_INPUT_NUM || input_size != STREAM_SWITCH_INPUT_NUM) { REPORT_INNER_ERROR("E19999", "input_data_addr.size():%zu or input size:%zu != STREAM_SWITCH_INPUT_NUM:%u " - "in op:%s(%s), check invalid when StreamSwitchTaskInfo %s", input_data_addr.size(), input_size, - STREAM_SWITCH_INPUT_NUM, op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + "in op:%s(%s), check invalid", input_data_addr.size(), input_size, + STREAM_SWITCH_INPUT_NUM, op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(INTERNAL_ERROR, "Input num should be %u. inputAddr size:%zu, inputDesc size:%zu.", STREAM_SWITCH_INPUT_NUM, input_data_addr.size(), input_size); return INTERNAL_ERROR; @@ -70,17 +70,17 @@ Status StreamSwitchTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *d vector active_stream_list; if (!AttrUtils::GetListInt(op_desc, ATTR_NAME_ACTIVE_STREAM_LIST, active_stream_list)) { - REPORT_INNER_ERROR("E19999", "Get Attr:%s in op:%s(%s) fail when StreamSwitchTaskInfo %s", + REPORT_INNER_ERROR("E19999", "Get Attr:%s in op:%s(%s) fail", ATTR_NAME_ACTIVE_STREAM_LIST.c_str(), - op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(INTERNAL_ERROR, "StreamSwitchOp get attr ACTIVE_STREAM_LIST fail."); return INTERNAL_ERROR; } if (active_stream_list.size() != kTrueBranchStreamNum) { REPORT_INNER_ERROR("E19999", "active_stream_list.size():%zu in op:%s(%s) != kTrueBranchStreamNum:%u, " - "check invalid when StreamSwitchTaskInfo %s", active_stream_list.size(), - op_desc->GetName().c_str(), op_desc->GetType().c_str(), kTrueBranchStreamNum, __FUNCTION__); + "check invalid", active_stream_list.size(), + op_desc->GetName().c_str(), op_desc->GetType().c_str(), kTrueBranchStreamNum); GELOGE(FAILED, "Stream num of switch true branch must be %u.", kTrueBranchStreamNum); return FAILED; } @@ -88,9 +88,8 @@ Status StreamSwitchTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *d size_t true_stream_index = active_stream_list.front(); if (true_stream_index >= davinci_model->GetStreamList().size()) { REPORT_INNER_ERROR("E19999", "active_stream_index:%zu in op:%s(%s) >= stream list size:%zu in model," - "check invalid when StreamSwitchTaskInfo %s", true_stream_index, - op_desc->GetName().c_str(), op_desc->GetType().c_str(), davinci_model->GetStreamList().size(), - __FUNCTION__); + "check invalid", true_stream_index, + op_desc->GetName().c_str(), op_desc->GetType().c_str(), davinci_model->GetStreamList().size()); GELOGE(INTERNAL_ERROR, "InitStreamSwitchTaskInfo stream index invalid. index:%zu, stream list size:%zu.", true_stream_index, davinci_model->GetStreamList().size()); return INTERNAL_ERROR; @@ -104,9 +103,9 @@ Status StreamSwitchTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *d if (op_desc->HasAttr(ATTR_NAME_SWITCH_DATA_TYPE)) { int64_t data_type = 0; if (!AttrUtils::GetInt(op_desc, ATTR_NAME_SWITCH_DATA_TYPE, data_type)) { - REPORT_INNER_ERROR("E19999", "Get Attr:%s in op:%s(%s) fail when StreamSwitchTaskInfo %s", + REPORT_INNER_ERROR("E19999", "Get Attr:%s in op:%s(%s) fail", ATTR_NAME_SWITCH_DATA_TYPE.c_str(), - op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(FAILED, "StreamSwitchOp[node:%s] get attr SWITCH_DATA_TYPE fail.", op_desc->GetName().c_str()); return FAILED; } @@ -123,8 +122,8 @@ Status StreamSwitchTaskInfo::Distribute() { GELOGI("StreamSwitchTaskInfo Distribute Start."); rtError_t rt_ret = rtStreamSwitchEx(input_ptr_, cond_, value_ptr_, true_stream_, stream_, data_type_); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtStreamSwitchEx fail, ret:0x%X, when StreamSwitchTaskInfo %s", - rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtStreamSwitchEx fail, ret:0x%X", + rt_ret); GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } @@ -142,8 +141,8 @@ Status StreamSwitchTaskInfo::CalculateArgs(const domi::TaskDef &task_def, Davinc GELOGI("Calc opType[%s] args size. Node name is [%s]", op_desc->GetType().c_str(), op_desc->GetName().c_str()); if (op_desc->GetInputsSize() != STREAM_SWITCH_INPUT_NUM) { REPORT_INNER_ERROR("E19999", "input size:%zu in op:%s(%s) != STREAM_SWITCH_INPUT_NUM:%u," - "check invalid when StreamSwitchTaskInfo %s", op_desc->GetInputsSize(), - op_desc->GetName().c_str(), op_desc->GetType().c_str(), STREAM_SWITCH_INPUT_NUM, __FUNCTION__); + "check invalid", op_desc->GetInputsSize(), + op_desc->GetName().c_str(), op_desc->GetType().c_str(), STREAM_SWITCH_INPUT_NUM); GELOGE(FAILED, "Stream switch op only have one data input. Now input size is %zu", op_desc->GetInputsSize()); return FAILED; } diff --git a/ge/graph/load/model_manager/task_info/stream_switchn_task_info.cc b/ge/graph/load/model_manager/task_info/stream_switchn_task_info.cc index 31340bcd..40bbff02 100755 --- a/ge/graph/load/model_manager/task_info/stream_switchn_task_info.cc +++ b/ge/graph/load/model_manager/task_info/stream_switchn_task_info.cc @@ -36,8 +36,8 @@ Status StreamSwitchNTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel * auto stream_switchn_def = task_def.stream_switch_n(); OpDescPtr op_desc = davinci_model->GetOpByIndex(stream_switchn_def.op_index()); if (op_desc == nullptr) { - REPORT_INNER_ERROR("E19999", "Can't get op_desc from davinci_model by index:%u when StreamSwitchNTaskInfo %s", - stream_switchn_def.op_index(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Can't get op_desc from davinci_model by index:%u", + stream_switchn_def.op_index()); GELOGE(FAILED, "Index is out of range, index: %u", stream_switchn_def.op_index()); return FAILED; } @@ -49,8 +49,8 @@ Status StreamSwitchNTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel * auto value = stream_switchn_def.target_value(); if (value.size() == 0) { REPORT_INNER_ERROR("E19999", "task_Def.stream_switch_n.target_value:%d in op:%s(%s) is 0," - "check invalid when StreamSwitchNTaskInfo %s", value.size(), - op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + "check invalid", value.size(), + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(FAILED, "The number of gears in dynamic batch scenario can not be 0."); return FAILED; } @@ -62,9 +62,9 @@ Status StreamSwitchNTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel * // set element_size_ if (!AttrUtils::GetInt(op_desc, ATTR_NAME_BATCH_NUM, element_size_)) { - REPORT_INNER_ERROR("E19999", "Get Attr:%s in op:%s(%s) fail when StreamSwitchNTaskInfo %s", + REPORT_INNER_ERROR("E19999", "Get Attr:%s in op:%s(%s) fail", ATTR_NAME_BATCH_NUM.c_str(), - op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(FAILED, "Get ATTR_NAME_BATCH_NUM of switchN op failed."); return FAILED; } @@ -92,8 +92,8 @@ Status StreamSwitchNTaskInfo::Distribute() { rtError_t rt_ret = rtStreamSwitchN(input_ptr_, input_size_, value_ptr_, true_stream_ptr_, element_size_, stream_, data_type_); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtStreamSwitchN failed, ret:0x%X, when InitStreamSwitchNTaskInfo %s", - rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtStreamSwitchN failed, ret:0x%X", + rt_ret); GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } @@ -106,18 +106,17 @@ Status StreamSwitchNTaskInfo::Distribute() { Status StreamSwitchNTaskInfo::GetTrueStreamPtr(const OpDescPtr &op_desc, DavinciModel *davinci_model) { vector true_stream_id_list; if (!AttrUtils::GetListInt(op_desc, ATTR_NAME_ACTIVE_STREAM_LIST, true_stream_id_list)) { - REPORT_INNER_ERROR("E19999", "Get Attr:%s in op:%s(%s) fail when StreamSwitchNTaskInfo %s", + REPORT_INNER_ERROR("E19999", "Get Attr:%s in op:%s(%s) fail", ATTR_NAME_ACTIVE_STREAM_LIST.c_str(), - op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(FAILED, "StreamSwitchNOp get attr ACTIVE_STREAM_LIST fail."); return FAILED; } if (true_stream_id_list.size() > davinci_model->GetStreamList().size()) { REPORT_INNER_ERROR("E19999", "active_stream_list.size:%zu in op:%s(%s) >= stream list size:%zu in model," - "check invalid when StreamSwitchNTaskInfo %s", true_stream_id_list.size(), - op_desc->GetName().c_str(), op_desc->GetType().c_str(), davinci_model->GetStreamList().size(), - __FUNCTION__); + "check invalid", true_stream_id_list.size(), + op_desc->GetName().c_str(), op_desc->GetType().c_str(), davinci_model->GetStreamList().size()); GELOGE(FAILED, "InitStreamSwitchNTaskInfo get true stream id list failed. true stream size:%zu, " "stream list size:%zu.", @@ -130,9 +129,8 @@ Status StreamSwitchNTaskInfo::GetTrueStreamPtr(const OpDescPtr &op_desc, Davinci uint32_t true_stream_id = true_stream_id_list[i]; if (true_stream_id >= davinci_model->GetStreamList().size()) { REPORT_INNER_ERROR("E19999", "active_stream_id:%u in op:%s(%s) >= stream list size:%zu in model," - "check invalid when StreamSwitchNTaskInfo %s", true_stream_id, - op_desc->GetName().c_str(), op_desc->GetType().c_str(), davinci_model->GetStreamList().size(), - __FUNCTION__); + "check invalid", true_stream_id, + op_desc->GetName().c_str(), op_desc->GetType().c_str(), davinci_model->GetStreamList().size()); GELOGE(FAILED, "InitStreamSwitchNTaskInfo stream id invalid. id:%u, stream list size:%zu.", true_stream_id, davinci_model->GetStreamList().size()); return FAILED; @@ -144,8 +142,8 @@ Status StreamSwitchNTaskInfo::GetTrueStreamPtr(const OpDescPtr &op_desc, Davinci if (true_stream_list_.empty()) { REPORT_INNER_ERROR("E19999", "active_stream_list.size():%zu in op:%s(%s) is empty, " - "check invalid when StreamSwitchNTaskInfo %s", true_stream_id_list.size(), - op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + "check invalid", true_stream_id_list.size(), + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(FAILED, "true stream list is null."); return FAILED; } @@ -163,8 +161,8 @@ Status StreamSwitchNTaskInfo::CalculateArgs(const domi::TaskDef &task_def, Davin GELOGI("Calc opType[%s] args size. Node name is [%s]", op_desc->GetType().c_str(), op_desc->GetName().c_str()); if (op_desc->GetInputsSize() != kStreamSwitchnInputNum) { REPORT_INNER_ERROR("E19999", "input size:%zu in op:%s(%s) != kStreamSwitchnInputNum:%u ," - "check invalid when StreamSwitchNTaskInfo %s", op_desc->GetInputsSize(), - op_desc->GetName().c_str(), op_desc->GetType().c_str(), kStreamSwitchnInputNum, __FUNCTION__); + "check invalid", op_desc->GetInputsSize(), + op_desc->GetName().c_str(), op_desc->GetType().c_str(), kStreamSwitchnInputNum); GELOGE(FAILED, "Stream switchn op only have one data input. Now input size is %zu", op_desc->GetInputsSize()); return FAILED; } @@ -187,8 +185,8 @@ Status StreamSwitchNTaskInfo::InputPtrUpdate(const OpDescPtr &op_desc, DavinciMo const vector input_legnth = ModelUtils::GetInputSize(op_desc); if (input_offset.empty() || input_legnth.empty()) { REPORT_INNER_ERROR("E19999", "input_offset size:%zu or input_length.size:%zu in op:%s(%s) is empty," - "check invalid when StreamSwitchNTaskInfo %s", input_offset.size(), input_legnth.size(), - op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + "check invalid", input_offset.size(), input_legnth.size(), + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(FAILED, "input offset size %zu, input legnth size: %zu", input_offset.size(), input_legnth.size()); return FAILED; } @@ -201,8 +199,8 @@ Status StreamSwitchNTaskInfo::InputPtrUpdate(const OpDescPtr &op_desc, DavinciMo auto input_data_addr = ModelUtils::GetInputDataAddrs(davinci_model->GetRuntimeParam(), op_desc); if (input_data_addr.empty()) { REPORT_INNER_ERROR("E19999", "input_data_addr size:%zu in op:%s(%s) is empty," - "check invalid when StreamSwitchNTaskInfo %s", input_data_addr.size(), - op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + "check invalid", input_data_addr.size(), + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(FAILED, "input data addr is empty"); return FAILED; } diff --git a/ge/graph/load/model_manager/task_info/super_kernel/super_kernel.cc b/ge/graph/load/model_manager/task_info/super_kernel/super_kernel.cc index e93a79ae..66bf5ab7 100644 --- a/ge/graph/load/model_manager/task_info/super_kernel/super_kernel.cc +++ b/ge/graph/load/model_manager/task_info/super_kernel/super_kernel.cc @@ -27,22 +27,22 @@ Status SuperKernel::Launch(rtStream_t stream, uint32_t dump_flag) { rtError_t rt_ret = rtMalloc(reinterpret_cast(&device_args_addr_), sizeof(args), RT_MEMORY_HBM); GE_IF_BOOL_EXEC(rt_ret != RT_ERROR_NONE, - REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%lu, ret:0x%X when %s", - sizeof(args), rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%lu, ret:0x%X", + sizeof(args), rt_ret); GELOGE(RT_FAILED, "rtMalloc failied. error: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret);) rt_ret = rtMemcpy(reinterpret_cast(device_args_addr_), sizeof(args), reinterpret_cast(args), sizeof(args), RT_MEMCPY_HOST_TO_DEVICE); GE_IF_BOOL_EXEC(rt_ret != RT_ERROR_NONE, - REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%lu, ret:0x%X when %s", - sizeof(args), rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%lu, ret:0x%X", + sizeof(args), rt_ret); GELOGE(RT_FAILED, "rtMemcpy failied. error: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret);) rt_ret = rtKernelLaunchWithFlag((void *const)func_stub_, block_dim_, device_args_addr_, sizeof(args), NULL, stream, dump_flag); GE_IF_BOOL_EXEC(rt_ret != RT_ERROR_NONE, - REPORT_CALL_ERROR("E19999", "Call rtKernelLaunchWithFlag failed, dump_flag:%u, ret:0x%X when %s", - dump_flag, rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtKernelLaunchWithFlag failed, dump_flag:%u, ret:0x%X", + dump_flag, rt_ret); GELOGE(RT_FAILED, "rtKernelLaunchWithFlag failied. error: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret);) return SUCCESS; diff --git a/ge/graph/load/model_manager/task_info/super_kernel/super_kernel_factory.cc b/ge/graph/load/model_manager/task_info/super_kernel/super_kernel_factory.cc index 597b1204..9ba62475 100644 --- a/ge/graph/load/model_manager/task_info/super_kernel/super_kernel_factory.cc +++ b/ge/graph/load/model_manager/task_info/super_kernel/super_kernel_factory.cc @@ -36,14 +36,14 @@ Status SuperKernelFactory::Init() { rtError_t rt_ret; rt_ret = rtGetFunctionByName(this->sk_stub_name_.c_str(), &this->func_stub_); GE_IF_BOOL_EXEC(rt_ret != RT_ERROR_NONE, - REPORT_CALL_ERROR("E19999", "Call rtGetFunctionByName failed, stub_func:%s, ret:0x%X, when %s", - this->sk_stub_name_.c_str(), rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtGetFunctionByName failed, stub_func:%s, ret:0x%X", + this->sk_stub_name_.c_str(), rt_ret); GELOGE(RT_FAILED, "rtGetFunctionByName failed. stub_func: %s, please export LD_LIBRARY_PATH for " "libcce_aicore.so", this->sk_stub_name_.c_str()); return RT_ERROR_TO_GE_STATUS(rt_ret);) rt_ret = rtGetAddrByFun(this->func_stub_, &this->func_ptr_); GE_IF_BOOL_EXEC(rt_ret != RT_ERROR_NONE, - REPORT_CALL_ERROR("E19999", "Call rtGetAddrByFun failed, ret:0x%X, when %s", rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtGetAddrByFun failed, ret:0x%X", rt_ret); GELOGE(RT_FAILED, "rtGetAddrByFun failed. error: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret);) GELOGD( @@ -101,7 +101,7 @@ Status SuperKernelFactory::FuseKernels(const std::vector &stub_func_list void *sub_device_func = nullptr; rt_ret = rtGetAddrByFun(stub_func_list[i], &sub_device_func); GE_IF_BOOL_EXEC(rt_ret != RT_ERROR_NONE, - REPORT_CALL_ERROR("E19999", "Call rtGetAddrByFun failed, ret:0x%X, when %s", rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtGetAddrByFun failed, ret:0x%X", rt_ret); GELOGE(RT_FAILED, "rtGetAddrByFun failed. error: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret);) GELOGD("SKT: fuseKernels subFunc %p, device func address %p", stub_func_list[i], sub_device_func); @@ -114,15 +114,15 @@ Status SuperKernelFactory::FuseKernels(const std::vector &stub_func_list } rt_ret = rtMalloc(reinterpret_cast(&hbm_nav_table_addr), nav_table_size, RT_MEMORY_HBM); GE_IF_BOOL_EXEC(rt_ret != RT_ERROR_NONE, - REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%lu, ret:0x%X, when %s", - nav_table_size, rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%lu, ret:0x%X", + nav_table_size, rt_ret); GELOGE(RT_FAILED, "rtMalloc failed. error: 0x%X", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret);) rt_ret = rtMemcpy(reinterpret_cast(hbm_nav_table_addr), nav_table_size, reinterpret_cast(nav_table.get()), nav_table_size, RT_MEMCPY_HOST_TO_DEVICE); GE_IF_BOOL_EXEC(rt_ret != RT_ERROR_NONE, - REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%lu, ret:0x%X when %s", - nav_table_size, rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%lu, ret:0x%X", + nav_table_size, rt_ret); GELOGE(RT_FAILED, "rtMemcpy failed. error: 0x%X", rt_ret); GE_CHK_RT(rtFree(hbm_nav_table_addr)); return RT_ERROR_TO_GE_STATUS(rt_ret);) // Create the necessary metadata for the super kernel diff --git a/ge/graph/load/model_manager/task_info/task_info.cc b/ge/graph/load/model_manager/task_info/task_info.cc index c465556c..fb446bf7 100755 --- a/ge/graph/load/model_manager/task_info/task_info.cc +++ b/ge/graph/load/model_manager/task_info/task_info.cc @@ -25,8 +25,8 @@ Status TaskInfo::SetStream(uint32_t stream_id, const std::vector &st } else if (stream_list.size() > stream_id) { stream_ = stream_list[stream_id]; } else { - REPORT_INNER_ERROR("E19999", "stream_id:%u >= stream_list.size(): %zu, check invalid when TaskInfo %s", - stream_id, stream_list.size(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "stream_id:%u >= stream_list.size(): %zu, check invalid", + stream_id, stream_list.size()); GELOGE(FAILED, "index: %u >= stream_list.size(): %zu.", stream_id, stream_list.size()); return FAILED; } diff --git a/ge/graph/load/model_manager/tbe_handle_store.cc b/ge/graph/load/model_manager/tbe_handle_store.cc index ad53fbf8..6efb6190 100755 --- a/ge/graph/load/model_manager/tbe_handle_store.cc +++ b/ge/graph/load/model_manager/tbe_handle_store.cc @@ -23,7 +23,7 @@ namespace ge { void TbeHandleInfo::used_inc(uint32_t num) { if (used_ > std::numeric_limits::max() - num) { - REPORT_INNER_ERROR("E19999", "Used:%u reach numeric max when TbeHandleInfo %s", used_, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Used:%u reach numeric max", used_); GELOGE(INTERNAL_ERROR, "Used[%u] reach numeric max.", used_); return; } @@ -33,7 +33,7 @@ void TbeHandleInfo::used_inc(uint32_t num) { void TbeHandleInfo::used_dec(uint32_t num) { if (used_ < std::numeric_limits::min() + num) { - REPORT_INNER_ERROR("E19999", "Used:%u reach numeric min when TbeHandleInfo %s", used_, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Used:%u reach numeric min", used_); GELOGE(INTERNAL_ERROR, "Used[%u] reach numeric min.", used_); return; } @@ -107,8 +107,8 @@ void TBEHandleStore::ReferTBEHandle(const std::string &name) { std::lock_guard lock(mutex_); auto it = kernels_.find(name); if (it == kernels_.end()) { - REPORT_INNER_ERROR("E19999", "Kernel:%s not found in stored check invalid when TbeHandleInfo %s", - name.c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Kernel:%s not found in stored check invalid", + name.c_str()); GELOGE(INTERNAL_ERROR, "Kernel[%s] not found in stored.", name.c_str()); return; } @@ -128,8 +128,8 @@ void TBEHandleStore::EraseTBEHandle(const std::map &names for (auto &item : names) { auto it = kernels_.find(item.first); if (it == kernels_.end()) { - REPORT_INNER_ERROR("E19999", "Kernel:%s not found in stored check invalid when TbeHandleInfo %s", - item.first.c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Kernel:%s not found in stored check invalid", + item.first.c_str()); GELOGE(INTERNAL_ERROR, "Kernel[%s] not found in stored.", item.first.c_str()); continue; } @@ -140,8 +140,8 @@ void TBEHandleStore::EraseTBEHandle(const std::map &names } else { rtError_t rt_ret = rtDevBinaryUnRegister(info.handle()); if (rt_ret != RT_ERROR_NONE) { - REPORT_INNER_ERROR("E19999", "Call rtDevBinaryUnRegister failed for Kernel:%s fail, ret:0x%X, " - "when TbeHandleInfo %s", item.first.c_str(), rt_ret, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Call rtDevBinaryUnRegister failed for Kernel:%s fail, ret:0x%X", + item.first.c_str(), rt_ret); GELOGE(INTERNAL_ERROR, "Kernel[%s] UnRegister handle fail:%u.", item.first.c_str(), rt_ret); } kernels_.erase(it); diff --git a/ge/graph/load/model_manager/zero_copy_offset.cc b/ge/graph/load/model_manager/zero_copy_offset.cc index eedf889e..9d6f4e4f 100644 --- a/ge/graph/load/model_manager/zero_copy_offset.cc +++ b/ge/graph/load/model_manager/zero_copy_offset.cc @@ -76,8 +76,8 @@ Status ZeroCopyOffset::InitOutputDataInfo(const vector &input_size_list auto tensor_desc = op_desc->GetInputDescPtr(idx); GE_CHECK_NOTNULL(tensor_desc); if (TensorUtils::GetTensorSizeInBytes(*tensor_desc, size) != GRAPH_SUCCESS) { - REPORT_INNER_ERROR("E19999", "Get input TensorSize in op:%s(%s) failed, input_index:%zu, when ZeroCopyOffset %s", - op_desc->GetName().c_str(), op_desc->GetType().c_str(), idx, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Get input TensorSize in op:%s(%s) failed, input_index:%zu", + op_desc->GetName().c_str(), op_desc->GetType().c_str(), idx); GELOGE(FAILED, "GetTensorSizeInBytes failed!"); return FAILED; } diff --git a/ge/graph/load/model_manager/zero_copy_task.cc b/ge/graph/load/model_manager/zero_copy_task.cc index 77937bec..c96dd8b7 100755 --- a/ge/graph/load/model_manager/zero_copy_task.cc +++ b/ge/graph/load/model_manager/zero_copy_task.cc @@ -36,8 +36,8 @@ ZeroCopyTask::~ZeroCopyTask() { args_addr_ = nullptr; } */ Status ZeroCopyTask::SetTaskArgsOffset(uintptr_t addr, size_t offset) { if (offset + sizeof(uintptr_t) > args_size_) { - REPORT_INNER_ERROR("E19999", "Param offset:%zu + 8 > args_size_:%zu, check invalid when ZeroCopyOffset %s", - offset, args_size_, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Param offset:%zu + 8 > args_size_:%zu, check invalid", + offset, args_size_); GELOGE(FAILED, "[ZCPY] %s set task args failed, args size: %zu, offset: %zu", name_.c_str(), args_size_, offset); return FAILED; // unexpected error, need fix. } @@ -118,8 +118,8 @@ Status ZeroCopyTask::DistributeParam(bool async_mode, rtStream_t stream) { } if (rt_err != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMemcpyAsync or rtMemcpy failed, size:%zu, ret: 0x%X when ZeroCopyTask %s", - args_size_, rt_err, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMemcpyAsync or rtMemcpy failed, size:%zu, ret: 0x%X", + args_size_, rt_err); GELOGE(RT_FAILED, "[ZCPY] %s distribute task param failed, error=0x%x", name_.c_str(), rt_err); return RT_ERROR_TO_GE_STATUS(rt_err); } diff --git a/ge/graph/manager/graph_caching_allocator.cc b/ge/graph/manager/graph_caching_allocator.cc index e87a2a0f..bfa1cdc7 100644 --- a/ge/graph/manager/graph_caching_allocator.cc +++ b/ge/graph/manager/graph_caching_allocator.cc @@ -111,7 +111,7 @@ Status CachingAllocator::Initialize(uint32_t device_id) { } auto bin_ptr = new (std::nothrow) BlockBin(BlockComparator); if (bin_ptr == nullptr) { - REPORT_CALL_ERROR("E19999", "New BlockBin fail, device_id:%u, when CachingAllocator %s", device_id, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "New BlockBin fail, device_id:%u", device_id); GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "Alloc BlockBin failed."); return ACL_ERROR_GE_MEMORY_ALLOCATION; } @@ -147,8 +147,8 @@ uint8_t *CachingAllocator::Malloc(size_t size, uint8_t *org_ptr, uint32_t device ptr = block->ptr; } if (ptr == nullptr) { - REPORT_INNER_ERROR("E19999", "FindFreeBlock fail, size:%zu, device_id:%u, when CachingAllocator %s", - size, device_id, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "FindFreeBlock fail, size:%zu, device_id:%u", + size, device_id); GELOGE(FAILED, "Malloc failed device id = %u, size= %zu", device_id, size); } return ptr; @@ -157,8 +157,8 @@ uint8_t *CachingAllocator::Malloc(size_t size, uint8_t *org_ptr, uint32_t device Status CachingAllocator::Free(uint8_t *ptr, uint32_t device_id) { GELOGI("Free device id = %u", device_id); if (ptr == nullptr) { - REPORT_INNER_ERROR("E19999", "Param ptr is nullptr, device_id:%u, check invalid when CachingAllocator %s", - device_id, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Param ptr is nullptr, device_id:%u, check invalid", + device_id); GELOGE(PARAM_INVALID, "Invalid memory pointer"); return ge::PARAM_INVALID; } @@ -166,8 +166,8 @@ Status CachingAllocator::Free(uint8_t *ptr, uint32_t device_id) { std::lock_guard lock(mutex_); auto it = allocated_blocks_.find(ptr); if (it == allocated_blocks_.end()) { - REPORT_INNER_ERROR("E19999", "Param ptr not allocated before, device_id:%u, check invalid when CachingAllocator %s", - device_id, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Param ptr not allocated before, device_id:%u, check invalid", + device_id); GELOGE(PARAM_INVALID, "Invalid memory pointer"); return ge::PARAM_INVALID; } @@ -225,8 +225,8 @@ Block *CachingAllocator::FindFreeBlock(size_t size, uint8_t *org_ptr, uint32_t d Block key(device_id, size, org_ptr); BlockBin *bin = GetBlockBin(size); if (bin == nullptr) { - REPORT_INNER_ERROR("E19999", "GetBlockBin fail, size:%zu, device_id:%u, when CachingAllocator %s", - size, device_id, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "GetBlockBin fail, size:%zu, device_id:%u", + size, device_id); GELOGE(ge::FAILED, "Get block bin failed size = %zu", size); return nullptr; } @@ -258,8 +258,8 @@ Block *CachingAllocator::SplitBlock(Block *block, size_t size, BlockBin &bin, ui Block *remaining = block; Block *new_block = new (std::nothrow) Block(device_id, size, &bin, block->ptr); if (new_block == nullptr) { - REPORT_CALL_ERROR("E19999", "New Block fail, size:%zu, device_id:%u, when CachingAllocator %s", - size, device_id, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "New Block fail, size:%zu, device_id:%u", + size, device_id); GELOGE(ge::FAILED, "Alloc block failed size = %zu", size); return block; } @@ -304,15 +304,15 @@ Status CachingAllocator::TryExtendCache(size_t size, uint32_t device_id) { Status CachingAllocator::AddToBlockBin(uint8_t *ptr, size_t size, uint32_t device_id) { BlockBin *bin = GetBlockBin(size); if (bin == nullptr) { - REPORT_INNER_ERROR("E19999", "GetBlockBin fail, size:%zu, device_id:%u, when CachingAllocator %s", - size, device_id, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "GetBlockBin fail, size:%zu, device_id:%u", + size, device_id); GELOGE(ge::FAILED, "Get block bin failed size = %zu", size); return ge::FAILED; } Block *block = new (std::nothrow) Block(device_id, size, bin, nullptr); if (block == nullptr) { - REPORT_CALL_ERROR("E19999", "New Block fail, size:%zu, device_id:%u, when CachingAllocator %s", - size, device_id, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "New Block fail, size:%zu, device_id:%u", + size, device_id); GELOGE(ge::FAILED, "Alloc block failed size = %zu", size); return ge::FAILED; } diff --git a/ge/graph/manager/graph_context.cc b/ge/graph/manager/graph_context.cc index 66143c54..3a705ad9 100644 --- a/ge/graph/manager/graph_context.cc +++ b/ge/graph/manager/graph_context.cc @@ -44,7 +44,7 @@ GraphContext::GraphContext(const GraphNodePtr &graph_node) { Status GraphContext::SetComputeGraph(const GraphNodePtr &graph_node) { if (graph_node == nullptr) { - REPORT_INNER_ERROR("E19999", "Param graph_node is nullptr, check invalid when GraphContext %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Param graph_node is nullptr, check invalid"); GELOGE(GE_GRAPH_PARAM_NULLPTR, "graphNode is NULL!"); return GE_GRAPH_PARAM_NULLPTR; } @@ -55,8 +55,7 @@ Status GraphContext::SetComputeGraph(const GraphNodePtr &graph_node) { if (compute_graph_ == nullptr) { std::shared_ptr graph = graph_node->GetGraph(); if (graph == nullptr) { - REPORT_INNER_ERROR("E19999", "Param graph in graph_node is nullptr, check invalid when GraphContext %s", - __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Param graph in graph_node is nullptr, check invalid"); GELOGE(GE_GRAPH_OPTIMIZE_COMPUTE_GRAPH_NULL, "compute_graph by graphNode is NULL!"); return GE_GRAPH_OPTIMIZE_COMPUTE_GRAPH_NULL; } @@ -73,15 +72,14 @@ Status GraphContext::Finalize() const { return SUCCESS; } Status GraphContext::GetVariableTensor(const std::string &var_data_name, GeTensor &returned_tensor) { if (var_data_name.empty()) { - REPORT_INNER_ERROR("E19999", "Param var_data_name is empty, check invalid when GraphContext %s", - __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Param var_data_name is empty, check invalid"); GELOGE(GE_GRAPH_EMPTY_STRING_NAME, "Variable data name is empty!"); return GE_GRAPH_EMPTY_STRING_NAME; } if (GetVarNodeTensorTable().empty()) { - REPORT_INNER_ERROR("E19999", "VarNodeTensorTable is empty, var_data_name:%s, check invalid when GraphContext %s", - var_data_name.c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "VarNodeTensorTable is empty, var_data_name:%s, check invalid", + var_data_name.c_str()); GELOGE(GE_GRAPH_EMPTY_VARIABLE_TENSOR_TABLE, "VarNodeTensorTable is empty!"); return GE_GRAPH_EMPTY_VARIABLE_TENSOR_TABLE; } @@ -90,8 +88,8 @@ Status GraphContext::GetVariableTensor(const std::string &var_data_name, GeTenso returned_tensor.SetTensorDesc(var_record.second.GetTensorDesc()); auto ret = returned_tensor.SetData(var_record.second.GetData()); if (ret != SUCCESS) { - REPORT_INNER_ERROR("E19999", "SetData to tensor fail, var_data_name:%s, when GraphContext %s", - var_data_name.c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "SetData to tensor fail, var_data_name:%s", + var_data_name.c_str()); GELOGE(ret, "Set Tensor data failed!"); return ret; } @@ -100,8 +98,8 @@ Status GraphContext::GetVariableTensor(const std::string &var_data_name, GeTenso } } - REPORT_INNER_ERROR("E19999", "VarRecord with data_name:%s does not exist, check invalid when GraphContext %s", - var_data_name.c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "VarRecord with data_name:%s does not exist, check invalid", + var_data_name.c_str()); GELOGE(GE_GRAPH_VARIABLE_DOES_NOT_EXIST, "VarRecord with data_name %s does NOT exist!", var_data_name.c_str()); return GE_GRAPH_VARIABLE_DOES_NOT_EXIST; diff --git a/ge/graph/manager/graph_manager.cc b/ge/graph/manager/graph_manager.cc index d866beca..f7357d9d 100755 --- a/ge/graph/manager/graph_manager.cc +++ b/ge/graph/manager/graph_manager.cc @@ -140,7 +140,7 @@ ge::Status CheckFpCeilingMode() { auto ret = ge::GetContext().GetOption("ge.fpCeilingMode", mode); if (ret == ge::GRAPH_SUCCESS) { if (kValidFpCeilingMode.count(mode) == 0) { - REPORT_INNER_ERROR("E19999", "Option ge.fpCeilingMode is invalid, value:%s, when %s", mode.c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Option ge.fpCeilingMode is invalid, value:%s", mode.c_str()); GELOGE(ge::GE_GRAPH_OPTIONS_INVALID, "The fp_ceiling_mode %s is invalid, options are 0, 1, and 2.", mode.c_str()); return ge::GE_GRAPH_OPTIONS_INVALID; } @@ -169,14 +169,14 @@ Status GraphManager::Initialize(const std::map &options) { // malloc graph_run_listener_ = MakeShared(sync_run_mutex_, condition_); if (graph_run_listener_ == nullptr) { - REPORT_CALL_ERROR("E19999", "New GraphModelListener fail when GraphManager %s", __FUNCTION__); + REPORT_CALL_ERROR("E19999", "New GraphModelListener fail"); GELOGE(MEMALLOC_FAILED, "Make shared failed"); return MEMALLOC_FAILED; } // graph context graph_context_ = MakeShared(); if (graph_context_ == nullptr) { - REPORT_CALL_ERROR("E19999", "New GraphModelListener fail when GraphManager %s", __FUNCTION__); + REPORT_CALL_ERROR("E19999", "New GraphModelListener fail"); GELOGE(MEMALLOC_FAILED, "Make shared failed."); return MEMALLOC_FAILED; } @@ -298,8 +298,8 @@ Status GraphManager::InitDynamicParams(ComputeGraphPtr &compute_graph) { std::string op_type; auto ret = GetOriginalType(node, op_type); if (ret != SUCCESS) { - REPORT_CALL_ERROR("E19999", "GetOriginalType from op:%s fail when GraphManager %s", - node->GetName().c_str(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "GetOriginalType from op:%s fail", + node->GetName().c_str()); GELOGE(FAILED, "Failed to get node %s original type.", node->GetName().c_str()); return FAILED; } @@ -330,7 +330,7 @@ Status GraphManager::AddGraph(const GraphId &graph_id, const Graph &graph, const std::map &options, const OmgContext &omg_context) { if (HasGraphNode(graph_id)) { - REPORT_INNER_ERROR("E19999", "graph_id:%u is exist, check invalid when GraphManager %s", graph_id, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "graph_id:%u is exist, check invalid", graph_id); GELOGE(GE_GRAPH_GRAPH_ALREADY_EXIST, "[GraphManager] graph exists, graph_id = %u.", graph_id); return GE_GRAPH_GRAPH_ALREADY_EXIST; } @@ -341,8 +341,8 @@ Status GraphManager::AddGraph(const GraphId &graph_id, const Graph &graph, bool graph_has_been_added = false; if (AttrUtils::GetBool(*compute_graph, ATTR_NAME_GRAPH_HAS_BEEN_ADDED, graph_has_been_added) && graph_has_been_added) { - REPORT_INNER_ERROR("E19999", "Get Attr:%s from graph:%u fail when GraphManager %s", - ATTR_NAME_GRAPH_HAS_BEEN_ADDED.c_str(), graph_id, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Get Attr:%s from graph:%u fail", + ATTR_NAME_GRAPH_HAS_BEEN_ADDED.c_str(), graph_id); GELOGE(GE_GRAPH_GRAPH_ALREADY_EXIST, "[GraphManager] same graph object can not be added again, graph_id = %u.", graph_id); return GE_GRAPH_GRAPH_ALREADY_EXIST; @@ -350,8 +350,8 @@ Status GraphManager::AddGraph(const GraphId &graph_id, const Graph &graph, (void)AttrUtils::SetBool(*compute_graph, ATTR_NAME_GRAPH_HAS_BEEN_ADDED, true); compute_graph_ = compute_graph; } else { - REPORT_INNER_ERROR("E19999", "compute_graph from graph:%u is nullptr, check invalid when GraphManager %s", - graph_id, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "compute_graph from graph:%u is nullptr, check invalid", + graph_id); GELOGE(FAILED, "compute graph is null"); return FAILED; } @@ -369,14 +369,14 @@ Status GraphManager::AddGraph(const GraphId &graph_id, const Graph &graph, GraphNodePtr graph_node = MakeShared(graph_id); GE_IF_BOOL_EXEC(graph_node == nullptr, - REPORT_CALL_ERROR("E19999", "New GraphNode fail, graph_id:%u, when GraphManager %s", - graph_id, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "New GraphNode fail, graph_id:%u", + graph_id); GELOGE(FAILED, "GraphNode make shared failed"); return FAILED); std::shared_ptr graph_ptr = MakeShared(graph); GE_IF_BOOL_EXEC(graph_ptr == nullptr, - REPORT_CALL_ERROR("E19999", "New Graph fail, graph_id:%u, when GraphManager %s", - graph_id, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "New Graph fail, graph_id:%u", + graph_id); GELOGE(FAILED, "GraphPtr make shared failed"); return FAILED); // update option about tuning graph @@ -413,7 +413,7 @@ Status GraphManager::AddGraphWithCopy(const GraphId &graph_id, const Graph &grap const std::map &options, const OmgContext &omg_context) { if (HasGraphNode(graph_id)) { - REPORT_INNER_ERROR("E19999", "graph_id:%u is exist, check invalid when GraphManager %s", graph_id, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "graph_id:%u is exist, check invalid", graph_id); GELOGE(GE_GRAPH_GRAPH_ALREADY_EXIST, "[GraphManager] graph exists, graph_id = %u.", graph_id); return GE_GRAPH_GRAPH_ALREADY_EXIST; } @@ -423,15 +423,15 @@ Status GraphManager::AddGraphWithCopy(const GraphId &graph_id, const Graph &grap bool graph_has_been_added = false; if (AttrUtils::GetBool(*compute_graph, ATTR_NAME_GRAPH_HAS_BEEN_ADDED, graph_has_been_added) && graph_has_been_added) { - REPORT_INNER_ERROR("E19999", "Get Attr:%s from graph:%u fail when GraphManager %s", - ATTR_NAME_GRAPH_HAS_BEEN_ADDED.c_str(), graph_id, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Get Attr:%s from graph:%u fail", + ATTR_NAME_GRAPH_HAS_BEEN_ADDED.c_str(), graph_id); GELOGE(GE_GRAPH_GRAPH_ALREADY_EXIST, "[GraphManager] same graph object can not be added again, graph_id = %u.", graph_id); return GE_GRAPH_GRAPH_ALREADY_EXIST; } } else { - REPORT_INNER_ERROR("E19999", "compute_graph from graph:%u is nullptr, check invalid when GraphManager %s", - graph_id, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "compute_graph from graph:%u is nullptr, check invalid", + graph_id); GELOGE(FAILED, "compute graph is null"); return FAILED; } @@ -453,15 +453,15 @@ Status GraphManager::AddGraphWithCopy(const GraphId &graph_id, const Graph &grap GraphNodePtr graph_node = MakeShared(graph_id); if (graph_node == nullptr) { - REPORT_CALL_ERROR("E19999", "New GraphNode fail, graph_id:%u, when GraphManager %s", - graph_id, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "New GraphNode fail, graph_id:%u", + graph_id); GELOGE(FAILED, "GraphNode make shared failed"); return FAILED; } std::shared_ptr graph_ptr = GraphUtils::CreateGraphPtrFromComputeGraph(new_compute_graph); if (graph_ptr == nullptr) { - REPORT_CALL_ERROR("E19999", "New Graph fail, graph_id:%u, when GraphManager %s", - graph_id, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "New Graph fail, graph_id:%u", + graph_id); GELOGE(FAILED, "GraphPtr make shared failed"); return FAILED; } @@ -505,8 +505,8 @@ Status GraphManager::MergeSubGraph(ComputeGraphPtr &compute_graph, const ge::Com Status ret_topo = compute_graph->TopologicalSorting(); if (ret_topo != SUCCESS) { - REPORT_CALL_ERROR("E19999", "TopologicalSorting fail, graph_id:%u, when GraphManager %s", - compute_graph->GetGraphID(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "TopologicalSorting fail, graph_id:%u", + compute_graph->GetGraphID()); GELOGE(ret_topo, "[GraphManager]: TopologicalSorting the merged graph failed."); return ret_topo; } @@ -542,15 +542,15 @@ Status GraphManager::CopySubGraphAndMarkFusion(const ComputeGraphPtr &compute_gr std::vector output_nodes; ComputeGraphPtr new_compute_graph = GraphUtils::CloneGraph(old_compute_graph, "", input_nodes, output_nodes); if (new_compute_graph == nullptr) { - REPORT_CALL_ERROR("E19999", "CloneGraph fail, graph_id:%u, when GraphManager %s", - compute_graph->GetGraphID(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "CloneGraph fail, graph_id:%u", + compute_graph->GetGraphID()); GELOGE(INTERNAL_ERROR, "Clone graph failed."); return INTERNAL_ERROR; } copy_graphs.emplace(old_compute_graph->GetName(), new_compute_graph); if (!AttrUtils::SetBool(old_compute_graph, ATTR_NAME_NEED_LX_FUSION, true)) { - REPORT_INNER_ERROR("E19999", "Set Attr:%s to graph:%u fail when GraphManager %s", - ATTR_NAME_NEED_LX_FUSION.c_str(), old_compute_graph->GetGraphID(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Set Attr:%s to graph:%u fail", + ATTR_NAME_NEED_LX_FUSION.c_str(), old_compute_graph->GetGraphID()); GELOGE(INTERNAL_ERROR, "Set attr lx_fusion to graph failed."); return INTERNAL_ERROR; } @@ -616,7 +616,7 @@ Status GraphManager::OptimizeSubGraphWithMultiThreads(ComputeGraphPtr compute_gr for (size_t i = 0; i < vector_future.size(); ++i) { Status ret_status = vector_future[i].get(); if (ret_status != SUCCESS) { - REPORT_CALL_ERROR("E19999", "subgraph %zu optimize failed, when GraphManager %s", i, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "subgraph %zu optimize failed", i); GELOGE(ret_status, "subgraph %zu optimize failed", i); return ret_status; } @@ -627,7 +627,7 @@ Status GraphManager::OptimizeSubGraphWithMultiThreads(ComputeGraphPtr compute_gr bool GraphManager::CheckAllFusionOptimizeSuccess(const ComputeGraphPtr &compute_graph, Graph2SubGraphInfoList &sub_graph_map) { if (compute_graph == nullptr) { - REPORT_INNER_ERROR("E19999", "Param compute_graph is nullptr, check invalid when GraphManager %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Param compute_graph is nullptr, check invalid"); GELOGE(PARAM_INVALID, "Input param compute_graph is nullptr."); return false; } @@ -667,8 +667,8 @@ Status GraphManager::ReplaceSubgraphWithOriGraph(const ComputeGraphPtr &compute_ for (const auto &subgraph : root_subgraph_list) { auto iter = copy_graphs.find(subgraph->GetSubGraph()->GetName()); if (iter == copy_graphs.end()) { - REPORT_INNER_ERROR("E19999", "Can not find subgraph:%s in copy graphs, check invalid when GraphManager %s", - subgraph->GetSubGraph()->GetName().c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Can not find subgraph:%s in copy graphs, check invalid", + subgraph->GetSubGraph()->GetName().c_str()); GELOGE(FAILED, "Can not find subgraph:%s in copy graphs.", subgraph->GetSubGraph()->GetName().c_str()); return FAILED; } @@ -680,8 +680,8 @@ Status GraphManager::ReplaceSubgraphWithOriGraph(const ComputeGraphPtr &compute_ for (const auto &subgraph : subgraph_list) { auto iter = copy_graphs.find(subgraph->GetSubGraph()->GetName()); if (iter == copy_graphs.end()) { - REPORT_INNER_ERROR("E19999", "Can not find subgraph:%s in copy graphs, check invalid when GraphManager %s", - subgraph->GetSubGraph()->GetName().c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Can not find subgraph:%s in copy graphs, check invalid", + subgraph->GetSubGraph()->GetName().c_str()); GELOGE(FAILED, "Can not find subgraph:%s in copy graphs.", subgraph->GetSubGraph()->GetName().c_str()); return FAILED; } @@ -780,8 +780,8 @@ Status GraphManager::PreRunAfterOptimizeSubGraph(const GraphNodePtr &graph_node, Status ret = compute_graph->TopologicalSorting(); if (ret != SUCCESS) { - REPORT_CALL_ERROR("E19999", "TopologicalSorting fail, graph_id:%u, when GraphManager %s", - compute_graph->GetGraphID(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "TopologicalSorting fail, graph_id:%u", + compute_graph->GetGraphID()); GELOGE(ret, "Graph topological sort failed, ret:%d.", ret); return ret; } @@ -797,15 +797,15 @@ Status GraphManager::SetRtContext(rtContext_t rt_context, rtCtxMode_t mode, uint rtError_t rt_ret = rtCtxCreate(&rt_context, mode, ge::GetContext().DeviceId()); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtCtxCreate faileded, session_id:%lu, graph_id:%u, mode:%d, when GraphManager %s", - session_id, graph_id, mode, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtCtxCreate faileded, session_id:%lu, graph_id:%u, mode:%d", + session_id, graph_id, mode); GELOGE(FAILED, "Call rt api failed, ret: 0x%X", rt_ret); return FAILED; } rt_ret = rtCtxSetCurrent(rt_context); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtCtxSetCurrent failed, session_id:%lu, graph_id:%u, mode:%d, " - "when GraphManager %s", session_id, graph_id, mode, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtCtxSetCurrent failed, session_id:%lu, graph_id:%u, mode:%d", + session_id, graph_id, mode); GELOGE(FAILED, "Call rt api failed, ret: 0x%X", rt_ret); return FAILED; } @@ -939,7 +939,7 @@ Status GraphManager::StartForRunGraph(const GraphNodePtr &graph_node, const std: ErrorManager::GetInstance().SetStage(ErrorMessage::kModelCompile, ErrorMessage::kOther); if (graph_node->GetBuildFlag()) { REPORT_INNER_ERROR("E19999", "Graph:%u has not build before, can't run directly, " - "check invalid when GraphManager %s", graph_node->GetGraphId(), __FUNCTION__); + "check invalid", graph_node->GetGraphId()); GELOGE(PARAM_INVALID, "The graph %u need to re-build, you should remove it from GE " "first, then AddGraph again and rebuild it.", @@ -1141,22 +1141,22 @@ Status GraphManager::RunGraph(const GraphId &graph_id, const std::vectorGetRunFlag()) { REPORT_INNER_ERROR("E19999", "Graph is already running, can't be run again, graph_id:%u, " - "check invalid when GraphManager %s", graph_id, __FUNCTION__); + "check invalid", graph_id); GELOGE(GE_GRAPH_ALREADY_RUNNING, "[RunGraph] graph already running, graph id = %u", graph_id); return GE_GRAPH_ALREADY_RUNNING; } @@ -1170,7 +1170,7 @@ Status GraphManager::RunGraph(const GraphId &graph_id, const std::vectorInitFlag()) { - REPORT_INNER_ERROR("E19999", "GELib is not init before, graph_id:%u, check invalid when GraphManager %s", - graph_id, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "GELib is not init before, graph_id:%u, check invalid", + graph_id); GELOGE(GE_CLI_GE_NOT_INITIALIZED, "GE is not initialized"); return GE_CLI_GE_NOT_INITIALIZED; } @@ -1298,8 +1298,8 @@ Status GraphManager::BuildGraphForUnregisteredOp(const GraphId &graph_id, const instance_ptr->OpsKernelManagerObj().GetOpsKernelInfoStore(op_desc->GetOpKernelLibName()); if (kernel_info == nullptr) { REPORT_INNER_ERROR("E19999", "GetOpsKernelInfoStore fail for op:%s(%s), kernel_lib_name:%s, graph_id:%u, " - "check invalid when GraphManager %s", op_desc->GetName().c_str(), op_desc->GetType().c_str(), - op_desc->GetOpKernelLibName().c_str(), graph_id, __FUNCTION__); + "check invalid", op_desc->GetName().c_str(), op_desc->GetType().c_str(), + op_desc->GetOpKernelLibName().c_str(), graph_id); GELOGE(FAILED, "Get op kernel info store failed"); return FAILED; } @@ -1307,8 +1307,8 @@ Status GraphManager::BuildGraphForUnregisteredOp(const GraphId &graph_id, const ret = kernel_info->CompileOp(node_vec); if (ret != SUCCESS) { REPORT_CALL_ERROR("E19999", "Call CompileOp fail for op:%s(%s), kernel_lib_name:%s, graph_id:%u, " - "check invalid when GraphManager %s", op_desc->GetName().c_str(), op_desc->GetType().c_str(), - op_desc->GetOpKernelLibName().c_str(), graph_id, __FUNCTION__); + "check invalid", op_desc->GetName().c_str(), op_desc->GetType().c_str(), + op_desc->GetOpKernelLibName().c_str(), graph_id); GELOGE(FAILED, "Get op kernel info store failed"); GELOGE(ret, "Compile op failed, op = %s, graph_id = %u.", op_desc->GetName().c_str(), graph_id); return ret; @@ -1333,22 +1333,22 @@ Status GraphManager::BuildGraph(const GraphId &graph_id, const std::vectorGetRunFlag()) { REPORT_INNER_ERROR("E19999", "Graph is already running, can't be run again, graph_id:%u, " - "check invalid when GraphManager %s", graph_id, __FUNCTION__); + "check invalid", graph_id); GELOGE(GE_GRAPH_ALREADY_RUNNING, "[BuildGraph] graph already running, graph id = %u", graph_node->GetGraphId()); return GE_GRAPH_ALREADY_RUNNING; } @@ -1416,15 +1416,15 @@ Status GraphManager::RemoveGraph(const GraphId &graph_id) { GraphNodePtr graph_node = nullptr; Status ret = GetGraphNode(graph_id, graph_node); if (ret != SUCCESS) { - REPORT_INNER_ERROR("E19999", "Graph:%u not exist in graph_map, check invalid when GraphManager %s", - graph_id, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Graph:%u not exist in graph_map, check invalid", + graph_id); GELOGE(GE_GRAPH_GRAPH_NOT_EXIST, "[GraphManager] Id %u does not exists.", graph_id); return GE_GRAPH_GRAPH_NOT_EXIST; } if ((graph_node == nullptr) || (graph_node->GetRunFlag())) { - REPORT_INNER_ERROR("E19999", "Graph:%u is running, can't be remove, check invalid when GraphManager %s", - graph_id, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Graph:%u is running, can't be remove, check invalid", + graph_id); GELOGE(GE_GRAPH_GRAPH_IS_RUNNING, "[GraphManager] Id %u is running, can't be deleted.", graph_id); return GE_GRAPH_GRAPH_IS_RUNNING; } @@ -1446,8 +1446,8 @@ Status GraphManager::RemoveGraph(const GraphId &graph_id) { GELOGI("UnloadModel via new ome."); rt_ret = rtSetDevice(GetContext().DeviceId()); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtSetDevice failed, device_id:%u, graph_id:%u, when GraphManager %s", - GetContext().DeviceId(), graph_id, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtSetDevice failed, device_id:%u, graph_id:%u", + GetContext().DeviceId(), graph_id); GELOGE(RT_FAILED, "[GraphManager:] rtSetDevice failed, modelId=%u, graphId=%u.", all_sub_graph[i]->GetModelIdInfo().model_id, graph_id); ret = FAILED; @@ -1461,8 +1461,8 @@ Status GraphManager::RemoveGraph(const GraphId &graph_id) { } rt_ret = rtDeviceReset(GetContext().DeviceId()); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtDeviceReset fail, device_id:%u, graph_id:%u, when GraphManager %s", - GetContext().DeviceId(), graph_id, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtDeviceReset fail, device_id:%u, graph_id:%u", + GetContext().DeviceId(), graph_id); GELOGE(RT_FAILED, "[GraphManager:] unload model failed, modelId=%u, graphId=%u.", all_sub_graph[i]->GetModelIdInfo().model_id, graph_id); ret = FAILED; @@ -1479,8 +1479,8 @@ Status GraphManager::RemoveGraph(const GraphId &graph_id) { GELOGI("Unload model %u.", ge_root_model->GetModelId()); rt_ret = rtSetDevice(GetContext().DeviceId()); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtSetDevice failed, device_id:%u, graph_id:%u, when GraphManager %s", - GetContext().DeviceId(), graph_id, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtSetDevice failed, device_id:%u, graph_id:%u", + GetContext().DeviceId(), graph_id); GELOGE(RT_FAILED, "[GraphManager:] rtSetDevice failed, modelId=%u, graphId=%u.", ge_root_model->GetModelId(), graph_id); return FAILED; @@ -1493,8 +1493,8 @@ Status GraphManager::RemoveGraph(const GraphId &graph_id) { } rt_ret = rtDeviceReset(GetContext().DeviceId()); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtDeviceReset failed, device_id:%u, graph_id:%u, when GraphManager %s", - GetContext().DeviceId(), graph_id, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtDeviceReset failed, device_id:%u, graph_id:%u", + GetContext().DeviceId(), graph_id); GELOGE(RT_FAILED, "[GraphManager:] rtDeviceReset failed, modelId=%u, graphId=%u.", ge_root_model->GetModelId(), graph_id); ret = FAILED; @@ -1681,8 +1681,8 @@ Status GraphManager::ParseOption(const std::map &optio } else if (flag == "1") { option = true; } else { - REPORT_INNER_ERROR("E19999", "Option:%s value:%s must be 0 or 1, check invalid when GraphManager %s", - key.c_str(), flag.c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Option:%s value:%s must be 0 or 1, check invalid", + key.c_str(), flag.c_str()); GELOGE(GE_GRAPH_OPTIONS_INVALID, "Key:%s, its value %s is invalid, it must be 0 or 1.", key.c_str(), flag.c_str()); return GE_GRAPH_OPTIONS_INVALID; @@ -1699,8 +1699,8 @@ Status GraphManager::ParseOption(const std::map &optio if (iter != options.end()) { option = static_cast(std::strtol(iter->second.c_str(), &ptr, kDecimal)); if (ptr != nullptr && *ptr != '\0') { - REPORT_INNER_ERROR("E19999", "Option:%s value:%s must be int32_t type, check invalid when GraphManager %s", - key.c_str(), iter->second.c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Option:%s value:%s must be int32_t type, check invalid", + key.c_str(), iter->second.c_str()); GELOGE(GE_GRAPH_OPTIONS_INVALID, "Key:%s, its value %s is invalid, must be int32_t type.", key.c_str(), iter->second.c_str()); return GE_GRAPH_OPTIONS_INVALID; @@ -1744,8 +1744,8 @@ Status GraphManager::ParseOption(const std::map &optio // split engine and num by : size_t pos = engine_parallel.find(':'); if (pos == string::npos) { - REPORT_INNER_ERROR("E19999", "Option:%s, value:%s, engine and num must be connected by :, check invalid " - "when GraphManager %s", key.c_str(), engine_parallel.c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Option:%s, value:%s, engine and num must be connected by :, check invalid", + key.c_str(), engine_parallel.c_str()); GELOGE(GE_GRAPH_OPTIONS_INVALID, "engine and num must be connected by :, " "while your input is %s", @@ -1779,8 +1779,8 @@ Status GraphManager::ParseOption(const std::map &optio Status GraphManager::CheckEngineName(const std::string &engine_name, const std::string &key, const std::map &option) { if (engine_name.empty()) { - REPORT_INNER_ERROR("E19999", "Option:%s, param engine_name:%s is empty, check invalid when GraphManager %s", - key.c_str(), engine_name.c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Option:%s, param engine_name:%s is empty, check invalid", + key.c_str(), engine_name.c_str()); GELOGE(GE_GRAPH_OPTIONS_INVALID, "engine name of %s is empty", key.c_str()); return GE_GRAPH_OPTIONS_INVALID; } @@ -1791,8 +1791,8 @@ Status GraphManager::CheckEngineName(const std::string &engine_name, const std:: auto it_stream_repeat = option.find(engine_name); if (it_stream_repeat != option.end()) { - REPORT_INNER_ERROR("E19999", "Option:%s, param engine_name:%s is repeated, check invalid when GraphManager %s", - key.c_str(), engine_name.c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Option:%s, param engine_name:%s is repeated, check invalid", + key.c_str(), engine_name.c_str()); GELOGE(GE_GRAPH_OPTIONS_INVALID, "engine : %s of %s is repeated", engine_name.c_str(), key.c_str()); return GE_GRAPH_OPTIONS_INVALID; } @@ -1801,15 +1801,15 @@ Status GraphManager::CheckEngineName(const std::string &engine_name, const std:: Status GraphManager::ParseParallelNum(const std::string ¶llel_num, const std::string &key, int &num) { if (parallel_num.empty()) { - REPORT_INNER_ERROR("E19999", "Option:%s, param parallel num:%s is empty, check invalid when GraphManager %s", - key.c_str(), parallel_num.c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Option:%s, param parallel num:%s is empty, check invalid", + key.c_str(), parallel_num.c_str()); GELOGE(GE_GRAPH_OPTIONS_INVALID, "parallel num of %s is empty", key.c_str()); return GE_GRAPH_OPTIONS_INVALID; } for (char c : parallel_num) { if (!isdigit(c)) { - REPORT_INNER_ERROR("E19999", "Option:%s, param parallel num:%s is not digit, check invalid when GraphManager %s", - key.c_str(), parallel_num.c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Option:%s, param parallel num:%s is not digit, check invalid", + key.c_str(), parallel_num.c_str()); GELOGE(GE_GRAPH_OPTIONS_INVALID, "%s input is invalid ", key.c_str()); return GE_GRAPH_OPTIONS_INVALID; } @@ -1818,25 +1818,25 @@ Status GraphManager::ParseParallelNum(const std::string ¶llel_num, const std try { num = std::stoi(parallel_num); } catch (std::invalid_argument &) { - REPORT_INNER_ERROR("E19999", "Option:%s, param parallel num:%s is invalid argument, check when GraphManager %s", - key.c_str(), parallel_num.c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Option:%s, param parallel num:%s is invalid argument, check", + key.c_str(), parallel_num.c_str()); GELOGE(GE_GRAPH_OPTIONS_INVALID, "parallel num : %s of %s is invalid argument", parallel_num.c_str(), key.c_str()); return GE_GRAPH_OPTIONS_INVALID; } catch (std::out_of_range &) { - REPORT_INNER_ERROR("E19999", "Option:%s, param parallel num:%s is out of range, check when GraphManager %s", - key.c_str(), parallel_num.c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Option:%s, param parallel num:%s is out of range, check", + key.c_str(), parallel_num.c_str()); GELOGE(GE_GRAPH_OPTIONS_INVALID, "parallel num : %s of %s is out of range", parallel_num.c_str(), key.c_str()); return GE_GRAPH_OPTIONS_INVALID; } catch (...) { - REPORT_INNER_ERROR("E19999", "Option:%s, param parallel num:%s is invalid argument, check when GraphManager %s", - key.c_str(), parallel_num.c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Option:%s, param parallel num:%s is invalid argument, check", + key.c_str(), parallel_num.c_str()); GELOGE(GE_GRAPH_OPTIONS_INVALID, "parallel num : %s of %s is invalid argument", parallel_num.c_str(), key.c_str()); return GE_GRAPH_OPTIONS_INVALID; } if (num < 1) { - REPORT_INNER_ERROR("E19999", "Option:%s, param parallel num:%s < 1, check invalid when GraphManager %s", - key.c_str(), parallel_num.c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Option:%s, param parallel num:%s < 1, check invalid", + key.c_str(), parallel_num.c_str()); GELOGE(GE_GRAPH_OPTIONS_INVALID, "parallel num : %s of %s must bigger than 0", parallel_num.c_str(), key.c_str()); return GE_GRAPH_OPTIONS_INVALID; } @@ -1864,8 +1864,8 @@ Status GraphManager::GetGraphNode(const GraphId &graph_id, GraphNodePtr &out) { auto iter = graph_map_.find(graph_id); if (iter == graph_map_.end()) { out = nullptr; - REPORT_INNER_ERROR("E19999", "Graph:%u not exist in graph_map, check invalid when GraphManager %s", - graph_id, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Graph:%u not exist in graph_map, check invalid", + graph_id); GELOGE(GE_GRAPH_GRAPH_NOT_EXIST, "[GraphManager] graph not exist, graph_id= %u.", graph_id); return GE_GRAPH_GRAPH_NOT_EXIST; } @@ -1886,8 +1886,7 @@ Status GraphManager::SummaryHandle(const GraphId &graph_id, std::vector> &whole_summary_output_indexes = GetCompilerStages(graph_id).optimizer.GetSummaryOutputIndexes(); if (whole_summary_output_indexes.find(graph_id) == whole_summary_output_indexes.end()) { - REPORT_INNER_ERROR("E19999", "Graph:%u not exist in whole_summary_output_indexes, check invalid " - "when GraphManager %s", graph_id, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Graph:%u not exist in whole_summary_output_indexes, check invalid", graph_id); GELOGE(FAILED, "No Summary graph found in map."); return FAILED; } @@ -1933,8 +1932,8 @@ Status GraphManager::CheckpointHandle(const GraphId &graph_id, const ComputeGrap } } if (netoutput == nullptr) { - REPORT_INNER_ERROR("E19999", "No netoutput node in graph:%u, check invalid when GraphManager %s", - graph_id, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "No netoutput node in graph:%u, check invalid", + graph_id); GELOGE(FAILED, "Netoutput is null."); return FAILED; } @@ -1942,9 +1941,9 @@ Status GraphManager::CheckpointHandle(const GraphId &graph_id, const ComputeGrap std::string desc_name; auto out_anchor = in->GetPeerOutAnchor(); if (out_anchor == nullptr) { - REPORT_INNER_ERROR("E19999", "Peer anchor of op:%s(%s), in_index:%u is nullptr, graph_id:%u, check invalid " - "when GraphManager %s", netoutput->GetName().c_str(), netoutput->GetType().c_str(), - in->GetIdx(), graph_id, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Peer anchor of op:%s(%s), in_index:%u is nullptr, graph_id:%u, check invalid", + netoutput->GetName().c_str(), netoutput->GetType().c_str(), + in->GetIdx(), graph_id); GELOGE(FAILED, "out_anchor is null."); return FAILED; } @@ -1953,8 +1952,7 @@ Status GraphManager::CheckpointHandle(const GraphId &graph_id, const ComputeGrap while (peer_node != nullptr && peer_node->GetType() != kVariable) { if (peer_node->GetAllInDataAnchors().size() != 1) { REPORT_INNER_ERROR("E19999", "More than one prior nodes of peer_node:%s(%s) in checkpoint Graph:%u, " - "check invalid when GraphManager %s", - peer_node->GetName().c_str(), peer_node->GetType().c_str(), graph_id, __FUNCTION__); + "check invalid", peer_node->GetName().c_str(), peer_node->GetType().c_str(), graph_id); GELOGE(FAILED, "More than one prior nodes of peer_node %s in checkpoint Graph.", peer_node->GetName().c_str()); return FAILED; } @@ -1968,9 +1966,9 @@ Status GraphManager::CheckpointHandle(const GraphId &graph_id, const ComputeGrap } } if (peer_node == nullptr) { - REPORT_INNER_ERROR("E19999", "Peer anchor node of op:%s(%s), in_index:%u is nullptr, graph_id:%u, check invalid " - "when GraphManager %s", netoutput->GetName().c_str(), netoutput->GetType().c_str(), - in->GetIdx(), graph_id, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Peer anchor node of op:%s(%s), in_index:%u is nullptr, graph_id:%u, check invalid", + netoutput->GetName().c_str(), netoutput->GetType().c_str(), + in->GetIdx(), graph_id); GELOGE(FAILED, "No variable op found in one branch, checkpoint graph illegal."); return FAILED; } @@ -1978,8 +1976,8 @@ Status GraphManager::CheckpointHandle(const GraphId &graph_id, const ComputeGrap GELOGI("[GraphManager] CheckpointHandle, descName=%s.", desc_name.c_str()); if (in->GetIdx() >= static_cast(outputs.size())) { REPORT_INNER_ERROR("E19999", "in index:%u of op:%s(%s) is out of outputs.size:%zu range, graph_id:%u, " - "check invalid when GraphManager %s", in->GetIdx(), netoutput->GetName().c_str(), - netoutput->GetType().c_str(), outputs.size(), graph_id, __FUNCTION__); + "check invalid", in->GetIdx(), netoutput->GetName().c_str(), + netoutput->GetType().c_str(), outputs.size(), graph_id); GELOGE(FAILED, "variable index out of range."); return FAILED; } @@ -2026,8 +2024,8 @@ Status GraphManager::PushSummaryData2ME(const GraphId &graph_id, } return iter->second(graph_id, tmp_summary_data); } - REPORT_INNER_ERROR("E19999", "No summary callback found, graph_id:%u, check invalid when GraphManager %s", - graph_id, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "No summary callback found, graph_id:%u, check invalid", + graph_id); GELOGE(FAILED, "[GraphManager] PushSummaryData2ME failed, not found summary callback."); return FAILED; } @@ -2048,8 +2046,8 @@ Status GraphManager::PushSaveData2ME(const GraphId &graph_id, const std::mapsecond(graph_id, tmp_save_data); } - REPORT_INNER_ERROR("E19999", "No checkpoint callback found, graph_id:%u, check invalid when GraphManager %s", - graph_id, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "No checkpoint callback found, graph_id:%u, check invalid", + graph_id); GELOGE(FAILED, "[GraphManager] PushSaveData2ME failed, not found checkpoint callback."); return FAILED; } @@ -2078,8 +2076,8 @@ bool GraphManager::CheckVariableForCheckpointGraph(NodePtr &node) { } auto out = node->GetOutDataAnchor(0); if (out == nullptr) { - REPORT_INNER_ERROR("E19999", "anchor index:0 of op:%s(%s) is nullptr, check invalid when GraphManager %s", - node->GetName().c_str(), node->GetType().c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "anchor index:0 of op:%s(%s) is nullptr, check invalid", + node->GetName().c_str(), node->GetType().c_str()); GELOGE(GE_GRAPH_PARAM_NULLPTR, "out is nullptr."); return false; } @@ -2112,7 +2110,7 @@ static inline bool CheckConstanOpForCheckpointGraph(NodePtr &node) { return node bool GraphManager::IsCheckpointGraph(ComputeGraphPtr &compute_graph) { if (compute_graph == nullptr) { - REPORT_INNER_ERROR("E19999", "Param compute_graph is nullptr, check invalid when GraphManager %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Param compute_graph is nullptr, check invalid"); GELOGE(GE_GRAPH_PARAM_NULLPTR, "[IsCheckpointGraph] computeGraph is nullptr."); return false; } @@ -2247,8 +2245,8 @@ Status GraphManager::RemoveIsolatedConstInThisGraph(ge::ComputeGraphPtr &compute if (n->GetOutAllNodes().empty() && n->GetInAllNodes().empty()) { // it is an isolated constant, just remove it if (GraphUtils::RemoveJustNode(compute_graph, n) != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Remove constant op:%s(%s) failed when GraphManager %s", - n->GetName().c_str(), n->GetType().c_str(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Remove constant op:%s(%s) failed", + n->GetName().c_str(), n->GetType().c_str()); GELOGE(FAILED, "remove constant %s failed.", n->GetName().c_str()); return FAILED; } @@ -2643,8 +2641,8 @@ Status GraphManager::CheckAndReleaseMemory(const GeModelPtr &ge_model, const Gra " Device[%u] free_memory_size[%ld]", graph_node->GetGraphId(), memory_size, weight_size, GetContext().DeviceId(), free_memory); if (ge::CheckInt64AddOverflow(memory_size, weight_size) != SUCCESS) { - REPORT_INNER_ERROR("E19999", "memory_size:%ld and weight_size:%ld will overflow after add, check invalid " - "when GraphManager %s", memory_size, weight_size, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "memory_size:%ld and weight_size:%ld will overflow after add, check invalid", + memory_size, weight_size); GELOGE(INTERNAL_ERROR, "The sum of Memory size and weight size exceeds INT64_MAX"); return INTERNAL_ERROR; } @@ -2688,8 +2686,8 @@ Status GraphManager::CheckAndReleaseMemory(const GeModelPtr &ge_model, const Gra max_memory_size); rtError_t rt_ret = rtSetDevice(GetContext().DeviceId()); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtSetDevice failed, device_id:%u, when GraphManager %s", - GetContext().DeviceId(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtSetDevice failed, device_id:%u", + GetContext().DeviceId()); GELOGE(RT_FAILED, "[GraphManager:] rtSetDevice failed, modelId=%u, graphId=%u.", model_id, graph_id); continue; } @@ -2704,8 +2702,8 @@ Status GraphManager::CheckAndReleaseMemory(const GeModelPtr &ge_model, const Gra } rt_ret = rtDeviceReset(GetContext().DeviceId()); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtDeviceReset failed, device_id:%u, when GraphManager %s", - GetContext().DeviceId(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtDeviceReset failed, device_id:%u", + GetContext().DeviceId()); GELOGE(RT_FAILED, "[GraphManager:] rtDeviceReset failed, modelId=%u, graphId=%u.", model_id, graph_id); continue; } @@ -2735,14 +2733,14 @@ Status GraphManager::ProcessSubGraphWithMultiThreads(GraphManager *graph_manager GE_DUMP(compute_graph_tmp, "OptimizeSubGraphBefore"); GE_CHECK_NOTNULL(compute_graph_tmp); if (!AttrUtils::SetInt(*compute_graph_tmp, ATTR_NAME_ROOT_GRAPH_ID, root_graph_id)) { - REPORT_CALL_ERROR("E19999", "Set Attr:%s to graph:%u, when GraphManager %s", ATTR_NAME_ROOT_GRAPH_ID.c_str(), - compute_graph_tmp->GetGraphID(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Set Attr:%s to graph:%u", ATTR_NAME_ROOT_GRAPH_ID.c_str(), + compute_graph_tmp->GetGraphID()); GELOGE(FAILED, "Failed to set attr ATTR_NAME_ROOT_GRAPH_ID for subgraph, graph_id: %u.", root_graph_id); return FAILED; } if (!AttrUtils::SetStr(*compute_graph_tmp, ATTR_NAME_ROOT_GRAPH_NAME, root_graph_name)) { - REPORT_CALL_ERROR("E19999", "Set Attr:%s to graph:%u, when GraphManager %s", ATTR_NAME_ROOT_GRAPH_NAME.c_str(), - compute_graph_tmp->GetGraphID(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Set Attr:%s to graph:%u", ATTR_NAME_ROOT_GRAPH_NAME.c_str(), + compute_graph_tmp->GetGraphID()); GELOGE(FAILED, "Failed to set attr ATTR_NAME_ROOT_GRAPH_NAME for subgraph, \ root_graph_name: %s.", root_graph_name.c_str()); return FAILED; @@ -2762,8 +2760,7 @@ Status GraphManager::ProcessSubGraphWithMultiThreads(GraphManager *graph_manager compute_graph_tmp != nullptr ? compute_graph_tmp->GetName().c_str() : "", engine_name.c_str(), pthread_self()); } else { - REPORT_INNER_ERROR("E19999", "Param sub_graph_info_ptr or graph_manager is nullptr when GraphManager %s", - __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Param sub_graph_info_ptr or graph_manager is nullptr"); GELOGE(FAILED, "graph_manager or sub_graph_info_ptr is nullptr"); return FAILED; } @@ -2977,16 +2974,16 @@ Status GraphManager::ParseInputsDimsForGetNexNosinkAndData(const vector } GeAttrValue::INT index = 0; if (!(AttrUtils::GetInt(op_desc, ATTR_NAME_INDEX, index))) { - REPORT_CALL_ERROR("E19999", "Get Attr:%s from op:%s(%s) fail when GraphManager %s", ATTR_NAME_INDEX.c_str(), - op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Get Attr:%s from op:%s(%s) fail", ATTR_NAME_INDEX.c_str(), + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(PARAM_INVALID, "Get index from attr failed"); return PARAM_INVALID; } if (static_cast(index) > input_tensor.size()) { REPORT_INNER_ERROR("E19999", "Attr:%s in op:%s(%s) value:%ld > param input_tensor.size:%zu, " - "check invalid when GraphManager %s", ATTR_NAME_INDEX.c_str(), + "check invalid", ATTR_NAME_INDEX.c_str(), op_desc->GetName().c_str(), op_desc->GetType().c_str(), - index, input_tensor.size(), __FUNCTION__); + index, input_tensor.size()); GELOGE(PARAM_INVALID, "The count of input tensor should be equal to the count of data."); return PARAM_INVALID; } @@ -3135,7 +3132,7 @@ void GraphManager::ReturnError(GraphManager *graph_manager, GraphNodePtr &graph_ auto compute_graph = GraphUtils::GetComputeGraph(*graph_node->GetGraph()); if (graph_manager == nullptr || compute_graph == nullptr) { REPORT_INNER_ERROR("E19999", "Param graph_manager or compute_graph in graph_node is nullptr, " - "check invalid when GraphManager %s", __FUNCTION__); + "check invalid"); GELOGE(GRAPH_FAILED, "[Analyze Mode] compute graph is null!"); callback(GRAPH_FAILED, outputs); return; @@ -3156,8 +3153,8 @@ void GraphManager::ReturnError(GraphManager *graph_manager, GraphNodePtr &graph_ } if (len < 0) { REPORT_INNER_ERROR("E19999", "InputIndex:%zu ShapeSize:%ld of op:%s(%s) < 0, unknown shape is not support, " - "check invalid when GraphManager %s", i, len, - node->GetName().c_str(), node->GetType().c_str(), __FUNCTION__); + "check invalid", i, len, + node->GetName().c_str(), node->GetType().c_str()); GELOGE(GRAPH_FAILED, "Analyze Mode does not support GEOP output unknown shape!"); callback(GRAPH_FAILED, outputs); return; @@ -3167,10 +3164,9 @@ void GraphManager::ReturnError(GraphManager *graph_manager, GraphNodePtr &graph_ } auto size = GetSizeByDataType(input_desc->GetDataType()); if (size <= 0) { - REPORT_INNER_ERROR("E19999", "data_type:%s of op:%s(%s) is not support, input_index:%zu check invalid " - "when GraphManager %s", + REPORT_INNER_ERROR("E19999", "data_type:%s of op:%s(%s) is not support, input_index:%zu check invalid", ge::TypeUtils::DataTypeToSerialString(input_desc->GetDataType()).c_str(), - node->GetName().c_str(), node->GetType().c_str(), i, __FUNCTION__); + node->GetName().c_str(), node->GetType().c_str(), i); GELOGE(PARAM_INVALID, "Failed to get cube size, the data type %s is invalid", ge::TypeUtils::DataTypeToSerialString(input_desc->GetDataType()).c_str()); callback(GRAPH_FAILED, outputs); @@ -3178,9 +3174,9 @@ void GraphManager::ReturnError(GraphManager *graph_manager, GraphNodePtr &graph_ } if (CheckInt64MulOverflow(len, static_cast(size)) != true) { REPORT_INNER_ERROR("E19999", "shape_size:%ld of op:%s(%s) will overflow after multiply by " - "size:%u of data_type:%s, input_index:%zu, check invalid when GraphManager %s", len, + "size:%u of data_type:%s, input_index:%zu, check invalid", len, node->GetName().c_str(), node->GetType().c_str(), size, - ge::TypeUtils::DataTypeToSerialString(input_desc->GetDataType()).c_str(), i, __FUNCTION__); + ge::TypeUtils::DataTypeToSerialString(input_desc->GetDataType()).c_str(), i); GELOGE(MEMALLOC_FAILED, "int64 multiply happens overflow! a:%ld b:%d", len, size); callback(GRAPH_FAILED, outputs); return; @@ -3203,15 +3199,15 @@ bool GraphManager::IsGraphNeedRebuild(uint32_t graph_id) { GraphNodePtr graph_node = nullptr; Status ret = GetGraphNode(graph_id, graph_node); if (ret != SUCCESS) { - REPORT_INNER_ERROR("E19999", "Graph:%u not exist in graph_map, check invalid when GraphManager %s", - graph_id, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Graph:%u not exist in graph_map, check invalid", + graph_id); GELOGE(ret, "[RunGraph] graph not exist, graph_id=%u.", graph_id); return true; } if (graph_node == nullptr) { - REPORT_INNER_ERROR("E19999", "Graph node is nullptr in graph_map, graph_id:%u, check invalid when GraphManager %s", - graph_id, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Graph node is nullptr in graph_map, graph_id:%u, check invalid", + graph_id); GELOGE(GE_GRAPH_GRAPH_NODE_NULL, "[RunGraph] graph node is NULL, graphId=%u.", graph_id); return true; } @@ -3226,15 +3222,15 @@ const map *GraphManager::GetGraphOptions(uint32_t grap GraphNodePtr graph_node = nullptr; Status ret = GetGraphNode(graph_id, graph_node); if (ret != SUCCESS) { - REPORT_INNER_ERROR("E19999", "Graph:%u not exist in graph_map, check invalid when GraphManager %s", - graph_id, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Graph:%u not exist in graph_map, check invalid", + graph_id); GELOGE(ret, "[RunGraph] graph not exist, graph_id=%u.", graph_id); return nullptr; } if (!graph_node) { - REPORT_INNER_ERROR("E19999", "Graph node is nullptr in graph_map, graph_id:%u, check invalid when GraphManager %s", - graph_id, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Graph node is nullptr in graph_map, graph_id:%u, check invalid", + graph_id); GELOGE(GE_GRAPH_GRAPH_NODE_NULL, "[RunGraph] graph node is NULL, graph_id=%u.", graph_id); return nullptr; } @@ -3265,8 +3261,8 @@ Status GraphManager::OptimizeSubgraph(const GraphNodePtr &graph_node, ComputeGra } bool dynamic_shape_partitioned = false; if (!AttrUtils::GetBool(*compute_graph, ATTR_NAME_DYNAMIC_SHAPE_PARTITIONED, dynamic_shape_partitioned)) { - REPORT_INNER_ERROR("E19999", "Get Attr:%s from graph:%u fail when GraphManager %s", - ATTR_NAME_DYNAMIC_SHAPE_PARTITIONED.c_str(), compute_graph->GetGraphID(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Get Attr:%s from graph:%u fail", + ATTR_NAME_DYNAMIC_SHAPE_PARTITIONED.c_str(), compute_graph->GetGraphID()); GELOGE(FAILED, "failed get dynamic shape partitioned flag on partitioned graph."); return FAILED; } @@ -3324,8 +3320,8 @@ Status GraphManager::OptimizeSubgraph(const GraphNodePtr &graph_node, ComputeGra if (AttrUtils::GetBool(compute_graph, ATTR_NAME_OFF_SUPERKERNEL_ATTR, off_superkernel)) { GELOGI("Compute graph %s get superkernel flag %d.", compute_graph->GetName().c_str(), off_superkernel); if (!AttrUtils::SetBool(merged_compute_graph, ATTR_NAME_OFF_SUPERKERNEL_ATTR, off_superkernel)) { - REPORT_INNER_ERROR("E19999", "Set Attr:%s to graph:%u fail when GraphManager %s", - ATTR_NAME_OFF_SUPERKERNEL_ATTR.c_str(), compute_graph->GetGraphID(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Set Attr:%s to graph:%u fail", + ATTR_NAME_OFF_SUPERKERNEL_ATTR.c_str(), compute_graph->GetGraphID()); GELOGE(FAILED, "Compute graph %s set superkernel flag %d failed", merged_compute_graph->GetName().c_str(), off_superkernel); return FAILED; @@ -3335,8 +3331,8 @@ Status GraphManager::OptimizeSubgraph(const GraphNodePtr &graph_node, ComputeGra GE_DUMP(merged_compute_graph, "mergedComputeGraph"); compute_graph = merged_compute_graph; if (!AttrUtils::SetBool(*compute_graph, ATTR_NAME_DYNAMIC_SHAPE_PARTITIONED, dynamic_shape_partitioned)) { - REPORT_INNER_ERROR("E19999", "Set Attr:%s to graph:%u fail when GraphManager %s", - ATTR_NAME_DYNAMIC_SHAPE_PARTITIONED.c_str(), compute_graph->GetGraphID(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Set Attr:%s to graph:%u fail", + ATTR_NAME_DYNAMIC_SHAPE_PARTITIONED.c_str(), compute_graph->GetGraphID()); GELOGE(FAILED, "failed set dynamic shape partitioned flag on partitioned graph."); return FAILED; } @@ -3450,8 +3446,8 @@ Status GraphManager::SaveVariables(const Graph &graph, const std::vectorGetType() != VARIABLE) { if (peer_node->GetAllInDataAnchors().size() != 1) { REPORT_INNER_ERROR("E19999", "peer node:%s(%s) of netoutput has more than 1 input in checkpoint Graph, " - "check invalid when GraphManager %s", - peer_node->GetName().c_str(), peer_node->GetType().c_str(), __FUNCTION__); + "check invalid", + peer_node->GetName().c_str(), peer_node->GetType().c_str()); GELOGE(FAILED, "peer_node [%s] has more than 1 input in checkpoint Graph.", peer_node->GetName().c_str()); return FAILED; } @@ -3507,8 +3503,8 @@ Status GraphManager::SaveCheckPointResult(const Graph &graph, const std::vector< } if (peer_node->GetType() != VARIABLE) { REPORT_INNER_ERROR("E19999", "peer node:%s(%s) of netoutput is not variable in checkpoint Graph, " - "check invalid when GraphManager %s", - peer_node->GetName().c_str(), peer_node->GetType().c_str(), __FUNCTION__); + "check invalid", + peer_node->GetName().c_str(), peer_node->GetType().c_str()); GELOGE(FAILED, " peer_node %s is not variable in checkpoint Graph.", peer_node->GetName().c_str()); return FAILED; } @@ -3516,7 +3512,7 @@ Status GraphManager::SaveCheckPointResult(const Graph &graph, const std::vector< GELOGI("[GraphManager] SaveVariables, varName is %s.", var_name.c_str()); if (in->GetIdx() >= static_cast(outputs.size())) { REPORT_INNER_ERROR("E19999", "In index:%u of netoutput is out of outputs.size:%zu range in checkpoint Graph, " - "check invalid when GraphManager %s", in->GetIdx(), outputs.size(), __FUNCTION__); + "check invalid", in->GetIdx(), outputs.size()); GELOGE(FAILED, "variable index[%d] out of range[%zu].", in->GetIdx(), outputs.size()); return FAILED; } diff --git a/ge/graph/manager/graph_manager_utils.cc b/ge/graph/manager/graph_manager_utils.cc index e9270401..3a8d577c 100644 --- a/ge/graph/manager/graph_manager_utils.cc +++ b/ge/graph/manager/graph_manager_utils.cc @@ -84,7 +84,7 @@ Status SubGraphInfo::FreeInOutBuffer() { rtError_t rt_ret; rt_ret = rtFreeHost(*iter); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtFreeHost fail when SubGraphInfo %s", __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtFreeHost fail"); GELOGE(rt_ret, "[GraphManager] subgraph free buffer failed, modelId = %u", model_id_info_.model_id); buffer_addr_.erase(buffer_addr_.begin(), iter); return GE_GRAPH_FREE_FAILED; @@ -120,7 +120,7 @@ Status GraphModelListener::OnComputeDone(uint32_t model_id, uint32_t task_id, ui uint32_t GraphModelListener::GetResultCode() const { if (!is_finished_) { - REPORT_CALL_ERROR("E19999", "Model not run finish, fail for %s", __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Model not run finish"); GELOGE(INTERNAL_ERROR, "[GraphManager] model not run finish."); return INTERNAL_ERROR; } diff --git a/ge/graph/manager/graph_mem_allocator.cc b/ge/graph/manager/graph_mem_allocator.cc index 56b455da..24e75356 100755 --- a/ge/graph/manager/graph_mem_allocator.cc +++ b/ge/graph/manager/graph_mem_allocator.cc @@ -49,8 +49,8 @@ uint8_t *MemoryAllocator::MallocMemory(const string &purpose, size_t memory_size uint8_t *memory_addr = nullptr; if (rtMalloc(reinterpret_cast(&memory_addr), memory_size, memory_type_) != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMalloc fail, purpose:%s, size:%zu, device_id:%u, when MemoryAllocator %s", - purpose.c_str(), memory_size, device_id, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMalloc fail, purpose:%s, size:%zu, device_id:%u", + purpose.c_str(), memory_size, device_id); GELOGE(ge::INTERNAL_ERROR, "MemoryAllocator::MallocMemory device_id = %u," " size= %lu", @@ -68,7 +68,7 @@ Status MemoryAllocator::FreeMemory(uint8_t *memory_addr, uint32_t device_id) con GELOGI("MemoryAllocator::FreeMemory device_id = %u", device_id); auto rtRet = rtFree(memory_addr); if (rtRet != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtFree fail, device_id:%u, when MemoryAllocator %s", device_id, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtFree fail, device_id:%u", device_id); GELOGE(rtRet, "MemoryAllocator::MallocMemory device_id = %u", device_id); return RT_ERROR_TO_GE_STATUS(rtRet); } @@ -87,9 +87,8 @@ uint8_t *MemoryAllocator::MallocMemory(const string &purpose, const string &memo uint8_t *memory_addr = MallocMemory(purpose, memory_size, device_id); if (memory_addr == nullptr) { - REPORT_CALL_ERROR("E19999", "Malloc Memory fail, purpose:%s, memory_key:%s, memory_size:%zu, device_id:%u, " - "when MemoryAllocator %s", purpose.c_str(), memory_key.c_str(), - memory_size, device_id, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Malloc Memory fail, purpose:%s, memory_key:%s, memory_size:%zu, device_id:%u", + purpose.c_str(), memory_key.c_str(), memory_size, device_id); GELOGE(ge::INTERNAL_ERROR, "MemoryAllocator::MallocMemory failed," " memory_key[%s], size = %lu.", @@ -126,8 +125,8 @@ Status MemoryAllocator::FreeMemory(const string &memory_key, uint32_t device_id) } if (FreeMemory(it->second.memory_addr_, device_id) != ge::SUCCESS) { - REPORT_CALL_ERROR("E19999", "Free Memory fail, memory_key:%s, device_id:%u, when MemoryAllocator %s", - memory_key.c_str(), device_id, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Free Memory fail, memory_key:%s, device_id:%u", + memory_key.c_str(), device_id); GELOGE(ge::INTERNAL_ERROR, "MemoryAllocator::FreeMemory rtFree failed," " memory_key[%s]", @@ -177,7 +176,7 @@ Status MemManager::Initialize(const std::vector &memory_type) { memory_allocator_map_[index] = memory_allocator; GELOGI("Create MemoryAllocator memory type[%u] success.", index); } else { - REPORT_CALL_ERROR("E19999", "New MemoryAllocator fail, index:%u, when MemoryAllocator %s", index, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "New MemoryAllocator fail, index:%u", index); GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "Alloc MemoryAllocator failed."); } } else { diff --git a/ge/graph/manager/graph_var_manager.cc b/ge/graph/manager/graph_var_manager.cc index b8df2bcd..5d440f00 100755 --- a/ge/graph/manager/graph_var_manager.cc +++ b/ge/graph/manager/graph_var_manager.cc @@ -40,7 +40,7 @@ ge::Status VarResource::GetVarAddr(const std::string &var_name, const ge::GeTens rtMemType_t &memory_type) { if (dev_ptr == nullptr) { REPORT_INNER_ERROR("E19999", "Param dev_ptr is nullptr, var_name:%s, session_id:%lu, " - "check invalid when VarResource %s", var_name.c_str(), session_id_, __FUNCTION__); + "check invalid", var_name.c_str(), session_id_); GELOGE(FAILED, "[GetVarAddr] dev_ptr is null!"); return FAILED; } @@ -50,8 +50,8 @@ ge::Status VarResource::GetVarAddr(const std::string &var_name, const ge::GeTens auto iter = var_addr_mgr_map_.find(var_key); if (iter == var_addr_mgr_map_.end()) { REPORT_INNER_ERROR("E19999", "var_key:%s can't find in var_addr_mgr_map_, var_name:%s, session_id:%lu, " - "check invalid when VarResource %s", var_key.c_str(), var_name.c_str(), - session_id_, __FUNCTION__); + "check invalid", var_key.c_str(), var_name.c_str(), + session_id_); GELOGE(FAILED, "VarResource::GetVarAddr failed, var_key %s", var_key.c_str()); return FAILED; } @@ -108,8 +108,8 @@ ge::Status VarResource::SaveVarAddr(const std::string &var_name, const ge::GeTen } REPORT_INNER_ERROR("E19999", "var_key:%s conflict in var_addr_mgr_map_, var_name:%s, session_id:%lu, " - "check invalid when VarResource %s", var_key.c_str(), var_name.c_str(), - session_id_, __FUNCTION__); + "check invalid", var_key.c_str(), var_name.c_str(), + session_id_); GELOGE(FAILED, "VarResource::SaveVarAddr, var_key %s save addr conflict", var_key.c_str()); return FAILED; } @@ -144,8 +144,8 @@ ge::Status VarResource::RenewCurVarDesc(const std::string &var_name, const ge::O } if (op_desc == nullptr) { - REPORT_INNER_ERROR("E19999", "Param op_desc is nullptr, var_name:%s, session_id:%lu, check invalid " - "when VarResource %s", var_name.c_str(), session_id_, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Param op_desc is nullptr, var_name:%s, session_id:%lu, check invalid", + var_name.c_str(), session_id_); GELOGE(FAILED, "[RenewCurVarDesc] renew var desc fail! input opdesc is null!"); return FAILED; } @@ -163,8 +163,8 @@ ge::Status VarResource::RenewCurVarDesc(const std::string &var_name, const ge::O auto iter = var_addr_mgr_map_.find(key); if (iter == var_addr_mgr_map_.end()) { REPORT_INNER_ERROR("E19999", "var_key:%s can't find in var_addr_mgr_map_, var_name:%s, session_id:%lu, op:%s(%s), " - "check invalid when VarResource %s", key.c_str(), var_name.c_str(), - session_id_, op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + "check invalid", key.c_str(), var_name.c_str(), + session_id_, op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(FAILED, "[RenewCurVarDesc] can't find ele with key [%s]", key.c_str()); return FAILED; } @@ -285,14 +285,14 @@ Status HbmMemResource::AssignVarMem(const std::string &var_name, uint64_t size, total_size_ = VarManager::Instance(session_id)->GetVarMemMaxSize(); if (total_size_ < var_mem_size_) { REPORT_INNER_ERROR("E19999", "VarMemMaxSize:%lu < var_mem_size_:%lu, var_size:%lu, var_name:%s, check invalid" - " when HbmMemResource %s", total_size_, var_mem_size_, size, var_name.c_str(), __FUNCTION__); + "", total_size_, var_mem_size_, size, var_name.c_str()); GELOGE(PARAM_INVALID, "total_size_: %lu is smaller than var_mem_size_: %lu", total_size_, var_mem_size_); return PARAM_INVALID; } uint64_t free_size = total_size_ - var_mem_size_; if (free_size < (size + kSessionMemAlignSize * kSessionMemAlignUnit)) { - REPORT_INNER_ERROR("E19999", "free_size:%lu not enough, var_align_size:%lu, var_name:%s, check invalid " - "when HbmMemResource %s", free_size, size, var_name.c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "free_size:%lu not enough, var_align_size:%lu, var_name:%s, check invalid", + free_size, size, var_name.c_str()); GELOGE(PARAM_INVALID, "Out of memory : current var size[%lu] exceeds total var size[%lu]", size + kSessionMemAlignSize * kSessionMemAlignUnit + var_mem_size_, total_size_); return PARAM_INVALID; @@ -316,8 +316,8 @@ Status HbmMemResource::AssignVarMem(const std::string &var_name, uint64_t size, Status RdmaMemResource::AssignVarMem(const std::string &var_name, uint64_t size, uint64_t session_id, size_t &address) { uint8_t *buffer = MemManager::Instance().RdmaPoolInstance(RT_MEMORY_HBM).Malloc(size); if (buffer == nullptr) { - REPORT_CALL_ERROR("E19999", "malloc rdma memory fail, var_size:%lu, var_name:%s when RdmaMemResource %s", - size, var_name.c_str(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "malloc rdma memory fail, var_size:%lu, var_name:%s", + size, var_name.c_str()); GELOGE(MEMALLOC_FAILED, "Failed to malloc rdma memory for node %s, size = %lu", var_name.c_str(), size); return MEMALLOC_FAILED; } @@ -467,8 +467,8 @@ int64_t VarManager::GetVarMemSize(rtMemType_t memory_type) { } if (mem_resource == nullptr) { - REPORT_INNER_ERROR("E19999", "Find no mem_resource in map, memory_type:%d, session_id:%lu when VarManager %s", - memory_type, session_id_, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Find no mem_resource in map, memory_type:%d, session_id:%lu", + memory_type, session_id_); GELOGE(ge::INTERNAL_ERROR, "MemResource is invalid."); return 0; } @@ -482,8 +482,8 @@ Status VarManager::UpdateVarMemSize(rtMemType_t memory_type, int64_t mem_size) { if (iter == mem_resource_map_.end()) { mem_resource = MemResource::BuildMemResourceFromType(memory_type); if (mem_resource == nullptr) { - REPORT_CALL_ERROR("E19999", "memory_type:%d invalid or New MemResource fail, session_id:%lu when VarManager %s", - memory_type, session_id_, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "memory_type:%d invalid or New MemResource fail, session_id:%lu", + memory_type, session_id_); GELOGE(ge::INTERNAL_ERROR, "Alloc MemResource failed, memory_type = %u.", memory_type); return ge::INTERNAL_ERROR; } else { @@ -494,8 +494,8 @@ Status VarManager::UpdateVarMemSize(rtMemType_t memory_type, int64_t mem_size) { } if (mem_resource == nullptr) { - REPORT_INNER_ERROR("E19999", "MemResource is invalid, memory_type:%d, session_id:%lu when VarManager %s", - memory_type, session_id_, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "MemResource is invalid, memory_type:%d, session_id:%lu", + memory_type, session_id_); GELOGE(ge::INTERNAL_ERROR, "MemResource is invalid."); return FAILED; } @@ -514,8 +514,8 @@ ge::Status VarManager::AssignVarMem(const std::string &var_name, const ge::GeTen size_t mem_offset = 0; ge::Status result = TensorUtils::GetSize(tensor_desc, tensor_desc_size); if (result != ge::SUCCESS) { - REPORT_CALL_ERROR("E19999", "Get size from tensor fail, var_name:%s, memory_type:%d, session_id:%lu, " - "when VarManager %s", var_name.c_str(), memory_type, session_id_, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Get size from tensor fail, var_name:%s, memory_type:%d, session_id:%lu", + var_name.c_str(), memory_type, session_id_); GELOGE(result, "get size from TensorDesc failed"); return result; } @@ -525,8 +525,8 @@ ge::Status VarManager::AssignVarMem(const std::string &var_name, const ge::GeTen if (it == mem_resource_map_.end()) { mem_resource = MemResource::BuildMemResourceFromType(memory_type); if (mem_resource == nullptr) { - REPORT_CALL_ERROR("E19999", "memory_type:%d invalid or New MemResource fail, session_id:%lu when VarManager %s", - memory_type, session_id_, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "memory_type:%d invalid or New MemResource fail, session_id:%lu", + memory_type, session_id_); GELOGE(ge::INTERNAL_ERROR, "Alloc MemResource failed, memory_type = %u.", memory_type); return ge::INTERNAL_ERROR; } else { @@ -537,8 +537,8 @@ ge::Status VarManager::AssignVarMem(const std::string &var_name, const ge::GeTen } if (mem_resource == nullptr) { - REPORT_INNER_ERROR("E19999", "MemResource is invalid, memory_type:%d, session_id:%lu when VarManager %s", - memory_type, session_id_, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "MemResource is invalid, memory_type:%d, session_id:%lu", + memory_type, session_id_); GELOGE(ge::INTERNAL_ERROR, "MemResource is invalid, memory_type = %u.", memory_type); return ge::INTERNAL_ERROR; } @@ -549,7 +549,7 @@ ge::Status VarManager::AssignVarMem(const std::string &var_name, const ge::GeTen } if (var_resource_ == nullptr) { REPORT_INNER_ERROR("E19999", "VarManager has not been init, memory_type:%d, session_id:%lu, " - "check invalid when VarManager %s", memory_type, session_id_, __FUNCTION__); + "check invalid", memory_type, session_id_); GELOGW("VarManager has not been init."); return ge::INTERNAL_ERROR; } @@ -668,9 +668,9 @@ ge::Status VarManager::RenewCurVarDesc(const std::string &var_name, ge::OpDescPt GELOGD("VarManager::RenewCurVarDesc var_name = %s.", var_name.c_str()); if (var_resource_ == nullptr) { - REPORT_INNER_ERROR("E19999", "VarManager has not been init, op:%s(%s), session_id:%lu, check invalid " - "when VarManager %s", op_desc->GetName().c_str(), op_desc->GetType().c_str(), - session_id_, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "VarManager has not been init, op:%s(%s), session_id:%lu, check invalid", + op_desc->GetName().c_str(), op_desc->GetType().c_str(), + session_id_); GELOGE(ge::INTERNAL_ERROR, "VarManager has not been init."); return ge::INTERNAL_ERROR; } @@ -822,8 +822,8 @@ Status VarManager::SetMemoryMallocSize(const map &options) { var_mem_logic_base_ = graph_mem_max_size_ + kGraphMemoryBuffer; if (var_mem_logic_base_ > kMaxMemorySize) { - REPORT_INNER_ERROR("E19999", "var_login_base:%zu can not exeed limit:%zu, session_id:%lu, check invalid " - "when VarManager %s", var_mem_logic_base_, kMaxMemorySize, session_id_, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "var_login_base:%zu can not exeed limit:%zu, session_id:%lu, check invalid", + var_mem_logic_base_, kMaxMemorySize, session_id_); GELOGE(ge::GE_GRAPH_OPTIONS_INVALID, "kMemoryVarLogicBase : %zu can not exceed max memory size : %zu.", var_mem_logic_base_, kMaxMemorySize); return ge::GE_GRAPH_OPTIONS_INVALID; @@ -831,8 +831,8 @@ Status VarManager::SetMemoryMallocSize(const map &options) { use_max_mem_size_ = graph_mem_max_size_ + var_mem_max_size_; if (use_max_mem_size_ > kMaxMemorySize) { - REPORT_INNER_ERROR("E19999", "all mem_use size:%zu can not exeed limit:%zu, session_id:%lu, check invalid " - "when VarManager %s", use_max_mem_size_, kMaxMemorySize, session_id_, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "all mem_use size:%zu can not exeed limit:%zu, session_id:%lu, check invalid", + use_max_mem_size_, kMaxMemorySize, session_id_); GELOGE(ge::GE_GRAPH_OPTIONS_INVALID, "kUseMaxMemorySize : %zu can not exceed max memory size : %zu.", use_max_mem_size_, kMaxMemorySize); return ge::GE_GRAPH_OPTIONS_INVALID; @@ -843,8 +843,8 @@ Status VarManager::SetMemoryMallocSize(const map &options) { Status VarManager::ParseMemoryMallocSize(string &memory_size, size_t &result) { if (memory_size.empty()) { - REPORT_INNER_ERROR("E19999", "Param memory_size is empty, session_id:%lu, check invalid when VarManager %s", - session_id_, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Param memory_size is empty, session_id:%lu, check invalid", + session_id_); GELOGE(GE_GRAPH_OPTIONS_INVALID, "Memory malloc size input is empty."); return GE_GRAPH_OPTIONS_INVALID; } @@ -870,8 +870,8 @@ Status VarManager::ParseMemoryMallocSize(string &memory_size, size_t &result) { for (char c : split) { if (!isdigit(c)) { - REPORT_INNER_ERROR("E19999", "Param memory_size:%s contains non digit, session_id:%lu, check invalid " - "when VarManager %s", memory_size.c_str(), session_id_, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Param memory_size:%s contains non digit, session_id:%lu, check invalid", + memory_size.c_str(), session_id_); GELOGE(GE_GRAPH_OPTIONS_INVALID, "Memory malloc size input contains non digit."); return GE_GRAPH_OPTIONS_INVALID; } @@ -879,14 +879,14 @@ Status VarManager::ParseMemoryMallocSize(string &memory_size, size_t &result) { uint64_t num = std::strtoul(split.c_str(), nullptr, 0); GE_IF_BOOL_EXEC(TypeUtils::CheckUint64MulOverflow(result, static_cast(num)), REPORT_INNER_ERROR("E19999", "Param memory_size:%s will overflow after multi all, session_id:%lu, " - "check invalid when VarManager %s", memory_size.c_str(), - session_id_, __FUNCTION__); + "check invalid", memory_size.c_str(), + session_id_); GELOGE(FAILED, "Input memory size is out of range."); return FAILED); if ((num > kMaxMemorySize) || (result * static_cast(num) > kMaxMemorySize)) { REPORT_INNER_ERROR("E19999", "Param memory_size:%s after multi will exceed limit:%lu, session_id:%lu, " - "check invalid when VarManager %s", memory_size.c_str(), kMaxMemorySize, - session_id_, __FUNCTION__); + "check invalid", memory_size.c_str(), kMaxMemorySize, + session_id_); GELOGE(FAILED, "Input memory size can not exceed max memory size : %zu.", kMaxMemorySize); return FAILED; } @@ -990,7 +990,7 @@ VarManager *VarManagerPool::GetVarManager(uint64_t session_id) { VarManager *var_manager = new (std::nothrow) VarManager(session_id); if (var_manager == nullptr) { - REPORT_INNER_ERROR("E19999", "New VarManager fail, session_id:%lu, when VarManager %s", session_id, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "New VarManager fail, session_id:%lu", session_id); GELOGE(INTERNAL_ERROR, "VarManager::Instance find session by " "session_id[%lu] failed.", diff --git a/ge/graph/manager/host_mem_allocator.cc b/ge/graph/manager/host_mem_allocator.cc index ab272670..98f9a313 100644 --- a/ge/graph/manager/host_mem_allocator.cc +++ b/ge/graph/manager/host_mem_allocator.cc @@ -34,7 +34,7 @@ uint8_t *HostMemAllocator::Malloc(size_t size) { std::lock_guard lock(mutex_); std::shared_ptr aligned_ptr = MakeShared(size); if (aligned_ptr == nullptr) { - REPORT_INNER_ERROR("E19999", "New AlignedPtr fail, when HostMemAllocator %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "New AlignedPtr fail"); GELOGE(INTERNAL_ERROR, "make shared_ptr for AlignedPtr failed"); return nullptr; } @@ -45,7 +45,7 @@ uint8_t *HostMemAllocator::Malloc(size_t size) { Status HostMemAllocator::Free(const void *memory_addr) { if (memory_addr == nullptr) { - REPORT_INNER_ERROR("E19999", "Param memory_addr is nullptr, check invalid when HostMemAllocator %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Param memory_addr is nullptr, check invalid"); GELOGE(GE_GRAPH_FREE_FAILED, "Invalid memory pointer"); return GE_GRAPH_FREE_FAILED; } @@ -53,8 +53,7 @@ Status HostMemAllocator::Free(const void *memory_addr) { std::lock_guard lock(mutex_); auto it = allocated_blocks_.find(memory_addr); if (it == allocated_blocks_.end()) { - REPORT_INNER_ERROR("E19999", "Memory_addr is not alloc before, check invalid when HostMemAllocator %s", - __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Memory_addr is not alloc before, check invalid"); GELOGE(PARAM_INVALID, "Invalid memory pointer"); return PARAM_INVALID; } diff --git a/ge/graph/manager/host_mem_manager.cc b/ge/graph/manager/host_mem_manager.cc index 6461b77c..40a0d1b9 100644 --- a/ge/graph/manager/host_mem_manager.cc +++ b/ge/graph/manager/host_mem_manager.cc @@ -39,8 +39,8 @@ Status SharedMemAllocator::Allocate(SharedMemInfo &mem_info) { rtMallocHostSharedMemoryOut output_para; rtError_t rt_ret = rtMallocHostSharedMemory(&input_para, &output_para); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMallocHostSharedMemory fail, ret:0x%X, when SharedMemAllocator %s", - rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMallocHostSharedMemory fail, ret:0x%X", + rt_ret); GELOGE(RT_FAILED, "Call rt api(rtMallocHostSharedMemory) failed, devid:[%u].", device_id); return GE_GRAPH_MEMORY_ALLOC_FAILED; } @@ -61,8 +61,8 @@ Status SharedMemAllocator::DeAllocate(SharedMemInfo &mem_info) { mem_info.host_aligned_ptr->MutableGet(), mem_info.device_address}; rtError_t rt_ret = rtFreeHostSharedMemory(&free_para); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtFreeHostSharedMemory fail, ret:0x%X, when SharedMemAllocator %s", - rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtFreeHostSharedMemory fail, ret:0x%X", + rt_ret); GELOGE(RT_FAILED, "Call rt api(rtFreeHostSharedMemory) failed, ret: 0x%X.", rt_ret); return RT_FAILED; } @@ -78,7 +78,7 @@ Status HostMemManager::Initialize() { std::lock_guard lock(mutex_); allocator_ = std::unique_ptr(new (std::nothrow) SharedMemAllocator()); if (allocator_ == nullptr) { - REPORT_CALL_ERROR("E19999", "New SharedMemAllocator fail when SharedMemAllocator %s", __FUNCTION__); + REPORT_CALL_ERROR("E19999", "New SharedMemAllocator fail"); GELOGE(GE_GRAPH_MALLOC_FAILED, "Shared memory allocator init failed!"); return GE_GRAPH_MALLOC_FAILED; } @@ -99,8 +99,8 @@ Status HostMemManager::MallocSharedMemory(SharedMemInfo &mem_info) { std::lock_guard lock(mutex_); auto iter = var_memory_base_map_.find(mem_info.op_name); if (iter != var_memory_base_map_.end()) { - REPORT_INNER_ERROR("E19999", "MemInfo.op_name:%s can't find in var_memory_base_map_ when HostMemManager %s", - mem_info.op_name.c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "MemInfo.op_name:%s can't find in var_memory_base_map_", + mem_info.op_name.c_str()); GELOGE(FAILED, "Host shared memory for op %s has been malloced", mem_info.op_name.c_str()); return FAILED; } @@ -114,8 +114,8 @@ Status HostMemManager::MallocSharedMemory(SharedMemInfo &mem_info) { Status HostMemManager::QueryVarMemInfo(const string &op_name, uint64_t &base_addr, uint64_t &data_size) { std::lock_guard lock(mutex_); if (var_memory_base_map_.find(op_name) == var_memory_base_map_.end()) { - REPORT_INNER_ERROR("E19999", "MemInfo.op_name:%s can't find in var_memory_base_map_ when HostMemManager %s", - op_name.c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "MemInfo.op_name:%s can't find in var_memory_base_map_", + op_name.c_str()); GELOGE(INTERNAL_ERROR, "Find host base base_addr failed,node name:%s!", op_name.c_str()); return INTERNAL_ERROR; } diff --git a/ge/graph/manager/memory_api.cc b/ge/graph/manager/memory_api.cc index 7f977756..415f8088 100644 --- a/ge/graph/manager/memory_api.cc +++ b/ge/graph/manager/memory_api.cc @@ -50,8 +50,8 @@ Status RdmaRemoteRegister(const std::vector &var_info, rtMemType_t path.append(file_name); string canonical_path = RealPath(path.c_str()); if (canonical_path.empty()) { - REPORT_INNER_ERROR("E19999", "canonical_path:%s is empty, check invalid when %s", - canonical_path.c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "canonical_path:%s is empty, check invalid", + canonical_path.c_str()); GELOGE(FAILED, "Failed to get realpath of %s", path.c_str()); return FAILED; } @@ -67,16 +67,16 @@ Status RdmaRemoteRegister(const std::vector &var_info, rtMemType_t auto hcom_remote_mem_register = (HcclResult(*)(const MemRegisterAddr *, uint32_t))dlsym(handle, "HcomRegRemoteAccessMem"); if (hcom_remote_mem_register == nullptr) { - REPORT_CALL_ERROR("E19999", "Symbol HcomRegRemoteAccessMem can't find in %s, check invalid when %s", - canonical_path.c_str(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Symbol HcomRegRemoteAccessMem can't find in %s, check invalid", + canonical_path.c_str()); GELOGE(FAILED, "Failed to invoke hcom_remote_mem_register function."); return FAILED; } HcclResult hccl_ret = hcom_remote_mem_register(reg_addrs.get(), table_len); if (hccl_ret != HCCL_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Call hcom_remote_mem_register failed, ret:%d, when %s", - hccl_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call hcom_remote_mem_register failed, ret:%d,", + hccl_ret); GELOGE(HCCL_E_INTERNAL, "Rdma mem register failed, ret: 0x%X", hccl_ret); return HCCL_E_INTERNAL; } diff --git a/ge/graph/manager/rdma_pool_allocator.cc b/ge/graph/manager/rdma_pool_allocator.cc index 6f9c4d31..c19a2159 100644 --- a/ge/graph/manager/rdma_pool_allocator.cc +++ b/ge/graph/manager/rdma_pool_allocator.cc @@ -81,8 +81,7 @@ Status RdmaPoolAllocator::InitMemory(size_t mem_size) { auto device_id = GetContext().DeviceId(); GELOGD("Init Rdma Memory with size [%zu] for devid:[%u]", mem_size, device_id); if (rdma_base_addr_ != nullptr) { - REPORT_INNER_ERROR("E19999", "Param rdma_base_addr_ is nullptr, check invalid when RdmaPoolAllocator %s", - __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Param rdma_base_addr_ is nullptr, check invalid"); GELOGE(GE_MULTI_INIT, "Rdma pool has been malloced"); return GE_MULTI_INIT; } @@ -102,7 +101,7 @@ Status RdmaPoolAllocator::InitMemory(size_t mem_size) { // Init with a base block. auto *base_block = new (std::nothrow) Block(device_id, mem_size, rdma_base_addr_); if (base_block == nullptr) { - REPORT_CALL_ERROR("E19999", "New Block failed, device_id:%u, when RdmaPoolAllocator %s", device_id, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "New Block failed, device_id:%u", device_id); GELOGE(GE_GRAPH_MALLOC_FAILED, "Block malloc failed"); return GE_GRAPH_MALLOC_FAILED; } @@ -121,8 +120,8 @@ uint8_t *RdmaPoolAllocator::Malloc(size_t size, uint32_t device_id) { block_bin_.erase(it); block->allocated = true; if (block->ptr == nullptr) { - REPORT_INNER_ERROR("E19999", "Rdmapool memory address is nullptr, device_id:%u, check invalid when RdmaPoolAllocator %s", - device_id, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Rdmapool memory address is nullptr, device_id:%u, check invalid", + device_id); GELOGE(INTERNAL_ERROR, "Rdmapool memory address is nullptr."); return nullptr; } @@ -155,8 +154,8 @@ uint8_t *RdmaPoolAllocator::Malloc(size_t size, uint32_t device_id) { Status RdmaPoolAllocator::Free(uint8_t *memory_addr, uint32_t device_id) { GELOGI("Free rdma memory, device id = %u", device_id); if (memory_addr == nullptr) { - REPORT_INNER_ERROR("E19999", "Param memory_addr is nullptr, device_id:%u, check invalid when RdmaPoolAllocator %s", - device_id, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Param memory_addr is nullptr, device_id:%u, check invalid", + device_id); GELOGE(GE_GRAPH_FREE_FAILED, "Invalid memory pointer"); return GE_GRAPH_FREE_FAILED; } @@ -165,7 +164,7 @@ Status RdmaPoolAllocator::Free(uint8_t *memory_addr, uint32_t device_id) { auto it = allocated_blocks_.find(memory_addr); if (it == allocated_blocks_.end()) { REPORT_INNER_ERROR("E19999", "Param memory_addr is not allocated before, device_id:%u, " - "check invalid when RdmaPoolAllocator %s", device_id, __FUNCTION__); + "check invalid", device_id); GELOGE(PARAM_INVALID, "Invalid memory pointer"); return PARAM_INVALID; } @@ -208,8 +207,7 @@ void RdmaPoolAllocator::MergeBlocks(Block *dst, Block *src) { Status RdmaPoolAllocator::GetBaseAddr(uint64_t &base_addr, uint64_t &mem_size) { if (rdma_base_addr_ == nullptr) { - REPORT_INNER_ERROR("E19999", "Param rdma_base_addr_ is nullptr, check invalid when RdmaPoolAllocator %s", - __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Param rdma_base_addr_ is nullptr, check invalid"); GELOGE(INTERNAL_ERROR, "Rdma base addr is nullptr."); return INTERNAL_ERROR; } diff --git a/ge/graph/manager/trans_var_data_utils.cc b/ge/graph/manager/trans_var_data_utils.cc index 2b7be573..7c96eb95 100644 --- a/ge/graph/manager/trans_var_data_utils.cc +++ b/ge/graph/manager/trans_var_data_utils.cc @@ -35,24 +35,24 @@ class RtContextSwitchGuard { RtContextSwitchGuard(rtCtxMode_t mode, uint32_t device_id) : last_(nullptr), current_(nullptr) { auto ret = rtCtxGetCurrent(&last_); if (ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtCtxGetCurrent failed, device_id:%u, ret:0x%X, when %s", - device_id, ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtCtxGetCurrent failed, device_id:%u, ret:0x%X,", + device_id, ret); GELOGE(RT_FAILED, "Failed to get current context from rt, error-code %d", ret); return; } ret = rtCtxCreate(¤t_, mode, static_cast(device_id)); if (ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtCtxCreate failed, device_id:%u, ret:0x%X, when %s", - device_id, ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtCtxCreate failed, device_id:%u, ret:0x%X,", + device_id, ret); GELOGE(RT_FAILED, "Failed to create new context for device %u, error-code %d", device_id, ret); return; } ret = rtCtxSetCurrent(current_); if (ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtCtxSetCurrent failed, device_id:%u, ret:0x%X, when %s", - device_id, ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtCtxSetCurrent failed, device_id:%u, ret:0x%X,", + device_id, ret); GELOGE(RT_FAILED, "Failed to switch context to normal, context %p, device %u", current_, device_id); return; } @@ -78,8 +78,8 @@ class RtContextSwitchGuard { int64_t CalcVarSizeInBytes(const GeTensorDesc &desc) { int64_t var_size = GetSizeByDataType(desc.GetDataType()); if (var_size <= 0) { - REPORT_INNER_ERROR("E19999", "Data type:%s in desc, it's size:%ld < 0, check invalid when %s", - TypeUtils::DataTypeToSerialString(desc.GetDataType()).c_str(), var_size, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Data type:%s in desc, it's size:%ld < 0, check invalid", + TypeUtils::DataTypeToSerialString(desc.GetDataType()).c_str(), var_size); GELOGE(PARAM_INVALID, "Failed to calc var data size from data type %s", TypeUtils::DataTypeToSerialString(desc.GetDataType()).c_str()); return -1; @@ -97,8 +97,8 @@ Status CopyVarToDevice(const NodePtr &var, const formats::TransResult &trans_res auto ret = rtMemcpy(var_addr, trans_result.length, reinterpret_cast(trans_result.data.get()), trans_result.length, RT_MEMCPY_HOST_TO_DEVICE); if (ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, op:%s(%s), size:%lu, ret:0x%X, when %s", var->GetName().c_str(), - var->GetType().c_str(), trans_result.length, ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, op:%s(%s), size:%lu, ret:0x%X,", var->GetName().c_str(), + var->GetType().c_str(), trans_result.length, ret); GELOGE(RT_FAILED, "Failed to copy memory to device, size %zu", trans_result.length); return RT_FAILED; } @@ -120,8 +120,8 @@ Status CopyVarFromDevice(uint64_t session_id, const NodePtr &var, std::unique_pt uint8_t *var_addr = VarManager::Instance(session_id)->GetVarMemoryAddr(var_logic, RT_MEMORY_HBM); if (var_addr == nullptr) { - REPORT_CALL_ERROR("E19999", "Get variable memory addr failed, mem_type:%d, op:%s(%s), session_id:%lu, when %s", - RT_MEMORY_HBM, var->GetName().c_str(), var->GetType().c_str(), session_id, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Get variable memory addr failed, mem_type:%d, op:%s(%s), session_id:%lu,", + RT_MEMORY_HBM, var->GetName().c_str(), var->GetType().c_str(), session_id); GELOGE(INTERNAL_ERROR, "Failed to copy var %s from device, cant not get " "var addr from logic addr %p", @@ -136,8 +136,8 @@ Status CopyVarFromDevice(uint64_t session_id, const NodePtr &var, std::unique_pt std::unique_ptr var_host(new(std::nothrow) uint8_t[var_size_bytes]); if (var_host == nullptr) { - REPORT_CALL_ERROR("E19999", "New host memory failed, size:%ld, op:%s(%s), session_id:%lu, when %s", - var_size_bytes, var->GetName().c_str(), var->GetType().c_str(), session_id, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "New host memory failed, size:%ld, op:%s(%s), session_id:%lu,", + var_size_bytes, var->GetName().c_str(), var->GetType().c_str(), session_id); GELOGE(OUT_OF_MEMORY, "Failed to malloc rt-host memory, size %ld", var_size_bytes); return OUT_OF_MEMORY; } @@ -145,8 +145,8 @@ Status CopyVarFromDevice(uint64_t session_id, const NodePtr &var, std::unique_pt ret = rtMemcpy(reinterpret_cast(var_host.get()), var_size_bytes, reinterpret_cast(var_addr), var_size_bytes, RT_MEMCPY_DEVICE_TO_HOST); if (ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%ld, op:%s(%s), session_id:%lu, ret:0x%X when %s", - var_size_bytes, var->GetName().c_str(), var->GetType().c_str(), session_id, ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%ld, op:%s(%s), session_id:%lu, ret:0x%X", + var_size_bytes, var->GetName().c_str(), var->GetType().c_str(), session_id, ret); GELOGE(RT_FAILED, "Failed to copy var memory from device, var %s, size %ld," " rt-error-code %u", @@ -191,12 +191,12 @@ Status TransVarOnHost(uint8_t *var_data, const VarTransRoad &trans_road, formats TypeUtils::DataTypeToSerialString(data_type).c_str()); auto ret = formats::TransFormat({src_data, src_format, dst_format, src_shape, dst_shape, data_type}, tmp_result); if (ret != SUCCESS) { - REPORT_CALL_ERROR("E19999", "Trans format from %s to %s, shape %s to %s failed, data type:%s, ret:%u, when %s", + REPORT_CALL_ERROR("E19999", "Trans format from %s to %s, shape %s to %s failed, data type:%s, ret:%u,", TypeUtils::FormatToSerialString(src_format).c_str(), TypeUtils::FormatToSerialString(dst_format).c_str(), formats::ShapeToString(src_shape).c_str(), formats::ShapeToString(dst_shape).c_str(), - TypeUtils::DataTypeToSerialString(data_type).c_str(), ret, __FUNCTION__); + TypeUtils::DataTypeToSerialString(data_type).c_str(), ret); GELOGE(INTERNAL_ERROR, "Failed to trans format from %s to %s, shape %s to %s, " "data type %s error code %u", @@ -217,10 +217,10 @@ Status TransVarOnHost(uint8_t *var_data, const VarTransRoad &trans_road, formats auto ret = formats::TransDataType({src_data, static_cast(src_data_size), src_data_type, dst_data_type}, tmp_result); if (ret != SUCCESS) { - REPORT_CALL_ERROR("E19999", "Trans data type from %s to %s failed, input shape %s, data size %ld, ret:%u, " - "when %s", TypeUtils::DataTypeToSerialString(src_data_type).c_str(), + REPORT_CALL_ERROR("E19999", "Trans data type from %s to %s failed, input shape %s, data size %ld, ret:%u", + TypeUtils::DataTypeToSerialString(src_data_type).c_str(), TypeUtils::DataTypeToSerialString(dst_data_type).c_str(), - formats::ShapeToString(input_shape).c_str(), src_data_size, ret, __FUNCTION__); + formats::ShapeToString(input_shape).c_str(), src_data_size, ret); GELOGE(INTERNAL_ERROR, "Failed to trans data type from %s to %s, input shape %s, data size %ld, error code %u", TypeUtils::DataTypeToSerialString(src_data_type).c_str(), TypeUtils::DataTypeToSerialString(dst_data_type).c_str(), formats::ShapeToString(input_shape).c_str(), @@ -228,8 +228,8 @@ Status TransVarOnHost(uint8_t *var_data, const VarTransRoad &trans_road, formats return ret; } } else { - REPORT_INNER_ERROR("E19999", "Trans var data failed, the trans type %s does not supported, check invalid when %s", - trans_info.node_type.c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Trans var data failed, the trans type %s does not supported, check invalid", + trans_info.node_type.c_str()); GELOGE(UNSUPPORTED, "Failed to trans var data, the trans type %s does not supported", trans_info.node_type.c_str()); return UNSUPPORTED; @@ -264,8 +264,8 @@ Status ReAssignVarAddr(uint64_t session_id, uint8_t *var_addr = VarManager::Instance(session_id)->GetVarMemoryAddr(var_logic, RT_MEMORY_HBM); if (var_addr == nullptr) { - REPORT_CALL_ERROR("E19999", "Get variable memory addr failed, mem_type:%d, var_name:%s, session_id:%lu, when %s", - RT_MEMORY_HBM, var_name.c_str(), session_id, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Get variable memory addr failed, mem_type:%d, var_name:%s, session_id:%lu,", + RT_MEMORY_HBM, var_name.c_str(), session_id); GELOGE(INTERNAL_ERROR, "Failed to convert var %s logic addr to real addr", var_name.c_str()); return INTERNAL_ERROR; } @@ -293,8 +293,8 @@ Status TransVarData(const NodePtr &var, const VarTransRoad &trans_road, uint64_t // Sync var data from device std::unique_ptr var_data; if (trans_road.empty()) { - REPORT_INNER_ERROR("E19999", "Param trans_road is empty, session_id:%lu, check invalid when %s", - session_id, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Param trans_road is empty, session_id:%lu, check invalid", + session_id); GELOGE(INTERNAL_ERROR, "Failed to get trans_road, trans_road is empty."); return INTERNAL_ERROR; } @@ -346,10 +346,10 @@ Status TransTensor(uint8_t *var_data, const NodePtr &var_src, const NodePtr &var auto ret = formats::TransDataType( {var_data, static_cast(src_data_shape_size), src_data_datatype, dst_data_datatype}, result); if (ret != SUCCESS) { - REPORT_CALL_ERROR("E19999", "Trans data type from %s to %s failed, data size %ld, ret:%u, " - "when %s", TypeUtils::DataTypeToSerialString(src_data_datatype).c_str(), + REPORT_CALL_ERROR("E19999", "Trans data type from %s to %s failed, data size %ld, ret:%u", + TypeUtils::DataTypeToSerialString(src_data_datatype).c_str(), TypeUtils::DataTypeToSerialString(dst_data_datatype).c_str(), - src_data_shape_size, ret, __FUNCTION__); + src_data_shape_size, ret); GELOGE(INTERNAL_ERROR, "trans var data on host failed"); return ret; }); @@ -367,7 +367,7 @@ Status CopyTensorFromSrcVarNode(const NodePtr &var_src, /// [opdesc of var_src and var_dst are checked before passed in, no need to check if they are nullptr] GE_IF_BOOL_EXEC(var_src == nullptr || var_dst == nullptr, REPORT_INNER_ERROR("E19999", "Param var_src or var_dst is empty, session_id:%lu, device_id:%u, " - "check invalid when %s", session_id, device_id, __FUNCTION__); + "check invalid", session_id, device_id); GELOGE(FAILED, "node var is nullptr"); return FAILED); // src_node output_desc (fp32) GeTensorDesc output_desc = var_src->GetOpDesc()->GetOutputDesc(0); @@ -491,16 +491,16 @@ Status TransVarDataUtils::TransAllVarData(const vector &variable_nodes, ErrorManager::GetInstance().SetErrorContext(error_context); rtError_t rt_ret = rtCtxSetCurrent(ctx); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtCtxSetCurrent failed, session_id:%lu, graph_id:%u, ret:0x%X, when %s", - session_id, graph_id, rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtCtxSetCurrent failed, session_id:%lu, graph_id:%u, ret:0x%X,", + session_id, graph_id, rt_ret); GELOGE(RT_FAILED, "Failed to set context, error_code is: 0x%X.", rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret); } uint32_t allocated_graph_id = 0; Status ret = VarManager::Instance(session_id)->GetAllocatedGraphId(node->GetName(), allocated_graph_id); if (ret != SUCCESS) { - REPORT_CALL_ERROR("E19999", "Get allocated GraphId failed, session_id:%lu, graph_id:%u, ret:0x%X, when %s", - session_id, graph_id, ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Get allocated GraphId failed, session_id:%lu, graph_id:%u, ret:0x%X,", + session_id, graph_id, ret); GELOGE(INTERNAL_ERROR, "var has not been allocated, node:%s, graph_id:%u.", node->GetName().c_str(), graph_id); return INTERNAL_ERROR; @@ -548,8 +548,8 @@ Status TransVarDataUtils::TransAllVarData(const vector &variable_nodes, Status TransVarDataUtils::CopyVarData(const ComputeGraphPtr &compute_graph, uint64_t session_id, uint32_t device_id) { GELOGD("CopyVarData start: session_id:%lu.", session_id); if (compute_graph == nullptr) { - REPORT_INNER_ERROR("E19999", "Param compute_graph is nullptr, session_id:%lu, device_id:%u, check invalid when %s", - session_id, device_id, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Param compute_graph is nullptr, session_id:%lu, device_id:%u, check invalid", + session_id, device_id); GELOGE(FAILED, "compute_graph is nullptr"); return FAILED; } diff --git a/ge/graph/manager/util/debug.cc b/ge/graph/manager/util/debug.cc index 996947b8..65aa3192 100644 --- a/ge/graph/manager/util/debug.cc +++ b/ge/graph/manager/util/debug.cc @@ -63,16 +63,16 @@ Status Debug::DumpDevMem(const char *file, const void *addr, int64_t size) { uint8_t *host_addr = nullptr; rtError_t ret = rtMallocHost(reinterpret_cast(&host_addr), size); if (ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMallocHost failed, size:%zu, ret: 0x%X when Debug %s", - size, ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMallocHost failed, size:%zu, ret: 0x%X", + size, ret); GELOGE(FAILED, "Call rt api rtMallocHost failed, ret: 0x%X", ret); return FAILED; } GE_MAKE_GUARD_RTMEM(host_addr); ret = rtMemcpy(host_addr, size, addr, size, RT_MEMCPY_DEVICE_TO_HOST); if (ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret: 0x%X when Debug %s", - size, ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret: 0x%X", + size, ret); GELOGE(FAILED, "Call rt api rtMemcpy failed, ret: 0x%X", ret); return FAILED; } diff --git a/ge/graph/manager/util/hcom_util.cc b/ge/graph/manager/util/hcom_util.cc index 544ebb90..a30321f9 100644 --- a/ge/graph/manager/util/hcom_util.cc +++ b/ge/graph/manager/util/hcom_util.cc @@ -40,9 +40,9 @@ Status HcomOmeUtil::GetHcclDataType(const ge::ConstOpDescPtr &op_desc, if (op_desc->GetType() == HCOMRECEIVE) { bool ret = ge::AttrUtils::GetDataType(op_desc, HCOM_ATTR_DATA_TYPE, src_data_type); if (ret == false) { - REPORT_INNER_ERROR("E19999", "Get Attr:%s in op:%s(%s) fail when HcomOmeUtil %s", + REPORT_INNER_ERROR("E19999", "Get Attr:%s in op:%s(%s) fail", HCOM_ATTR_DATA_TYPE.c_str(), - op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(PARAM_INVALID, "op:HcomReceive, op desc no attr: dtype."); return PARAM_INVALID; } @@ -55,9 +55,9 @@ Status HcomOmeUtil::GetHcclDataType(const ge::ConstOpDescPtr &op_desc, auto iter = kConstOpHcclDataType.find(static_cast(src_data_type)); if (iter == kConstOpHcclDataType.end()) { REPORT_INNER_ERROR("E19999", "Attr:%s in op:%s(%s), value data_type:%s, not support in kConstOpHcclDataType now, " - "check invalid when HcomOmeUtil %s", HCOM_ATTR_DATA_TYPE.c_str(), + "check invalid", HCOM_ATTR_DATA_TYPE.c_str(), op_desc->GetName().c_str(), op_desc->GetType().c_str(), - ge::TypeUtils::DataTypeToSerialString(src_data_type).c_str(), __FUNCTION__); + ge::TypeUtils::DataTypeToSerialString(src_data_type).c_str()); GELOGE(PARAM_INVALID, "HcomOmeUtil:: Node: %s Optype: %s HcomDataType cann't support! Current Davinci Data Type : %s", op_desc->GetName().c_str(), op_desc->GetType().c_str(), @@ -83,8 +83,8 @@ Status HcomOmeUtil::GetHcomCount(const ge::ConstOpDescPtr &op_desc, HcclDataType int &count) { GE_CHECK_NOTNULL(op_desc); if (!IsHCOMOp(op_desc->GetType())) { - REPORT_INNER_ERROR("E19999", "Op:%s(%s) is not hcom op, check invalid when HcomOmeUtil %s", - op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Op:%s(%s) is not hcom op, check invalid", + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(PARAM_INVALID, "HcomOmeUtil:: operator is not Hcom operator."); return PARAM_INVALID; } @@ -151,8 +151,8 @@ Status HcomOmeUtil::GetHorovodCount(const ge::ConstOpDescPtr &op_desc, std::vector &kernel_hccl_infos) { GE_CHECK_NOTNULL(op_desc); if (!IsHorovodOp(op_desc->GetType())) { - REPORT_INNER_ERROR("E19999", "Op:%s(%s) is not horovod op, check invalid when HcomOmeUtil %s", - op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Op:%s(%s) is not horovod op, check invalid", + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(PARAM_INVALID, "HcomOmeUtil:: operator is not Horovod operator."); return PARAM_INVALID; } @@ -225,9 +225,9 @@ Status HcomOmeUtil::GetHcclOperationType(const ge::ConstOpDescPtr &op_desc, Hccl if (IsHCOMOp(op_desc->GetType())) { std::string hcom_op_type; GE_CHK_BOOL_EXEC(ge::AttrUtils::GetStr(op_desc, HCOM_ATTR_REDUCE_TYPE, hcom_op_type), - REPORT_INNER_ERROR("E19999", "Get Attr:%s in op:%s(%s) fail when HcomOmeUtil %s", + REPORT_INNER_ERROR("E19999", "Get Attr:%s in op:%s(%s) fail", HCOM_ATTR_REDUCE_TYPE.c_str(), - op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + op_desc->GetName().c_str(), op_desc->GetType().c_str()); return PARAM_INVALID, "HcomOmeUtil:: Node: %s Optype: %s Get HCOM_ATTR_REDUCE_TYPE fail, not support!", op_desc->GetName().c_str(), op_desc->GetType().c_str()); @@ -242,8 +242,8 @@ Status HcomOmeUtil::GetHcclOperationType(const ge::ConstOpDescPtr &op_desc, Hccl op_type = HCCL_REDUCE_SUM; } else { REPORT_INNER_ERROR("E19999", "Attr:%s in Op:%s(%s), hcom_op_type value:%s is not support now, " - "check invalid when HcomOmeUtil %s", HCOM_ATTR_REDUCE_TYPE.c_str(), - op_desc->GetName().c_str(), op_desc->GetType().c_str(), hcom_op_type.c_str(), __FUNCTION__); + "check invalid", HCOM_ATTR_REDUCE_TYPE.c_str(), + op_desc->GetName().c_str(), op_desc->GetType().c_str(), hcom_op_type.c_str()); GELOGE(PARAM_INVALID, "HcomOmeUtil::Get HCOM_ATTR_REDUCE_TYPE fail, [%s] not support!", hcom_op_type.c_str()); return PARAM_INVALID; } @@ -252,9 +252,9 @@ Status HcomOmeUtil::GetHcclOperationType(const ge::ConstOpDescPtr &op_desc, Hccl if (IsHorovodOp(op_desc->GetType())) { int64_t horovod_op_type; GE_CHK_BOOL_EXEC(ge::AttrUtils::GetInt(op_desc, ATTR_HOROVOD_ATTR_REDUCE_TYPE, horovod_op_type), - REPORT_INNER_ERROR("E19999", "Get Attr:%s in op:%s(%s) fail when HcomOmeUtil %s", + REPORT_INNER_ERROR("E19999", "Get Attr:%s in op:%s(%s) fail", ATTR_HOROVOD_ATTR_REDUCE_TYPE.c_str(), - op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + op_desc->GetName().c_str(), op_desc->GetType().c_str()); return PARAM_INVALID, "HcomOmeUtil:: Node: %s Optype: %s Get ATTR_HOROVOD_ATTR_REDUCE_TYPE fail, not support!", op_desc->GetName().c_str(), op_desc->GetType().c_str()); @@ -262,8 +262,8 @@ Status HcomOmeUtil::GetHcclOperationType(const ge::ConstOpDescPtr &op_desc, Hccl auto iter = kHorovodRedOpToHcclRedOp.find(static_cast(horovod_op_type)); if (iter == kHorovodRedOpToHcclRedOp.end()) { REPORT_INNER_ERROR("E19999", "Attr:%s in Op:%s(%s), horovod_op_type value:%ld is not support now, " - "check invalid when HcomOmeUtil %s", ATTR_HOROVOD_ATTR_REDUCE_TYPE.c_str(), - op_desc->GetName().c_str(), op_desc->GetType().c_str(), horovod_op_type, __FUNCTION__); + "check invalid", ATTR_HOROVOD_ATTR_REDUCE_TYPE.c_str(), + op_desc->GetName().c_str(), op_desc->GetType().c_str(), horovod_op_type); GELOGE(PARAM_INVALID, "HcomOmeUtil:: Node: %s Optype: %s HcomOpType cann't support! Current HcomOpType : %ld", op_desc->GetName().c_str(), op_desc->GetType().c_str(), horovod_op_type); return PARAM_INVALID; @@ -277,9 +277,9 @@ Status HcomOmeUtil::GetHcclOperationType(const ge::ConstOpDescPtr &op_desc, Hccl Status HcomOmeUtil::GetHcclRootId(const ge::ConstOpDescPtr &op_desc, int64_t &root_id) { GE_CHECK_NOTNULL(op_desc); GE_CHK_BOOL_EXEC(ge::AttrUtils::GetInt(op_desc, HCOM_ATTR_ROOT_RANK, root_id), - REPORT_INNER_ERROR("E19999", "Get Attr:%s in op:%s(%s) fail when HcomOmeUtil %s", + REPORT_INNER_ERROR("E19999", "Get Attr:%s in op:%s(%s) fail", HCOM_ATTR_ROOT_RANK.c_str(), - op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + op_desc->GetName().c_str(), op_desc->GetType().c_str()); return PARAM_INVALID, "HcomOmeUtil::Node %s Optype: %s Get HCOM_ATTR_ROOT_INDEX fail, not support!", op_desc->GetName().c_str(), op_desc->GetType().c_str()); @@ -322,8 +322,8 @@ Status HcomOmeUtil::CheckKernelHcclInfo(const ge::ConstOpDescPtr &op_desc, GE_CHECK_NOTNULL(op_desc); if (IsHCOMOp(op_desc->GetType()) && kernel_hccl_infos.size() != 1) { REPORT_INNER_ERROR("E19999", "Op:%s(%s) is not hcom op or param kernel_hccl_infos.size:%zu != 1, " - "check invalid when HcomOmeUtil %s", - op_desc->GetName().c_str(), op_desc->GetType().c_str(), kernel_hccl_infos.size(), __FUNCTION__); + "check invalid", + op_desc->GetName().c_str(), op_desc->GetType().c_str(), kernel_hccl_infos.size()); GELOGE(PARAM_INVALID, "HcomOmeUtil:: in Hcom scenario, the number of GETaskKernelHcclInfo is invalid."); return PARAM_INVALID; } @@ -334,9 +334,9 @@ Status HcomOmeUtil::CheckKernelHcclInfo(const ge::ConstOpDescPtr &op_desc, } if (kernel_hccl_infos.empty() || op_desc->GetInputsSize() != kernel_hccl_infos.size()) { REPORT_INNER_ERROR("E19999", "Param kernel_hccl_infos.size:%zu is empty or not equal to input_desc size:%zu " - "in op:%s(%s), check invalid when HcomOmeUtil %s", + "in op:%s(%s), check invalid", kernel_hccl_infos.size(), op_desc->GetInputsSize(), - op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(PARAM_INVALID, "HcomOmeUtil:: in Horovod scenario, the number of GETaskKernelHcclInfo is invalid."); return PARAM_INVALID; } diff --git a/ge/graph/optimize/graph_optimize.cc b/ge/graph/optimize/graph_optimize.cc index c233667f..1dc349a6 100644 --- a/ge/graph/optimize/graph_optimize.cc +++ b/ge/graph/optimize/graph_optimize.cc @@ -37,7 +37,7 @@ GraphOptimize::GraphOptimize() void AddNodeInputProperty(ComputeGraphPtr &compute_graph) { if (compute_graph == nullptr) { - REPORT_INNER_ERROR("E19999", "Param compute_graph is nullptr, check invalid when %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Param compute_graph is nullptr, check invalid"); GELOGE(GE_GRAPH_OPTIMIZE_COMPUTE_GRAPH_NULL, "[AddNodeInputProperty]: compute_graph is nullptr."); return; } @@ -79,7 +79,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 when GraphOptimize %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Param compute_graph is nullptr, check invalid"); GELOGE(GE_GRAPH_OPTIMIZE_COMPUTE_GRAPH_NULL, "[OptimizeSubGraph]: compute_graph is nullptr."); return GE_GRAPH_OPTIMIZE_COMPUTE_GRAPH_NULL; } @@ -89,7 +89,7 @@ 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 when GraphOptimize %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Gelib not init before, check invalid"); GELOGE(GE_CLI_GE_NOT_INITIALIZED, "GraphOptimzer: GE is not initialized"); return GE_CLI_GE_NOT_INITIALIZED; } @@ -109,8 +109,8 @@ Status GraphOptimize::OptimizeSubGraph(ComputeGraphPtr &compute_graph, const std Status ret = (*iter)->OptimizeFusedGraphAfterGraphSlice(*(compute_graph)); if (ret != SUCCESS) { REPORT_INNER_ERROR("E19999", "Call OptimizeFusedGraphAfterGraphSlice failed, ret:%d, engine_name:%s, " - "graph_name:%s when GraphOptimize %s", ret, engine_name.c_str(), - compute_graph->GetName().c_str(), __FUNCTION__); + "graph_name:%s", ret, engine_name.c_str(), + compute_graph->GetName().c_str()); GELOGE(ret, "[OptimizeSubGraph][OptimizeFusedGraphAfterGraphSlice]: graph optimize failed, ret:%d", ret); return ret; } @@ -122,8 +122,8 @@ Status GraphOptimize::OptimizeSubGraph(ComputeGraphPtr &compute_graph, const std ret = (*iter)->OptimizeFusedGraph(*(compute_graph)); if (ret != SUCCESS) { REPORT_INNER_ERROR("E19999", "Call OptimizeFusedGraph failed, ret:%d, engine_name:%s, " - "graph_name:%s when GraphOptimize %s", ret, engine_name.c_str(), - compute_graph->GetName().c_str(), __FUNCTION__); + "graph_name:%s", ret, engine_name.c_str(), + compute_graph->GetName().c_str()); GELOGE(ret, "[OptimizeSubGraph][OptimizeFusedGraph]: graph optimize failed, ret:%d", ret); return ret; } @@ -141,7 +141,7 @@ Status GraphOptimize::OptimizeOriginalGraph(ComputeGraphPtr &compute_graph) { return SUCCESS; } if (compute_graph == nullptr) { - REPORT_INNER_ERROR("E19999", "Param compute_graph is nullptr, check invalid when GraphOptimize %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Param compute_graph is nullptr, check invalid"); GELOGE(GE_GRAPH_OPTIMIZE_COMPUTE_GRAPH_NULL, "[OptimizeOriginalGraph]: compute_graph is nullptr."); return GE_GRAPH_OPTIMIZE_COMPUTE_GRAPH_NULL; } @@ -149,7 +149,7 @@ Status GraphOptimize::OptimizeOriginalGraph(ComputeGraphPtr &compute_graph) { 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 when GraphOptimize %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Gelib not init before, check invalid"); GELOGE(GE_CLI_GE_NOT_INITIALIZED, "OptimizeOriginalGraph failed."); return GE_CLI_GE_NOT_INITIALIZED; } @@ -167,8 +167,8 @@ Status GraphOptimize::OptimizeOriginalGraph(ComputeGraphPtr &compute_graph) { ret = (iter->second)->OptimizeOriginalGraph(*compute_graph); if (ret != SUCCESS) { REPORT_INNER_ERROR("E19999", "Call OptimizeOriginalGraph failed, ret:%d, engine_name:%s, " - "graph_name:%s when GraphOptimize %s", ret, iter->first.c_str(), - compute_graph->GetName().c_str(), __FUNCTION__); + "graph_name:%s", ret, iter->first.c_str(), + compute_graph->GetName().c_str()); GELOGE(ret, "[OptimizeOriginalGraph]: graph optimize failed, ret:%d", ret); return ret; } @@ -188,7 +188,7 @@ 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 when GraphOptimize %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Gelib not init before, check invalid"); GELOGE(GE_CLI_GE_NOT_INITIALIZED, "OptimizeOriginalGraph failed."); return GE_CLI_GE_NOT_INITIALIZED; } @@ -207,8 +207,8 @@ Status GraphOptimize::OptimizeOriginalGraphJudgeInsert(ComputeGraphPtr &compute_ ret = (iter->second)->OptimizeOriginalGraphJudgeInsert(*compute_graph); if (ret != SUCCESS) { REPORT_INNER_ERROR("E19999", "Call OptimizeOriginalGraphJudgeInsert failed, ret:%d, engine_name:%s, " - "graph_name:%s when GraphOptimize %s", ret, iter->first.c_str(), - compute_graph->GetName().c_str(), __FUNCTION__); + "graph_name:%s", ret, iter->first.c_str(), + compute_graph->GetName().c_str()); GELOGE(ret, "[OptimizeOriginalGraphJudgeInsert]: graph optimize failed, ret:%d", ret); return ret; } @@ -219,14 +219,14 @@ 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 when GraphOptimize %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Param compute_graph is nullptr, check invalid"); GELOGE(GE_GRAPH_OPTIMIZE_COMPUTE_GRAPH_NULL, "[OptimizeOriginalGraph]: 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 when GraphOptimize %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Gelib not init before, check invalid"); GELOGE(GE_CLI_GE_NOT_INITIALIZED, "OptimizeOriginalGraph failed."); return GE_CLI_GE_NOT_INITIALIZED; } @@ -245,8 +245,8 @@ Status GraphOptimize::OptimizeOriginalGraphForQuantize(ComputeGraphPtr &compute_ ret = iter->second->OptimizeGraphPrepare(*compute_graph); if (ret != SUCCESS) { REPORT_INNER_ERROR("E19999", "Call OptimizeGraphPrepare failed, ret:%d, engine_name:%s, " - "graph_name:%s when GraphOptimize %s", ret, iter->first.c_str(), - compute_graph->GetName().c_str(), __FUNCTION__); + "graph_name:%s", ret, iter->first.c_str(), + compute_graph->GetName().c_str()); GELOGE(ret, "[OptimizeOriginalGraphForQuantize]: graph optimize failed, ret:%u", ret); return ret; } @@ -257,14 +257,14 @@ 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 when GraphOptimize %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Param compute_graph is nullptr, check invalid"); GELOGE(GE_GRAPH_OPTIMIZE_COMPUTE_GRAPH_NULL, "[OptimizeGraphBeforeBuildForRts]: 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 when GraphOptimize %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Gelib not init before, check invalid"); GELOGE(GE_CLI_GE_NOT_INITIALIZED, "OptimizeGraphBeforeBuildForRts failed."); return GE_CLI_GE_NOT_INITIALIZED; } @@ -284,8 +284,8 @@ Status GraphOptimize::OptimizeGraphBeforeBuildForRts(ComputeGraphPtr &compute_gr ret = iter->second->OptimizeGraphBeforeBuild(*compute_graph); if (ret != SUCCESS) { REPORT_INNER_ERROR("E19999", "Call OptimizeGraphBeforeBuild failed, ret:%d, engine_name:%s, " - "graph_name:%s when GraphOptimize %s", ret, iter->first.c_str(), - compute_graph->GetName().c_str(), __FUNCTION__); + "graph_name:%s", ret, iter->first.c_str(), + compute_graph->GetName().c_str()); GELOGE(ret, "[OptimizeGraphBeforeBuildForRts]: graph optimize failed, ret:%u", ret); return ret; } @@ -296,8 +296,8 @@ Status GraphOptimize::OptimizeGraphBeforeBuildForRts(ComputeGraphPtr &compute_gr Status GraphOptimize::SetOptions(const ge::GraphManagerOptions &options) { if (options.framework_type >= static_cast(domi::FrameworkType::FRAMEWORK_RESERVED)) { - REPORT_INNER_ERROR("E19999", "Param framework_type:%d in option check invalid when GraphOptimize %s", - options.framework_type, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Param framework_type:%d in option check invalid", + options.framework_type); GELOGE(GE_GRAPH_OPTIONS_INVALID, "Optimize Type %d invalid.", options.framework_type); return GE_GRAPH_OPTIONS_INVALID; } @@ -372,14 +372,14 @@ 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 when GraphOptimize %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Param compute_graph is nullptr, check invalid"); GELOGE(GE_GRAPH_OPTIMIZE_COMPUTE_GRAPH_NULL, "[OptimizeWholeGraph]: 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 when GraphOptimize %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Gelib not init before, check invalid"); GELOGE(GE_CLI_GE_NOT_INITIALIZED, "OptimizeWholeGraph failed."); return GE_CLI_GE_NOT_INITIALIZED; } @@ -399,8 +399,8 @@ Status GraphOptimize::OptimizeWholeGraph(ComputeGraphPtr &compute_graph) { GE_DUMP(compute_graph, "OptimizeWholeGraph" + iter.first); if (ret != SUCCESS) { REPORT_INNER_ERROR("E19999", "Call OptimizeWholeGraph failed, ret:%d, engine_name:%s, " - "graph_name:%s when GraphOptimize %s", ret, iter.first.c_str(), - compute_graph->GetName().c_str(), __FUNCTION__); + "graph_name:%s", ret, iter.first.c_str(), + compute_graph->GetName().c_str()); GELOGE(ret, "[OptimizeWholeGraph]: graph optimize failed, ret:%u", ret); return ret; } diff --git a/ge/graph/passes/addn_pass.cc b/ge/graph/passes/addn_pass.cc index 88d021fa..3e2d3f06 100644 --- a/ge/graph/passes/addn_pass.cc +++ b/ge/graph/passes/addn_pass.cc @@ -26,14 +26,14 @@ const size_t kInputSizeSingle = 1; Status AddNPass::Run(NodePtr &node) { GELOGD("AddNPass running"); if (node == nullptr) { - REPORT_INNER_ERROR("E19999", "Param node is nullptr, check invalid when AddNPass %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Param node is nullptr, check invalid"); GELOGE(PARAM_INVALID, "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 when AddNPass %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Param op_desc of node is nullptr, check invalid"); GELOGE(PARAM_INVALID, "Param [node] op desc is null."); return PARAM_INVALID; } diff --git a/ge/graph/passes/aicpu_constant_folding_pass.cc b/ge/graph/passes/aicpu_constant_folding_pass.cc index 18fdba2a..b5a989c8 100644 --- a/ge/graph/passes/aicpu_constant_folding_pass.cc +++ b/ge/graph/passes/aicpu_constant_folding_pass.cc @@ -122,8 +122,7 @@ bool AicpuConstantFoldingPass::CheckInput(const NodePtr &node, vector &weight_vec, vector &input_addrs) { if (weight_vec.empty()) { - REPORT_INNER_ERROR("E19999", "Param weight_vec is empty, check invalid when AicpuConstantFoldingPass :%s", - __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Param weight_vec is empty, check invalid"); GELOGE(FAILED, "Weight is null"); return FAILED; } @@ -134,8 +133,8 @@ Status AicpuConstantFoldingPass::GetInputAddrs(const vector &w rtError_t rt_ret = rtMemcpy(input_addr, weight->GetData().size(), weight->GetData().data(), weight->GetData().size(), RT_MEMCPY_HOST_TO_DEVICE); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret = 0x%X, when AicpuConstantFoldingPass %s", - weight->GetData().size(), rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret = 0x%X", + weight->GetData().size(), rt_ret); GELOGE(rt_ret, "rtMemcpy error"); GE_CHK_RT(rtFree(input_addr)); return FAILED; @@ -149,8 +148,8 @@ Status AicpuConstantFoldingPass::GetInputAddrs(const vector &w Status AicpuConstantFoldingPass::GetOutputAddrs(const OpDescPtr &node_desc, vector &output_addrs) { if (node_desc->GetOutputsSize() == 0) { - REPORT_INNER_ERROR("E19999", "Ouput desc size of op:%s(%s) is 0, check invalid when AicpuConstantFoldingPass :%s", - node_desc->GetName().c_str(), node_desc->GetType().c_str(), __FUNCTION__); + 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 "); return FAILED; } @@ -177,8 +176,8 @@ Status AicpuConstantFoldingPass::GenerateDataPtrInfo(const vector &out if (result_summary.shape_data_size != 0) { rtError_t rt_ret = rtMalloc(&shape_data_addr, result_summary.shape_data_size, RT_MEMORY_HBM); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%lu, ret = 0x%X, when AicpuConstantFoldingPass %s", - result_summary.shape_data_size, rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%lu, ret = 0x%X", + result_summary.shape_data_size, rt_ret); GELOGE(rt_ret, "rtMalloc error"); GE_CHK_RT(rtFree(raw_data_addr)); return FAILED; @@ -208,8 +207,7 @@ Status AicpuConstantFoldingPass::GenerateDataPtrInfo(const vector &out Status AicpuConstantFoldingPass::UpdateWorkSpaceAddr(string &task_info, STR_FWK_OP_KERNEL &task) { // Update the workspace_addr if (task_info.empty()) { - REPORT_INNER_ERROR("E19999", "Param task_info is empty, check invalid when AicpuConstantFoldingPass :%s", - __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Param task_info is empty, check invalid"); GELOGE(FAILED, "task_info is empty "); return FAILED; } @@ -218,8 +216,8 @@ Status AicpuConstantFoldingPass::UpdateWorkSpaceAddr(string &task_info, STR_FWK_ rtError_t rt_ret = rtMemcpy(workspace_addr, task_info.size(), task_info.data(), task_info.size(), RT_MEMCPY_HOST_TO_DEVICE); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret = 0x%X, when AicpuConstantFoldingPass %s", - task_info.size(), rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret = 0x%X", + task_info.size(), rt_ret); GELOGE(rt_ret, "rtMemcpy error"); GE_CHK_RT(rtFree(workspace_addr)); return FAILED; @@ -233,8 +231,7 @@ Status AicpuConstantFoldingPass::UpdateWorkSpaceAddr(string &task_info, STR_FWK_ Status AicpuConstantFoldingPass::UpdateInputAndOutputAddr(const vector &io_addrs, STR_FWK_OP_KERNEL &task) { 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 when AicpuConstantFoldingPass :%s", - __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Param io_addrs size is 0, check invalid"); GELOGE(FAILED, "addrs_size is less than 1 "); return FAILED; } @@ -242,8 +239,8 @@ Status AicpuConstantFoldingPass::UpdateInputAndOutputAddr(const vector GE_CHK_RT_RET(rtMalloc(&input_output_addr, addrs_size, RT_MEMORY_HBM)); rtError_t rt_ret = rtMemcpy(input_output_addr, addrs_size, io_addrs.data(), addrs_size, RT_MEMCPY_HOST_TO_DEVICE); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret = 0x%X, when AicpuConstantFoldingPass %s", - addrs_size, rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret = 0x%X", + addrs_size, rt_ret); GELOGE(rt_ret, "rtMemcpy error"); GE_CHK_RT(rtFree(input_output_addr)); return FAILED; @@ -300,8 +297,8 @@ Status AicpuConstantFoldingPass::UpdateMemCopyAddr(string &task_info, const vect GE_CHK_RT_RET(rtMalloc(&input_addr_ptr, data_size, RT_MEMORY_HBM)); rtError_t rt_ret = rtMemcpy(input_addr_ptr, data_size, item.data(), data_size, RT_MEMCPY_HOST_TO_DEVICE); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret = 0x%X, when AicpuConstantFoldingPass %s", - data_size, rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret = 0x%X", + data_size, rt_ret); GELOGE(rt_ret, "rtMemcpy error"); GE_CHK_RT(rtFree(input_addr_ptr)); return FAILED; @@ -330,15 +327,14 @@ Status AicpuConstantFoldingPass::LaunchSingleOpRunTask(const NodePtr &node, cons void *task_buf = nullptr; auto instance_ptr = ge::GELib::GetInstance(); if (instance_ptr == nullptr || !instance_ptr->InitFlag()) { - REPORT_INNER_ERROR("E19999", "GeLib is not init before, check invalid when AicpuConstantFoldingPass %s", - __FUNCTION__); + REPORT_INNER_ERROR("E19999", "GeLib is not init before, check invalid"); GELOGE(GE_CLI_GE_NOT_INITIALIZED, "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, when AicpuConstantFoldingPass %s", - kKernelLibName, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Find ops kernel by name:%s failed", + kKernelLibName); GELOGE(FAILED, "Get op kernel info store failed"); return FAILED; } @@ -389,15 +385,14 @@ Status AicpuConstantFoldingPass::LaunchMemCopyTask(const vector &data_ void *task_buf = nullptr; auto instance_ptr = ge::GELib::GetInstance(); if (instance_ptr == nullptr || !instance_ptr->InitFlag()) { - REPORT_INNER_ERROR("E19999", "GeLib is not init before, check invalid when AicpuConstantFoldingPass %s", - __FUNCTION__); + REPORT_INNER_ERROR("E19999", "GeLib is not init before, check invalid"); GELOGE(GE_CLI_GE_NOT_INITIALIZED, "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, when AicpuConstantFoldingPass %s", - kKernelLibName, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Find ops kernel by name:%s failed", + kKernelLibName); GELOGE(FAILED, "Get op kernel info store failed"); return FAILED; } @@ -454,8 +449,8 @@ Status AicpuConstantFoldingPass::GenerateTaskForLaunch(STR_FWK_OP_KERNEL &aicpu_ rtError_t rt_ret = rtMemcpy(task_buf, sizeof(STR_FWK_OP_KERNEL), reinterpret_cast(&aicpu_task), sizeof(STR_FWK_OP_KERNEL), RT_MEMCPY_HOST_TO_DEVICE); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret = 0x%X, when AicpuConstantFoldingPass %s", - sizeof(STR_FWK_OP_KERNEL), rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret = 0x%X", + sizeof(STR_FWK_OP_KERNEL), rt_ret); GELOGE(rt_ret, "rtMemcpy error"); GE_CHK_RT(rtFree(task_buf)); return FAILED; @@ -485,57 +480,57 @@ Status AicpuConstantFoldingPass::KernelLaunch(void *task_buf) { rtError_t rt_ret = rtModelCreate(&model, 0); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtModelCreate failed, ret = 0x%X, when AicpuConstantFoldingPass %s", - rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtModelCreate failed, ret = 0x%X", + rt_ret); GELOGE(rt_ret, "create model failed."); return FAILED; } rt_ret = rtStreamCreate(&stream, 0); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtStreamCreate failed, ret = 0x%X, when AicpuConstantFoldingPass %s", - rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtStreamCreate failed, ret = 0x%X", + rt_ret); GELOGE(rt_ret, "create stream failed."); return FAILED; } rt_ret = rtModelBindStream(model, stream, 0); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtModelBindStream failed, ret = 0x%X, when AicpuConstantFoldingPass %s", - rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtModelBindStream failed, ret = 0x%X", + rt_ret); GELOGE(rt_ret, "rtModelBindStream failed."); 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, when AicpuConstantFoldingPass %s", - rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtModelBindStream failed, ret = 0x%X", + rt_ret); GELOGE(rt_ret, "rtKernelLaunchEx failed."); return FAILED; } rt_ret = rtModelLoadComplete(model); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtModelLoadComplete failed, ret = 0x%X, when AicpuConstantFoldingPass %s", - rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtModelLoadComplete failed, ret = 0x%X", + rt_ret); GELOGE(rt_ret, "rtModelLoadComplete failed."); return FAILED; } rt_ret = rtStreamCreate(&stream_run, 0); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtStreamCreate failed, ret = 0x%X, when AicpuConstantFoldingPass %s", - rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtStreamCreate failed, ret = 0x%X", + rt_ret); GELOGE(rt_ret, "create run stream failed."); 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, when AicpuConstantFoldingPass %s", - rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtModelExecute failed, ret = 0x%X", + rt_ret); GELOGE(rt_ret, "rtModelExecute failed."); return FAILED; } rt_ret = rtStreamSynchronize(stream_run); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtStreamSynchronize failed, ret = 0x%X, when AicpuConstantFoldingPass %s", - rt_ret, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call rtStreamSynchronize failed, ret = 0x%X", + rt_ret); GELOGE(rt_ret, "rtStreamSynchronize failed."); return FAILED; } @@ -546,8 +541,8 @@ Status AicpuConstantFoldingPass::GenerateGeTensor(const OpDescPtr &node_desc, co vector &outputs) { if ((node_desc->GetOutputsSize() * kDouble) != data_vec.size()) { REPORT_INNER_ERROR("E19999", "Output desc size:%zu of op:%s(%s), after multi 2, not equal to data_vec.size:%zu, " - "check invalid when AicpuConstantFoldingPass %s", node_desc->GetOutputsSize(), - node_desc->GetName().c_str(), node_desc->GetType().c_str(), data_vec.size(), __FUNCTION__); + "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()); return FAILED; } @@ -556,7 +551,7 @@ Status AicpuConstantFoldingPass::GenerateGeTensor(const OpDescPtr &node_desc, co auto output_tensor_desc = node_desc->GetOutputDesc(static_cast(i)); GeTensorPtr output_ptr = MakeShared(output_tensor_desc); if (output_ptr == nullptr) { - REPORT_CALL_ERROR("E19999", "New GeTensor failed when AicpuConstantFoldingPass %s", __FUNCTION__); + REPORT_CALL_ERROR("E19999", "New GeTensor failed"); GELOGE(FAILED, "node[%s] something wrong with construct GeTensor", node_desc->GetName().c_str()); return FAILED; } @@ -564,8 +559,8 @@ Status AicpuConstantFoldingPass::GenerateGeTensor(const OpDescPtr &node_desc, co uint64_t raw_data_size = raw_data_info.data_size; std::unique_ptr data_addr(new (std::nothrow) uint8_t[raw_data_size]()); if (data_addr == nullptr) { - REPORT_CALL_ERROR("E19999", "New Buffer failed, size:%lu, when AicpuConstantFoldingPass %s", - raw_data_size, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "New Buffer failed, size:%lu", + raw_data_size); GELOGE(MEMALLOC_FAILED, "new data_addr failed"); return INTERNAL_ERROR; } @@ -589,8 +584,8 @@ Status AicpuConstantFoldingPass::GenerateGeTensor(const OpDescPtr &node_desc, co uint64_t dim_num = shape_data_size / sizeof(uint64_t); std::unique_ptr shape_addr(new (std::nothrow) int64_t[dim_num]()); if (shape_addr == nullptr) { - REPORT_CALL_ERROR("E19999", "New Buffer failed, size:%lu, when AicpuConstantFoldingPass %s", - dim_num, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "New Buffer failed, size:%lu", + dim_num); GELOGE(MEMALLOC_FAILED, "new shape_addr failed"); return INTERNAL_ERROR; } @@ -636,24 +631,22 @@ 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 when AicpuConstantFoldingPass %s", - __FUNCTION__); + REPORT_INNER_ERROR("E19999", "GeLib is not init before, check invalid"); GELOGE(GE_CLI_GE_NOT_INITIALIZED, "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, when AicpuConstantFoldingPass %s", - kKernelLibName, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Find ops kernel by name:%s failed", + kKernelLibName); GELOGE(FAILED, "Get op kernel info store failed"); 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), " - "when AicpuConstantFoldingPass %s", kKernelLibName, - node->GetName().c_str(), node->GetType().c_str(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Call opsFlagCheck faled, ops kernel name:%s, op:%s(%s)", + kKernelLibName, node->GetName().c_str(), node->GetType().c_str()); GELOGE(FAILED, "Get op check_result failed"); return true; } diff --git a/ge/graph/passes/assert_pass.cc b/ge/graph/passes/assert_pass.cc index 42472746..20734d56 100644 --- a/ge/graph/passes/assert_pass.cc +++ b/ge/graph/passes/assert_pass.cc @@ -30,12 +30,12 @@ namespace ge { Status AssertPass::Run(NodePtr &node) { GELOGD("AssertPass running"); if (node == nullptr) { - REPORT_INNER_ERROR("E19999", "Param node is nullptr, check invalid when AssertPass %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Param node is nullptr, check invalid"); GELOGE(PARAM_INVALID, "param [node] must not be null."); return PARAM_INVALID; } if (node->GetOpDesc() == nullptr) { - REPORT_INNER_ERROR("E19999", "Param op_desc of node is nullptr, check invalid when AssertPass %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Param op_desc of node is nullptr, check invalid"); GELOGE(PARAM_INVALID, "param [node] [opDesc] must not be null."); return PARAM_INVALID; } @@ -95,8 +95,8 @@ 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 when AssertPass %s", - node->GetName().c_str(), node->GetType().c_str(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Isolate and delete node:%s(%s) faild", + 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 1789b3f1..43a95516 100644 --- a/ge/graph/passes/assign_remove_pass.cc +++ b/ge/graph/passes/assign_remove_pass.cc @@ -57,18 +57,18 @@ Status AssignRemovePass::OptimizedAssignNode(NodePtr &assign_node) { const auto &ref_in_anchor = assign_node->GetInDataAnchor(kAssignRefInputIndex); const auto &value_in_anchor = assign_node->GetInDataAnchor(kAssignValueInputIndex); if ((ref_in_anchor == nullptr) || (value_in_anchor == nullptr)) { - REPORT_INNER_ERROR("E19999", "Index %d or %d input anchor of node:%s(%s) is nullptr, check invalid " - "when AssignRemovePass %s", kAssignRefInputIndex, kAssignValueInputIndex, - assign_node->GetName().c_str(), assign_node->GetType().c_str(), __FUNCTION__); + 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()); return FAILED; } const auto &ref_peer_anchor = ref_in_anchor->GetPeerOutAnchor(); const auto &value_peer_anchor = value_in_anchor->GetPeerOutAnchor(); if ((ref_peer_anchor == nullptr) || (value_peer_anchor == nullptr)) { - REPORT_INNER_ERROR("E19999", "Index %d or %d input anchor of node:%s(%s), peer anchor is nullptr, check invalid " - "when AssignRemovePass %s", kAssignRefInputIndex, kAssignValueInputIndex, - assign_node->GetName().c_str(), assign_node->GetType().c_str(), __FUNCTION__); + 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()); return FAILED; } @@ -85,8 +85,8 @@ Status AssignRemovePass::OptimizedAssignNode(NodePtr &assign_node) { /// GELOGD("Optimization for assign_node %s start", assign_node->GetName().c_str()); if (IsolateAndDeleteNode(assign_node, {kAssignRefInputIndex}) != SUCCESS) { - REPORT_CALL_ERROR("E19999", "Isolate and delete node:%s(%s) failed when AssignRemovePass %s", - assign_node->GetName().c_str(), assign_node->GetType().c_str(), __FUNCTION__); + 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()); return FAILED; } @@ -94,27 +94,26 @@ Status AssignRemovePass::OptimizedAssignNode(NodePtr &assign_node) { const auto &ref_input = ref_peer_anchor->GetOwnerNode()->GetOpDesc(); const auto &value_input = value_peer_anchor->GetOwnerNode()->GetOpDesc(); if ((ref_input == nullptr) || (value_input == nullptr)) { - REPORT_INNER_ERROR("E19999", "Input index %d or %d of node:%s(%s), peer op is nullptr, check invalid " - "when AssignRemovePass %s", kAssignRefInputIndex, kAssignValueInputIndex, - assign_node->GetName().c_str(), assign_node->GetType().c_str(), __FUNCTION__); + 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"); return FAILED; } // variable has and only has one input 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 " - "when AssignRemovePass %s", kAssignRefInputIndex, - assign_node->GetName().c_str(), assign_node->GetType().c_str(), __FUNCTION__); + 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()); return FAILED; } if (GraphUtils::AddEdge(value_peer_anchor, ref_peer_anchor->GetOwnerNode()->GetInDataAnchor(0)) != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(out_index:%d) and op:%s(%s)(in_index:0) failed " - "when AssignRemovePass %s", value_peer_anchor->GetOwnerNode()->GetName().c_str(), + REPORT_CALL_ERROR("E19999", "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(), __FUNCTION__); + 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()); return FAILED; } @@ -123,9 +122,9 @@ Status AssignRemovePass::OptimizedAssignNode(NodePtr &assign_node) { value_input->GetName().c_str(), ref_input->GetName().c_str()); if (!AttrUtils::SetStr(value_input->MutableOutputDesc(value_peer_anchor->GetIdx()), ASSIGN_VAR_NAME, ref_input->GetName())) { - REPORT_CALL_ERROR("E19999", "Set Attr:%s to output:%d desc of node:%s(%s) failed when %s", + 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(), __FUNCTION__); + value_input->GetName().c_str(), value_input->GetType().c_str()); GELOGE(FAILED, "Set attr ASSIGN_VAR_NAME failed."); return FAILED; } @@ -158,9 +157,9 @@ Status AssignRemovePass::TransformAttr(NodePtr &node) { GELOGD("add attr ASSIGN_VAR_NAME on node %s, var_name=%s", in_node->GetName().c_str(), assign_var_name.c_str()); if (!AttrUtils::SetStr(in_node->GetOpDesc()->MutableOutputDesc(peer_data_anchor->GetIdx()), ASSIGN_VAR_NAME, assign_var_name)) { - REPORT_CALL_ERROR("E19999", "Set Attr:%s to output:%d desc of node:%s(%s) failed when %s", + 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(), __FUNCTION__); + in_node->GetName().c_str(), in_node->GetType().c_str()); GELOGE(FAILED, "Set attr ASSIGN_VAR_NAME failed."); return FAILED; } diff --git a/ge/graph/passes/atomic_addr_clean_pass.cc b/ge/graph/passes/atomic_addr_clean_pass.cc index 981c8e64..24b84fa0 100755 --- a/ge/graph/passes/atomic_addr_clean_pass.cc +++ b/ge/graph/passes/atomic_addr_clean_pass.cc @@ -299,7 +299,7 @@ Status AtomicAddrCleanPass::HandleDispersedAtomicNodes(ComputeGraphPtr &graph, 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 when AtomicAddrCleanPass %s", __FUNCTION__); + REPORT_CALL_ERROR("E19999", "New OpDesc failed"); GELOGE(INTERNAL_ERROR, "Make shared atomic addr clean op failed."); return nullptr; } @@ -327,16 +327,16 @@ NodePtr AtomicAddrCleanPass::InsertAtomicAddrCleanNode(ComputeGraphPtr &graph) { Status AtomicAddrCleanPass::LinkToAtomicNode(const NodePtr &atomic_node, NodePtr &atomic_clean_node) { 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 when AtomicAddrCleanPass %s", __FUNCTION__); + "check invalid"); DOMI_LOGE("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(); if (in_ctrl_anchor == nullptr || out_ctrl_anchor == nullptr) { REPORT_INNER_ERROR("E19999", "in_ctrl_anchor of op:%s(%s) or out_ctrl_anchor of op:%s(%s) is nullptr, " - "check invalid when AtomicAddrCleanPass %s", + "check invalid", atomic_node->GetName().c_str(), atomic_node->GetType().c_str(), - atomic_clean_node->GetName().c_str(), atomic_clean_node->GetType().c_str(), __FUNCTION__); + 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()); @@ -345,11 +345,11 @@ Status AtomicAddrCleanPass::LinkToAtomicNode(const NodePtr &atomic_node, NodePtr graphStatus status = GraphUtils::AddEdge(out_ctrl_anchor, in_ctrl_anchor); if (status != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(out_index:%d) and op:%s(%s)(in_index:%d) failed " - "when AssignRemovePass %s", out_ctrl_anchor->GetOwnerNode()->GetName().c_str(), - out_ctrl_anchor->GetOwnerNode()->GetType().c_str(), out_ctrl_anchor->GetIdx(), + REPORT_CALL_ERROR("E19999", "Add control edge 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(), in_ctrl_anchor->GetIdx(), __FUNCTION__); + 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()); @@ -407,8 +407,7 @@ Status AtomicAddrCleanPass::CompileUnknownGraphOp(const vector &atomic_ std::unordered_map> node_vector_map; std::shared_ptr instance = ge::GELib::GetInstance(); if ((instance == nullptr) || !instance->InitFlag()) { - REPORT_INNER_ERROR("E19999", "GeLib is not init before, check invalid when AtomicAddrCleanPass %s", - __FUNCTION__); + REPORT_INNER_ERROR("E19999", "GeLib is not init before, check invalid"); GELOGE(ge::GE_CLI_GE_NOT_INITIALIZED, "CompileSingleOp failed."); return ge::GE_CLI_GE_NOT_INITIALIZED; } @@ -421,8 +420,8 @@ 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, when AtomicAddrCleanPass %s", - kernel_lib_name.c_str(), __FUNCTION__); + 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()); return ge::INTERNAL_ERROR; @@ -443,8 +442,8 @@ Status AtomicAddrCleanPass::CompileUnknownGraphOp(const vector &atomic_ GELOGI("The atomic node size of compile op of %s is %zu", kernel_lib_name.c_str(), node_vector.size()); GE_TIMESTAMP_ADD(UnknownGraphCompileOp); if (ret != ge::SUCCESS) { - REPORT_CALL_ERROR("E19999", "Call CompileOp failed, kernel_lib_name:%s, ret:%d, when AtomicAddrCleanPass %s", - kernel_lib_name.c_str(), ret, __FUNCTION__); + 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()); return ret; } diff --git a/ge/graph/passes/attach_stream_label_pass.cc b/ge/graph/passes/attach_stream_label_pass.cc index 3d9fbfe2..75599c45 100644 --- a/ge/graph/passes/attach_stream_label_pass.cc +++ b/ge/graph/passes/attach_stream_label_pass.cc @@ -119,8 +119,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 when AttachStreamLabelPass %s", - stream_label.c_str(), tmp_node->GetName().c_str(), tmp_node->GetType().c_str(), __FUNCTION__); + 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."); return status; } @@ -139,8 +139,8 @@ Status AttachStreamLabelPass::AttachFlag(const NodePtr &node, std::string &strea const std::string &type = node->GetType(); if (type == STREAMSWITCH) { if (node->GetInDataNodes().empty()) { - REPORT_INNER_ERROR("E19999", "In data nodes is empty of op:%s(%s), check invalid when AttachStreamLabelPass %s", - node->GetName().c_str(), node->GetType().c_str(), __FUNCTION__); + 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()); return INTERNAL_ERROR; } @@ -149,16 +149,16 @@ Status AttachStreamLabelPass::AttachFlag(const NodePtr &node, std::string &strea OpDescPtr op_desc = node->GetOpDesc(); GE_CHECK_NOTNULL(op_desc); GE_CHK_BOOL_EXEC(AttrUtils::GetBool(op_desc, ATTR_NAME_SWITCH_TRUE_BRANCH_FLAG, value), - REPORT_CALL_ERROR("E19999", "Get Attr:%s of op:%s(%s) failed when AttachStreamLabelPass %s", + REPORT_CALL_ERROR("E19999", "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(), __FUNCTION__); + op_desc->GetName().c_str(), op_desc->GetType().c_str()); return FAILED, "StreamSwitch get attr TRUE_BRANCH_STREAM failed."); 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 when AttachStreamLabelPass %s", - stream_label.c_str(), node->GetName().c_str(), node->GetType().c_str(), __FUNCTION__); + 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."); return status; } @@ -166,8 +166,8 @@ Status AttachStreamLabelPass::AttachFlag(const NodePtr &node, std::string &strea 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 when AttachStreamLabelPass %s", - stream_label.c_str(), node->GetName().c_str(), node->GetType().c_str(), __FUNCTION__); + 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."); return status; } @@ -207,9 +207,9 @@ Status AttachStreamLabelPass::UpdateEnterNode() { bool get_attr = AttrUtils::GetListStr(active_node->GetOpDesc(), ATTR_NAME_ACTIVE_LABEL_LIST, active_label_list) && (active_label_list.size() == 1) && !active_label_list[0].empty(); if (!get_attr) { - REPORT_CALL_ERROR("E19999", "Get Attr:%s of op:%s(%s) failed when AttachStreamLabelPass %s", + 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(), __FUNCTION__); + 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()); return INTERNAL_ERROR; } @@ -245,9 +245,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 when AttachStreamLabelPass %s", - stream_label.c_str(), enter_node->GetName().c_str(), enter_node->GetType().c_str(), - __FUNCTION__); + 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."); return status; } @@ -281,9 +280,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 when AttachStreamLabelPass %s", - stream_label.c_str(), out_node->GetName().c_str(), out_node->GetType().c_str(), - __FUNCTION__); + 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."); return status; } diff --git a/ge/graph/passes/bitcast_pass.cc b/ge/graph/passes/bitcast_pass.cc index 9048edd2..b5166959 100644 --- a/ge/graph/passes/bitcast_pass.cc +++ b/ge/graph/passes/bitcast_pass.cc @@ -32,7 +32,7 @@ const char *const kAttrNameType = "type"; Status BitcastPass::Run(NodePtr &node) { GELOGD("Bitcast running"); if (node == nullptr) { - REPORT_INNER_ERROR("E19999", "Param node is nullptr, check invalid when BitcastPass %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Param node is nullptr, check invalid"); GELOGE(PARAM_INVALID, "Param [node] must not be null."); return PARAM_INVALID; } @@ -43,7 +43,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 when BitcastPass %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Param op_desc of node is nullptr, check invalid"); return PARAM_INVALID; } ge::DataType dst_data_type; @@ -61,31 +61,30 @@ Status BitcastPass::Run(NodePtr &node) { Status BitcastPass::CheckDstDataType(const OpDescPtr op_desc, ge::DataType &dst_data_type) { if (!ge::AttrUtils::GetDataType(op_desc, kAttrNameType, dst_data_type)) { - REPORT_CALL_ERROR("E19999", "Get Attr:%s of op:%s(%s) failed when BitcastPass %s", - kAttrNameType, op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + 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."); return PARAM_INVALID; } if (dst_data_type >= ge::DT_UNDEFINED) { - REPORT_INNER_ERROR("E19999", "Param dst_data_type:%d check invalid, op:%s(%s), when BitcastPass %s", - dst_data_type, op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + 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()); 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 when BitcastPass %s", - op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + 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."); return PARAM_INVALID; } if (op_desc->GetOutputDescPtr(0)->GetDataType() != dst_data_type) { REPORT_INNER_ERROR("E19999", "Index 0 ouput desc of op:%s(%s), it't data type:%s not equal to dst_data_type:%s, " - "check invalid when BitcastPass %s", op_desc->GetName().c_str(), op_desc->GetType().c_str(), + "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(), - __FUNCTION__); + TypeUtils::DataTypeToSerialString(op_desc->GetOutputDescPtr(0)->GetDataType()).c_str()); GELOGE(PARAM_INVALID, "dst_data_type[%s] is not equal to output_data_type[%s].", TypeUtils::DataTypeToSerialString(dst_data_type).c_str(), TypeUtils::DataTypeToSerialString(op_desc->GetOutputDescPtr(0)->GetDataType()).c_str()); @@ -98,8 +97,8 @@ Status BitcastPass::CheckOutputShape(const OpDescPtr op_desc, const ge::DataType const GeTensorDescPtr &input_tensor_desc = op_desc->MutableInputDesc(0); const GeTensorDescPtr &output_tensor_desc = op_desc->MutableOutputDesc(0); if (input_tensor_desc == nullptr) { - REPORT_INNER_ERROR("E19999", "Index 0 input desc of op:%s(%s) not exist, check invalid when BitcastPass %s", - op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + 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."); return PARAM_INVALID; } @@ -108,8 +107,8 @@ Status BitcastPass::CheckOutputShape(const OpDescPtr op_desc, const ge::DataType ge::DataType ori_data_type = input_tensor_desc->GetDataType(); if (ori_data_type >= ge::DT_UNDEFINED) { REPORT_INNER_ERROR("E19999", "ori_data_type:%d of index 0 input desc in op:%s(%s), " - "check invalid when BitcastPass %s", - ori_data_type, op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + "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()); return PARAM_INVALID; @@ -128,10 +127,9 @@ Status BitcastPass::CheckOutputShape(const OpDescPtr op_desc, const ge::DataType if (dim_vec != output_tensor_desc->GetShape().GetDims()) { REPORT_INNER_ERROR("E19999", "Shape:%s of index 0 output desc in op:%s(%s), different from expect shape:%s ," - "check invalid when BitcastPass %s", + "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(), - __FUNCTION__); + 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."); return PARAM_INVALID; } @@ -142,7 +140,7 @@ Status BitcastPass::CheckOutputShape(const OpDescPtr op_desc, const ge::DataType Status BitcastPass::CalcAndUpdateShape(BitcastPass::kVecInt64 &dim_vec, ge::DataType ori_data_type, ge::DataType dst_data_type) { if (dim_vec.size() == 0) { - REPORT_INNER_ERROR("E19999", "Param dim_vec is empty, check invalid when BitcastPass %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Param dim_vec is empty, check invalid"); GELOGE(PARAM_INVALID, "Pre node shape size is zero."); return PARAM_INVALID; } @@ -154,9 +152,9 @@ Status BitcastPass::CalcAndUpdateShape(BitcastPass::kVecInt64 &dim_vec, ge::Data } else if (ori_data_size > dst_data_size) { if (ori_data_size % dst_data_size != 0) { REPORT_INNER_ERROR("E19999", "size:%ld of ori_data_type:%s is not divisible by size:%ld of dst_data_type:%s ," - "check invalid when BitcastPass %s", + "check invalid", ori_data_size, TypeUtils::DataTypeToSerialString(ori_data_type).c_str(), - dst_data_size, TypeUtils::DataTypeToSerialString(dst_data_type).c_str(), __FUNCTION__); + dst_data_size, TypeUtils::DataTypeToSerialString(dst_data_type).c_str()); GELOGE(PARAM_INVALID, "ori_data_size is not divisible by dst_data_size."); return PARAM_INVALID; } @@ -165,17 +163,17 @@ Status BitcastPass::CalcAndUpdateShape(BitcastPass::kVecInt64 &dim_vec, ge::Data } else { if (dst_data_size % ori_data_size != 0) { REPORT_INNER_ERROR("E19999", "size:%ld of dst_data_type:%s is not divisible by size:%ld of ori_data_type:%s ," - "check invalid when BitcastPass %s", + "check invalid", dst_data_size, TypeUtils::DataTypeToSerialString(dst_data_type).c_str(), - ori_data_size, TypeUtils::DataTypeToSerialString(ori_data_type).c_str(), __FUNCTION__); + ori_data_size, TypeUtils::DataTypeToSerialString(ori_data_type).c_str()); GELOGE(PARAM_INVALID, "dst_data_size is not divisible by ori_data_size."); return PARAM_INVALID; } if (dim_vec[dim_vec.size() - 1] != (dst_data_size / ori_data_size)) { 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 when BitcastPass %s", - dim_vec[dim_vec.size() - 1], dst_data_size, ori_data_size, __FUNCTION__); + "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."); return PARAM_INVALID; } diff --git a/ge/graph/passes/cast_remove_pass.cc b/ge/graph/passes/cast_remove_pass.cc index ee95bdc2..7e2bb7bb 100644 --- a/ge/graph/passes/cast_remove_pass.cc +++ b/ge/graph/passes/cast_remove_pass.cc @@ -25,14 +25,13 @@ namespace ge { Status CastRemovePass::Run(NodePtr &node) { if (node == nullptr) { - REPORT_INNER_ERROR("E19999", "Param node is nullptr, check invalid when CastRemovePass %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Param node is nullptr, check invalid"); GELOGE(PARAM_INVALID, "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 when CastRemovePass %s", - __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Param op_desc of node is nullptr, check invalid"); GELOGE(PARAM_INVALID, "OpDesc of param [node] must not be null."); return PARAM_INVALID; } @@ -49,7 +48,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 when CastRemovePass %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "op_desc of end_node is nullptr, check invalid"); GELOGE(PARAM_INVALID, "OpDesc of end node must not be null."); return PARAM_INVALID; } @@ -103,8 +102,8 @@ Status CastRemovePass::RemoveCast(DataType &type, std::vector &nodes_to GELOGI("CastRemovePass, remove Cast %s.", node->GetName().c_str()); cast_name = node->GetName(); if (IsolateAndDeleteNode(node, {0}) != SUCCESS) { - REPORT_CALL_ERROR("E19999", "Isolate and delete node:%s(%s) failed when CastRemovePass %s", - node->GetName().c_str(), node->GetType().c_str(), __FUNCTION__); + 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()); return FAILED; } @@ -120,8 +119,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 when CastRemovePass %s", - __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Find nullptr op_desc in node, check invalid"); GELOGE(FAILED, "OpDesc must not be null."); return FAILED; } @@ -131,9 +129,9 @@ Status CastRemovePass::RemoveCast(DataType &type, std::vector &nodes_to op_desc->SetName(new_node_name); // add attr to changed TransData, then will be rebuild if (!AttrUtils::SetBool(op_desc, ATTR_NEED_COMPILE, true)) { - REPORT_CALL_ERROR("E19999", "Set Attr:%s of op:%s(%s) failed when CastRemovePass %s", + 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(), __FUNCTION__); + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(FAILED, "Set ATTR_NEED_COMPILE Attr fail."); return FAILED; } diff --git a/ge/graph/passes/cast_translate_pass.cc b/ge/graph/passes/cast_translate_pass.cc index 4dd1e5cd..37e9bc83 100644 --- a/ge/graph/passes/cast_translate_pass.cc +++ b/ge/graph/passes/cast_translate_pass.cc @@ -223,8 +223,8 @@ Status CastTranslatePass::Run(NodePtr &node) { continue; } if (IsolateAndDeleteNode(out_data_node, {0}) != SUCCESS) { - REPORT_CALL_ERROR("E19999", "Isolate and delete node:%s(%s) failed when CastTranslatePass %s", - out_data_node->GetName().c_str(), out_data_node->GetType().c_str(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Isolate and delete node:%s(%s) failed", + out_data_node->GetName().c_str(), out_data_node->GetType().c_str()); return FAILED; } } @@ -249,14 +249,14 @@ 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_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 out put edge failed"); // 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_STATUS_RET(base_node->GetInControlAnchor()->LinkFrom(peer_anchor), "link from peer anchor failed"); + GE_CHK_GRAPH_STATUS_RET(base_node->GetInControlAnchor()->LinkFrom(peer_anchor), "link from peer anchor failed"); } in_ctr_anchor->UnlinkAll(); out_data_node->GetAllInDataAnchors().at(0)->UnlinkAll(); @@ -264,9 +264,8 @@ Status CastTranslatePass::FuseDstNTranslates(NodePtr &node) { ComputeGraphPtr graph = out_data_node->GetOwnerComputeGraph(); GE_CHECK_NOTNULL(graph); if (GraphUtils::RemoveNodeWithoutRelink(graph, out_data_node) != SUCCESS) { - REPORT_CALL_ERROR("E19999", "Remove node:%s(%s) without relink in graph:%s failed when CastTranslatePass %s", - out_data_node->GetName().c_str(), out_data_node->GetType().c_str(), graph->GetName().c_str(), - __FUNCTION__); + 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()); return FAILED; } diff --git a/ge/graph/passes/common_subexpression_elimination_pass.cc b/ge/graph/passes/common_subexpression_elimination_pass.cc index 40503650..a95d0077 100644 --- a/ge/graph/passes/common_subexpression_elimination_pass.cc +++ b/ge/graph/passes/common_subexpression_elimination_pass.cc @@ -106,9 +106,9 @@ Status CommonSubexpressionEliminationPass::Run(ComputeGraphPtr graph) { ret = GraphUtils::ReplaceNodeAnchors(iter->second, node, {}, output_map); if (ret != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Replace node:%s(%s) by node:%s(%s) failed " - "when CommonSubexpressionEliminationPass %s", node->GetName().c_str(), node->GetType().c_str(), - iter->second->GetName().c_str(), iter->second->GetType().c_str(), __FUNCTION__); + 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); return INTERNAL_ERROR; @@ -118,9 +118,8 @@ Status CommonSubexpressionEliminationPass::Run(ComputeGraphPtr graph) { ret = GraphUtils::RemoveNodeWithoutRelink(graph, node); if (ret != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Remove node:%s(%s) without relink in graph:%s failed " - "when CommonSubexpressionEliminationPass %s", - node->GetName().c_str(), node->GetType().c_str(), graph->GetName().c_str(), __FUNCTION__); + 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()); return INTERNAL_ERROR; } diff --git a/ge/graph/passes/compile_nodes_pass.cc b/ge/graph/passes/compile_nodes_pass.cc index 797b99fe..76330dc6 100755 --- a/ge/graph/passes/compile_nodes_pass.cc +++ b/ge/graph/passes/compile_nodes_pass.cc @@ -41,7 +41,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 when CompileNodesPass %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Gelib not init before, check invalid"); GELOGE(ge::GE_CLI_GE_NOT_INITIALIZED, "Run CompileNodesPass failed."); return ge::GE_CLI_GE_NOT_INITIALIZED; } @@ -100,8 +100,8 @@ graphStatus CompileNodesPass::GetSupportedKernel(const NodePtr &node, const std: (void)instance->DNNEngineManagerObj().GetDNNEngineName(node); kernel_lib_name = op_desc->GetOpKernelLibName(); if (kernel_lib_name.empty()) { - REPORT_INNER_ERROR("E19999", "kernel_lib_name in op:%s(%s) is empty, check invalid when CompileNodesPass %s", - op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + 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(), op_desc->GetType().c_str()); return GRAPH_FAILED; @@ -109,8 +109,8 @@ graphStatus CompileNodesPass::GetSupportedKernel(const NodePtr &node, const std: } OpsKernelInfoStorePtr kernel_info = instance->OpsKernelManagerObj().GetOpsKernelInfoStore(kernel_lib_name); if (kernel_info == nullptr) { - REPORT_INNER_ERROR("E19999", "Find ops kernel by name:%s failed for op:%s(%s), when CompileNodesPass %s", - kernel_lib_name.c_str(), op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + 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()); return ge::GE_GRAPH_PARAM_NULLPTR; } @@ -173,8 +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, when CompileNodesPass %s", - kernel_nodes.first.c_str(), __FUNCTION__); + 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()); return ge::GE_GRAPH_PARAM_NULLPTR; } @@ -190,8 +190,8 @@ graphStatus CompileNodesPass::CompileNodes(const std::shared_ptr instance } auto ret = kernel_info->CompileOp(kernel_nodes.second); if (ret != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Call CompileOp failed, kernel_lib_name:%s, ret:%d, when CompileNodesPass %s", - kernel_nodes.first.c_str(), ret, __FUNCTION__); + 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()); return GRAPH_FAILED; } diff --git a/ge/graph/passes/cond_pass.cc b/ge/graph/passes/cond_pass.cc index 4ca2de10..c274df49 100644 --- a/ge/graph/passes/cond_pass.cc +++ b/ge/graph/passes/cond_pass.cc @@ -76,9 +76,9 @@ Status CondPass::Run(NodePtr &node) { break; default: REPORT_INNER_ERROR("E19999", - "data_type:%d of index:%d input tensor in op:%s(%s) check invalid when CondPass %s", + "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(), __FUNCTION__); + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(FAILED, "UpdateInputDesc for node %s failed.", op_desc->GetName().c_str()); return FAILED; } @@ -89,8 +89,8 @@ Status CondPass::Run(NodePtr &node) { cond_tensor.SetShape(GeShape()); cond_tensor.SetOriginShape(GeShape()); 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, when CondPass %s", - op_desc->GetName().c_str(), op_desc->GetType().c_str(), cond_in_anchor->GetIdx(), __FUNCTION__); + 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()); return FAILED; } @@ -165,8 +165,8 @@ Status CondPass::GetCondInfoForWhile(const NodePtr &node, ComputeGraphPtr &graph auto iter = subgraph_names_to_index.find(ATTR_NAME_WHILE_COND); if (iter == subgraph_names_to_index.end()) { REPORT_INNER_ERROR("E19999", "subgraph name:%s not exist in SubgraphNameIndexes map of op:%s(%s), " - "check invalid when CondPass %s", ATTR_NAME_WHILE_COND.c_str(), - op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + "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()); return FAILED; } @@ -179,8 +179,8 @@ Status CondPass::GetCondInfoForWhile(const NodePtr &node, ComputeGraphPtr &graph // cond_graph has and only has one output uint32_t output_num = net_output_node->GetAllInDataAnchorsSize(); if (output_num != 1) { - REPORT_INNER_ERROR("E19999", "Input data anchor num:%u of op:%s(%s) not equal to 1, check invalid when CondPass %s", - output_num, op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + 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.", output_num, node->GetName().c_str()); return FAILED; @@ -244,12 +244,12 @@ Status CondPass::HandleScalarCond(const ComputeGraphPtr &graph, const OutDataAnc } if (GraphUtils::InsertNodeAfter(peer_out_anchor, { cond_in_anchor }, cast_node) != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Insert Cast node %s(%s) between %s(%s)->%s(%s) failed, when CondPass %s", + REPORT_CALL_ERROR("E19999", "Insert Cast node %s(%s) between %s(%s)->%s(%s) failed", cast_node->GetName().c_str(), cast_node->GetType().c_str(), peer_out_anchor->GetOwnerNode()->GetName().c_str(), peer_out_anchor->GetOwnerNode()->GetType().c_str(), cond_in_anchor->GetOwnerNode()->GetName().c_str(), - cond_in_anchor->GetOwnerNode()->GetType().c_str(), __FUNCTION__); + cond_in_anchor->GetOwnerNode()->GetType().c_str()); GELOGE(FAILED, "Insert Cast node %s between %s->%s failed.", cast_node->GetName().c_str(), peer_out_anchor->GetOwnerNode()->GetName().c_str(), cond_in_anchor->GetOwnerNode()->GetName().c_str()); @@ -285,27 +285,27 @@ Status CondPass::InsertNode(const ComputeGraphPtr &graph, const OutDataAnchorPtr OpDescBuilder op_desc_builder(in_data_anchor->GetOwnerNode()->GetName() + "_" + type, type); OpDescPtr op_desc = op_desc_builder.AddInput("x", in_tensor).AddOutput("y", out_tensor).Build(); if (op_desc == nullptr) { - REPORT_CALL_ERROR("E19999", "Create op_desc:%s(%s) failed, when CondPass %s", - (in_data_anchor->GetOwnerNode()->GetName() + "_" + type).c_str(), type.c_str(), __FUNCTION__); + 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."); 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 when CondPass %s", - op_desc->GetName().c_str(), op_desc->GetType().c_str(), graph->GetName().c_str(), __FUNCTION__); + 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()); return FAILED; } AddRePassNode(new_node); if (GraphUtils::InsertNodeAfter(peer_out_anchor, { in_data_anchor }, new_node) != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Insert node %s(%s) between %s(%s)->%s(%s) failed, when CondPass %s", + REPORT_CALL_ERROR("E19999", "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(), __FUNCTION__); + 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()); @@ -337,8 +337,8 @@ 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, when CondPass %s", - name.c_str(), CAST, __FUNCTION__); + 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()); return nullptr; } @@ -346,19 +346,18 @@ NodePtr CondPass::AddCastNode(const ComputeGraphPtr &graph, const std::string &n 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, when CondPass %s", + 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(), __FUNCTION__); + cast_desc->GetName().c_str(), cast_desc->GetType().c_str()); GELOGE(FAILED, "Set CAST_ATTR failed, node: %s.", name.c_str()); return nullptr; } NodePtr cast_node = graph->AddNode(cast_desc); if (cast_node == nullptr) { - REPORT_CALL_ERROR("E19999", "Add node:%s(%s) to graph:%s failed when CondPass %s", - cast_desc->GetName().c_str(), cast_desc->GetType().c_str(), graph->GetName().c_str(), - __FUNCTION__); + 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()); return nullptr; } diff --git a/ge/graph/passes/cond_remove_pass.cc b/ge/graph/passes/cond_remove_pass.cc index a4a76346..74568c2f 100644 --- a/ge/graph/passes/cond_remove_pass.cc +++ b/ge/graph/passes/cond_remove_pass.cc @@ -85,12 +85,11 @@ Status CondRemovePass::RemoveDeadCondLink(const int32_t index, const NodePtr &no const auto &in_anchor = node->GetInDataAnchor(index); const auto &peerout_anchor = in_anchor->GetPeerOutAnchor(); if (GraphUtils::RemoveEdge(peerout_anchor, in_anchor) != SUCCESS) { - REPORT_CALL_ERROR("E19999", "Remove edge between op:%s(%s)(out_index:%d) and op:%s(%s)(in_index:%d) failed " - "when CondRemovePass %s", + REPORT_CALL_ERROR("E19999", "Remove edge between op:%s(%s)(out_index:%d) and op:%s(%s)(in_index:%d) failed", peerout_anchor->GetOwnerNode()->GetName().c_str(), peerout_anchor->GetOwnerNode()->GetType().c_str(), peerout_anchor->GetIdx(), in_anchor->GetOwnerNode()->GetName().c_str(), in_anchor->GetOwnerNode()->GetType().c_str(), - in_anchor->GetIdx(), __FUNCTION__); + in_anchor->GetIdx()); 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()); @@ -104,8 +103,8 @@ Status CondRemovePass::GetCaseChosenBranch(const NodePtr &node, const uint32_t c uint32_t subgraph_names_size = static_cast(node->GetOpDesc()->GetSubgraphInstanceNames().size()); uint32_t cond_index_new = cond_index; if (subgraph_names_size == 0) { - REPORT_INNER_ERROR("E19999", "subgraph size of op:%s(%s) is 0, check invavlid when CondRemovePass %s", - node->GetName().c_str(), node->GetType().c_str(), __FUNCTION__); + 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()); return ge::FAILED; } @@ -115,8 +114,8 @@ Status CondRemovePass::GetCaseChosenBranch(const NodePtr &node, const uint32_t c } const auto &chosen_branch_name = node->GetOpDesc()->GetSubgraphInstanceName(cond_index_new); if (chosen_branch_name.empty()) { - REPORT_INNER_ERROR("E19999", "Get subgraph name from op:%s(%s) by index:%u failed, when CondRemovePass %s", - node->GetName().c_str(), node->GetType().c_str(), cond_index_new, __FUNCTION__); + 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); return ge::FAILED; } @@ -131,8 +130,8 @@ Status CondRemovePass::GetIfChosenBranch(const NodePtr &node, const uint32_t con uint32_t subgraph_names_size = static_cast(node->GetOpDesc()->GetSubgraphInstanceNames().size()); uint32_t cond_index_new = 0; if (subgraph_names_size == 0) { - REPORT_INNER_ERROR("E19999", "subgraph size of op:%s(%s) is 0, check invavlid when CondRemovePass %s", - node->GetName().c_str(), node->GetType().c_str(), __FUNCTION__); + 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()); return ge::FAILED; } @@ -142,16 +141,16 @@ Status CondRemovePass::GetIfChosenBranch(const NodePtr &node, const uint32_t con } const auto &chosen_branch_name = node->GetOpDesc()->GetSubgraphInstanceName(cond_index_new); if (chosen_branch_name.empty()) { - REPORT_INNER_ERROR("E19999", "Get subgraph name from op:%s(%s) by index:%u failed, when CondRemovePass %s", - node->GetName().c_str(), node->GetType().c_str(), cond_index_new, __FUNCTION__); + 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); return ge::FAILED; } auto chosen_graph = GraphUtils::FindRootGraph(node->GetOwnerComputeGraph())->GetSubgraph(chosen_branch_name); if (chosen_graph == nullptr) { REPORT_INNER_ERROR("E19999", - "Find subgraph by name:%s from node:%s(%s)'s root_graph failed, when CondRemovePass %s", - chosen_branch_name.c_str(), node->GetName().c_str(), node->GetType().c_str(), __FUNCTION__); + "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(), node->GetName().c_str(), node->GetOwnerComputeGraph()->GetName().c_str()); return ge::FAILED; @@ -259,12 +258,11 @@ Status CondRemovePass::ReplaceIfCaseNodeWithPartitioncall(const NodePtr &node, c for (const auto &peerout_anchor : input_anchor->GetPeerAnchors()) { if (GraphUtils::AddEdge(peerout_anchor, partitioncall_node->GetInAnchor( input_anchor->GetIdx() - kConditionIndexNum)) != ge::GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(out_index:%d) and op:%s(%s)(in_index:%d) failed " - "when CondRemovePass %s", + REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(out_index:%d) and op:%s(%s)(in_index:%d) failed", peerout_anchor->GetOwnerNode()->GetName().c_str(), peerout_anchor->GetOwnerNode()->GetType().c_str(), peerout_anchor->GetIdx(), partitioncall_node->GetName().c_str(), - partitioncall_node->GetType().c_str(), input_anchor->GetIdx(), __FUNCTION__); + 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", peerout_anchor->GetOwnerNode()->GetName().c_str(), peerout_anchor->GetIdx(), partitioncall_node->GetName().c_str(), input_anchor->GetIdx(), input_desc_size, @@ -278,11 +276,10 @@ Status CondRemovePass::ReplaceIfCaseNodeWithPartitioncall(const NodePtr &node, c for (const auto &output_anchor : node->GetAllOutAnchors()) { for (const auto &peerin_anchor : output_anchor->GetPeerAnchors()) { if (GraphUtils::RemoveEdge(node->GetOutAnchor(output_anchor->GetIdx()), peerin_anchor) != ge::GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Remove edge between op:%s(%s)(out_index:%d) and op:%s(%s)(in_index:%d) failed " - "when CondRemovePass %s", + REPORT_CALL_ERROR("E19999", "Remove edge between op:%s(%s)(out_index:%d) and op:%s(%s)(in_index:%d) failed", 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(), __FUNCTION__); + 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", node->GetName().c_str(), output_anchor->GetIdx(), peerin_anchor->GetOwnerNode()->GetName().c_str(), peerin_anchor->GetIdx(), input_desc_size, output_desc_size); @@ -290,12 +287,11 @@ Status CondRemovePass::ReplaceIfCaseNodeWithPartitioncall(const NodePtr &node, c } if (GraphUtils::AddEdge(partitioncall_node->GetOutAnchor(output_anchor->GetIdx()), peerin_anchor) != ge::GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Remove edge between op:%s(%s)(out_index:%d) and op:%s(%s)(in_index:%d) failed " - "when CondRemovePass %s", + REPORT_CALL_ERROR("E19999", "Remove edge between op:%s(%s)(out_index:%d) and op:%s(%s)(in_index:%d) failed", partitioncall_node->GetName().c_str(), partitioncall_node->GetType().c_str(), output_anchor->GetIdx(), peerin_anchor->GetOwnerNode()->GetName().c_str(), - peerin_anchor->GetOwnerNode()->GetType().c_str(), peerin_anchor->GetIdx(), __FUNCTION__); + 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", partitioncall_node->GetName().c_str(), output_anchor->GetIdx(), peerin_anchor->GetOwnerNode()->GetName().c_str(), peerin_anchor->GetIdx(), input_desc_size, diff --git a/ge/graph/passes/constant_folding_pass.cc b/ge/graph/passes/constant_folding_pass.cc index 66e076af..db2ef494 100644 --- a/ge/graph/passes/constant_folding_pass.cc +++ b/ge/graph/passes/constant_folding_pass.cc @@ -108,6 +108,8 @@ Status ConstantFoldingPass::Run(ge::NodePtr &node) { node->GetType().c_str()); return SUCCESS; } + 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()); return ret; } @@ -125,6 +127,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", diff --git a/ge/graph/passes/constant_fuse_same_pass.cc b/ge/graph/passes/constant_fuse_same_pass.cc index eb8b3470..8cb8c091 100644 --- a/ge/graph/passes/constant_fuse_same_pass.cc +++ b/ge/graph/passes/constant_fuse_same_pass.cc @@ -57,6 +57,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."); return GE_GRAPH_PARAM_NULLPTR; } @@ -159,6 +160,11 @@ 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", + 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()); return FAILED; @@ -185,6 +191,8 @@ Status ConstantFuseSamePass::FuseConstNodes(ComputeGraphPtr &graph, return FAILED; } 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()); return FAILED; } diff --git a/ge/graph/passes/control_trigger_pass.cc b/ge/graph/passes/control_trigger_pass.cc index e179c64e..9125a48f 100644 --- a/ge/graph/passes/control_trigger_pass.cc +++ b/ge/graph/passes/control_trigger_pass.cc @@ -70,6 +70,12 @@ Status ControlTriggerPass::HandleDynamicCtrlEdges(ComputeGraphPtr &graph, NodePt NodePtr constant = (branch_flag ? iter2->second.second : iter2->second.first); if ((GraphUtils::RemoveEdge(in_ctrl_node->GetOutControlAnchor(), node->GetInControlAnchor()) != GRAPH_SUCCESS) || (GraphUtils::AddEdge(in_ctrl_node->GetOutControlAnchor(), constant->GetInControlAnchor()) != GRAPH_SUCCESS)) { + REPORT_CALL_ERROR("E19999", "Remove control edge between op:%s(%s) and op:%s(%s), then " + "add control edge between op:%s(%s) and op:%s(%s) failed", + in_ctrl_node->GetName().c_str(), in_ctrl_node->GetType().c_str(), + 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()); return FAILED; @@ -185,6 +191,7 @@ ControlNodeType ControlTriggerPass::TransferNodeType(const NodePtr &node, uint32 } 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; } @@ -264,14 +271,23 @@ Status ControlTriggerPass::InsertOppositeBranch(ComputeGraphPtr &graph, NodePtr } if (GraphUtils::AddEdge(in_ctrl_node->GetOutControlAnchor(), orig_const->GetInControlAnchor()) != GRAPH_SUCCESS) { + 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()); 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()); 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()); return FAILED; } @@ -282,6 +298,7 @@ Status ControlTriggerPass::InsertOppositeBranch(ComputeGraphPtr &graph, NodePtr control_trigger_map_[node] = {pred_const}; } 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."); return FAILED; } @@ -303,12 +320,15 @@ NodePtr ControlTriggerPass::InsertMergeNode(ComputeGraphPtr &graph, NodePtr &nod const std::string name = node->GetName() + "_" + MERGE; 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()); return nullptr; } if ((op_desc->AddInputDesc(data_desc) != GRAPH_SUCCESS) || (op_desc->AddInputDesc(data_desc) != GRAPH_SUCCESS) || (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()); return nullptr; } @@ -316,12 +336,20 @@ NodePtr ControlTriggerPass::InsertMergeNode(ComputeGraphPtr &graph, NodePtr &nod GELOGI("Create Merge op:%s.", name.c_str()); NodePtr merge_node = graph->AddNode(op_desc); 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()); return nullptr; } if ((GraphUtils::RemoveEdge(in_ctrl_node->GetOutControlAnchor(), node->GetInControlAnchor()) != GRAPH_SUCCESS) || (GraphUtils::AddEdge(merge_node->GetOutControlAnchor(), node->GetInControlAnchor()) != GRAPH_SUCCESS)) { + REPORT_CALL_ERROR("E19999", "Remove control edge between op:%s(%s) and op:%s(%s), then " + "add control edge between op:%s(%s) and op:%s(%s) failed", + in_ctrl_node->GetName().c_str(), in_ctrl_node->GetType().c_str(), + 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(), merge_node->GetName().c_str(), node->GetName().c_str()); return nullptr; @@ -343,6 +371,7 @@ NodePtr ControlTriggerPass::InsertConstNode(ComputeGraphPtr &graph, NodePtr &mer const std::string name = merge_node->GetName() + "_" + CONSTANT + (flag ? "_t" : "_f"); 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()); return nullptr; } @@ -350,15 +379,20 @@ NodePtr ControlTriggerPass::InsertConstNode(ComputeGraphPtr &graph, NodePtr &mer int32_t value = 0; 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."); 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()); 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()); return nullptr; } @@ -366,12 +400,17 @@ NodePtr ControlTriggerPass::InsertConstNode(ComputeGraphPtr &graph, NodePtr &mer GELOGI("Create Const op: %s", name.c_str()); NodePtr const_node = graph->AddNode(op_desc); 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()); return nullptr; } uint32_t out_idx = (flag ? SWITCH_TRUE_OUTPUT : SWITCH_FALSE_OUTPUT); if (GraphUtils::AddEdge(const_node->GetOutDataAnchor(0), merge_node->GetInDataAnchor(out_idx)) != GRAPH_SUCCESS) { + 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()); return nullptr; } @@ -390,11 +429,14 @@ NodePtr ControlTriggerPass::InsertIdentityNode(ComputeGraphPtr &graph, const std const GeTensorDesc &data_desc) { 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()); 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()); return nullptr; } @@ -402,6 +444,8 @@ NodePtr ControlTriggerPass::InsertIdentityNode(ComputeGraphPtr &graph, const std GELOGI("Create Identity op:%s.", name.c_str()); NodePtr identity_node = graph->AddNode(op_desc); 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()); return nullptr; } @@ -418,17 +462,24 @@ 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"); return INTERNAL_ERROR; } InDataAnchorPtr in_cond_anchor = switch_node->GetInDataAnchor(SWITCH_PRED_INPUT); if (in_cond_anchor == nullptr) { + 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()); return INTERNAL_ERROR; } OutDataAnchorPtr pred_cond_anchor = in_cond_anchor->GetPeerOutAnchor(); if (pred_cond_anchor == nullptr) { + 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()); return INTERNAL_ERROR; } diff --git a/ge/graph/passes/ctrl_edge_transfer_pass.cc b/ge/graph/passes/ctrl_edge_transfer_pass.cc index a538a10c..598d2e14 100755 --- a/ge/graph/passes/ctrl_edge_transfer_pass.cc +++ b/ge/graph/passes/ctrl_edge_transfer_pass.cc @@ -64,13 +64,13 @@ Status CtrlEdgeTransferPass::Run(ge::ComputeGraphPtr graph) { for (auto &in_control_node : n->GetInControlNodes()) { GE_CHECK_NOTNULL(in_control_node); - GE_CHK_STATUS_RET(ge::GraphUtils::RemoveEdge(in_control_node->GetOutControlAnchor(), + GE_CHK_GRAPH_STATUS_RET(ge::GraphUtils::RemoveEdge(in_control_node->GetOutControlAnchor(), n->GetInControlAnchor()), "remove edge failed"); for (auto &out_node : n->GetOutNodes()) { if (out_node == nullptr) { continue; } - GE_CHK_STATUS_RET(ge::GraphUtils::AddEdge(in_control_node->GetOutControlAnchor(), + GE_CHK_GRAPH_STATUS_RET(ge::GraphUtils::AddEdge(in_control_node->GetOutControlAnchor(), out_node->GetInControlAnchor()), "add edge failed."); } } diff --git a/ge/graph/passes/data_pass.cc b/ge/graph/passes/data_pass.cc index 5bbd2fb1..cb94b161 100644 --- a/ge/graph/passes/data_pass.cc +++ b/ge/graph/passes/data_pass.cc @@ -30,6 +30,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()); return FAILED; } @@ -38,6 +40,8 @@ Status MappingSubgraphInput(const ComputeGraphPtr &graph, const std::functionGetName().c_str(), index, parent_index); if (!AttrUtils::SetInt(node->GetOpDesc(), 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()); return FAILED; } @@ -65,6 +69,9 @@ Status MappingSubgraphOutput(const ComputeGraphPtr &graph, const std::functionMutableInputDesc(index); GE_CHECK_NOTNULL(tensor); if (!AttrUtils::SetInt(tensor, ATTR_NAME_PARENT_NODE_INDEX, parent_index)) { + REPORT_CALL_ERROR("E19999", "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); GELOGE(FAILED, "Failed to set parent index for graph %s", graph->GetName().c_str()); return FAILED; } @@ -140,12 +147,16 @@ Status DataPass::PostParseSubgraph(const ComputeGraphPtr &graph, const string &i auto post_func_it = subgraph_handle.find(parent_node->GetType()); 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.", parent_node->GetName().c_str(), parent_node->GetType().c_str()); return FAILED; } 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", graph->GetName().c_str(), parent_node->GetName().c_str(), parent_node->GetType().c_str()); return FAILED; diff --git a/ge/graph/passes/dimension_adjust_pass.cc b/ge/graph/passes/dimension_adjust_pass.cc index 9677fa5f..61480f17 100755 --- a/ge/graph/passes/dimension_adjust_pass.cc +++ b/ge/graph/passes/dimension_adjust_pass.cc @@ -29,12 +29,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."); 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."); return PARAM_INVALID; } @@ -42,6 +44,8 @@ Status DimensionAdjustPass::Run(ge::NodePtr &node) { string type; Status ret = GetOriginalType(node, type); 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."); return ret; } @@ -69,12 +73,16 @@ Status DimensionAdjustPass::Run(ge::NodePtr &node) { if (ret == NOT_CHANGED) { return SUCCESS; } + REPORT_CALL_ERROR("E19999", "kernel compute for op:%s(%s) failed", + node->GetName().c_str(), node->GetType().c_str()); GELOGE(ret, "DimensionAdjustPass compute failed"); return ret; } if (node->GetAllInDataAnchors().size() > static_cast(kRemoveInputIndex)) { ret = PassUtils::UnlinkNodeWithControlCopy(node, kRemoveInputIndex); 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."); return ret; } @@ -111,12 +119,12 @@ Status DimensionAdjustPass::DealWithInNodes(NodePtr &node) { GE_CHECK_NOTNULL(identity); GELOGI("Create new identity node[%s] after node %s[type: %s] success.", identity->GetName().c_str(), in_node->GetName().c_str(), in_node->GetType().c_str()); - GE_CHK_STATUS_RET(GraphUtils::AddEdge(in_node_anchor, identity->GetInDataAnchor(0))) + GE_CHK_GRAPH_STATUS_RET(GraphUtils::AddEdge(in_node_anchor, identity->GetInDataAnchor(0))) GE_CHECK_NOTNULL(identity->GetOutControlAnchor()); if (identity->GetOutControlAnchor()->IsLinkedWith(node->GetInControlAnchor())) { continue; } - GE_CHK_STATUS_RET(GraphUtils::AddEdge(identity->GetOutControlAnchor(), node->GetInControlAnchor())) + GE_CHK_GRAPH_STATUS_RET(GraphUtils::AddEdge(identity->GetOutControlAnchor(), node->GetInControlAnchor())) } } @@ -126,12 +134,14 @@ Status DimensionAdjustPass::DealWithInNodes(NodePtr &node) { NodePtr DimensionAdjustPass::AddIdentityNodeToGraph(const string &name, const GeTensorDesc &tensor, 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."); return nullptr; } OpDescPtr desc = MakeShared("", ""); if (desc == nullptr) { + REPORT_CALL_ERROR("E19999", "New OpDesc failed"); GELOGE(MEMALLOC_FAILED, "Failed to create op desc."); return nullptr; } @@ -141,6 +151,8 @@ NodePtr DimensionAdjustPass::AddIdentityNodeToGraph(const string &name, const Ge auto ret = desc->AddInputDesc(tensor); auto ret2 = desc->AddOutputDesc(tensor); 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."); return nullptr; } diff --git a/ge/graph/passes/dimension_compute_pass.cc b/ge/graph/passes/dimension_compute_pass.cc index dfa2d404..cfd978b6 100755 --- a/ge/graph/passes/dimension_compute_pass.cc +++ b/ge/graph/passes/dimension_compute_pass.cc @@ -39,12 +39,16 @@ Status DimensionComputePass::Run(ge::NodePtr &node) { if (ret == NOT_CHANGED) { return SUCCESS; } 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"); return ret; } } 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", diff --git a/ge/graph/passes/dropout_pass.cc b/ge/graph/passes/dropout_pass.cc index 09c297a6..11be74f0 100644 --- a/ge/graph/passes/dropout_pass.cc +++ b/ge/graph/passes/dropout_pass.cc @@ -31,10 +31,12 @@ namespace ge { 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."); 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."); return PARAM_INVALID; } 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 d6503d0d..361d4a46 100755 --- a/ge/graph/passes/end_of_sequence_add_control_pass.cc +++ b/ge/graph/passes/end_of_sequence_add_control_pass.cc @@ -26,6 +26,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."); return PARAM_INVALID; } @@ -82,6 +83,10 @@ 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", + 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()); return FAILED; } diff --git a/ge/graph/passes/enter_pass.cc b/ge/graph/passes/enter_pass.cc index 066c97cf..cde3d6d9 100644 --- a/ge/graph/passes/enter_pass.cc +++ b/ge/graph/passes/enter_pass.cc @@ -37,6 +37,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()); return PARAM_INVALID; } @@ -58,6 +59,9 @@ Status EnterPass::Run(NodePtr &node) { } GELOGI("Remove control edge from %s to %s.", node->GetName().c_str(), out_ctrl_node->GetName().c_str()); if (GraphUtils::RemoveEdge(node->GetOutControlAnchor(), out_ctrl_node->GetInControlAnchor()) != GRAPH_SUCCESS) { + 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()); return FAILED; @@ -89,14 +93,14 @@ Status EnterPass::OptimizeEnterWithOnlyDataOut(NodePtr &node, NodePtr &in_node) } GE_CHECK_NOTNULL(in_node->GetOutDataAnchor(0)); - GE_CHK_STATUS_RET(in_node->GetOutDataAnchor(0)->Unlink(node->GetInDataAnchor(0))) + GE_CHK_GRAPH_STATUS_RET(in_node->GetOutDataAnchor(0)->Unlink(node->GetInDataAnchor(0))) const auto &out_data_anchor = node->GetOutDataAnchor(0); GE_CHECK_NOTNULL(out_data_anchor); for (const auto &peer_in_data_anchor : out_data_anchor->GetPeerInDataAnchors()) { - GE_CHK_STATUS_RET(out_data_anchor->Unlink(peer_in_data_anchor)) - GE_CHK_STATUS_RET(in_node->GetOutDataAnchor(0)->LinkTo(peer_in_data_anchor)) + GE_CHK_GRAPH_STATUS_RET(out_data_anchor->Unlink(peer_in_data_anchor)) + GE_CHK_GRAPH_STATUS_RET(in_node->GetOutDataAnchor(0)->LinkTo(peer_in_data_anchor)) } - GE_CHK_STATUS_RET(GraphUtils::RemoveNodeWithoutRelink(node->GetOwnerComputeGraph(), node)) + GE_CHK_GRAPH_STATUS_RET(GraphUtils::RemoveNodeWithoutRelink(node->GetOwnerComputeGraph(), node)) AddNodeDeleted(node); AddRePassNodesWithInOut(in_node); @@ -136,11 +140,11 @@ Status EnterPass::UnlinkCtrlEdgeBeforeConst(NodePtr &node) { } GELOGI("Unlink control edge from %s to %s.", node->GetName().c_str(), out_ctrl_node->GetName().c_str()); - GE_CHK_STATUS_RET(out_ctrl_anchor->Unlink(out_ctrl_node->GetInControlAnchor())) + GE_CHK_GRAPH_STATUS_RET(out_ctrl_anchor->Unlink(out_ctrl_node->GetInControlAnchor())) for (auto &out_node_of_const : out_nodes_of_const) { if (!out_ctrl_anchor->IsLinkedWith(out_node_of_const->GetInControlAnchor())) { GELOGI("Link control edge from %s to %s.", node->GetName().c_str(), out_node_of_const->GetName().c_str()); - GE_CHK_STATUS_RET(out_ctrl_anchor->LinkTo(out_node_of_const->GetInControlAnchor())) + GE_CHK_GRAPH_STATUS_RET(out_ctrl_anchor->LinkTo(out_node_of_const->GetInControlAnchor())) } } } diff --git a/ge/graph/passes/flow_ctrl_pass.cc b/ge/graph/passes/flow_ctrl_pass.cc index 435130b3..0072224b 100755 --- a/ge/graph/passes/flow_ctrl_pass.cc +++ b/ge/graph/passes/flow_ctrl_pass.cc @@ -115,6 +115,7 @@ NodePtr FlowCtrlPass::InsertOp(ComputeGraphPtr &compute_graph, const string &nod const std::vector &output_list) { 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()); return nullptr; } @@ -122,6 +123,8 @@ NodePtr FlowCtrlPass::InsertOp(ComputeGraphPtr &compute_graph, const string &nod for (auto &input_desc : input_list) { graphStatus graph_status = op_desc->AddInputDesc(input_desc); 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); return nullptr; } @@ -130,14 +133,21 @@ NodePtr FlowCtrlPass::InsertOp(ComputeGraphPtr &compute_graph, const string &nod for (auto &output_desc : output_list) { graphStatus graph_status = op_desc->AddOutputDesc(output_desc); 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); return nullptr; } } - GE_IF_BOOL_EXEC(compute_graph == nullptr, DOMI_LOGE("compute_graph is nullptr"); 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"); + 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()); return nullptr; } @@ -149,9 +159,15 @@ 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, - GELOGE(FAILED, "loop_cond is null"); return nullptr); + REPORT_INNER_ERROR("E19999", "Param loop_cond or its op_desc is nullptr, " + "check invalid"); + GELOGE(FAILED, "loop_cond is null"); + return nullptr); GE_IF_BOOL_EXEC(iter_per_loop == nullptr || iter_per_loop->GetOpDesc() == nullptr, - GELOGE(FAILED, "iter_per_loop is nullptr"); return nullptr); + REPORT_INNER_ERROR("E19999", "Param iter_per_loop or its op_desc is nullptr, " + "check invalid"); + GELOGE(FAILED, "iter_per_loop 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; @@ -164,6 +180,9 @@ NodePtr FlowCtrlPass::InsertStreamSwitchOp(ComputeGraphPtr &compute_graph, const // set input 0 graphStatus add_ret = GraphUtils::AddEdge(loop_cond->GetOutDataAnchor(0), stream_switch->GetInDataAnchor(0)); if (add_ret != GRAPH_SUCCESS) { + 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); return nullptr; } @@ -171,6 +190,9 @@ NodePtr FlowCtrlPass::InsertStreamSwitchOp(ComputeGraphPtr &compute_graph, const // set input 1 add_ret = GraphUtils::AddEdge(iter_per_loop->GetOutDataAnchor(0), stream_switch->GetInDataAnchor(1)); if (add_ret != GRAPH_SUCCESS) { + 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); return nullptr; } @@ -178,13 +200,19 @@ NodePtr FlowCtrlPass::InsertStreamSwitchOp(ComputeGraphPtr &compute_graph, const // 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)), - DOMI_LOGE("set ATTR_NAME_STREAM_SWITCH_COND failed"); return nullptr); + 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); return stream_switch; } NodePtr FlowCtrlPass::AddVariableNode(ComputeGraphPtr &compute_graph, const string &name) { - GE_IF_BOOL_EXEC(compute_graph == nullptr, DOMI_LOGE("compute_graph is nullptr"); 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"); + return nullptr); NodePtr exist_node = compute_graph->FindNode(name); if (exist_node != nullptr) { GELOGD("Node %s already exist, no need add.", name.c_str()); @@ -193,10 +221,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()); 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()); return nullptr; } @@ -238,6 +270,9 @@ Status FlowCtrlPass::AddGlobalStepVariableNode(ComputeGraphPtr &compute_graph) { // add ctrl edges graphStatus add_ret = GraphUtils::AddEdge(global_step->GetOutControlAnchor(), output_node->GetInControlAnchor()); if (add_ret != GRAPH_SUCCESS) { + 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); return FAILED; } @@ -249,6 +284,8 @@ 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, " + "check invalid"); GELOGE(FAILED, "ref node or value node is null"); return nullptr); GeTensorDesc ref_tensor_desc = ref_node->GetOpDesc()->GetOutputDesc(0); @@ -263,12 +300,18 @@ NodePtr FlowCtrlPass::InsertAssignOp(ge::ComputeGraphPtr &compute_graph, const s // assign node input 0 = ref_node graphStatus add_ret = GraphUtils::AddEdge(ref_node->GetOutDataAnchor(0), assign_node->GetInDataAnchor(0)); if (add_ret != GRAPH_SUCCESS) { + 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); return nullptr; } // assign input 1 = value_node add_ret = GraphUtils::AddEdge(value_node->GetOutDataAnchor(0), assign_node->GetInDataAnchor(1)); if (add_ret != GRAPH_SUCCESS) { + 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); return nullptr; } @@ -298,10 +341,23 @@ Status FlowCtrlPass::CreateIterCtrlTrueBranch(ComputeGraphPtr &compute_graph, co string active_name = switch_node->GetName() + "_StreamActive"; // add attr for stream assign model to break branch. - GE_CHK_STATUS_RET(SetStreamLabel(assign_add_node_in_fpbp_loop_, active_name), "set stream label failed"); + auto status = SetStreamLabel(assign_add_node_in_fpbp_loop_, active_name); + if (status != ge::SUCCESS) { + 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."); + return status; + } // used for stream assign to find true branch - GE_CHK_STATUS_RET(SetActiveLabelList(switch_node, { active_name }), "set active label list failed"); + status = SetActiveLabelList(switch_node, { active_name }); + 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."); + return status; + } // 2. Insert active node NodePtr active_node = InsertOp(compute_graph, STREAMACTIVE, active_name, {}, {}); @@ -309,14 +365,28 @@ Status FlowCtrlPass::CreateIterCtrlTrueBranch(ComputeGraphPtr &compute_graph, co GELOGE(FAILED, "Insert stream active node:%s for IterCtrlTrueStream failed.", active_name.c_str()); return FAILED; } - GE_CHK_STATUS_RET(SetStreamLabel(active_node, active_name), "set stream label 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."); + return status; + } GE_IF_BOOL_EXEC(!AttrUtils::SetBool(active_node->GetOpDesc(), ATTR_NAME_IS_LOOP_ACTIVE, true), - DOMI_LOGE("set ATTR_NAME_IS_LOOP_ACTIVE failed"); return FAILED); + 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"); + return FAILED); // add ctrl edges graphStatus add_ret = GraphUtils::AddEdge(switch_node->GetOutControlAnchor(), assign_add_node_in_fpbp_loop_->GetInControlAnchor()); if (add_ret != GRAPH_SUCCESS) { + 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_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); return FAILED; } @@ -324,6 +394,10 @@ Status FlowCtrlPass::CreateIterCtrlTrueBranch(ComputeGraphPtr &compute_graph, co add_ret = GraphUtils::AddEdge(assign_add_node_in_fpbp_loop_->GetOutControlAnchor(), active_node->GetInControlAnchor()); if (add_ret != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "Add control edge 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()); GELOGE(FAILED, "Add assign_add_node to active_node ctrl edge failed, add_ret=%u.", add_ret); return FAILED; } @@ -351,10 +425,19 @@ Status FlowCtrlPass::CreateIterCtrlFalseBranch(ComputeGraphPtr &compute_graph, c return FAILED; } - GE_CHK_STATUS_RET(SetStreamLabel(assign_node, switch_node->GetName()), "set stream label failed."); + auto status = SetStreamLabel(assign_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(), assign_node->GetName().c_str(), assign_node->GetType().c_str()); + GELOGE(status, "Set stream label failed."); + return status; + } graphStatus add_ret = GraphUtils::AddEdge(switch_node->GetOutControlAnchor(), assign_node->GetInControlAnchor()); if (add_ret != GRAPH_SUCCESS) { + 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); return FAILED; } @@ -368,15 +451,30 @@ Status FlowCtrlPass::CreateIterCtrlFalseBranch(ComputeGraphPtr &compute_graph, c GELOGE(FAILED, "Insert stream active node:%s for IterCtrlTrueStream failed.", active_name.c_str()); return FAILED; } - GE_CHK_STATUS_RET(SetStreamLabel(active_node, switch_node->GetName()), "set stream label 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."); + return status; + } GE_CHK_STATUS_RET(SetSwitchBranchNodeLabel(active_node, switch_node->GetName()), "set switch branch node label failed."); string model_exit_name = switch_node->GetName() + "_ModelExit"; - GE_CHK_STATUS_RET(SetActiveLabelList(active_node, { model_exit_name }), "set active label list failed"); + 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."); + return status; + } add_ret = GraphUtils::AddEdge(assign_node->GetOutControlAnchor(), active_node->GetInControlAnchor()); if (add_ret != GRAPH_SUCCESS) { + 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); return FAILED; } @@ -387,10 +485,20 @@ Status FlowCtrlPass::CreateIterCtrlFalseBranch(ComputeGraphPtr &compute_graph, c GELOGE(FAILED, "Insert model_exit node:%s for IterCtrlTrueStream failed.", model_exit_name.c_str()); return FAILED; } - GE_CHK_STATUS_RET(SetStreamLabel(model_exit_node, model_exit_name), "set stream label failed"); + status = SetStreamLabel(model_exit_node, model_exit_name); + if (status != ge::SUCCESS) { + 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."); + return status; + } add_ret = GraphUtils::AddEdge(active_node->GetOutControlAnchor(), model_exit_node->GetInControlAnchor()); if (add_ret != GRAPH_SUCCESS) { + 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); return FAILED; } @@ -433,10 +541,19 @@ Status FlowCtrlPass::AddFpBpIteratorCtrl(ComputeGraphPtr &compute_graph, NodePtr GELOGE(FAILED, "InsertStreamSwitchOp:%s failed.", switch_name.c_str()); return FAILED; } - GE_CHK_STATUS_RET(SetStreamLabel(switch_node, switch_name), "set stream label 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."); + return status; + } graphStatus add_ret = GraphUtils::AddEdge(pre_node->GetOutControlAnchor(), switch_node->GetInControlAnchor()); if (add_ret != GRAPH_SUCCESS) { + 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); return FAILED; @@ -477,9 +594,14 @@ Status FlowCtrlPass::AddSpecialNodeIteratorCtrl(ComputeGraphPtr &compute_graph, * itersPerLoop loopCond */ GE_IF_BOOL_EXEC(loop_after_node == nullptr || compute_graph == nullptr, - DOMI_LOGE("loop after node or compute graph is null."); return FAILED); + 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."); + 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()); return FAILED; } @@ -488,17 +610,26 @@ Status FlowCtrlPass::AddSpecialNodeIteratorCtrl(ComputeGraphPtr &compute_graph, // 1. Get variables NodePtr loop_cond_node = compute_graph->FindNode(NODE_NAME_FLOWCTRL_LOOP_COND); 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()); 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()); return FAILED; } // 2. Add StreamSwitch and edges to switch_node. - GE_IF_BOOL_EXEC(loop_pre_node == nullptr, DOMI_LOGE("loop pre node is null."); return FAILED); + 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."); + 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) { @@ -506,16 +637,28 @@ Status FlowCtrlPass::AddSpecialNodeIteratorCtrl(ComputeGraphPtr &compute_graph, return FAILED; } - GE_CHK_STATUS_RET(SetStreamLabel(switch_node, switch_name), "set stream label 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."); + return status; + } graphStatus add_ret = GraphUtils::AddEdge(loop_pre_node->GetOutControlAnchor(), switch_node->GetInControlAnchor()); if (add_ret != GRAPH_SUCCESS) { + 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); return FAILED; } add_ret = GraphUtils::AddEdge(loop_after_node->GetOutControlAnchor(), switch_node->GetInControlAnchor()); if (add_ret != GRAPH_SUCCESS) { + 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); return FAILED; @@ -529,22 +672,47 @@ Status FlowCtrlPass::AddSpecialNodeIteratorCtrl(ComputeGraphPtr &compute_graph, return FAILED; } - GE_CHK_STATUS_RET(SetStreamLabel(active_node, active_name), "set stream label 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."); + return status; + } GE_IF_BOOL_EXEC(!AttrUtils::SetBool(active_node->GetOpDesc(), ATTR_NAME_IS_LOOP_ACTIVE, true), - DOMI_LOGE("set ATTR_NAME_IS_LOOP_ACTIVE failed"); return FAILED); + 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"); + return FAILED); add_ret = GraphUtils::AddEdge(switch_node->GetOutControlAnchor(), active_node->GetInControlAnchor()); if (add_ret != GRAPH_SUCCESS) { + 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); return FAILED; } // used for stream assign to find true branch - GE_CHK_STATUS_RET(SetActiveLabelList(switch_node, { active_name }), "set active label list failed."); + status = SetActiveLabelList(switch_node, { active_name }); + 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."); + return status; + } // used for stream assign to find active stream - GE_CHK_STATUS_RET(SetActiveLabelList(active_node, { loop_pre_node->GetName() }), "set active label list failed"); + 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."); + return status; + } active_nodes_in_iter_loop_.push_back(active_node); return SUCCESS; } diff --git a/ge/graph/passes/folding_pass.cc b/ge/graph/passes/folding_pass.cc index 227a0f61..d4558ac7 100755 --- a/ge/graph/passes/folding_pass.cc +++ b/ge/graph/passes/folding_pass.cc @@ -35,6 +35,7 @@ namespace ge { 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."); return nullptr; } @@ -42,6 +43,9 @@ shared_ptr GetKernelByType(const NodePtr &node) { string type = node->GetType(); if (type == FRAMEWORKOP) { if (!ge::AttrUtils::GetStr(node->GetOpDesc(), ATTR_NAME_FRAMEWORK_ORIGINAL_TYPE, type)) { + REPORT_CALL_ERROR("E19999", "Get Attr:%s from op:%s(%s) failed", + ATTR_NAME_FRAMEWORK_ORIGINAL_TYPE.c_str(), + node->GetName().c_str(), node->GetType().c_str()); return nullptr; } } @@ -79,6 +83,7 @@ IndexsToAnchors GetIndexAndPeerInDataAnchors(NodePtr &node) { 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"); return nullptr; } @@ -90,12 +95,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."); return nullptr; } OpDescPtr desc = MakeShared("", ""); if (desc == nullptr) { + REPORT_CALL_ERROR("E19999", "New OpDesc failed"); GELOGE(MEMALLOC_FAILED, "Failed to create op desc."); return nullptr; } @@ -105,6 +112,8 @@ NodePtr AddIdentityNodeToGraph(const std::string &name, const GeTensorDesc &tens auto ret = desc->AddInputDesc(tensor); auto ret2 = desc->AddOutputDesc(tensor); 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."); return nullptr; } @@ -137,6 +146,8 @@ 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", + node->GetName().c_str(), node->GetType().c_str()); GELOGE(INTERNAL_ERROR, "Failed to isolate and delete node %s, type %s.", node->GetName().c_str(), node->GetType().c_str()); return INTERNAL_ERROR; @@ -149,6 +160,8 @@ Status FoldingPass::Folding(NodePtr &node, vector &outputs) { continue; } if (IsolateAndDeleteNode(pre_node, {}) != SUCCESS) { + REPORT_INNER_ERROR("E19999", "Isolate and delete node:%s(%s) faild", + pre_node->GetName().c_str(), pre_node->GetType().c_str()); GELOGE(INTERNAL_ERROR, "Failed to isolate and delete in data node %s, type %s.", pre_node->GetName().c_str(), pre_node->GetType().c_str()); return INTERNAL_ERROR; @@ -177,6 +190,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", + 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.", in_node->GetName().c_str(), node->GetName().c_str(), node->GetType().c_str()); return INTERNAL_ERROR; @@ -192,6 +209,9 @@ Status FoldingPass::DealWithInNodes(NodePtr &node) { } 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", + 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()); return INTERNAL_ERROR; @@ -199,6 +219,9 @@ Status FoldingPass::DealWithInNodes(NodePtr &node) { GELOGI("Create new identity node success."); ret = GraphUtils::AddEdge(identity->GetOutControlAnchor(), node->GetInControlAnchor()); if (ret != GRAPH_SUCCESS) { + 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()); return INTERNAL_ERROR; @@ -212,6 +235,7 @@ Status FoldingPass::DealWithInNodes(NodePtr &node) { Status FoldingPass::AddConstNode(NodePtr &node, IndexsToAnchors indexes_to_anchors, std::vector &v_weight) { if (node == nullptr) { + REPORT_INNER_ERROR("E19999", "Param node is nullptr, check invalid"); GELOGE(PARAM_INVALID, "node is null"); return FAILED; } @@ -219,6 +243,8 @@ Status FoldingPass::AddConstNode(NodePtr &node, IndexsToAnchors indexes_to_ancho for (auto &index_to_anchors : indexes_to_anchors) { auto index = static_cast(index_to_anchors.first); 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, " "the out nodes num %lu calculated is less than the node out anchor index %zu", @@ -227,6 +253,8 @@ Status FoldingPass::AddConstNode(NodePtr &node, IndexsToAnchors indexes_to_ancho } 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", node->GetName().c_str(), node->GetType().c_str(), index); return INTERNAL_ERROR; @@ -243,6 +271,8 @@ Status FoldingPass::AddConstNode(NodePtr &node, IndexsToAnchors indexes_to_ancho // add new const to re-pass node for (auto &in_anchor : index_to_anchors.second) { 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."); return INTERNAL_ERROR; } @@ -254,6 +284,9 @@ Status FoldingPass::AddConstNode(NodePtr &node, IndexsToAnchors indexes_to_ancho } Status ret = GraphUtils::AddEdge(node->GetOutControlAnchor(), const_node->GetInControlAnchor()); if (ret != GRAPH_SUCCESS) { + 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(), const_node->GetName().c_str()); return INTERNAL_ERROR; @@ -263,6 +296,9 @@ 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(), + 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()); return INTERNAL_ERROR; @@ -279,6 +315,8 @@ Status FoldingPass::RemoveNodeKeepingCtrlEdges(NodePtr &node) { GE_IF_BOOL_EXEC(node == nullptr, GELOGE(PARAM_INVALID, "node is null"); return PARAM_INVALID); auto ret = GraphUtils::IsolateNode(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(), node->GetType().c_str()); return INTERNAL_ERROR; @@ -287,6 +325,8 @@ Status FoldingPass::RemoveNodeKeepingCtrlEdges(NodePtr &node) { auto graph = node->GetOwnerComputeGraph(); ret = GraphUtils::RemoveNodeWithoutRelink(graph, 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()); return INTERNAL_ERROR; } @@ -297,6 +337,7 @@ Status FoldingPass::RemoveNodeKeepingCtrlEdges(NodePtr &node) { Status FoldingPass::ConnectNodeToInAnchor(InDataAnchorPtr &in_anchor, NodePtr &node, int node_index) { // 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"); return PARAM_INVALID; } @@ -309,6 +350,8 @@ Status FoldingPass::ConnectNodeToInAnchor(InDataAnchorPtr &in_anchor, NodePtr &n auto new_out_anchor = node->GetOutDataAnchor(node_index); 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," " the index %d for node %s, type %s is invalid", @@ -316,6 +359,10 @@ Status FoldingPass::ConnectNodeToInAnchor(InDataAnchorPtr &in_anchor, NodePtr &n return INTERNAL_ERROR; } if (GraphUtils::AddEdge(new_out_anchor, in_anchor) != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "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()); GELOGE(INTERNAL_ERROR, "Failed to add edge between anchors," " new node %s, type %s", diff --git a/ge/graph/passes/for_pass.cc b/ge/graph/passes/for_pass.cc index 3b7a0886..0b6377dc 100644 --- a/ge/graph/passes/for_pass.cc +++ b/ge/graph/passes/for_pass.cc @@ -64,12 +64,16 @@ Status ForPass::Run(NodePtr &node) { 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()); return FAILED; } ComputeGraphPtr body_graph = BuildBodyGraph(while_info); 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()); return FAILED; } @@ -99,6 +103,10 @@ Status ForPass::BuildForInfo(const ComputeGraphPtr &root_graph, const NodePtr &n OutDataAnchorPtr limit = FindInputWithIndex(node, FOR_LIMIT_INPUT); OutDataAnchorPtr delta = FindInputWithIndex(node, FOR_DELTA_INPUT); if ((start == nullptr) || (limit == nullptr) || (delta == nullptr)) { + REPORT_INNER_ERROR("E19999", "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, 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()); return FAILED; } @@ -118,11 +126,15 @@ Status ForPass::BuildForInfo(const ComputeGraphPtr &root_graph, const NodePtr &n // For node has and only has one sub_graph std::string for_body_name = op_desc->GetSubgraphInstanceName(0); 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()); 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()); return FAILED; } @@ -222,6 +234,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."); return FAILED; } @@ -232,6 +246,9 @@ Status ForPass::TranWhileInfo(const ComputeGraphPtr &graph, const ForInfo &for_i // Const node has and only has one output, Identity node has and only has one input if ((identity_node == nullptr) || (GraphUtils::AddEdge(i_node->GetOutDataAnchor(0), identity_node->GetInDataAnchor(0)) != GRAPH_SUCCESS)) { + 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()); return FAILED; } @@ -240,6 +257,8 @@ Status ForPass::TranWhileInfo(const ComputeGraphPtr &graph, const ForInfo &for_i // Identity node has and only has one output OutDataAnchorPtr i_input = identity_node->GetOutDataAnchor(0); 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."); return FAILED; } @@ -272,6 +291,7 @@ Status ForPass::TranWhileInfo(const ComputeGraphPtr &graph, const ForInfo &for_i 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()); return nullptr; } @@ -279,16 +299,21 @@ OpDescPtr ForPass::CreateConstDesc(const std::string &name, int32_t value) { GeTensorDesc data_desc(GeShape(), FORMAT_ND, DT_INT32); 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()); 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()); 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()); return nullptr; } @@ -334,6 +359,7 @@ Status ForPass::CreateLoopInput(const ComputeGraphPtr &graph, const ForInfo &for graphStatus error_code = GRAPH_SUCCESS; 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()); return FAILED; } @@ -346,6 +372,7 @@ Status ForPass::CreateLoopInput(const ComputeGraphPtr &graph, const ForInfo &for NodePtr abs_delta_node = graph_builder.GetNode(abs_name_0); 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."); return FAILED; } @@ -431,11 +458,15 @@ Status ForPass::InsertWhileNode(const ComputeGraphPtr &graph, const std::string OpDescBuilder op_desc_builder(name, WHILE); OpDescPtr op_desc = op_desc_builder.AddDynamicInput("input", arg_num).AddDynamicOutput("output", arg_num).Build(); if (op_desc == nullptr) { + REPORT_CALL_ERROR("E19999", "Add dynamic input or output to op:%s(%s) failed", + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(FAILED, "Create while op_desc failed, name:%s.", name.c_str()); return FAILED; } NodePtr while_node = graph->AddNode(op_desc); 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()); return FAILED; } @@ -553,6 +584,7 @@ ComputeGraphPtr ForPass::BuildCondGraph(WhileInfo &while_info) { std::string error_msg; 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()); return nullptr; } @@ -667,6 +699,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()); 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 ab8fc39b..1f062813 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 @@ -34,6 +34,7 @@ using std::string; 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."); return GE_GRAPH_PARAM_NULLPTR; } @@ -101,12 +102,20 @@ Status FuseDataNodesWithCommonInputPass::FuseDataNodes( first_node->GetName().c_str(), subgraph->GetName().c_str()); // the data node which can be fused has none input(both data and control in) if (GraphUtils::MoveOutCtrlEdges(node, first_node) != SUCCESS) { + REPORT_CALL_ERROR("E19999", "Move out control edge from node:%s(%s) to node:%s(%s) failed", + node->GetName().c_str(), node->GetType().c_str(), + first_node->GetName().c_str(), first_node->GetType().c_str()); return FAILED; } if (GraphUtils::ReplaceNodeDataAnchors(first_node, node, {}, {0}) != SUCCESS) { + REPORT_CALL_ERROR("E19999", "Replace data edge from node:%s(%s) to node:%s(%s) failed", + node->GetName().c_str(), node->GetType().c_str(), + first_node->GetName().c_str(), first_node->GetType().c_str()); return FAILED; } 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()); return FAILED; } diff --git a/ge/graph/passes/get_original_format_pass.cc b/ge/graph/passes/get_original_format_pass.cc index e743f190..4b78ae49 100644 --- a/ge/graph/passes/get_original_format_pass.cc +++ b/ge/graph/passes/get_original_format_pass.cc @@ -51,6 +51,9 @@ Status GetOriginalFormatPass::SetOriginalFormat(const ge::ComputeGraphPtr &graph GE_CHECK_NOTNULL(node_ptr); GE_IF_BOOL_EXEC(!AttrUtils::SetInt(node_ptr->GetOpDesc(), ATTR_NAME_INFERRED_FORMAT, DOMI_TENSOR_RESERVED), + 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"); return FAILED); } @@ -64,9 +67,15 @@ Status GetOriginalFormatPass::SetOriginalFormat(const ge::ComputeGraphPtr &graph GELOGI("Data node: %s,format :%d", node_ptr->GetName().c_str(), GetLocalOmgContext().format); ori_format = static_cast(GetLocalOmgContext().format); GE_IF_BOOL_EXEC(!AttrUtils::SetInt(desc_ptr, ATTR_NAME_FORMAT, ori_format), + 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"); 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"); return FAILED); continue; @@ -130,6 +139,9 @@ Status GetOriginalFormatPass::SetOriginalFormat(const ge::ComputeGraphPtr &graph if (ignore_pred_format) { GE_IF_BOOL_EXEC(!AttrUtils::SetBool(tmp_op_ptr, ATTR_NAME_IGNORE_PRED_FORMAT, true), + 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"); return FAILED); } @@ -137,9 +149,15 @@ Status GetOriginalFormatPass::SetOriginalFormat(const ge::ComputeGraphPtr &graph // Do not reset ATTR_NAME_FORMAT if it is set in the OpParser. if (!tmp_op_ptr->HasAttr(ATTR_NAME_FORMAT)) { GE_IF_BOOL_EXEC(!AttrUtils::SetInt(tmp_op_ptr, ATTR_NAME_FORMAT, ori_format), + 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"); 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"); return FAILED); } else { @@ -147,6 +165,9 @@ Status GetOriginalFormatPass::SetOriginalFormat(const ge::ComputeGraphPtr &graph GE_RETURN_WITH_LOG_IF_FALSE(AttrUtils::GetInt(tmp_op_ptr, ATTR_NAME_FORMAT, existingFormat), "Get existing_format attr failed"); 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"); return FAILED; } diff --git a/ge/graph/passes/global_step_insert_pass.cc b/ge/graph/passes/global_step_insert_pass.cc index 4431fc3d..9fc1d066 100755 --- a/ge/graph/passes/global_step_insert_pass.cc +++ b/ge/graph/passes/global_step_insert_pass.cc @@ -34,11 +34,16 @@ NodePtr GlobalStepInsertPass::InsertOp(ComputeGraphPtr &compute_graph, const std::vector &input_list, const std::vector &output_list) { OpDescPtr op_desc = MakeShared(node_name, node_type); - GE_IF_BOOL_EXEC(op_desc == nullptr, GELOGE(FAILED,"Make OpDesc failed"); return nullptr); + GE_IF_BOOL_EXEC(op_desc == nullptr, + REPORT_CALL_ERROR("E19999", "New OpDesc failed"); + GELOGE(FAILED,"Make OpDesc failed"); + return nullptr); for (auto &input_desc : input_list) { graphStatus graph_status = op_desc->AddInputDesc(input_desc); 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); return nullptr; } @@ -47,6 +52,8 @@ NodePtr GlobalStepInsertPass::InsertOp(ComputeGraphPtr &compute_graph, for (auto &output_desc : output_list) { graphStatus graph_status = op_desc->AddOutputDesc(output_desc); 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); return nullptr; } @@ -55,6 +62,8 @@ NodePtr GlobalStepInsertPass::InsertOp(ComputeGraphPtr &compute_graph, GE_IF_BOOL_EXEC(compute_graph == nullptr, GELOGE(FAILED,"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()); return nullptr); @@ -93,6 +102,9 @@ Status GlobalStepInsertPass::Run(ComputeGraphPtr compute_graph) { // add ctrl edges graphStatus add_ret = GraphUtils::AddEdge(global_step->GetOutControlAnchor(), output_node->GetInControlAnchor()); if (add_ret != GRAPH_SUCCESS) { + 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); return FAILED; } diff --git a/ge/graph/passes/guarantee_const_pass.cc b/ge/graph/passes/guarantee_const_pass.cc index a2d8f262..f6567fce 100644 --- a/ge/graph/passes/guarantee_const_pass.cc +++ b/ge/graph/passes/guarantee_const_pass.cc @@ -24,6 +24,7 @@ #include "graph/common/omg_util.h" #include "graph/utils/attr_utils.h" #include "graph/utils/graph_utils.h" +#include "graph/utils/type_utils.h" namespace ge { namespace { @@ -35,6 +36,8 @@ 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."); return status_ret; } @@ -42,6 +45,9 @@ Status GuaranteeConstPass::Run(NodePtr &node) { return SUCCESS; } if (node->GetOpDesc()->GetAllInputsDesc().size() != kGuaranteeConstInputsSize) { + REPORT_CALL_ERROR("E19999", "Num:%zu of input desc 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()); return PARAM_INVALID; } @@ -51,6 +57,11 @@ 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", + 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()); return FAILED; } diff --git a/ge/graph/passes/hccl_continuous_memcpy_pass.cc b/ge/graph/passes/hccl_continuous_memcpy_pass.cc index 1931baf0..790661bc 100644 --- a/ge/graph/passes/hccl_continuous_memcpy_pass.cc +++ b/ge/graph/passes/hccl_continuous_memcpy_pass.cc @@ -36,6 +36,8 @@ Status HcclContinuousMemcpyPass::Run(ge::ComputeGraphPtr graph) { for (const auto &node : graph->GetDirectNode()) { auto op_desc = node->GetOpDesc(); if (op_desc == nullptr) { + REPORT_INNER_ERROR("E19999", "Node with nullptr op_desc exist in Param graph:%s, check invalid", + graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "node has no op_desc, node_name : %s.", node->GetName().c_str()); return INTERNAL_ERROR; } @@ -76,6 +78,9 @@ Status HcclContinuousMemcpyPass::ContinuousInputProcess(const ComputeGraphPtr &g } auto src_out_anchor = hccl_in_anchor->GetPeerOutAnchor(); if (src_out_anchor == nullptr) { + REPORT_INNER_ERROR("E19999", "Node:%s(%s) input:%d anchor, peer anchor is nullptr, check invalid", + node->GetName().c_str(), node->GetType().c_str(), + hccl_in_anchor->GetIdx()); GELOGE(INTERNAL_ERROR, "hcom op input has no peer anchor, node_name:%s", node->GetName().c_str()); return INTERNAL_ERROR; } @@ -115,6 +120,9 @@ Status HcclContinuousMemcpyPass::P2pmemInputProcess(const ComputeGraphPtr &graph } auto src_out_anchor = hccl_in_anchor->GetPeerOutAnchor(); if (src_out_anchor == nullptr) { + REPORT_INNER_ERROR("E19999", "Node:%s(%s) input:%u anchor, peer anchor is nullptr, check invalid", + node->GetName().c_str(), node->GetType().c_str(), + index); GELOGE(INTERNAL_ERROR, "hcom op input has no peer anchor, node_name:%s", node->GetName().c_str()); return INTERNAL_ERROR; } @@ -146,6 +154,7 @@ NodePtr HcclContinuousMemcpyPass::CreateIdentityNode(const ComputeGraphPtr &grap NodePtr pre_node = out_data_anchor->GetOwnerNode(); OpDescPtr pre_op_desc = pre_node->GetOpDesc(); if (pre_op_desc == nullptr) { + REPORT_INNER_ERROR("E19999", "OpDesc in node is nullptr, check invalid"); GELOGE(INTERNAL_ERROR, "OpDesc of pre node is invalid."); return nullptr; } @@ -154,6 +163,7 @@ NodePtr HcclContinuousMemcpyPass::CreateIdentityNode(const ComputeGraphPtr &grap node_name = CheckDuplicateName(node_name); OpDescPtr op_desc = MakeShared(node_name.c_str(), IDENTITY); if (op_desc == nullptr) { + REPORT_CALL_ERROR("E19999", "New OpDesc failed"); GELOGE(INTERNAL_ERROR, "Create Identity op: MakeShared op_desc fail."); return nullptr; } @@ -161,12 +171,16 @@ NodePtr HcclContinuousMemcpyPass::CreateIdentityNode(const ComputeGraphPtr &grap graphStatus ret = op_desc->AddInputDesc("x", pre_op_desc->GetOutputDesc(out_data_anchor->GetIdx())); if (ret != 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(INTERNAL_ERROR, "Create Identity op: add input desc fail."); return nullptr; } ret = op_desc->AddOutputDesc("y", pre_op_desc->GetOutputDesc(out_data_anchor->GetIdx())); if (ret != 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(INTERNAL_ERROR, "Create Identity op: add output desc fail."); return nullptr; } @@ -175,6 +189,8 @@ NodePtr HcclContinuousMemcpyPass::CreateIdentityNode(const ComputeGraphPtr &grap NodePtr memcpy_node = graph->AddNode(op_desc); if (memcpy_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, "Insert Identity node fail."); return nullptr; } @@ -247,6 +263,13 @@ Status HcclContinuousMemcpyPass::InsertIdentityBeforeHccl(const ComputeGraphPtr Status ret1 = src_out_anchor->Unlink(hccl_in_anchor); if (ret1 != SUCCESS) { + REPORT_CALL_ERROR("E19999", + "Op:%s(%s) out index:%d unlink from op:%s(%s) in index:%d failed", + src_out_anchor->GetOwnerNode()->GetName().c_str(), + src_out_anchor->GetOwnerNode()->GetType().c_str(), src_out_anchor->GetIdx(), + hccl_in_anchor->GetOwnerNode()->GetName().c_str(), + hccl_in_anchor->GetOwnerNode()->GetType().c_str(), + hccl_in_anchor->GetIdx()); GELOGE(INTERNAL_ERROR, "The op %s Unlink anchor %s fail.", src_out_anchor->GetOwnerNode()->GetName().c_str(), hccl_in_anchor->GetOwnerNode()->GetName().c_str()); return FAILED; @@ -255,6 +278,13 @@ Status HcclContinuousMemcpyPass::InsertIdentityBeforeHccl(const ComputeGraphPtr GE_CHECK_NOTNULL(out_data_anchor_0); ret1 = out_data_anchor_0->LinkTo(hccl_in_anchor); if (ret1 != SUCCESS) { + REPORT_CALL_ERROR("E19999", + "Op:%s(%s) out index:%d link to op:%s(%s) in index:%d failed", + out_data_anchor_0->GetOwnerNode()->GetName().c_str(), + out_data_anchor_0->GetOwnerNode()->GetType().c_str(), out_data_anchor_0->GetIdx(), + hccl_in_anchor->GetOwnerNode()->GetName().c_str(), + hccl_in_anchor->GetOwnerNode()->GetType().c_str(), + hccl_in_anchor->GetIdx()); GELOGE(INTERNAL_ERROR, "The op %s link anchor %s fail.", memcpy_node->GetName().c_str(), hccl_in_anchor->GetOwnerNode()->GetName().c_str()); return FAILED; @@ -262,6 +292,12 @@ Status HcclContinuousMemcpyPass::InsertIdentityBeforeHccl(const ComputeGraphPtr Status ret = src_out_anchor->LinkTo(memcpy_node->GetInDataAnchor(kAnchorNum)); if (ret != SUCCESS) { + REPORT_CALL_ERROR("E19999", + "Op:%s(%s) out index:%d link to op:%s(%s) in index:%u failed", + src_out_anchor->GetOwnerNode()->GetName().c_str(), + src_out_anchor->GetOwnerNode()->GetType().c_str(), src_out_anchor->GetIdx(), + memcpy_node->GetName().c_str(), memcpy_node->GetType().c_str(), + kAnchorNum); GELOGE(INTERNAL_ERROR, "The op %s link anchor %s fail.", src_out_anchor->GetOwnerNode()->GetName().c_str(), memcpy_node->GetName().c_str()); return FAILED; @@ -307,6 +343,12 @@ Status HcclContinuousMemcpyPass::InsertAssignAfterBroadcastIfNeed(const ComputeG Status ret = hccl_out_anchor->LinkTo(assign_node->GetInDataAnchor(kAnchorAssignValueIndex)); if (ret != SUCCESS) { + REPORT_CALL_ERROR("E19999", + "Op:%s(%s) out index:%d link to op:%s(%s) in index:%u failed", + hccl_out_anchor->GetOwnerNode()->GetName().c_str(), + hccl_out_anchor->GetOwnerNode()->GetType().c_str(), hccl_out_anchor->GetIdx(), + assign_node->GetName().c_str(), assign_node->GetType().c_str(), + kAnchorAssignValueIndex); GELOGE(INTERNAL_ERROR, "The op %s link anchor %s fail.", hccl_out_anchor->GetOwnerNode()->GetName().c_str(), assign_node->GetName().c_str()); return FAILED; @@ -314,6 +356,12 @@ Status HcclContinuousMemcpyPass::InsertAssignAfterBroadcastIfNeed(const ComputeG ret = var_out_anchor->LinkTo(assign_node->GetInDataAnchor(kAnchorAssignRefIndex)); if (ret != SUCCESS) { + REPORT_CALL_ERROR("E19999", + "Op:%s(%s) out index:%d link to op:%s(%s) in index:%u failed", + var_out_anchor->GetOwnerNode()->GetName().c_str(), + var_out_anchor->GetOwnerNode()->GetType().c_str(), var_out_anchor->GetIdx(), + assign_node->GetName().c_str(), assign_node->GetType().c_str(), + kAnchorAssignRefIndex); GELOGE(INTERNAL_ERROR, "The op %s link anchor %s fail.", var_out_anchor->GetOwnerNode()->GetName().c_str(), assign_node->GetName().c_str()); return FAILED; @@ -328,7 +376,12 @@ Status HcclContinuousMemcpyPass::InsertAssignAfterBroadcastIfNeed(const ComputeG continue; } ret = assign_out_control_anchor->LinkTo(in_data_anchor->GetOwnerNode()->GetInControlAnchor()); - if (ret != SUCCESS) { + if (ret != SUCCESS) { + REPORT_CALL_ERROR("E19999", "Op:%s(%s) link control to op:%s(%s) failed", + assign_out_control_anchor->GetOwnerNode()->GetName().c_str(), + assign_out_control_anchor->GetOwnerNode()->GetType().c_str(), + in_data_anchor->GetOwnerNode()->GetName().c_str(), + in_data_anchor->GetOwnerNode()->GetType().c_str()); GELOGE(INTERNAL_ERROR, "The op %s link control anchor %s fail.", assign_out_control_anchor->GetOwnerNode()->GetName().c_str(), in_data_anchor->GetOwnerNode()->GetName().c_str()); @@ -342,6 +395,11 @@ Status HcclContinuousMemcpyPass::InsertAssignAfterBroadcastIfNeed(const ComputeG } ret = assign_out_control_anchor->LinkTo(in_control_anchor); if (ret != SUCCESS) { + REPORT_CALL_ERROR("E19999", "Op:%s(%s) link control to op:%s(%s) failed", + assign_out_control_anchor->GetOwnerNode()->GetName().c_str(), + assign_out_control_anchor->GetOwnerNode()->GetType().c_str(), + in_control_anchor->GetOwnerNode()->GetName().c_str(), + in_control_anchor->GetOwnerNode()->GetType().c_str()); GELOGE(INTERNAL_ERROR, "The op %s link control anchor %s fail.", assign_out_control_anchor->GetOwnerNode()->GetName().c_str(), in_control_anchor->GetOwnerNode()->GetName().c_str()); @@ -363,6 +421,7 @@ NodePtr HcclContinuousMemcpyPass::CreateAssignNode(const ComputeGraphPtr &graph, NodePtr pre_node = out_data_anchor->GetOwnerNode(); OpDescPtr pre_op_desc = pre_node->GetOpDesc(); if (pre_op_desc == nullptr) { + REPORT_INNER_ERROR("E19999", "OpDesc in node is nullptr, check invalid"); GELOGE(INTERNAL_ERROR, "OpDesc of pre node is invalid."); return nullptr; } @@ -371,36 +430,48 @@ NodePtr HcclContinuousMemcpyPass::CreateAssignNode(const ComputeGraphPtr &graph, node_name = CheckDuplicateName(node_name); OpDescPtr op_desc = MakeShared(node_name.c_str(), ASSIGN); if (op_desc == nullptr) { + REPORT_CALL_ERROR("E19999", "New OpDesc failed"); GELOGE(INTERNAL_ERROR, "Create Assign op: MakeShared op_desc fail."); return nullptr; } GELOGI("Create Assign op:%s.", op_desc->GetName().c_str()); if (!AttrUtils::SetBool(op_desc, ATTR_NEED_COMPILE, true)) { + REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed", + ATTR_NEED_COMPILE.c_str(), + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(INTERNAL_ERROR, "Set ATTR_NEED_COMPILE Attr for node:%s fail.", op_desc->GetName().c_str()); return nullptr; } graphStatus ret = op_desc->AddInputDesc("ref", pre_op_desc->GetOutputDesc(out_data_anchor->GetIdx())); if (ret != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "Add input desc to op:%s(%s) failed, name:ref", + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(INTERNAL_ERROR, "Create Assign op: add ref input desc fail."); return nullptr; } ret = op_desc->AddInputDesc("value", pre_op_desc->GetOutputDesc(out_data_anchor->GetIdx())); if (ret != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "Add input desc to op:%s(%s) failed, name:value", + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(INTERNAL_ERROR, "Create Assign op: add value input desc fail."); return nullptr; } ret = op_desc->AddOutputDesc("ref", pre_op_desc->GetOutputDesc(out_data_anchor->GetIdx())); if (ret != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "Add output desc to op:%s(%s) failed, name:ref", + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(INTERNAL_ERROR, "Create Assign op: add output desc fail."); return nullptr; } NodePtr assign_node = graph->AddNode(op_desc); if (assign_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, "Insert Identity node fail."); return nullptr; } diff --git a/ge/graph/passes/hccl_memcpy_pass.cc b/ge/graph/passes/hccl_memcpy_pass.cc index 537920b7..2d2f8220 100755 --- a/ge/graph/passes/hccl_memcpy_pass.cc +++ b/ge/graph/passes/hccl_memcpy_pass.cc @@ -38,6 +38,8 @@ Status HcclMemcpyPass::Run(ge::ComputeGraphPtr graph) { for (const auto &node : graph->GetDirectNode()) { auto op_desc = node->GetOpDesc(); if (op_desc == nullptr) { + REPORT_INNER_ERROR("E19999", "Node with nullptr op_desc exist in Param graph:%s, check invalid", + graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "node has no op_desc, node_name : %s.", node->GetName().c_str()); return INTERNAL_ERROR; } @@ -64,6 +66,8 @@ Status HcclMemcpyPass::MutableInputProcess(const ComputeGraphPtr &graph, const N } if (!AttrUtils::GetBool(op_desc, kInputMutable, node_input_mutable)) { + REPORT_CALL_ERROR("E19999", "Get Attr:%s from op:%s(%s) failed", kInputMutable, + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(INTERNAL_ERROR, "node:%s get attr:_input_mutable failed.", node->GetName().c_str()); return FAILED; } @@ -116,6 +120,7 @@ NodePtr HcclMemcpyPass::CreateIdentityNode(const ComputeGraphPtr &graph, const O NodePtr pre_node = out_data_anchor->GetOwnerNode(); OpDescPtr pre_op_desc = pre_node->GetOpDesc(); if (pre_op_desc == nullptr) { + REPORT_INNER_ERROR("E19999", "OpDesc in node is nullptr, check invalid"); GELOGE(INTERNAL_ERROR, "OpDesc of pre node is invalid."); return nullptr; } @@ -124,6 +129,7 @@ NodePtr HcclMemcpyPass::CreateIdentityNode(const ComputeGraphPtr &graph, const O node_name = CheckDuplicateName(node_name); OpDescPtr op_desc = MakeShared(node_name.c_str(), IDENTITY); if (op_desc == nullptr) { + REPORT_CALL_ERROR("E19999", "New OpDesc failed"); GELOGE(INTERNAL_ERROR, "Create Identity op: MakeShared op_desc fail."); return nullptr; } @@ -131,12 +137,16 @@ NodePtr HcclMemcpyPass::CreateIdentityNode(const ComputeGraphPtr &graph, const O graphStatus ret = op_desc->AddInputDesc("x", pre_op_desc->GetOutputDesc(out_data_anchor->GetIdx())); if (ret != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "Add input desc to op:%s(%s) failed, name:x", + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(INTERNAL_ERROR, "Create Identity op: add input desc fail."); return nullptr; } ret = op_desc->AddOutputDesc("y", pre_op_desc->GetOutputDesc(out_data_anchor->GetIdx())); if (ret != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "Add output desc to op:%s(%s) failed, name:y", + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(INTERNAL_ERROR, "Create Identity op: add output desc fail."); return nullptr; } @@ -145,6 +155,8 @@ NodePtr HcclMemcpyPass::CreateIdentityNode(const ComputeGraphPtr &graph, const O NodePtr memcpy_node = graph->AddNode(op_desc); if (memcpy_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, "Insert Identity node fail."); return nullptr; } @@ -215,6 +227,12 @@ Status HcclMemcpyPass::InsertIdentityBeforeHccl(const ComputeGraphPtr &graph, co Status ret1 = src_out_anchor->Unlink(hccl_in_anchor); if (ret1 != SUCCESS) { + REPORT_CALL_ERROR("E19999", + "Op:%s(%s) out index:%d unlink from op:%s(%s) in index:%d failed", + src_out_anchor->GetOwnerNode()->GetName().c_str(), + src_out_anchor->GetOwnerNode()->GetType().c_str(), src_out_anchor->GetIdx(), + hccl_in_anchor->GetOwnerNode()->GetName().c_str(), + hccl_in_anchor->GetOwnerNode()->GetType().c_str(), hccl_in_anchor->GetIdx()); GELOGE(INTERNAL_ERROR, "The op %s Unlink anchor %s fail.", src_out_anchor->GetOwnerNode()->GetName().c_str(), hccl_in_anchor->GetOwnerNode()->GetName().c_str()); return FAILED; @@ -223,6 +241,13 @@ Status HcclMemcpyPass::InsertIdentityBeforeHccl(const ComputeGraphPtr &graph, co GE_CHECK_NOTNULL(out_data_anchor_0); ret1 = out_data_anchor_0->LinkTo(hccl_in_anchor); if (ret1 != SUCCESS) { + REPORT_CALL_ERROR("E19999", + "Op:%s(%s) out index:%d link to op:%s(%s) in index:%d failed", + out_data_anchor_0->GetOwnerNode()->GetName().c_str(), + out_data_anchor_0->GetOwnerNode()->GetType().c_str(), out_data_anchor_0->GetIdx(), + hccl_in_anchor->GetOwnerNode()->GetName().c_str(), + hccl_in_anchor->GetOwnerNode()->GetType().c_str(), + hccl_in_anchor->GetIdx()); GELOGE(INTERNAL_ERROR, "The op %s link anchor %s fail.", memcpy_node->GetName().c_str(), hccl_in_anchor->GetOwnerNode()->GetName().c_str()); return FAILED; @@ -230,6 +255,12 @@ Status HcclMemcpyPass::InsertIdentityBeforeHccl(const ComputeGraphPtr &graph, co Status ret = src_out_anchor->LinkTo(memcpy_node->GetInDataAnchor(kAnchorNum)); if (ret != SUCCESS) { + REPORT_CALL_ERROR("E19999", + "Op:%s(%s) out index:%d link to op:%s(%s) in index:%u failed", + src_out_anchor->GetOwnerNode()->GetName().c_str(), + src_out_anchor->GetOwnerNode()->GetType().c_str(), src_out_anchor->GetIdx(), + memcpy_node->GetName().c_str(), memcpy_node->GetType().c_str(), + kAnchorNum); GELOGE(INTERNAL_ERROR, "The op %s link anchor %s fail.", src_out_anchor->GetOwnerNode()->GetName().c_str(), memcpy_node->GetName().c_str()); return FAILED; @@ -275,6 +306,12 @@ Status HcclMemcpyPass::InsertAssignAfterBroadcastIfNeed(const ComputeGraphPtr &g Status ret = hccl_out_anchor->LinkTo(assign_node->GetInDataAnchor(kAnchorAssignValueIndex)); if (ret != SUCCESS) { + REPORT_CALL_ERROR("E19999", + "Op:%s(%s) out index:%d link to op:%s(%s) in index:%u failed", + hccl_out_anchor->GetOwnerNode()->GetName().c_str(), + hccl_out_anchor->GetOwnerNode()->GetType().c_str(), hccl_out_anchor->GetIdx(), + assign_node->GetName().c_str(), assign_node->GetType().c_str(), + kAnchorAssignValueIndex); GELOGE(INTERNAL_ERROR, "The op %s link anchor %s fail.", hccl_out_anchor->GetOwnerNode()->GetName().c_str(), assign_node->GetName().c_str()); return FAILED; @@ -282,6 +319,12 @@ Status HcclMemcpyPass::InsertAssignAfterBroadcastIfNeed(const ComputeGraphPtr &g ret = var_out_anchor->LinkTo(assign_node->GetInDataAnchor(kAnchorAssignRefIndex)); if (ret != SUCCESS) { + REPORT_CALL_ERROR("E19999", + "Op:%s(%s) out index:%d link to op:%s(%s) in index:%u failed", + var_out_anchor->GetOwnerNode()->GetName().c_str(), + var_out_anchor->GetOwnerNode()->GetType().c_str(), var_out_anchor->GetIdx(), + assign_node->GetName().c_str(), assign_node->GetType().c_str(), + kAnchorAssignRefIndex); GELOGE(INTERNAL_ERROR, "The op %s link anchor %s fail.", var_out_anchor->GetOwnerNode()->GetName().c_str(), assign_node->GetName().c_str()); return FAILED; @@ -296,7 +339,14 @@ Status HcclMemcpyPass::InsertAssignAfterBroadcastIfNeed(const ComputeGraphPtr &g continue; } ret = assign_out_control_anchor->LinkTo(in_data_anchor->GetOwnerNode()->GetInControlAnchor()); - if (ret != SUCCESS) { + if (ret != SUCCESS) { + REPORT_CALL_ERROR("E19999", + "Op:%s(%s) out index:%d link to op:%s(%s) in index:%d failed", + assign_out_control_anchor->GetOwnerNode()->GetName().c_str(), + assign_out_control_anchor->GetOwnerNode()->GetType().c_str(), assign_out_control_anchor->GetIdx(), + in_data_anchor->GetOwnerNode()->GetName().c_str(), + in_data_anchor->GetOwnerNode()->GetType().c_str(), + in_data_anchor->GetIdx()); GELOGE(INTERNAL_ERROR, "The op %s link control anchor %s fail.", assign_out_control_anchor->GetOwnerNode()->GetName().c_str(), in_data_anchor->GetOwnerNode()->GetName().c_str()); @@ -310,6 +360,11 @@ Status HcclMemcpyPass::InsertAssignAfterBroadcastIfNeed(const ComputeGraphPtr &g } ret = assign_out_control_anchor->LinkTo(in_control_anchor); if (ret != SUCCESS) { + REPORT_CALL_ERROR("E19999", "Op:%s(%s) link control to op:%s(%s) failed", + assign_out_control_anchor->GetOwnerNode()->GetName().c_str(), + assign_out_control_anchor->GetOwnerNode()->GetType().c_str(), + in_control_anchor->GetOwnerNode()->GetName().c_str(), + in_control_anchor->GetOwnerNode()->GetType().c_str()); GELOGE(INTERNAL_ERROR, "The op %s link control anchor %s fail.", assign_out_control_anchor->GetOwnerNode()->GetName().c_str(), in_control_anchor->GetOwnerNode()->GetName().c_str()); @@ -330,6 +385,7 @@ NodePtr HcclMemcpyPass::CreateAssignNode(const ComputeGraphPtr &graph, const Out NodePtr pre_node = out_data_anchor->GetOwnerNode(); OpDescPtr pre_op_desc = pre_node->GetOpDesc(); if (pre_op_desc == nullptr) { + REPORT_INNER_ERROR("E19999", "OpDesc in node is nullptr, check invalid"); GELOGE(INTERNAL_ERROR, "OpDesc of pre node is invalid."); return nullptr; } @@ -338,6 +394,7 @@ NodePtr HcclMemcpyPass::CreateAssignNode(const ComputeGraphPtr &graph, const Out node_name = CheckDuplicateName(node_name); OpDescPtr op_desc = MakeShared(node_name.c_str(), ASSIGN); if (op_desc == nullptr) { + REPORT_CALL_ERROR("E19999", "New OpDesc failed"); GELOGE(INTERNAL_ERROR, "Create Assign op: MakeShared op_desc fail."); return nullptr; } @@ -345,24 +402,32 @@ NodePtr HcclMemcpyPass::CreateAssignNode(const ComputeGraphPtr &graph, const Out graphStatus ret = op_desc->AddInputDesc("ref", pre_op_desc->GetOutputDesc(out_data_anchor->GetIdx())); if (ret != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "Add input desc to op:%s(%s) failed, name:ref", + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(INTERNAL_ERROR, "Create Assign op: add ref input desc fail."); return nullptr; } ret = op_desc->AddInputDesc("value", pre_op_desc->GetOutputDesc(out_data_anchor->GetIdx())); if (ret != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "Add input desc to op:%s(%s) failed, name:value", + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(INTERNAL_ERROR, "Create Assign op: add value input desc fail."); return nullptr; } ret = op_desc->AddOutputDesc("ref", pre_op_desc->GetOutputDesc(out_data_anchor->GetIdx())); if (ret != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "Add output desc to op:%s(%s) failed, name:ref", + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(INTERNAL_ERROR, "Create Assign op: add output desc fail."); return nullptr; } NodePtr assign_node = graph->AddNode(op_desc); if (assign_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, "Insert Identity node fail."); return nullptr; } diff --git a/ge/graph/passes/identity_pass.cc b/ge/graph/passes/identity_pass.cc index 5a54e391..461b126a 100755 --- a/ge/graph/passes/identity_pass.cc +++ b/ge/graph/passes/identity_pass.cc @@ -99,6 +99,8 @@ Status IdentityPass::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, "Identity pass get original type fail."); return status_ret; } @@ -118,6 +120,9 @@ Status IdentityPass::Run(NodePtr &node) { } size_t n = node->GetOpDesc()->GetOutputsSize(); if (node->GetOpDesc()->GetInputsSize() != n) { + REPORT_CALL_ERROR("E19999", "Num:%zu of input desc node:%s(%s) not equal to it's output desc num:%zu, " + "check invalid", node->GetOpDesc()->GetInputsSize(), + node->GetName().c_str(), node->GetType().c_str(), n); GELOGE(PARAM_INVALID, "Identity input / output size must be equal. in size:%lu, out size:%lu", node->GetOpDesc()->GetInputsSize(), n); return PARAM_INVALID; diff --git a/ge/graph/passes/infershape_pass.cc b/ge/graph/passes/infershape_pass.cc index b9a98f62..728f5512 100755 --- a/ge/graph/passes/infershape_pass.cc +++ b/ge/graph/passes/infershape_pass.cc @@ -22,8 +22,58 @@ #include "framework/common/util.h" #include "graph/shape_refiner.h" #include "graph/utils/graph_utils.h" +#include "utils/tensor_utils.h" +#include "utils/type_utils.h" namespace ge { + +void SerialShapeRange(const GeTensorDescPtr &desc, std::string &desc_str) { + desc_str += "["; + std::vector> shape_range; + (void)desc->GetShapeRange(shape_range); + for (const auto &pair : shape_range) { + desc_str += "{"; + desc_str += std::to_string(pair.first) + "," + std::to_string(pair.second); + desc_str += "},"; + } + desc_str += "]"; + shape_range.clear(); + (void)desc->GetOriginShapeRange(shape_range); + for (const auto &pair : shape_range) { + desc_str += ",{"; + desc_str += std::to_string(pair.first) + "," + std::to_string(pair.second); + desc_str += "},"; + } +} + +std::string GetInTensorInfoWithString(const ge::NodePtr &node) { + ge::OpDescPtr op_desc = node->GetOpDesc(); + std::stringstream ss; + ss << "{"; + int32_t in_idx = 0; + for (const auto &input_desc : op_desc->GetAllInputsDescPtr()) { + if (input_desc == nullptr) { + in_idx++; + continue; + } + if (in_idx > 0) { + ss << " "; + } + ss << "input_" << in_idx << " " << "tensor: ["; + ss << "(shape:[" << input_desc->MutableShape().ToString() << "]),"; + ss << "(format:" << TypeUtils::FormatToSerialString(input_desc->GetFormat()) << "),"; + ss << "(dtype:" << TypeUtils::DataTypeToSerialString(input_desc->GetDataType()) << "),"; + ss << "(origin_shape:" << input_desc->GetOriginShape().ToString() << "),"; + ss << "(origin_format:" << TypeUtils::FormatToSerialString(input_desc->GetOriginFormat()) << "),"; + ss << "(origin_dtype:" << TypeUtils::DataTypeToSerialString(input_desc->GetOriginDataType()) << "),"; + string range_str; + SerialShapeRange(input_desc, range_str); + ss << "(shape_range:" << range_str << ")]"; + in_idx++; + } + return ss.str(); +} + Status InferShapePass::Run(NodePtr &node) { // kOptimizeAfterSubGraph exist means after subgraph auto ret = ShapeRefiner::InferShapeAndType(node, !OptionExists(kOptimizeAfterSubGraph)); @@ -39,6 +89,8 @@ Status InferShapePass::Run(NodePtr &node) { (void)Analyzer::GetInstance()->SaveAnalyzerDataToFile(root_graph->GetSessionID(), root_graph->GetGraphID()); + REPORT_CALL_ERROR("E19999", "Call InferShapeAndType for node:%s(%s) failed, input_tensor:%s", + node->GetName().c_str(), node->GetType().c_str(), GetInTensorInfoWithString(node).c_str()); GELOGE(GE_GRAPH_INFERSHAPE_FAILED, "infershape failed. node: %s", node->GetName().c_str()); return GE_GRAPH_INFERSHAPE_FAILED; } diff --git a/ge/graph/passes/inplace_support_check_pass.cc b/ge/graph/passes/inplace_support_check_pass.cc index 44a0b3ef..9f0d76d0 100644 --- a/ge/graph/passes/inplace_support_check_pass.cc +++ b/ge/graph/passes/inplace_support_check_pass.cc @@ -69,6 +69,9 @@ Status InplaceSupportCheckPass::Run(NodePtr &node) { GELOGD("add attr INPLACE_SUPPORT_INPUT_INDEX on node %s, input_idx=%d", node->GetName().c_str(), inplace_input_idx); if (!AttrUtils::SetInt(node->GetOpDesc()->MutableOutputDesc(kInplaceSupportOutputIndex), INPLACE_SUPPORT_INPUT_INDEX, inplace_input_idx)) { + REPORT_CALL_ERROR("E19999", "Set Attr:%s to output:%u tensor of op:%s(%s) failed", + INPLACE_SUPPORT_INPUT_INDEX.c_str(), kInplaceSupportOutputIndex, + node->GetName().c_str(), node->GetType().c_str()); GELOGE(FAILED, "Set attr INPLACE_SUPPORT_INPUT_INDEX on node %s failed.", node->GetName().c_str()); return FAILED; } diff --git a/ge/graph/passes/input_output_connection_identify_pass.cc b/ge/graph/passes/input_output_connection_identify_pass.cc index 0d198dfb..6e2b3049 100644 --- a/ge/graph/passes/input_output_connection_identify_pass.cc +++ b/ge/graph/passes/input_output_connection_identify_pass.cc @@ -42,11 +42,14 @@ inline bool IsDataOp(const std::string &node_type) { Status InputOutputConnectionIdentifyPass::Run(ComputeGraphPtr graph) { if (graph == nullptr) { + REPORT_INNER_ERROR("E19999", "Param graph is nullptr, check invalid"); GELOGE(PARAM_INVALID, "Input param graph is null, skip identification of nodes that connect to input and output."); return PARAM_INVALID; } if (graph->GetParentGraph() != nullptr) { + REPORT_INNER_ERROR("E19999", "Param graph's parent graph is nullptr, " + "check invalid"); GELOGD("Current graph %s is a subgraph, skip identification of nodes that connect to input and output.", graph->GetName().c_str()); return SUCCESS; @@ -54,11 +57,15 @@ Status InputOutputConnectionIdentifyPass::Run(ComputeGraphPtr graph) { GELOGD("Start to identify nodes that connect to input and output."); if (graph->TopologicalSorting() != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "Topological Sorting graph:%s failed", + graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "Graph topological sort failed."); return INTERNAL_ERROR; } if (GraphUtils::GetRefMapping(graph, symbol_to_anchors_, anchor_to_symbol_) != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "Get ref mapping from graph:%s failed", + graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "Get ref-mapping for graph %s failed.", graph->GetName().c_str()); return INTERNAL_ERROR; } @@ -125,6 +132,8 @@ Status InputOutputConnectionIdentifyPass::UpdateNodeIdxMap(const string &symbol_ map> &connect_output_node_idx) { auto symbol_iter = symbol_to_anchors_.find(symbol_string); if (symbol_iter == symbol_to_anchors_.end()) { + REPORT_CALL_ERROR("E19999", "Can't find symbol:%s in symbol_to_anchors map, check invalid", + symbol_string.c_str()); GELOGE(PARAM_INVALID, "Input param symbol string: %s is invalid.", symbol_string.c_str()); return PARAM_INVALID; } @@ -171,6 +180,9 @@ Status InputOutputConnectionIdentifyPass::SetNodeAttrOfConnectingInputOutput( GE_CHECK_NOTNULL(iter.first); if (iter.first->GetOpDesc() != nullptr) { if (!AttrUtils::SetListInt(iter.first->GetOpDesc(), ATTR_NAME_NODE_CONNECT_INPUT, iter.second)) { + REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed", + ATTR_NAME_NODE_CONNECT_INPUT.c_str(), + iter.first->GetName().c_str(), iter.first->GetType().c_str()); GELOGE(INTERNAL_ERROR, "Failed to set attr %s for node %s.", ATTR_NAME_NODE_CONNECT_INPUT.c_str(), iter.first->GetName().c_str()); return INTERNAL_ERROR; @@ -182,6 +194,9 @@ Status InputOutputConnectionIdentifyPass::SetNodeAttrOfConnectingInputOutput( GE_CHECK_NOTNULL(iter.first); if (iter.first->GetOpDesc() != nullptr) { if (!AttrUtils::SetListInt(iter.first->GetOpDesc(), ATTR_NAME_NODE_CONNECT_OUTPUT, iter.second)) { + REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed", + ATTR_NAME_NODE_CONNECT_OUTPUT.c_str(), + iter.first->GetName().c_str(), iter.first->GetType().c_str()); GELOGE(INTERNAL_ERROR, "Failed to set attr %s for node %s.", ATTR_NAME_NODE_CONNECT_OUTPUT.c_str(), iter.first->GetName().c_str()); return INTERNAL_ERROR; diff --git a/ge/graph/passes/iterator_op_pass.cc b/ge/graph/passes/iterator_op_pass.cc index 1ec2bba9..d0cb434b 100644 --- a/ge/graph/passes/iterator_op_pass.cc +++ b/ge/graph/passes/iterator_op_pass.cc @@ -55,20 +55,36 @@ Status IteratorOpPass::Run(ge::ComputeGraphPtr graph) { if (type == "IteratorV2" || type == "Iterator" || op_type == kGetNext) { ge::NodePtr memcpy_async_node = InsertMemcpyAsyncNode(node, graph); GE_CHECK_NOTNULL(memcpy_async_node); - GE_CHK_STATUS_RET(SetCycleEvent(memcpy_async_node), "Set cycle event fail, node:%s", - memcpy_async_node->GetName().c_str()); + auto status = SetCycleEvent(memcpy_async_node); + if (status != ge::SUCCESS) { + REPORT_CALL_ERROR("E19999", "Set cycle event to op:%s(%s) failed", + memcpy_async_node->GetName().c_str(), memcpy_async_node->GetType().c_str()); + GELOGE(status, "Set cycle event failed."); + return status; + } - GE_CHK_STATUS_RET(SetStreamLabel(memcpy_async_node, memcpy_async_node->GetName()), - "Set stream label fail, node:%s", node->GetName().c_str()); + status = SetStreamLabel(memcpy_async_node, memcpy_async_node->GetName()); + if (status != ge::SUCCESS) { + REPORT_CALL_ERROR("E19999", "Set stream label:%s to op:%s(%s) failed", + memcpy_async_node->GetName().c_str(), memcpy_async_node->GetName().c_str(), + memcpy_async_node->GetType().c_str()); + GELOGE(status, "set stream label failed."); + return status; + } - GE_CHK_STATUS_RET(SetStreamLabel(node, node->GetName()), "Set stream label fail, node:%s", - node->GetName().c_str()); + status = SetStreamLabel(node, node->GetName()); + if (status != ge::SUCCESS) { + REPORT_CALL_ERROR("E19999", "Set stream label:%s to op:%s(%s) failed", + node->GetName().c_str(), node->GetName().c_str(), node->GetType().c_str()); + GELOGE(status, "set stream label failed."); + return status; + } GELOGI("Set independent loop for iterator node success"); int64_t loop_per_iter = 0; ge::GeTensorDesc ge_tensor_desc; - Status status = VarManager::Instance(graph->GetSessionID())->GetCurVarDesc(NODE_NAME_FLOWCTRL_LOOP_PER_ITER, + status = VarManager::Instance(graph->GetSessionID())->GetCurVarDesc(NODE_NAME_FLOWCTRL_LOOP_PER_ITER, ge_tensor_desc); GE_IF_BOOL_EXEC(status != SUCCESS, GELOGW("Fail to Get var_desc of NODE_NAME_FLOWCTRL_LOOP_PER_ITER failed."); continue); @@ -92,8 +108,14 @@ Status IteratorOpPass::Run(ge::ComputeGraphPtr graph) { if (loop_per_iter == kMaxIterationsPerLoop) { ge::NodePtr end_of_sequence_node = InsertEndOfSequenceNode(node, memcpy_async_node, graph); GE_CHECK_NOTNULL(end_of_sequence_node); - GE_CHK_STATUS_RET(SetStreamLabel(end_of_sequence_node, end_of_sequence_node->GetName()), - "Set stream label fail, node:%s", node->GetName().c_str()); + status = SetStreamLabel(end_of_sequence_node, end_of_sequence_node->GetName()); + if (status != ge::SUCCESS) { + REPORT_CALL_ERROR("E19999", "Set stream label:%s to op:%s(%s) failed", + end_of_sequence_node->GetName().c_str(), end_of_sequence_node->GetName().c_str(), + end_of_sequence_node->GetType().c_str()); + GELOGE(status, "set stream label failed."); + return status; + } GELOGI("Insert EndOfSequence node success."); } } @@ -110,8 +132,13 @@ Status IteratorOpPass::GetVariableValue(uint64_t session_id, const ge::GeTensorD GE_CHECK_NOTNULL(var_mem_base); // offset + logic_base uint8_t *dev_ptr = nullptr; - GE_CHK_STATUS_RET(VarManager::Instance(session_id)->GetVarAddr(var_name, tensor_desc, &dev_ptr), - "Get variable %s address failed.", var_name.c_str()); + auto status = VarManager::Instance(session_id)->GetVarAddr(var_name, tensor_desc, &dev_ptr); + if (status != ge::SUCCESS) { + REPORT_CALL_ERROR("E19999", "Get Var add by name:%s failed, session_id:%lu", + var_name.c_str(), session_id); + GELOGE(status, "Get variable %s address failed.", var_name.c_str()); + return status; + } int64_t offset = static_cast(reinterpret_cast(dev_ptr)); // logic_base_addr auto logic_var_base = VarManager::Instance(session_id)->GetVarMemLogicBase(); @@ -144,7 +171,11 @@ ge::NodePtr IteratorOpPass::InsertEndOfSequenceNode(const ge::NodePtr &pre_node, auto out_anchor = pre_node->GetOutDataAnchor(0); ge::graphStatus status; status = GraphUtils::AddEdge(out_anchor, end_of_seq_node->GetInDataAnchor(0)); - GE_CHK_BOOL_EXEC(status == GRAPH_SUCCESS, return nullptr, + GE_CHK_BOOL_EXEC(status == GRAPH_SUCCESS, + REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(index:0) and op:%s(%s)(index:0) failed", + pre_node->GetName().c_str(), pre_node->GetType().c_str(), + end_of_seq_node->GetName().c_str(), end_of_seq_node->GetType().c_str()); + return nullptr, "Graph add EndOfSequence op input edge fail, dst node: %s.", end_of_seq_node->GetName().c_str()); // EOS(control) --> subsequent of memcpy @@ -157,7 +188,11 @@ ge::NodePtr IteratorOpPass::InsertEndOfSequenceNode(const ge::NodePtr &pre_node, continue; } status = GraphUtils::AddEdge(out_ctrl_anchor, in_ctrl_anchor); - GE_CHK_BOOL_EXEC(status == GRAPH_SUCCESS, return nullptr, + GE_CHK_BOOL_EXEC(status == GRAPH_SUCCESS, + REPORT_CALL_ERROR("E19999", "Add control edge between op:%s(%s) and op:%s(%s) failed", + end_of_seq_node->GetName().c_str(), end_of_seq_node->GetType().c_str(), + out_node->GetName().c_str(), out_node->GetType().c_str()); + return nullptr, "Graph add EndOfSequence op out ctrl edge fail, dst node: %s.", out_node->GetName().c_str()); GELOGI("Graph add EndOfSequence op out ctrl edge, dst node: %s.", @@ -175,19 +210,27 @@ ge::NodePtr IteratorOpPass::InsertEndOfSequenceNode(const ge::NodePtr &pre_node, /// ge::OpDescPtr IteratorOpPass::CreateEndOfSequenceOp(const ge::NodePtr &pre_node) { GELOGI("Start to create endOfSequence op."); - GE_CHK_BOOL_EXEC(pre_node != nullptr, return nullptr, "Input param invalid."); + GE_CHK_BOOL_EXEC(pre_node != nullptr, + REPORT_INNER_ERROR("E19999", "Param pre_node is nullptr, check invalid"); + return nullptr, "Input param invalid."); string node_name = pre_node->GetName() + "_EndOfSequence"; ge::OpDescPtr op_desc = MakeShared(node_name, ENDOFSEQUENCE); if (op_desc == nullptr) { + REPORT_CALL_ERROR("E19999", "New OpDesc failed"); GELOGE(FAILED, "MakeShared fail."); return op_desc; } ge::OpDescPtr pre_node_op_desc = pre_node->GetOpDesc(); - GE_CHK_BOOL_EXEC(pre_node_op_desc != nullptr, return nullptr, "OpDesc of pre_node is invalid."); + GE_CHK_BOOL_EXEC(pre_node_op_desc != nullptr, + REPORT_INNER_ERROR("E19999", "OpDesc in node is nullptr, check invalid"); + return nullptr, "OpDesc of pre_node is invalid."); GELOGI("Create EndOfSequence op:%s.", op_desc->GetName().c_str()); - GE_CHK_BOOL_EXEC(op_desc->AddInputDesc(pre_node_op_desc->GetOutputDesc(0)) == GRAPH_SUCCESS, return nullptr, + GE_CHK_BOOL_EXEC(op_desc->AddInputDesc(pre_node_op_desc->GetOutputDesc(0)) == GRAPH_SUCCESS, + REPORT_CALL_ERROR("E19999", "Add input desc to op:%s(%s) failed", + op_desc->GetName().c_str(), op_desc->GetType().c_str()); + return nullptr, "Create EndOfSequence op:add input desc fail."); return op_desc; } @@ -205,7 +248,11 @@ ge::NodePtr IteratorOpPass::InsertMemcpyAsyncNode(const ge::NodePtr &pre_node, c ge::OpDescPtr memcpy_async_op_desc = CreateMemcpyAsyncOp(pre_node); GE_CHK_BOOL_EXEC(memcpy_async_op_desc != nullptr, GELOGW("Create memcpyAsync op fail."); return nullptr); ge::NodePtr memcpy_async_node = graph->AddNode(memcpy_async_op_desc); - GE_CHK_BOOL_EXEC(memcpy_async_node != nullptr, return nullptr, "Insert mencpy node fail."); + GE_CHK_BOOL_EXEC(memcpy_async_node != nullptr, + REPORT_CALL_ERROR("E19999", "Add node:%s(%s) to graph:%s failed", + memcpy_async_op_desc->GetName().c_str(), memcpy_async_op_desc->GetType().c_str(), + graph->GetName().c_str()); + return nullptr, "Insert mencpy node fail."); // Data out for (auto &out_anchor : pre_node->GetAllOutDataAnchors()) { @@ -217,9 +264,24 @@ ge::NodePtr IteratorOpPass::InsertMemcpyAsyncNode(const ge::NodePtr &pre_node, c for (auto &peer_in_anchor : out_anchor->GetPeerInDataAnchors()) { GE_IF_BOOL_EXEC(peer_in_anchor == nullptr, GELOGW("peer_in_anchor is nullptr"); return nullptr); status = GraphUtils::RemoveEdge(out_anchor, peer_in_anchor); - GE_CHK_BOOL_EXEC(status == GRAPH_SUCCESS, return nullptr, "Remove edge failed, index:%d.", out_anchor->GetIdx()); + GE_CHK_BOOL_EXEC(status == GRAPH_SUCCESS, + REPORT_CALL_ERROR( + "E19999", "Remove edge between op:%s(%s)(index:%d) and op:%s(%s)(index:%d) failed", + pre_node->GetName().c_str(), pre_node->GetType().c_str(), out_anchor->GetIdx(), + peer_in_anchor->GetOwnerNode()->GetName().c_str(), + peer_in_anchor->GetOwnerNode()->GetType().c_str(), + peer_in_anchor->GetIdx()); + return nullptr, "Remove edge failed, index:%d.", out_anchor->GetIdx()); status = GraphUtils::AddEdge(memcpy_async_node->GetOutDataAnchor(out_anchor->GetIdx()), peer_in_anchor); - GE_CHK_BOOL_EXEC(status == GRAPH_SUCCESS, return nullptr, + GE_CHK_BOOL_EXEC(status == GRAPH_SUCCESS, + REPORT_CALL_ERROR( + "E19999", "Add edge between op:%s(%s)(index:%d) and op:%s(%s)(index:%d) failed", + memcpy_async_node->GetName().c_str(), memcpy_async_node->GetType().c_str(), + out_anchor->GetIdx(), + peer_in_anchor->GetOwnerNode()->GetName().c_str(), + peer_in_anchor->GetOwnerNode()->GetType().c_str(), + peer_in_anchor->GetIdx()); + return nullptr, "Graph add memcpyAsync op out edge fail, src index:%d, dst index:%d, dst node: %s.", out_anchor->GetIdx(), peer_in_anchor->GetIdx(), peer_in_anchor->GetOwnerNode()->GetName().c_str()); @@ -227,7 +289,13 @@ ge::NodePtr IteratorOpPass::InsertMemcpyAsyncNode(const ge::NodePtr &pre_node, c peer_in_anchor->GetIdx(), peer_in_anchor->GetOwnerNode()->GetName().c_str()); } status = GraphUtils::AddEdge(out_anchor, memcpy_async_node->GetInDataAnchor(out_anchor->GetIdx())); - GE_CHK_BOOL_EXEC(status == GRAPH_SUCCESS, return nullptr, "Graph add memcpyAsync op in edge fail, index:%d.", + GE_CHK_BOOL_EXEC(status == GRAPH_SUCCESS, + REPORT_CALL_ERROR( + "E19999", "Add edge between op:%s(%s)(index:%d) and op:%s(%s)(index:%d) failed", + pre_node->GetName().c_str(), pre_node->GetType().c_str(), out_anchor->GetIdx(), + memcpy_async_node->GetName().c_str(), memcpy_async_node->GetType().c_str(), + out_anchor->GetIdx()); + return nullptr, "Graph add memcpyAsync op in edge fail, index:%d.", out_anchor->GetIdx()); } // Control out @@ -235,10 +303,22 @@ ge::NodePtr IteratorOpPass::InsertMemcpyAsyncNode(const ge::NodePtr &pre_node, c GE_IF_BOOL_EXEC(out_ctrl_anchor != nullptr, for (auto &peer_in_ctrl_anchor : out_ctrl_anchor->GetPeerInControlAnchors()) { ge::graphStatus status = GraphUtils::RemoveEdge(out_ctrl_anchor, peer_in_ctrl_anchor); - GE_CHK_BOOL_EXEC(status == GRAPH_SUCCESS, return nullptr, "Remove edge failed, dst node: %s.", + GE_CHK_BOOL_EXEC(status == GRAPH_SUCCESS, + REPORT_CALL_ERROR( + "E19999", "Remove control edge between op:%s(%s) and op:%s(%s) failed", + pre_node->GetName().c_str(), pre_node->GetType().c_str(), + peer_in_ctrl_anchor->GetOwnerNode()->GetName().c_str(), + peer_in_ctrl_anchor->GetOwnerNode()->GetType().c_str()); + return nullptr, "Remove edge failed, dst node: %s.", peer_in_ctrl_anchor->GetOwnerNode()->GetName().c_str()); status = GraphUtils::AddEdge(memcpy_async_node->GetOutControlAnchor(), peer_in_ctrl_anchor); - GE_CHK_BOOL_EXEC(status == GRAPH_SUCCESS, return nullptr, + GE_CHK_BOOL_EXEC(status == GRAPH_SUCCESS, + REPORT_CALL_ERROR( + "E19999", "Add control edge between op:%s(%s) and op:%s(%s) failed", + memcpy_async_node->GetName().c_str(), memcpy_async_node->GetType().c_str(), + peer_in_ctrl_anchor->GetOwnerNode()->GetName().c_str(), + peer_in_ctrl_anchor->GetOwnerNode()->GetType().c_str()); + return nullptr, "Graph add memcpyAsync op out ctrl edge fail, dst node: %s.", peer_in_ctrl_anchor->GetOwnerNode()->GetName().c_str()); GELOGI("Graph add memcpyAsync op out ctrl edge, dst node: %s.", @@ -261,20 +341,29 @@ ge::OpDescPtr IteratorOpPass::CreateMemcpyAsyncOp(const ge::NodePtr &pre_node) { string node_name = pre_node->GetName() + "_MemcpyAsync"; ge::OpDescPtr op_desc = MakeShared(node_name.c_str(), MEMCPYASYNC); if (op_desc == nullptr) { + REPORT_CALL_ERROR("E19999", "New OpDesc failed"); GELOGE(FAILED, "MakeShared fail."); return op_desc; } GELOGI("Create memcpyAsync op:%s.", op_desc->GetName().c_str()); ge::OpDescPtr pre_node_op_desc = pre_node->GetOpDesc(); - GE_CHK_BOOL_EXEC(pre_node_op_desc != nullptr, return nullptr, "OpDesc of pre_node is invalid."); + GE_CHK_BOOL_EXEC(pre_node_op_desc != nullptr, + REPORT_INNER_ERROR("E19999", "OpDesc in node is nullptr, check invalid"); + return nullptr, "OpDesc of pre_node is invalid."); size_t out_size = pre_node_op_desc->GetOutputsSize(); GELOGI("Create memcpyAsync op, pre_node out_size: %zu.", out_size); for (size_t i = 0; i < out_size; i++) { - GE_CHK_BOOL_EXEC(op_desc->AddInputDesc(pre_node_op_desc->GetOutputDesc(i)) == GRAPH_SUCCESS, return nullptr, + GE_CHK_BOOL_EXEC(op_desc->AddInputDesc(pre_node_op_desc->GetOutputDesc(i)) == GRAPH_SUCCESS, + REPORT_CALL_ERROR("E19999", "Add input desc to op:%s(%s) failed", + pre_node_op_desc->GetName().c_str(), pre_node_op_desc->GetType().c_str()); + return nullptr, "Create memcpyAsync op:add input desc fail."); - GE_CHK_BOOL_EXEC(op_desc->AddOutputDesc(pre_node_op_desc->GetOutputDesc(i)) == GRAPH_SUCCESS, return nullptr, + GE_CHK_BOOL_EXEC(op_desc->AddOutputDesc(pre_node_op_desc->GetOutputDesc(i)) == GRAPH_SUCCESS, + REPORT_CALL_ERROR("E19999", "Add output desc to op:%s(%s) failed", + pre_node_op_desc->GetName().c_str(), pre_node_op_desc->GetType().c_str()); + return nullptr, "Create memcpyAsync op:add output desc fail."); } diff --git a/ge/graph/passes/link_gen_mask_nodes_pass.cc b/ge/graph/passes/link_gen_mask_nodes_pass.cc index 5c4df98b..14f5dfc3 100755 --- a/ge/graph/passes/link_gen_mask_nodes_pass.cc +++ b/ge/graph/passes/link_gen_mask_nodes_pass.cc @@ -70,6 +70,9 @@ Status LinkGenMaskNodesPass::Run(ComputeGraphPtr graph) { graphStatus status_link_to = src_anchor->LinkTo(dest_anchor); if (status_link_to != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "Op:%s(%s) link control to op:%s(%s) failed", + src_node->GetName().c_str(), src_node->GetType().c_str(), + dest_node->GetName().c_str(), dest_node->GetType().c_str()); GELOGE(FAILED, "Link from %s to %s failed.", src_node->GetName().c_str(), dest_node->GetName().c_str()); return FAILED; } diff --git a/ge/graph/passes/mark_agnostic_pass.cc b/ge/graph/passes/mark_agnostic_pass.cc index 80b4bd7a..4c489bbe 100644 --- a/ge/graph/passes/mark_agnostic_pass.cc +++ b/ge/graph/passes/mark_agnostic_pass.cc @@ -132,7 +132,13 @@ Status MarkAgnosticPass::SetContinuousAttr(const NodePtr &node, const std::vecto (void)AttrUtils::SetBool(op_desc, ATTR_NAME_REFRESH_CONTINUOUS_FLAG, true); for (auto index : indexes) { auto out = op_desc->MutableOutputDesc(index); - GE_CHECK_NOTNULL(out); + if (out == nullptr) { + REPORT_INNER_ERROR("E19999", "Op:%s(%s) output:%u desc is nullptr, check invalid", + op_desc->GetName().c_str(), op_desc->GetType().c_str(), index); + GELOGE(FAILED, "[Check][Param]Op:%s(%s) output:%u desc is nullptr", + op_desc->GetName().c_str(), op_desc->GetType().c_str(), index); + return FAILED; + } // This attr is for out's dtype and format continuous with it's peer input (void)AttrUtils::SetInt(out, ATTR_NAME_FORMAT_CONTINUOUS, 1); } diff --git a/ge/graph/passes/mark_graph_unknown_status_pass.cc b/ge/graph/passes/mark_graph_unknown_status_pass.cc index ae0919fe..bf69480a 100644 --- a/ge/graph/passes/mark_graph_unknown_status_pass.cc +++ b/ge/graph/passes/mark_graph_unknown_status_pass.cc @@ -28,7 +28,7 @@ Status MarkGraphUnknownStatusPass::Run(ComputeGraphPtr graph) { bool is_unknown_shape = false; bool forced_unknown = false; for (const auto &node : graph->GetDirectNode()) { - GE_CHK_STATUS_RET(ge::NodeUtils::GetNodeUnknownShapeStatus(*node, is_unknown_shape), + GE_CHK_GRAPH_STATUS_RET(ge::NodeUtils::GetNodeUnknownShapeStatus(*node, is_unknown_shape), "Get node[%s] shape status failed!", node->GetName().c_str()); if (is_unknown_shape) { break; diff --git a/ge/graph/passes/memcpy_addr_async_pass.cc b/ge/graph/passes/memcpy_addr_async_pass.cc index 561ab8e3..aff89f35 100755 --- a/ge/graph/passes/memcpy_addr_async_pass.cc +++ b/ge/graph/passes/memcpy_addr_async_pass.cc @@ -41,6 +41,8 @@ Status MemcpyAddrAsyncPass::Run(ComputeGraphPtr graph) { int64_t value = 0; rtError_t rt_ret = rtGetRtCapability(FEATURE_TYPE_MEMCPY, MEMCPY_INFO_SUPPORT_ZEROCOPY, &value); if (rt_ret != RT_ERROR_NONE) { + REPORT_CALL_ERROR("E19999", "Call rtGetRtCapability failed, ret = 0x%X", + rt_ret); GELOGE(RT_FAILED, "rtGetRtCapability failed, error=0x%x.", rt_ret); return RT_FAILED; } @@ -115,6 +117,9 @@ Status MemcpyAddrAsyncPass::AddMemcpyAddrAsyncNode(const ComputeGraphPtr &graph, } else { uint32_t parent_index = 0; if (!AttrUtils::GetInt(in_node->GetOpDesc(), ATTR_NAME_PARENT_NODE_INDEX, parent_index)) { + REPORT_CALL_ERROR("E19999", "Get Attr:%s from op:%s(%s) failed", + ATTR_NAME_PARENT_NODE_INDEX.c_str(), + in_node->GetName().c_str(), in_node->GetType().c_str()); GELOGE(INTERNAL_ERROR, "Failed to get parent index of %s", in_node->GetName().c_str()); return INTERNAL_ERROR; } @@ -177,6 +182,9 @@ void MemcpyAddrAsyncPass::FindUserDataForNonDynamic(const ge::NodePtr &parent_no InDataAnchorPtr in_data_anchor = parent_node->GetInDataAnchor(parent_index); OutDataAnchorPtr out_anchor = in_data_anchor->GetPeerOutAnchor(); GE_IF_BOOL_EXEC(out_anchor == nullptr, + REPORT_INNER_ERROR("E19999", "Index:%u in data node of op:%s(%s) not exist, check invalid", + parent_index, + parent_node->GetName().c_str(), parent_node->GetType().c_str()); GELOGE(INTERNAL_ERROR, "Cannot find out_anchor of %s.", parent_node->GetName().c_str()); return); NodePtr in_node = out_anchor->GetOwnerNode(); @@ -190,6 +198,9 @@ void MemcpyAddrAsyncPass::FindUserDataForNonDynamic(const ge::NodePtr &parent_no in_anchor_for_known_ = in_data_anchor; NodePtr pre_in_node = in_node->GetOwnerComputeGraph()->GetParentNode(); if (!AttrUtils::GetInt(in_node->GetOpDesc(), 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(), + in_node->GetName().c_str(), in_node->GetType().c_str()); GELOGE(INTERNAL_ERROR, "Failed to refresh parent index of %s", in_node->GetName().c_str()); return; } @@ -206,6 +217,9 @@ void MemcpyAddrAsyncPass::FindUserDataForNonDynamic(const ge::NodePtr &parent_no } } else if (in_node->GetType() == IF || in_node->GetType() == WHILE || in_node->GetType() == CASE) { if (!AttrUtils::GetInt(parent_node->GetOpDesc(), ATTR_NAME_PARENT_NODE_INDEX, parent_index)) { + REPORT_CALL_ERROR("E19999", "Get Attr:%s to op:%s(%s) failed", + ATTR_NAME_PARENT_NODE_INDEX.c_str(), + parent_node->GetName().c_str(), parent_node->GetType().c_str()); GELOGE(INTERNAL_ERROR, "Failed to refresh parent index of %s", in_node->GetName().c_str()); return; } @@ -237,7 +251,9 @@ NodePtr MemcpyAddrAsyncPass::CreateMemcpyAddrAsyncNode(const ComputeGraphPtr &gr GELOGD("Start CreateMemcpyAddrAsyncNode."); static uint32_t new_node_index = 0; OpDescPtr pre_op_desc = out_data_anchor->GetOwnerNode()->GetOpDesc(); - GE_CHK_BOOL_EXEC(pre_op_desc != nullptr, return nullptr, "Op_desc of pre node is invalid."); + GE_CHK_BOOL_EXEC(pre_op_desc != nullptr, + REPORT_INNER_ERROR("E19999", "OpDesc in node is nullptr, check invalid"); + return nullptr, "Op_desc of pre node is invalid."); OpDescPtr op_desc = nullptr; if (known_sub_graph_) { // insert memcpyasync node when known sub graph @@ -247,14 +263,20 @@ NodePtr MemcpyAddrAsyncPass::CreateMemcpyAddrAsyncNode(const ComputeGraphPtr &gr string node_name = pre_op_desc->GetName() + "_" + MEMCPYADDRASYNC + "_" + std::to_string(new_node_index++); op_desc = MakeShared(node_name, MEMCPYADDRASYNC); } - GE_CHECK_NOTNULL_EXEC(op_desc, return nullptr); + GE_CHECK_NOTNULL_EXEC(op_desc, + REPORT_CALL_ERROR("E19999", "New OpDesc failed"); + return nullptr); if (op_desc->AddInputDesc(pre_op_desc->GetOutputDesc(out_data_anchor->GetIdx())) != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "Add input desc to op:%s(%s) failed", + pre_op_desc->GetName().c_str(), pre_op_desc->GetType().c_str()); GELOGE(INTERNAL_ERROR, "Add memcpy_addr_async input desc failed."); return nullptr; } if (op_desc->AddOutputDesc(pre_op_desc->GetOutputDesc(out_data_anchor->GetIdx())) != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "Add output desc to op:%s(%s) failed", + pre_op_desc->GetName().c_str(), pre_op_desc->GetType().c_str()); GELOGE(INTERNAL_ERROR, "Add memcpy_addr_async output desc failed."); return nullptr; } @@ -275,11 +297,17 @@ NodePtr MemcpyAddrAsyncPass::CreateMemcpyAddrAsyncNode(const ComputeGraphPtr &gr (void)ge::AttrUtils::GetBool(out_of_user_data->GetOpDesc(), ATTR_NAME_NODE_CONNECT_INPUT, labeled_input); if (labeled_input) { if (!ge::AttrUtils::SetBool(out_of_user_data->GetOpDesc(), ATTR_NAME_NODE_CONNECT_INPUT, false)) { + REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed", + ATTR_NAME_NODE_CONNECT_INPUT.c_str(), + out_of_user_data->GetName().c_str(), out_of_user_data->GetType().c_str()); GELOGE(FAILED, "Failed to unset attr %s for node %s.", ATTR_NAME_NODE_CONNECT_INPUT.c_str(), out_of_user_data->GetName().c_str()); return nullptr; } if (!ge::AttrUtils::SetBool(op_desc, ATTR_NAME_NODE_CONNECT_INPUT, true)) { + REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed", + ATTR_NAME_NODE_CONNECT_INPUT.c_str(), + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(FAILED, "Failed to set attr %s for node %s.", ATTR_NAME_NODE_CONNECT_INPUT.c_str(), op_desc->GetName().c_str()); return nullptr; @@ -287,7 +315,11 @@ NodePtr MemcpyAddrAsyncPass::CreateMemcpyAddrAsyncNode(const ComputeGraphPtr &gr } NodePtr memcpy_addr_async_node = graph->AddNode(op_desc); - GE_CHECK_NOTNULL_EXEC(memcpy_addr_async_node, return nullptr); + GE_CHECK_NOTNULL_EXEC(memcpy_addr_async_node, + 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()); + return nullptr); return memcpy_addr_async_node; } @@ -296,16 +328,29 @@ Status MemcpyAddrAsyncPass::InsertMemcpyAddrAsyncNode(const OutDataAnchorPtr &ou const InDataAnchorPtr &in_anchor, const NodePtr &node) { // insert memcpy_addr of each user_data and out_of_user_data if (GraphUtils::RemoveEdge(out_anchor, in_anchor) != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "Remove edge between op:%s(%s)(index:%d) and op:%s(%s)(index:%d) failed", + out_anchor->GetOwnerNode()->GetName().c_str(), out_anchor->GetOwnerNode()->GetType().c_str(), + out_anchor->GetIdx(), + in_anchor->GetOwnerNode()->GetName().c_str(), in_anchor->GetOwnerNode()->GetType().c_str(), + in_anchor->GetIdx()); GELOGE(INTERNAL_ERROR, "Remove edge of %s and %s failed.", out_anchor->GetOwnerNode()->GetName().c_str(), in_anchor->GetOwnerNode()->GetName().c_str()); return INTERNAL_ERROR; } if (GraphUtils::AddEdge(out_anchor, node->GetInDataAnchor(0)) != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "Remove edge between op:%s(%s)(index:%d) and op:%s(%s)(index:0) failed", + out_anchor->GetOwnerNode()->GetName().c_str(), out_anchor->GetOwnerNode()->GetType().c_str(), + out_anchor->GetIdx(), + node->GetName().c_str(), node->GetType().c_str()); GELOGE(INTERNAL_ERROR, "Add edge of %s and %s failed.", out_anchor->GetOwnerNode()->GetName().c_str(), node->GetName().c_str()); return INTERNAL_ERROR; } if (GraphUtils::AddEdge(node->GetOutDataAnchor(0), in_anchor) != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "Remove edge between op:%s(%s)(index:0) and op:%s(%s)(index:%d) failed", + node->GetName().c_str(), node->GetType().c_str(), + in_anchor->GetOwnerNode()->GetName().c_str(), in_anchor->GetOwnerNode()->GetType().c_str(), + in_anchor->GetIdx()); GELOGE(INTERNAL_ERROR, "Add edge of %s and %s failed.", node->GetName().c_str(), in_anchor->GetOwnerNode()->GetName().c_str()); return INTERNAL_ERROR; diff --git a/ge/graph/passes/merge_input_memcpy_pass.cc b/ge/graph/passes/merge_input_memcpy_pass.cc index 25882b2a..99f8712b 100644 --- a/ge/graph/passes/merge_input_memcpy_pass.cc +++ b/ge/graph/passes/merge_input_memcpy_pass.cc @@ -57,7 +57,8 @@ Status MergeInputMemcpyPass::AddMemcpyAsyncNodes(const ComputeGraphPtr &graph, c const std::string &memcpy_name = node->GetName() + "_input_" + std::to_string(in_data_anchor->GetIdx()); NodePtr memcpy_node = CreateMemcpyAsyncNode(graph, memcpy_name, peer_out_anchor, multi_batch_flag); GE_CHK_BOOL_EXEC(memcpy_node != nullptr, return FAILED, "Create MemcpyAsync node failed."); - GE_CHK_STATUS(GraphUtils::RemoveEdge(peer_out_anchor, in_data_anchor), "MemcpyAsync node remove edge failed."); + GE_CHK_STATUS(GraphUtils::RemoveEdge(peer_out_anchor, in_data_anchor), + "MemcpyAsync node remove edge failed."); GE_CHK_STATUS(GraphUtils::AddEdge(peer_out_anchor, memcpy_node->GetInDataAnchor(0)), "MemcpyAsync node add edge failed."); GE_CHK_STATUS(GraphUtils::AddEdge(memcpy_node->GetOutDataAnchor(0), in_data_anchor), @@ -90,8 +91,12 @@ NodePtr MergeInputMemcpyPass::CreateMemcpyAsyncNode(const ComputeGraphPtr &graph } GE_CHK_BOOL_EXEC(op_desc->AddInputDesc(pre_op_desc->GetOutputDesc(out_data_anchor->GetIdx())) == GRAPH_SUCCESS, + REPORT_CALL_ERROR("E19999", "Add input to op:%s(%s) failed", + op_desc->GetName().c_str(), op_desc->GetType().c_str()); return nullptr, "Create MemcpyAsync op: add input desc failed."); GE_CHK_BOOL_EXEC(op_desc->AddOutputDesc(pre_op_desc->GetOutputDesc(out_data_anchor->GetIdx())) == GRAPH_SUCCESS, + REPORT_CALL_ERROR("E19999", "Add output to op:%s(%s) failed", + op_desc->GetName().c_str(), op_desc->GetType().c_str()); return nullptr, "Create MemcpyAsync op: add output desc failed."); return graph->AddNode(op_desc); diff --git a/ge/graph/passes/merge_pass.cc b/ge/graph/passes/merge_pass.cc index 26d82820..3206efa9 100644 --- a/ge/graph/passes/merge_pass.cc +++ b/ge/graph/passes/merge_pass.cc @@ -35,6 +35,7 @@ const size_t kCaseOneInput = 1; Status MergePass::Run(NodePtr &node) { GELOGD("MergePass running"); if (node == nullptr) { + REPORT_INNER_ERROR("E19999", "Param node is nullptr, check invalid"); GELOGE(PARAM_INVALID, "param [node] must not be null."); return PARAM_INVALID; } @@ -46,6 +47,8 @@ Status MergePass::Run(NodePtr &node) { } if (node->GetAllOutDataAnchors().empty()) { + REPORT_INNER_ERROR("E19999", "Param node:%s(%s) all data anchor size is 0, check invalid", + node->GetName().c_str(), node->GetType().c_str()); GELOGE(PARAM_INVALID, "[%s] Merge node output anchor is empty", node->GetName().c_str()); return PARAM_INVALID; } @@ -79,6 +82,8 @@ Status MergePass::Run(NodePtr &node) { auto in_node = in_data_nodes.at(0); if (IsMergeInputNeedOptimized(in_node)) { if (IsolateAndDeleteNode(in_node, {0}) != SUCCESS) { + REPORT_CALL_ERROR("E19999", "Isolate and delete node:%s(%s) failed", + in_node->GetName().c_str(), in_node->GetType().c_str()); GELOGE(FAILED, "Isolate and delete node %s failed.", in_node->GetName().c_str()); return FAILED; } @@ -115,6 +120,8 @@ Status MergePass::ChangeIndexToConstant(NodePtr &node, int &value_index) { GE_CHECK_NOTNULL(node); ComputeGraphPtr graph = node->GetOwnerComputeGraph(); if (graph == nullptr) { + REPORT_INNER_ERROR("E19999", "Owner graph of node:%s(%s) is nullptr, check invalid", + node->GetName().c_str(), node->GetType().c_str()); GELOGE(FAILED, "[%s] The owner graph must not be null.", node->GetName().c_str()); return FAILED; } @@ -125,11 +132,17 @@ Status MergePass::ChangeIndexToConstant(NodePtr &node, int &value_index) { } NodePtr const_node = graph->AddNode(constant_op_desc); if (const_node == nullptr) { + REPORT_CALL_ERROR("E19999", "Add node:%s(%s) to graph:%s failed", + constant_op_desc->GetName().c_str(), constant_op_desc->GetType().c_str(), + graph->GetName().c_str()); return FAILED; } // Change peer in anchors from value_index to new Constant node if (GraphUtils::ReplaceNodeAnchors(const_node, node, {}, {1}) != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "Replace node:%s(%s) by node:%s(%s) failed", + node->GetName().c_str(), node->GetType().c_str(), + const_node->GetName().c_str(), const_node->GetType().c_str()); GELOGE(FAILED, "[%s] ReplaceNodeAnchors failed.", node->GetName().c_str()); return FAILED; } @@ -137,6 +150,9 @@ Status MergePass::ChangeIndexToConstant(NodePtr &node, int &value_index) { GE_CHECK_NOTNULL(out_control_anchor); // Add control anchor between Merge and Constant if (out_control_anchor->LinkTo(const_node->GetInControlAnchor()) != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "Op:%s(%s) link control to op:%s(%s) failed", + node->GetName().c_str(), node->GetType().c_str(), + const_node->GetName().c_str(), const_node->GetType().c_str()); return FAILED; } @@ -148,6 +164,7 @@ Status MergePass::CreateConstByValue(NodePtr &node, int value_index, OpDescPtr & // 1. create Constant OpDesc op_desc = MakeShared(constant_name, CONSTANT); if (op_desc == nullptr) { + REPORT_CALL_ERROR("E19999", "New OpDesc failed"); GELOGE(FAILED, "[%s] Make shared of Constant op desc failed.", constant_name.c_str()); return FAILED; } @@ -155,6 +172,7 @@ Status MergePass::CreateConstByValue(NodePtr &node, int value_index, OpDescPtr & // 2. get OpDesc of output number one of Merge(value_index) OpDescPtr original_op_desc = node->GetOpDesc(); if (original_op_desc == nullptr) { + REPORT_INNER_ERROR("E19999", "OpDesc in node is nullptr, check invalid"); GELOGE(FAILED, "[%s] Op desc must not be null.", constant_name.c_str()); return FAILED; } @@ -165,15 +183,19 @@ Status MergePass::CreateConstByValue(NodePtr &node, int value_index, OpDescPtr & GeTensorPtr const_tensor_ptr = MakeShared(original_out_tensor_desc, reinterpret_cast(&value_index), sizeof(int)); if (const_tensor_ptr == nullptr) { + REPORT_CALL_ERROR("E19999", "New GeTensor failed"); GELOGE(FAILED, "[%s] Make shared of Constant tensor failed.", constant_name.c_str()); return FAILED; } GE_IF_BOOL_EXEC(!AttrUtils::SetTensor(op_desc, ATTR_NAME_WEIGHTS, const_tensor_ptr), - GELOGE(FAILED, "get ATTR_NAME_WEIGHTS failed"); return FAILED); + 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(FAILED, "get ATTR_NAME_WEIGHTS failed"); return FAILED); // 4. set Constant output desc - GE_CHK_STATUS_RET(op_desc->AddOutputDesc(original_out_tensor_desc), "add out put desc failed"); + GE_CHK_GRAPH_STATUS_RET(op_desc->AddOutputDesc(original_out_tensor_desc), "add out put desc failed"); return SUCCESS; } diff --git a/ge/graph/passes/merge_to_stream_merge_pass.cc b/ge/graph/passes/merge_to_stream_merge_pass.cc index 44c5c069..8866831b 100644 --- a/ge/graph/passes/merge_to_stream_merge_pass.cc +++ b/ge/graph/passes/merge_to_stream_merge_pass.cc @@ -35,14 +35,24 @@ Status MergeToStreamMergePass::Run(ComputeGraphPtr graph) { GE_CHECK_NOTNULL(merge_op_desc); if (merge_op_desc->HasAttr(ATTR_INSERT_BY_MBATCH)) { GE_CHK_STATUS_RET(AddActiveNodes(graph, node), "Merge add active node failed."); - GE_CHK_STATUS_RET(SetStreamLabel(node, node->GetName()), "Set stream label failed"); + auto status = SetStreamLabel(node, node->GetName()); + if (status != ge::SUCCESS) { + REPORT_CALL_ERROR("E19999", "Set stream_label:%s to op:%s(%s) failed", + node->GetName().c_str(), node->GetName().c_str(), node->GetType().c_str()); + GELOGE(status, "Set stream label failed."); + return status; + } } else { GE_CHK_STATUS_RET(ReplaceMergeNode(graph, node), "Add StreamMerge node failed."); } } for (const auto &node : bypass_nodes_) { - GE_CHK_BOOL_EXEC(GraphUtils::RemoveNodeWithoutRelink(graph, node) == GRAPH_SUCCESS, return FAILED, + GE_CHK_BOOL_EXEC(GraphUtils::RemoveNodeWithoutRelink(graph, node) == 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()); + return FAILED, "Remove merge node failed."); } @@ -64,28 +74,40 @@ Status MergeToStreamMergePass::ReplaceMergeNode(const ComputeGraphPtr &graph, co GELOGI("Create StreamMerge Op, name=%s.", node_name.c_str()); OpDescPtr op_desc = MakeShared(node_name, STREAMMERGE); if (op_desc == nullptr) { + REPORT_CALL_ERROR("E19999", "New GeTensor failed"); GELOGE(FAILED, "Create op_desc failed, StreamMerge:%s.", node_name.c_str()); return FAILED; } for (const InDataAnchorPtr &in_anchor : merge_node->GetAllInDataAnchors()) { GE_CHK_BOOL_EXEC(op_desc->AddInputDesc(merge_op_desc->GetInputDesc(in_anchor->GetIdx())) == GRAPH_SUCCESS, + REPORT_CALL_ERROR("E19999", "Add input desc to op:%s(%s) failed", + op_desc->GetName().c_str(), op_desc->GetType().c_str()); return FAILED, "Create StreamMerge op: add input desc failed."); } for (const OutDataAnchorPtr &out_anchor : merge_node->GetAllOutDataAnchors()) { GE_CHK_BOOL_EXEC(op_desc->AddOutputDesc(merge_op_desc->GetOutputDesc(out_anchor->GetIdx())) == GRAPH_SUCCESS, + REPORT_CALL_ERROR("E19999", "Add ouput desc to op:%s(%s) failed", + op_desc->GetName().c_str(), op_desc->GetType().c_str()); return FAILED, "Create StreamMerge op: add output desc failed."); } NodePtr stream_merge = graph->AddNode(op_desc); - GE_CHK_BOOL_EXEC(stream_merge != nullptr, return FAILED, "Insert StreamMerge node failed."); + GE_CHK_BOOL_EXEC(stream_merge != 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()); + return FAILED, "Insert StreamMerge node failed."); GE_CHK_STATUS_RET(MoveEdges(merge_node, stream_merge), "Move edges failed."); bypass_nodes_.insert(merge_node); if (merge_op_desc->HasAttr(ATTR_NAME_NEXT_ITERATION)) { std::string next_iteration_name; GE_IF_BOOL_EXEC(!AttrUtils::GetStr(merge_op_desc, ATTR_NAME_NEXT_ITERATION, next_iteration_name), + REPORT_CALL_ERROR("E19999", "Get Attr:%s from op:%s(%s) failed", + ATTR_NAME_NEXT_ITERATION.c_str(), + merge_op_desc->GetName().c_str(), merge_op_desc->GetType().c_str()); GELOGE(INTERNAL_ERROR, "Get ATTR_NAME_NEXT_ITERATION failed"); return INTERNAL_ERROR); GE_CHK_STATUS_RET(SetNextIteration(stream_merge, next_iteration_name), "Set next iteration failed"); @@ -101,7 +123,9 @@ Status MergeToStreamMergePass::ReplaceMergeNode(const ComputeGraphPtr &graph, co /// @return Status /// Status MergeToStreamMergePass::AddActiveNodes(const ComputeGraphPtr &graph, const NodePtr &node) { - GE_CHK_BOOL_EXEC(node != nullptr, return FAILED, "Param of pre node is null."); + GE_CHK_BOOL_EXEC(node != nullptr, + REPORT_INNER_ERROR("E19999", "Param node is nullptr, check invalid"); + return FAILED, "Param of pre node is null."); for (const InDataAnchorPtr &in_data_anchor : node->GetAllInDataAnchors()) { OutDataAnchorPtr peer_out_anchor = in_data_anchor->GetPeerOutAnchor(); GE_IF_BOOL_EXEC(peer_out_anchor == nullptr, continue); @@ -134,13 +158,20 @@ NodePtr MergeToStreamMergePass::CreateActiveNode(const ComputeGraphPtr &graph, c GELOGI("Create StreamActive op:%s.", node_name.c_str()); OpDescPtr op_desc = MakeShared(node_name, STREAMACTIVE); if (op_desc == nullptr) { + REPORT_CALL_ERROR("E19999", "New GeTensor failed"); GELOGE(FAILED, "Create op_desc failed, StreamActive:%s.", node_name.c_str()); return nullptr; } NodePtr active_node = graph->AddNode(op_desc); - GE_CHK_BOOL_EXEC(active_node != nullptr, return nullptr, "Create StreamActive node failed."); + GE_CHK_BOOL_EXEC(active_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()); + return nullptr, "Create StreamActive node failed."); GE_IF_BOOL_EXEC(GraphUtils::AddEdge(node->GetOutControlAnchor(), active_node->GetInControlAnchor()) != SUCCESS, + REPORT_CALL_ERROR("E19999", "Add control edge between op:%s(%s) and op:%s(%s) failed", + node->GetName().c_str(), node->GetType().c_str(), + active_node->GetName().c_str(), active_node->GetType().c_str()); GELOGE(INTERNAL_ERROR, "add edge failed"); return nullptr); GE_IF_BOOL_EXEC(SetSwitchBranchNodeLabel(active_node, node_name) != SUCCESS, @@ -161,14 +192,16 @@ Status MergeToStreamMergePass::MoveEdges(const NodePtr &old_node, const NodePtr OutDataAnchorPtr peer_out_anchor = in_data_anchor->GetPeerOutAnchor(); GE_IF_BOOL_EXEC(peer_out_anchor == nullptr, continue); - GE_CHK_STATUS(GraphUtils::RemoveEdge(peer_out_anchor, in_data_anchor), "Merge remove in data edge failed."); + GE_CHK_STATUS(GraphUtils::RemoveEdge(peer_out_anchor, in_data_anchor), + "Merge remove in data edge failed."); GE_CHK_STATUS(GraphUtils::AddEdge(peer_out_anchor, new_node->GetInDataAnchor(in_data_anchor->GetIdx())), "StreamMerge add in data edge failed."); } for (const OutDataAnchorPtr &out_data_anchor : old_node->GetAllOutDataAnchors()) { for (const InDataAnchorPtr &peer_in_anchor : out_data_anchor->GetPeerInDataAnchors()) { - GE_CHK_STATUS(GraphUtils::RemoveEdge(out_data_anchor, peer_in_anchor), "Merge remove out data edge failed."); + GE_CHK_STATUS(GraphUtils::RemoveEdge(out_data_anchor, peer_in_anchor), + "Merge remove out data edge failed."); GE_CHK_STATUS(GraphUtils::AddEdge(new_node->GetOutDataAnchor(out_data_anchor->GetIdx()), peer_in_anchor), "StreamMerge add out data edge failed."); } diff --git a/ge/graph/passes/multi_batch_clone_pass.cc b/ge/graph/passes/multi_batch_clone_pass.cc index a33e1f40..9e1fe80a 100755 --- a/ge/graph/passes/multi_batch_clone_pass.cc +++ b/ge/graph/passes/multi_batch_clone_pass.cc @@ -52,7 +52,9 @@ inline bool IsGetNextType(const NodePtr &node) { } Status MultiBatchClonePass::Run(ComputeGraphPtr graph) { - GE_IF_BOOL_EXEC(graph == nullptr, GELOGE(FAILED, "Original graph is nullptr"); return FAILED); + GE_IF_BOOL_EXEC(graph == nullptr, + REPORT_INNER_ERROR("E19999", "Param graph is nullptr, check invalid"); + GELOGE(FAILED, "Original graph is nullptr"); return FAILED); if (graph->GetParentGraph() != nullptr) { GELOGD("Subgraph %s skip the MultiBatchClonePass", graph->GetName().c_str()); return SUCCESS; @@ -99,7 +101,9 @@ Status MultiBatchClonePass::Run(ComputeGraphPtr graph) { (void)AttrUtils::GetStr(graph, ATTR_NAME_SESSION_GRAPH_ID, session_graph_id_); ComputeGraphPtr branch = MakeShared(graph->GetName()); - GE_IF_BOOL_EXEC(branch == nullptr, GELOGE(OUT_OF_MEMORY, "Create multi batch graph failed"); return OUT_OF_MEMORY); + GE_IF_BOOL_EXEC(branch == nullptr, + REPORT_CALL_ERROR("E19999", "New OpDesc failed"); + GELOGE(OUT_OF_MEMORY, "Create multi batch graph failed"); return OUT_OF_MEMORY); (void)AttrUtils::SetStr(branch, ATTR_NAME_SESSION_GRAPH_ID, session_graph_id_); graph->InValid(); // Will modify, need topological again. @@ -140,6 +144,8 @@ Status MultiBatchClonePass::CollectIoNodes(const ComputeGraphPtr &graph) { } if (all_data_nodes_.empty() || all_output_nodes_.size() != 1) { + REPORT_INNER_ERROR("E19999", "Data node num is 0 or output node num != 1, graph:%s, check invalid", + graph->GetName().c_str()); GELOGE(FAILED, "data nodes: %zu, output nodes: %zu", all_data_nodes_.size(), all_output_nodes_.size()); return FAILED; } @@ -280,6 +286,7 @@ Status MultiBatchClonePass::CreateRootGraph(const ComputeGraphPtr &graph) { op_builder.AddInput("branch_index").AddDynamicInput("input", input_num).AddDynamicOutput("output", output_num); const OpDescPtr op_desc = op_builder.Build(); if (op_desc == nullptr) { + REPORT_INNER_ERROR("E19999", "Build op:%s(%s) failed", kMultiBatchCaseNode.c_str(), CASE); GELOGE(OUT_OF_MEMORY, "Create multi-batch case desc failed"); return OUT_OF_MEMORY; } @@ -287,12 +294,16 @@ Status MultiBatchClonePass::CreateRootGraph(const ComputeGraphPtr &graph) { op_desc->RegisterSubgraphIrName("branches", kDynamic); case_node_ = graph->AddNode(op_desc); if (case_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(OUT_OF_MEMORY, "Create multi-batch case node failed"); return OUT_OF_MEMORY; } uint32_t batch_num = static_cast(batch_shapes_.size()); if (!AttrUtils::SetInt(op_desc, ATTR_NAME_BATCH_NUM, batch_num)) { + REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed", ATTR_NAME_BATCH_NUM.c_str(), + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(FAILED, "Set attr ATTR_NAME_BATCH_NUM failed, Case: %s.", op_desc->GetName().c_str()); return FAILED; } @@ -300,6 +311,8 @@ Status MultiBatchClonePass::CreateRootGraph(const ComputeGraphPtr &graph) { for (uint32_t i = 0; i < batch_num; i++) { const std::string &attr_name = ATTR_NAME_PRED_VALUE + "_" + std::to_string(i); if (!AttrUtils::SetListInt(op_desc, attr_name, batch_shapes_[i])) { + REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed", attr_name.c_str(), + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(FAILED, "Set attr ATTR_NAME_PRED_VALUE failed, Case: %s.", op_desc->GetName().c_str()); return FAILED; } @@ -310,11 +323,15 @@ Status MultiBatchClonePass::CreateRootGraph(const ComputeGraphPtr &graph) { data_name_order.push_back(item.first); } if (!AttrUtils::SetListStr(op_desc, ATTR_USER_DESIGNEATE_SHAPE_ORDER, data_name_order)) { + REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed", ATTR_USER_DESIGNEATE_SHAPE_ORDER.c_str(), + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(FAILED, "Failed to add user designate shape order attr on case node %s", op_desc->GetName().c_str()); return FAILED; } if (!AttrUtils::SetBool(op_desc, ATTR_INSERT_BY_MBATCH, true)) { + REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed", ATTR_INSERT_BY_MBATCH.c_str(), + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(INTERNAL_ERROR, "Failed to add insert attr on case node %s", op_desc->GetName().c_str()); return INTERNAL_ERROR; } @@ -338,16 +355,21 @@ Status MultiBatchClonePass::CreateRootGraph(const ComputeGraphPtr &graph) { Status MultiBatchClonePass::CreateIndexDataNode(const ComputeGraphPtr &graph, NodePtr &shape_node) { const OpDescPtr data_desc = MakeShared(kMultiBatchDataNode, DATA); if (data_desc == nullptr) { + REPORT_CALL_ERROR("E19999", "New OpDesc failed"); GELOGE(OUT_OF_MEMORY, "Create multi-batch data node failed"); return FAILED; } GeTensorDesc data_tensor(GeShape({static_cast(batch_shapes_[0].size())}), FORMAT_ND, DT_INT32); if (data_desc->AddInputDesc(data_tensor) != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "Add input desc to op:%s(%s) failed", + data_desc->GetName().c_str(), data_desc->GetType().c_str()); GELOGE(FAILED, "Add input desc failed"); return FAILED; } if (data_desc->AddOutputDesc(data_tensor) != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "Add ouput desc to op:%s(%s) failed", + data_desc->GetName().c_str(), data_desc->GetType().c_str()); GELOGE(FAILED, "Add output desc failed"); return FAILED; } @@ -359,6 +381,8 @@ Status MultiBatchClonePass::CreateIndexDataNode(const ComputeGraphPtr &graph, No shape_node = graph->AddNode(data_desc); if (shape_node == nullptr) { + REPORT_CALL_ERROR("E19999", "Add node:%s(%s) to graph:%s failed", + data_desc->GetName().c_str(), data_desc->GetType().c_str(), graph->GetName().c_str()); GELOGE(OUT_OF_MEMORY, "Create multi-batch data node failed"); return OUT_OF_MEMORY; } @@ -376,6 +400,7 @@ Status MultiBatchClonePass::CreateIndexDataNode(const ComputeGraphPtr &graph, No Status MultiBatchClonePass::CreateIndexConstNode(const ComputeGraphPtr &graph, NodePtr &node) { const OpDescPtr const_desc = MakeShared(kMultiBatchConstNode, CONSTANT); if (const_desc == nullptr) { + REPORT_CALL_ERROR("E19999", "New OpDesc failed"); GELOGE(OUT_OF_MEMORY, "Create multi-batch const node failed"); return FAILED; } @@ -395,17 +420,23 @@ Status MultiBatchClonePass::CreateIndexConstNode(const ComputeGraphPtr &graph, N GeTensor tensor(const_tensor); (void)tensor.SetData(reinterpret_cast(addr.get()), count * sizeof(int32_t)); if (!AttrUtils::SetTensor(const_desc, ATTR_NAME_WEIGHTS, tensor)) { + REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed", ATTR_NAME_WEIGHTS.c_str(), + const_desc->GetName().c_str(), const_desc->GetType().c_str()); GELOGE(OUT_OF_MEMORY, "Failed to init tensor value for const %s", const_desc->GetName().c_str()); return FAILED; } if (const_desc->AddOutputDesc(const_tensor) != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "Add ouput desc to op:%s(%s) failed", + const_desc->GetName().c_str(), const_desc->GetType().c_str()); GELOGE(OUT_OF_MEMORY, "Failed to add output desc for const node %s", const_desc->GetName().c_str()); return FAILED; } node = graph->AddNode(const_desc); if (node == nullptr) { + REPORT_CALL_ERROR("E19999", "Add node:%s(%s) to graph:%s failed", + const_desc->GetName().c_str(), const_desc->GetType().c_str(), graph->GetName().c_str()); GELOGE(OUT_OF_MEMORY, "Create multi-batch const node failed"); return OUT_OF_MEMORY; } @@ -438,11 +469,14 @@ Status MultiBatchClonePass::CreateIndexNode(const ComputeGraphPtr &graph) { const OpDescPtr op_desc = op_builder.Build(); if (op_desc == nullptr) { + REPORT_INNER_ERROR("E19999", "Build op:%s(%s) failed", kMultiBatchMapIndexNode.c_str(), "MapIndex"); GELOGE(OUT_OF_MEMORY, "Create multi-batch index desc failed"); return FAILED; } NodePtr index_node = graph->AddNode(op_desc); if (index_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(OUT_OF_MEMORY, "Create multi-batch index node failed"); return OUT_OF_MEMORY; } @@ -450,16 +484,25 @@ Status MultiBatchClonePass::CreateIndexNode(const ComputeGraphPtr &graph) { GE_CHK_STATUS_RET(AddAttrForGetDynamicDims(shape_node_), "Failed to add attr for %s.", shape_node_->GetName().c_str()); if (GraphUtils::AddEdge(shape_node_->GetOutDataAnchor(0), index_node->GetInDataAnchor(0)) != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(index:0) and op:%s(%s)(index:0) failed", + shape_node_->GetName().c_str(), shape_node_->GetType().c_str(), + index_node->GetName().c_str(), index_node->GetType().c_str()); GELOGE(FAILED, "Failed to add edge between node:%s to MapIndex:%s", shape_node_->GetName().c_str(), index_node->GetName().c_str()); return FAILED; } if (GraphUtils::AddEdge(const_node->GetOutDataAnchor(0), index_node->GetInDataAnchor(1)) != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(index:0) and op:%s(%s)(index:1) failed", + const_node->GetName().c_str(), const_node->GetType().c_str(), + index_node->GetName().c_str(), index_node->GetType().c_str()); GELOGE(FAILED, "Failed to add edge between node:%s to MapIndex:%s", const_node->GetName().c_str(), index_node->GetName().c_str()); return FAILED; } if (GraphUtils::AddEdge(index_node->GetOutDataAnchor(0), case_node_->GetInDataAnchor(0)) != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(index:0) and op:%s(%s)(index:0) failed", + index_node->GetName().c_str(), index_node->GetType().c_str(), + case_node_->GetName().c_str(), case_node_->GetType().c_str()); GELOGE(FAILED, "Failed to add edge between MapIndex:%s to Case:%s", index_node->GetName().c_str(), case_node_->GetName().c_str()); return FAILED; @@ -471,6 +514,7 @@ Status MultiBatchClonePass::CreateIndexNode(const ComputeGraphPtr &graph) { Status MultiBatchClonePass::CreateGetDynamicDimsNode(const ComputeGraphPtr &graph, NodePtr &shape_node) { const OpDescPtr data_desc = MakeShared(kMultiBatchGetDynamicDimsNode, GETDYNAMICDIMS); if (data_desc == nullptr) { + REPORT_CALL_ERROR("E19999", "New OpDesc failed"); GELOGE(OUT_OF_MEMORY, "Create multi-batch get dynamic dims node failed"); return OUT_OF_MEMORY; } @@ -484,24 +528,35 @@ Status MultiBatchClonePass::CreateGetDynamicDimsNode(const ComputeGraphPtr &grap tensor_desc.SetFormat(FORMAT_ND); tensor_desc.SetDataType(DT_INT32); auto ret = data_desc->AddInputDesc(tensor_desc); - GE_IF_BOOL_EXEC(ret != GRAPH_SUCCESS, GELOGE(INTERNAL_ERROR, "Failed to add input desc for created data"); - return FAILED); + GE_IF_BOOL_EXEC(ret != GRAPH_SUCCESS, + REPORT_CALL_ERROR("E19999", "Add input desc to op:%s(%s) failed", + data_desc->GetName().c_str(), data_desc->GetType().c_str()); + GELOGE(INTERNAL_ERROR, "Failed to add input desc for created data"); + return FAILED); continue; } GeTensorDesc tensor_desc(GeShape({static_cast(input_shape_dims)}), FORMAT_ND, DT_INT32); auto ret = data_desc->AddInputDesc(tensor_desc); - GE_IF_BOOL_EXEC(ret != GRAPH_SUCCESS, GELOGE(INTERNAL_ERROR, "Failed to add input desc for created data"); - return FAILED); + GE_IF_BOOL_EXEC(ret != GRAPH_SUCCESS, + REPORT_CALL_ERROR("E19999", "Add input desc to op:%s(%s) failed", + data_desc->GetName().c_str(), data_desc->GetType().c_str()); + GELOGE(INTERNAL_ERROR, "Failed to add input desc for created data"); + return FAILED); } GeTensorDesc tensor_desc(GeShape({static_cast(batch_shapes_.at(0).size())}), FORMAT_ND, DT_INT32); auto ret = data_desc->AddOutputDesc(tensor_desc); - GE_IF_BOOL_EXEC(ret != GRAPH_SUCCESS, GELOGE(INTERNAL_ERROR, "Failed to add output desc for created data"); - return FAILED); + GE_IF_BOOL_EXEC(ret != GRAPH_SUCCESS, + REPORT_CALL_ERROR("E19999", "Add output desc to op:%s(%s) failed", + data_desc->GetName().c_str(), data_desc->GetType().c_str()); + GELOGE(INTERNAL_ERROR, "Failed to add output desc for created data"); + return FAILED); (void)AttrUtils::SetBool(data_desc, ATTR_INSERT_BY_MBATCH, true); shape_node = graph->AddNode(data_desc); if (shape_node == nullptr) { + REPORT_CALL_ERROR("E19999", "Add node:%s(%s) to graph:%s failed", + data_desc->GetName().c_str(), data_desc->GetType().c_str(), graph->GetName().c_str()); GELOGE(OUT_OF_MEMORY, "Create multi-batch dynamic dims node failed"); return OUT_OF_MEMORY; } @@ -515,6 +570,8 @@ Status MultiBatchClonePass::AddAttrForGetDynamicDims(const NodePtr &shape_node) } GELOGD("Add attr for :%s, type is %s:", shape_node->GetName().c_str(), shape_node->GetType().c_str()); if (!AttrUtils::SetInt(shape_node->GetOpDesc(), ATTR_GETNEXT_SINK_DATA_COUNT, data_count_from_getnext_)) { + REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed", ATTR_GETNEXT_SINK_DATA_COUNT.c_str(), + shape_node->GetName().c_str(), shape_node->GetType().c_str()); GELOGE(INTERNAL_ERROR, "set ATTR_GETNEXT_SINK_DATA_COUNT failed"); return INTERNAL_ERROR; } @@ -531,6 +588,8 @@ Status MultiBatchClonePass::AddAttrForGetDynamicDims(const NodePtr &shape_node) } } if (!AttrUtils::SetListInt(shape_node->GetOpDesc(), ATTR_GETNEXT_SINK_SHAPE_INFO, shape_info)) { + REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed", ATTR_GETNEXT_SINK_SHAPE_INFO.c_str(), + shape_node->GetName().c_str(), shape_node->GetType().c_str()); GELOGE(INTERNAL_ERROR, "set ATTR_GETNEXT_SINK_SHAPE_INFO failed"); return INTERNAL_ERROR; } @@ -547,9 +606,13 @@ Status MultiBatchClonePass::LinkGetNextToGetDynamicDims(const NodePtr &getnext_n shape_node->GetName().c_str(), input_index); auto out_data_anchor = getnext_node->GetOutDataAnchor(out_index); auto ret = GraphUtils::AddEdge(out_data_anchor, shape_node->GetInDataAnchor(input_index)); - GE_IF_BOOL_EXEC(ret != GRAPH_SUCCESS, GELOGE(INTERNAL_ERROR, "Failed to link getnext %s to getdynamicdims %s", - getnext_node->GetName().c_str(), shape_node->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", + getnext_node->GetName().c_str(), getnext_node->GetType().c_str(), out_index, + shape_node->GetName().c_str(), shape_node->GetType().c_str(), input_index); + GELOGE(INTERNAL_ERROR, "Failed to link getnext %s to getdynamicdims %s", + getnext_node->GetName().c_str(), shape_node->GetName().c_str()); + return INTERNAL_ERROR); } return SUCCESS; } @@ -557,6 +620,8 @@ Status MultiBatchClonePass::LinkGetNextToGetDynamicDims(const NodePtr &getnext_n Status MultiBatchClonePass::LinkGetDynamicDimsToNetOutput(const NodePtr &output_node) { if (!GetLocalOmgContext().dynamic_node_type.empty()) { if (!AttrUtils::SetStr(output_node->GetOpDesc(), ATTR_ALL_GEARS_INFO, GetLocalOmgContext().dynamic_dims)) { + REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed", ATTR_ALL_GEARS_INFO.c_str(), + output_node->GetName().c_str(), output_node->GetType().c_str()); GELOGE(INTERNAL_ERROR, "Failed to set all gears info attr on netoutput %s.", output_node->GetName().c_str()); return INTERNAL_ERROR; } @@ -565,15 +630,23 @@ Status MultiBatchClonePass::LinkGetDynamicDimsToNetOutput(const NodePtr &output_ GELOGD("Start link %s to %s.", shape_node_->GetName().c_str(), output_node->GetName().c_str()); size_t input_index = output_node->GetAllInDataAnchors().size(); if (NodeUtils::AppendInputAnchor(output_node, input_index + 1) != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "Append input anchor to op:%s(%s) failed, size:%zu", + output_node->GetName().c_str(), output_node->GetType().c_str(), input_index + 1); GELOGE(INTERNAL_ERROR, "Append input anchor of %s of %zu failed.", output_node->GetName().c_str(), input_index); return INTERNAL_ERROR; } auto ret = GraphUtils::AddEdge(shape_node_->GetOutDataAnchor(kDataOutIndex), output_node->GetInDataAnchor(input_index)); - GE_IF_BOOL_EXEC(ret != GRAPH_SUCCESS, GELOGE(INTERNAL_ERROR, "Failed to link netoutput %s to getdynamicdims %s", - output_node->GetName().c_str(), shape_node_->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:%zu) failed", + shape_node_->GetName().c_str(), shape_node_->GetType().c_str(), kDataOutIndex, + output_node->GetName().c_str(), output_node->GetType().c_str(), input_index); + GELOGE(INTERNAL_ERROR, "Failed to link netoutput %s to getdynamicdims %s", + output_node->GetName().c_str(), shape_node_->GetName().c_str()); + return INTERNAL_ERROR); if (!AttrUtils::SetBool(output_node->GetOpDesc(), ATTR_GETNEXT_SINK_DYNMAIC, true)) { + REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed", ATTR_GETNEXT_SINK_DYNMAIC.c_str(), + output_node->GetName().c_str(), output_node->GetType().c_str()); GELOGE(INTERNAL_ERROR, "Failed to set getnext sink dynamic attr on netoutput %s.", output_node->GetName().c_str()); return INTERNAL_ERROR; @@ -598,17 +671,25 @@ Status MultiBatchClonePass::CreateInputNode(const ComputeGraphPtr &graph) { const auto &node = all_data_nodes_[i]; const OpDescPtr op_desc = AttrUtils::CopyOpDesc(node->GetOpDesc()); if (op_desc == nullptr) { + REPORT_CALL_ERROR("E19999", "Copy op_desc from op:%s(%s) failed", + node->GetName().c_str(), node->GetType().c_str()); GELOGE(OUT_OF_MEMORY, "Create multi-batch Data node failed, name: %s", node->GetName().c_str()); return FAILED; } if (GraphUtils::CopyTensorAttrs(op_desc, node) != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "Copy tensor attr from op:%s(%s) failed", + node->GetName().c_str(), node->GetType().c_str()); return FAILED; } op_desc->SetName(node->GetName()); const NodePtr &data = graph->AddNode(op_desc); - GE_CHK_BOOL_EXEC(data != nullptr, return FAILED, "Add node[%s] to graph failed", op_desc->GetName().c_str()); + GE_CHK_BOOL_EXEC(data != 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()); + return FAILED, "Add node[%s] to graph failed", op_desc->GetName().c_str()); if (IsGetNextType(node)) { getnext_node = data; input_index_of_getnext = case_input_index; @@ -617,6 +698,9 @@ Status MultiBatchClonePass::CreateInputNode(const ComputeGraphPtr &graph) { } else { if (GraphUtils::AddEdge(data->GetOutDataAnchor(0), case_node_->GetInDataAnchor(case_input_index)) != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(index:0) and op:%s(%s)(index:%zu) failed", + data->GetName().c_str(), data->GetType().c_str(), + case_node_->GetName().c_str(), case_node_->GetType().c_str(), case_input_index); GELOGE(FAILED, "Failed to add edge between Data:%s to Case:%s", data->GetName().c_str(), case_node_->GetName().c_str()); return FAILED; @@ -651,6 +735,9 @@ Status MultiBatchClonePass::LinkEdgeForGetNext(const NodePtr &getnext_node, size for (size_t out_index = 0; out_index < data_count_from_getnext_; ++out_index, ++case_input_index) { if (GraphUtils::AddEdge(getnext_node->GetOutDataAnchor(out_index), case_node_->GetInDataAnchor(case_input_index)) != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(index:%zu) and op:%s(%s)(index:%zu) failed", + getnext_node->GetName().c_str(), getnext_node->GetType().c_str(), out_index, + case_node_->GetName().c_str(), case_node_->GetType().c_str(), case_input_index); GELOGE(FAILED, "Failed to add data edge between %zu Data:%s to %zu Case:%s", out_index, getnext_node->GetName().c_str(), case_input_index, case_node_->GetName().c_str()); return FAILED; @@ -681,18 +768,29 @@ Status MultiBatchClonePass::CreateConstNode(const ComputeGraphPtr &graph) { const auto &node = all_const_nodes_[i]; const OpDescPtr op_desc = AttrUtils::CopyOpDesc(node->GetOpDesc()); if (op_desc == nullptr) { + REPORT_CALL_ERROR("E19999", "Copy op_desc from op:%s(%s) failed", + node->GetName().c_str(), node->GetType().c_str()); GELOGE(OUT_OF_MEMORY, "Create multi-batch Const node failed, name: %s", node->GetName().c_str()); return FAILED; } op_desc->SetName(node->GetName()); if (GraphUtils::CopyTensorAttrs(op_desc, node) != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "Copy tensor attr from op:%s(%s) failed", + node->GetName().c_str(), node->GetType().c_str()); return FAILED; } const NodePtr &data = graph->AddNode(op_desc); - GE_CHK_BOOL_EXEC(data != nullptr, return FAILED, "Add node[%s] to graph failed", op_desc->GetName().c_str()); + GE_CHK_BOOL_EXEC(data != 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()); + return FAILED, "Add node[%s] to graph failed", op_desc->GetName().c_str()); if (GraphUtils::AddEdge(data->GetOutDataAnchor(0), case_node_->GetInDataAnchor(arg_index + i)) != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(index:0) and op:%s(%s)(index:%zu) failed", + data->GetName().c_str(), data->GetType().c_str(), + case_node_->GetName().c_str(), case_node_->GetType().c_str(), arg_index + i); GELOGE(FAILED, "Failed to add edge between Const:%s to Case:%s", data->GetName().c_str(), case_node_->GetName().c_str()); return FAILED; @@ -741,22 +839,33 @@ Status MultiBatchClonePass::CreateOutputNode(const ComputeGraphPtr &graph) { const auto &output = all_output_nodes_[0]; const OpDescPtr op_desc = AttrUtils::CopyOpDesc(output->GetOpDesc()); if (op_desc == nullptr) { + REPORT_CALL_ERROR("E19999", "Copy op_desc from op:%s(%s) failed", + output->GetName().c_str(), output->GetType().c_str()); GELOGE(OUT_OF_MEMORY, "Create multi-batch output node failed"); return FAILED; } if (GraphUtils::CopyTensorAttrs(op_desc, output) != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "Copy tensor attr from op:%s(%s) failed", + output->GetName().c_str(), output->GetType().c_str()); return FAILED; } op_desc->SetName(output->GetName()); const NodePtr &node = graph->AddNode(op_desc); - GE_CHK_BOOL_EXEC(node != nullptr, return FAILED, "Add node[%s] to graph failed", op_desc->GetName().c_str()); + GE_CHK_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(), + graph->GetName().c_str()); + return FAILED, "Add node[%s] to graph failed", op_desc->GetName().c_str()); for (size_t i = 0; i < case_node_->GetAllOutDataAnchorsSize(); ++i) { const auto it = direct_output_.find(i); if (it == direct_output_.end()) { if (GraphUtils::AddEdge(case_node_->GetOutDataAnchor(i), node->GetInDataAnchor(i)) != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(index:%zu) and op:%s(%s)(index:%zu) failed", + case_node_->GetName().c_str(), case_node_->GetType().c_str(), i, + node->GetName().c_str(), node->GetType().c_str(), i); GELOGE(FAILED, "Failed to add edge between Case:%s to NetOutput:%s", case_node_->GetName().c_str(), node->GetName().c_str()); return FAILED; @@ -764,10 +873,14 @@ Status MultiBatchClonePass::CreateOutputNode(const ComputeGraphPtr &graph) { } else { const auto data_node = graph->FindNode(it->second); if (data_node == nullptr) { + REPORT_CALL_ERROR("E19999", "Find node:%s from graph:%s failed", it->second.c_str(), graph->GetName().c_str()); GELOGE(GE_GRAPH_GRAPH_NODE_NULL, "Data node:%s not found", it->second.c_str()); return GE_GRAPH_GRAPH_NODE_NULL; } if (GraphUtils::AddEdge(data_node->GetOutDataAnchor(kDataOutIndex), node->GetInDataAnchor(i)) != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(index:%d) and op:%s(%s)(index:%zu) failed", + data_node->GetName().c_str(), data_node->GetType().c_str(), kDataOutIndex, + node->GetName().c_str(), node->GetType().c_str(), i); GELOGE(FAILED, "Failed to add edge between Data:%s to NetOutput:%s", data_node->GetName().c_str(), node->GetName().c_str()); return FAILED; @@ -857,6 +970,8 @@ Status MultiBatchClonePass::SetMaxShapeToData(const NodePtr &node, size_t out_an int64_t size = 1; for (auto dim : data_to_dynamic_info_.at(data_name).at(i)) { if (INT64_MAX / dim < size) { + REPORT_INNER_ERROR("E19999", "The shape %s size will overflow after multi", + formats::ShapeToString(data_to_dynamic_info_.at(data_name).at(i)).c_str()); GELOGE(PARAM_INVALID, "The shape %s size overflow", formats::ShapeToString(data_to_dynamic_info_.at(data_name).at(i)).c_str()); return PARAM_INVALID; @@ -890,11 +1005,15 @@ Status MultiBatchClonePass::SetShapeToData(const std::vector &shapes, c } if (NodeUtils::UpdateOutputShape(*data, out_anchor_index, data_shape) != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "Update ouput desc shape to op:%s(%s) failed, index:%zu", + data->GetName().c_str(), data->GetType().c_str(), out_anchor_index); GELOGE(INTERNAL_ERROR, "Failed to update output shape for data %s", data->GetName().c_str()); return INTERNAL_ERROR; } if (!IsGetNextType(data)) { if (NodeUtils::UpdateInputShape(*data, kDataInIndex, data_shape) != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "Update input desc shape to op:%s(%s) failed, index:%u", + data->GetName().c_str(), data->GetType().c_str(), kDataInIndex); GELOGE(INTERNAL_ERROR, "Failed to update input shape for data %s", data->GetName().c_str()); return INTERNAL_ERROR; } @@ -920,6 +1039,8 @@ Status MultiBatchClonePass::UpdateShapeOfShapeNode(const NodePtr &node, size_t o GeShape output_shape(output_dims); output_desc.SetShape(output_shape); if (node->GetOpDesc()->UpdateOutputDesc(shape_index, output_desc) != SUCCESS) { + REPORT_CALL_ERROR("E19999", "Update ouput desc to op:%s(%s) failed, index:%zu", + node->GetName().c_str(), node->GetType().c_str(), shape_index); GELOGE(FAILED, "Update output desc fail."); return FAILED; } @@ -936,12 +1057,16 @@ Status MultiBatchClonePass::UpdateShapeOfShapeNode(const NodePtr &node, size_t o Status MultiBatchClonePass::UpdateSubgraphData(const NodePtr &data, size_t batch_index) { int node_index = -1; if (!AttrUtils::GetInt(data->GetOpDesc(), ATTR_NAME_INDEX, node_index)) { + REPORT_CALL_ERROR("E19999", "Get Attr:%s from op:%s(%s) failed", ATTR_NAME_INDEX.c_str(), + data->GetName().c_str(), data->GetType().c_str()); GELOGE(FAILED, "Failed to get index from data[%s]", data->GetName().c_str()); return FAILED; } int parent_index = node_index + 1; if (!AttrUtils::SetInt(data->GetOpDesc(), 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(), + data->GetName().c_str(), data->GetType().c_str()); GELOGE(FAILED, "Failed to set parent index for node %s", data->GetName().c_str()); return FAILED; } @@ -958,6 +1083,8 @@ Status MultiBatchClonePass::UpdateSubgraphData(const NodePtr &data, size_t batch auto data_name = data->GetName(); size_t pos = data_name.find(kMultiBatchNodePostfix); if (pos == string::npos) { + REPORT_INNER_ERROR("E19999", "Cannot find key string [%s] of multi-batch in name of virtual input node:%s(%s)", + kMultiBatchNodePostfix.c_str(), data->GetName().c_str(), data->GetType().c_str()); GELOGE(FAILED, "Cannot find key string [%s] of multi-batch in name of virtual input node, node name: %s.", kMultiBatchNodePostfix.c_str(), data_name.c_str()); return FAILED; @@ -980,18 +1107,26 @@ Status MultiBatchClonePass::CreateOriGraph(const ComputeGraphPtr &graph) { auto out_data_anchor = node->GetOutDataAnchor(out_index); GE_IF_BOOL_EXEC(out_data_anchor == nullptr, continue); NodePtr data_node = CreateDataNode(graph, out_data_anchor, data_index); - GE_IF_BOOL_EXEC(data_node == nullptr, GELOGE(INTERNAL_ERROR, "Create %d data node failed.", - out_data_anchor->GetIdx()); return INTERNAL_ERROR); + GE_IF_BOOL_EXEC(data_node == nullptr, + REPORT_CALL_ERROR("E19999", "Create data node in graph:%s failed", graph->GetName().c_str()); + GELOGE(INTERNAL_ERROR, "Create %d data node failed.", out_data_anchor->GetIdx()); + return INTERNAL_ERROR); for (auto &in_anchor : out_data_anchor->GetPeerInDataAnchors()) { GE_IF_BOOL_EXEC(in_anchor == nullptr, continue); NodePtr dst_node = in_anchor->GetOwnerNode(); if (GraphUtils::RemoveEdge(out_data_anchor, in_anchor) != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "Remove edge between op:%s(%s)(index:%zu) and op:%s(%s)(index:%d) failed", + node->GetName().c_str(), node->GetType().c_str(), out_index, + dst_node->GetName().c_str(), dst_node->GetType().c_str(), in_anchor->GetIdx()); GELOGE(INTERNAL_ERROR, "Failed to remove edge between %s to %s", node->GetName().c_str(), dst_node->GetName().c_str()); return INTERNAL_ERROR; } if (GraphUtils::AddEdge(data_node->GetOutDataAnchor(0), dst_node->GetInDataAnchor(in_anchor->GetIdx())) != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(index:0) and op:%s(%s)(index:%d) failed", + data_node->GetName().c_str(), data_node->GetType().c_str(), + dst_node->GetName().c_str(), dst_node->GetType().c_str(), in_anchor->GetIdx()); GELOGE(INTERNAL_ERROR, "Failed to add edge between %s to %s", data_node->GetName().c_str(), dst_node->GetName().c_str()); return INTERNAL_ERROR; @@ -999,6 +1134,8 @@ Status MultiBatchClonePass::CreateOriGraph(const ComputeGraphPtr &graph) { } } if (graph->RemoveNode(node) != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "Remove node:%s(%s) from graph:%s failed", + node->GetName().c_str(), node->GetType().c_str(), graph->GetName().c_str()); GELOGE(GRAPH_FAILED, "Remove node %s failed!", node->GetName().c_str()); return GRAPH_FAILED; } @@ -1014,6 +1151,7 @@ NodePtr MultiBatchClonePass::CreateDataNode(const ComputeGraphPtr &graph, const std::string node_name = out_data_anchor->GetOwnerNode()->GetName() + "_" + std::to_string(out_anchor_index); OpDescPtr op_desc = MakeShared(node_name, DATA); if (op_desc == nullptr) { + REPORT_CALL_ERROR("E19999", "New OpDesc failed"); GELOGE(OUT_OF_MEMORY, "Create data node failed."); return nullptr; } @@ -1021,14 +1159,19 @@ NodePtr MultiBatchClonePass::CreateDataNode(const ComputeGraphPtr &graph, const OpDescPtr getnext_op_desc = out_data_anchor->GetOwnerNode()->GetOpDesc(); if (getnext_op_desc == nullptr) { + REPORT_INNER_ERROR("E19999", "Param out_data_anchor's owner node is nullptr, check invalid"); GELOGE(OUT_OF_MEMORY, "Op desc of %s is nullptr.", out_data_anchor->GetOwnerNode()->GetName().c_str()); return nullptr; } if (op_desc->AddInputDesc(getnext_op_desc->GetOutputDesc(out_anchor_index)) != 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(INTERNAL_ERROR, "Add %s input desc failed.", op_desc->GetName().c_str()); return nullptr; } if (op_desc->AddOutputDesc(getnext_op_desc->GetOutputDesc(out_anchor_index)) != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "Add output desc to op:%s(%s) failed", + getnext_op_desc->GetName().c_str(), getnext_op_desc->GetType().c_str()); GELOGE(INTERNAL_ERROR, "Add %s output desc failed.", op_desc->GetName().c_str()); return nullptr; } @@ -1052,7 +1195,9 @@ Status MultiBatchClonePass::CreateSubgraphs(const ComputeGraphPtr &graph, const std::vector output_nodes; const std::string postfix = kMultiBatchNodePostfix + std::to_string(i); ComputeGraphPtr subgraph = (i == 0) ? branch : GraphUtils::CloneGraph(branch, postfix, input_nodes, output_nodes); - GE_IF_BOOL_EXEC(subgraph == nullptr, GELOGE(FAILED, "Create multi-batch case node failed"); return FAILED); + GE_IF_BOOL_EXEC(subgraph == nullptr, + REPORT_CALL_ERROR("E19999", "Clone graph from graph:%s failed", branch->GetName().c_str()); + GELOGE(FAILED, "Create multi-batch case node failed"); return FAILED); subgraph->SetName("Batch_" + std::to_string(i)); subgraph->SetParentNode(case_node_); subgraph->SetParentGraph(graph); @@ -1095,6 +1240,9 @@ Status MultiBatchClonePass::UpdateSubgraphOutput() { GeTensorDescPtr tensor = op_desc->MutableInputDesc(index); GE_CHECK_NOTNULL(tensor); if (!AttrUtils::SetInt(tensor, ATTR_NAME_PARENT_NODE_INDEX, index)) { + REPORT_CALL_ERROR("E19999", "Set Attr:%s to input:%zu tensor of op:%s(%s) failed", + ATTR_NAME_PARENT_NODE_INDEX.c_str(), index, + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(FAILED, "Failed to set parent index for node %s", output_node->GetName().c_str()); return FAILED; } @@ -1138,9 +1286,9 @@ Status MultiBatchClonePass::PruneDirectOutput(const ComputeGraphPtr &graph) { return SUCCESS; } - GE_CHK_STATUS_RET(NodeUtils::RemoveOutputAnchor(case_node_, output_num - unused_num), "Remove output failed"); + GE_CHK_GRAPH_STATUS_RET(NodeUtils::RemoveOutputAnchor(case_node_, output_num - unused_num), "Remove output failed"); for (const auto &item : all_branch_output_) { - GE_CHK_STATUS_RET(NodeUtils::RemoveInputAnchor(item.second, output_num - unused_num), "Remove input failed"); + GE_CHK_GRAPH_STATUS_RET(NodeUtils::RemoveInputAnchor(item.second, output_num - unused_num), "Remove input failed"); } return SUCCESS; diff --git a/ge/graph/passes/multi_batch_pass.cc b/ge/graph/passes/multi_batch_pass.cc index 74f7e30e..eafe982c 100644 --- a/ge/graph/passes/multi_batch_pass.cc +++ b/ge/graph/passes/multi_batch_pass.cc @@ -21,6 +21,7 @@ #include "common/ge/ge_util.h" #include "graph/common/omg_util.h" #include "graph/utils/type_utils.h" +#include "common/formats/utils/formats_trans_utils.h" namespace ge { Status MultiBatchPass::Run(ComputeGraphPtr graph) { @@ -72,6 +73,8 @@ Status MultiBatchPass::Run(ComputeGraphPtr graph) { for (const NodePtr &node : bypass_nodes_) { if (GraphUtils::RemoveNodeWithoutRelink(graph, node) != 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(FAILED, "Remove SwitchN nodes %s failed.", node->GetName().c_str()); return FAILED; } @@ -139,11 +142,15 @@ Status MultiBatchPass::FindPredValue(const ComputeGraphPtr &graph, OutDataAnchor const auto &in_data_anchor = node->GetInDataAnchor(SWITCH_PRED_INPUT); if (in_data_anchor == nullptr) { + REPORT_INNER_ERROR("E19999", "Index:%u data anchor of node:%s(%s) is nullptr, check invalid", + SWITCH_PRED_INPUT, node->GetName().c_str(), node->GetType().c_str()); GELOGE(FAILED, "FindPredInput failed, in_data_anchor is null, node:%s.", node->GetName().c_str()); return FAILED; } const auto &pred_input = in_data_anchor->GetPeerOutAnchor(); if (pred_input == nullptr) { + REPORT_INNER_ERROR("E19999", "Index:%u data anchor of node:%s(%s), its peer anchor is nullptr, check invalid", + SWITCH_PRED_INPUT, node->GetName().c_str(), node->GetType().c_str()); GELOGE(FAILED, "FindPredInput failed, pred_input is null, node:%s.", node->GetName().c_str()); return FAILED; } @@ -151,6 +158,8 @@ Status MultiBatchPass::FindPredValue(const ComputeGraphPtr &graph, OutDataAnchor if (pred_value == nullptr) { pred_value = pred_input; } else if (pred_value != pred_input) { + REPORT_INNER_ERROR("E19999", "Multi pred_value of case node exist in graph:%s, check invalid", + graph->GetName().c_str()); GELOGE(FAILED, "Multi pred_value node exist."); return FAILED; } @@ -163,6 +172,7 @@ Status MultiBatchPass::FindPredValue(const ComputeGraphPtr &graph, OutDataAnchor } if (pred_value == nullptr) { + REPORT_INNER_ERROR("E19999", "Find Pred Input of case node in graph:%s failed", graph->GetName().c_str()); GELOGE(FAILED, "FindPredInput failed, pred_value is null."); return FAILED; } @@ -179,14 +189,22 @@ Status MultiBatchPass::GetDynamicType() { for (const auto &switch_n : switch_n_nodes_) { int32_t dynamic_type = static_cast(FIXED); if (!AttrUtils::GetInt(switch_n->GetOpDesc(), ATTR_DYNAMIC_TYPE, dynamic_type)) { + REPORT_CALL_ERROR("E19999", "Get Attr:%s from op:%s(%s) failed", ATTR_DYNAMIC_TYPE.c_str(), + switch_n->GetName().c_str(), switch_n->GetType().c_str()); GELOGE(FAILED, "Get attr ATTR_DYNAMIC_TYPE of node: %s failed.", switch_n->GetName().c_str()); return FAILED; } if (dynamic_type == static_cast(FIXED)) { + REPORT_INNER_ERROR("E19999", "Attr:%s in op:%s(%s), value:%d check invalid", ATTR_DYNAMIC_TYPE.c_str(), + switch_n->GetName().c_str(), switch_n->GetType().c_str(), dynamic_type); GELOGE(FAILED, "Attr ATTR_DYNAMIC_TYPE shouldn't be 0."); return FAILED; } if (dynamic_type_ != static_cast(FIXED) && dynamic_type_ != dynamic_type) { + REPORT_INNER_ERROR("E19999", "Attr:%s in op:%s(%s), value:%d not same as attr value:%d in node before, " + "check invalid", + ATTR_DYNAMIC_TYPE.c_str(), switch_n->GetName().c_str(), switch_n->GetType().c_str(), + dynamic_type, dynamic_type_); GELOGE(FAILED, "Attr ATTR_DYNAMIC_TYPE of all switch_n node should be same, while one is %d and another is %d.", dynamic_type, dynamic_type_); return FAILED; @@ -194,6 +212,7 @@ Status MultiBatchPass::GetDynamicType() { dynamic_type_ = dynamic_type; } if (dynamic_type_ == static_cast(FIXED)) { + REPORT_INNER_ERROR("E19999", "Find Attr:%s in all switcnn node failed", ATTR_DYNAMIC_TYPE.c_str()); GELOGE(FAILED, "Attr ATTR_DYNAMIC_TYPE shouldn't be 0."); return FAILED; } @@ -211,6 +230,8 @@ Status MultiBatchPass::GetUserDesignateShape() { for (const auto &switch_n : switch_n_nodes_) { std::vector cur_data_name_order; if (!AttrUtils::GetListStr(switch_n->GetOpDesc(), ATTR_USER_DESIGNEATE_SHAPE_ORDER, cur_data_name_order)) { + REPORT_CALL_ERROR("E19999", "Get Attr:%s from op:%s(%s) failed", ATTR_USER_DESIGNEATE_SHAPE_ORDER.c_str(), + switch_n->GetName().c_str(), switch_n->GetType().c_str()); GELOGE(FAILED, "Get attr ATTR_USER_DESIGNEATE_SHAPE_ORDER of node: %s failed.", switch_n->GetName().c_str()); return FAILED; } @@ -219,6 +240,11 @@ Status MultiBatchPass::GetUserDesignateShape() { first_check = false; } else { if (data_name_order_ != cur_data_name_order) { + REPORT_INNER_ERROR("E19999", "Attr:%s in op:%s(%s), value:%s not same as attr value:%s in node before, " + "check invalid", ATTR_USER_DESIGNEATE_SHAPE_ORDER.c_str(), + switch_n->GetName().c_str(), switch_n->GetType().c_str(), + formats::JoinToString(cur_data_name_order).c_str(), + formats::JoinToString(data_name_order_).c_str()); GELOGE(FAILED, "The ATTR_USER_DESIGNEATE_SHAPE_ORDER of switchN must be same: %s failed.", switch_n->GetName().c_str()); return FAILED; @@ -226,6 +252,7 @@ Status MultiBatchPass::GetUserDesignateShape() { } } if (data_name_order_.empty()) { + REPORT_INNER_ERROR("E19999", "Find Attr:%s in all switcnn node failed", ATTR_USER_DESIGNEATE_SHAPE_ORDER.c_str()); GELOGE(FAILED, "user shape order can not be empty"); return FAILED; } @@ -248,6 +275,8 @@ bool MultiBatchPass::CheckSwitchN(std::vector> &batch_shape if (batch_num == 0) { batch_num = tmp_num; } else if (batch_num != tmp_num) { + REPORT_INNER_ERROR("E19999", "Ouput size num:%u of node:%s(%s) not same as output size num:%d of node before, " + "check invalid", tmp_num, node->GetName().c_str(), node->GetType().c_str(), batch_num); GELOGE(FAILED, "Output size of SwitchN not equal;"); return false; } @@ -259,10 +288,12 @@ bool MultiBatchPass::CheckSwitchN(std::vector> &batch_shape } if (batch_shape.empty()) { + REPORT_INNER_ERROR("E19999", "batch_shape size is empty after GetBatchInfo, check invalid"); GELOGE(FAILED, "batch_shape is empty."); return false; } if (combined_batch.empty()) { + REPORT_INNER_ERROR("E19999", "combined_batch size is empty after GetBatchInfo, check invalid"); GELOGE(FAILED, "combined_batch is empty."); return false; } @@ -271,11 +302,15 @@ bool MultiBatchPass::CheckSwitchN(std::vector> &batch_shape for (uint32_t i = 1; i < batch_num; i++) { size_t tmp_dim_num = batch_shape[i].size(); if (dim_num != tmp_dim_num) { + REPORT_INNER_ERROR("E19999", "Dim num of batch_shape not equal, batch_0:%zu, batch_%u:%zu, check invalid", + dim_num, i, tmp_dim_num); GELOGE(FAILED, "Dim num of batch_shape not equal, batch_0:%zu, batch_%u:%zu.", dim_num, i, tmp_dim_num); return false; } size_t tmp_combined_dim_num = combined_batch[i].size(); if (combined_dim_num != tmp_combined_dim_num) { + REPORT_INNER_ERROR("E19999", "Dim num of combined_batch not equal, batch_0:%zu, batch_%u:%zu, check invalid", + combined_dim_num, i, tmp_combined_dim_num); GELOGE(FAILED, "Dim num of combined_batch not equal, batch_0:%zu, batch_%u:%zu.", combined_dim_num, i, tmp_combined_dim_num); return false; @@ -303,23 +338,32 @@ bool MultiBatchPass::GetBatchInfo(uint32_t batch_num, std::vectorGetOpDesc(); if (op_desc == nullptr) { + REPORT_INNER_ERROR("E19999", "OpDesc in node is nullptr, check invalid"); GELOGE(FAILED, "CheckDims failed, get op_desc failed, node: %s.", node->GetName().c_str()); return false; } std::vector output_dims; if (!AttrUtils::GetListInt(op_desc->GetOutputDesc(i), ATTR_NAME_SWITCHN_PRED_VALUE, output_dims)) { + REPORT_CALL_ERROR("E19999", "Get Attr:%s from output:%u tensor of op:%s(%s) failed", + ATTR_NAME_SWITCHN_PRED_VALUE.c_str(), i, + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(FAILED, "CheckDims failed, get attr ATTR_NAME_SWITCHN_PRED_VALUE failed, batch_index=%u.", i); return false; } idx_batch_shape.emplace_back(output_dims); output_dims.clear(); if (!AttrUtils::GetListInt(op_desc->GetOutputDesc(i), ATTR_NAME_COMBINED_DYNAMIC_DIMS, output_dims)) { + REPORT_CALL_ERROR("E19999", "Get Attr:%s from output:%u tensor of op:%s(%s) failed", + ATTR_NAME_COMBINED_DYNAMIC_DIMS.c_str(), i, + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(FAILED, "CheckDims failed, get attr ATTR_NAME_COMBINED_DYNAMIC_DIMS failed, batch_index=%u.", i); return false; } idx_combined_batch.emplace_back(output_dims); } if (!CheckDims(idx_batch_shape)) { + REPORT_INNER_ERROR("E19999", "Attr:%s of all output:%u tensor in switcnn node not equal, or not exist, " + "check invalid", ATTR_NAME_SWITCHN_PRED_VALUE.c_str(), i); GELOGE(FAILED, "CheckDims failed, batch_index=%u.", i); return false; } @@ -351,6 +395,9 @@ Status MultiBatchPass::FindSwitchOutNodes(uint32_t batch_num) { } bypass_nodes_.emplace_back(out_node); if (GraphUtils::RemoveEdge(out_data_anchor, peer_in_anchor) != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "Remove edge between op:%s(%s)(index:%d) and op:%s(%s)(index:%d) failed", + node->GetName().c_str(), node->GetType().c_str(), i, + out_node->GetName().c_str(), out_node->GetType().c_str(), peer_in_anchor->GetIdx()); GELOGE(FAILED, "Remove SwitchN out_data_edge failed, %s->%s.", node->GetName().c_str(), out_node->GetName().c_str()); return FAILED; @@ -359,6 +406,9 @@ Status MultiBatchPass::FindSwitchOutNodes(uint32_t batch_num) { output_nodes.emplace_back(identity_out_node); if (GraphUtils::RemoveEdge(out_node->GetOutControlAnchor(), identity_out_node->GetInControlAnchor()) != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "Remove control edge between op:%s(%s) and op:%s(%s) failed", + out_node->GetName().c_str(), out_node->GetType().c_str(), + identity_out_node->GetName().c_str(), identity_out_node->GetType().c_str()); GELOGE(FAILED, "Remove SwitchN out_data_edge failed, %s->%s.", node->GetName().c_str(), out_node->GetName().c_str()); return FAILED; @@ -401,6 +451,9 @@ Status MultiBatchPass::ReplaceSwitchN(const ComputeGraphPtr &graph, const OutDat // Add switchCase input edge if (GraphUtils::AddEdge(pred_value, switch_case->GetInDataAnchor(0)) != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "Remove edge between op:%s(%s)(index:%d) and op:%s(%s)(index:0) failed", + pred_value_node->GetName().c_str(), pred_value_node->GetType().c_str(), pred_value->GetIdx(), + switch_case->GetName().c_str(), switch_case->GetType().c_str()); GELOGE(FAILED, "Add SwitchCase in_data_edge failed, %s->%s.", pred_value_node->GetName().c_str(), switch_case->GetName().c_str()); return FAILED; @@ -448,6 +501,7 @@ NodePtr MultiBatchPass::CreateSwitchCaseNode(const ComputeGraphPtr &graph, const const std::vector> &combined_batch) { OpDescPtr op_desc = MakeShared(name, STREAMSWITCHN); if (op_desc == nullptr) { + REPORT_CALL_ERROR("E19999", "New OpDesc failed"); GELOGE(FAILED, "Create op_desc failed, StreamSwitchN:%s.", name.c_str()); return nullptr; } @@ -455,41 +509,56 @@ NodePtr MultiBatchPass::CreateSwitchCaseNode(const ComputeGraphPtr &graph, const GELOGI("Create StreamSwitchN op:%s.", name.c_str()); OpDescPtr pred_desc = pred_value->GetOwnerNode()->GetOpDesc(); if (pred_desc == nullptr) { + REPORT_INNER_ERROR("E19999", "OpDesc in node is nullptr, check invalid"); GELOGE(FAILED, "Get pred_desc failed, StreamSwitchN:%s.", name.c_str()); return nullptr; } if (op_desc->AddInputDesc(pred_desc->GetOutputDesc(pred_value->GetIdx())) != 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, "AddInputDesc failed, StreamSwitchN:%s.", name.c_str()); return nullptr; } NodePtr switch_case_node = graph->AddNode(op_desc); if (switch_case_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 node failed, StreamSwitchN:%s.", name.c_str()); return nullptr; } uint32_t batch_num = static_cast(batch_shape.size()); if (!AttrUtils::SetInt(op_desc, ATTR_NAME_BATCH_NUM, batch_num)) { + REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed", ATTR_NAME_BATCH_NUM.c_str(), + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(FAILED, "set attr ATTR_NAME_BATCH_NUM failed, StreamSwitchN:%s.", name.c_str()); return nullptr; } if (!AttrUtils::SetInt(op_desc, ATTR_DYNAMIC_TYPE, dynamic_type_)) { + REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed", ATTR_DYNAMIC_TYPE.c_str(), + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(FAILED, "Set attr ATTR_DYNAMIC_TYPE failed, StreamSwitchN:%s.", name.c_str()); return nullptr; } if (!AttrUtils::SetListStr(op_desc, ATTR_USER_DESIGNEATE_SHAPE_ORDER, data_name_order_)) { + REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed", ATTR_USER_DESIGNEATE_SHAPE_ORDER.c_str(), + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(FAILED, "Set attr ATTR_USER_DESIGNEATE_SHAPE_ORDER failed, StreamSwitchN:%s.", name.c_str()); return nullptr; } for (uint32_t i = 0; i < batch_num; i++) { const std::string &attr_name = ATTR_NAME_PRED_VALUE + "_" + std::to_string(i); if (!AttrUtils::SetListInt(op_desc, attr_name, batch_shape[i])) { + REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed", attr_name.c_str(), + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(FAILED, "set attr ATTR_NAME_PRED_VALUE failed, StreamSwitchN:%s.", name.c_str()); return nullptr; } const std::string &attr_combined_batch = ATTR_NAME_COMBINED_BATCH + "_" + std::to_string(i); if (!AttrUtils::SetListInt(op_desc, attr_combined_batch, combined_batch[i])) { + REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed", attr_combined_batch.c_str(), + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(FAILED, "set attr ATTR_NAME_COMBINED_BATCH failed, StreamSwitchN:%s.", name.c_str()); return nullptr; } @@ -507,11 +576,15 @@ NodePtr MultiBatchPass::CreateSwitchCaseNode(const ComputeGraphPtr &graph, const Status MultiBatchPass::BypassSwitchN(const NodePtr &switch_n_node, const NodePtr &switch_case) { InDataAnchorPtr in_data_anchor = switch_n_node->GetInDataAnchor(SWITCH_DATA_INPUT); if (in_data_anchor == nullptr) { + REPORT_INNER_ERROR("E19999", "Index:%u in data anchor of node:%s(%s) is nullptr, check invalid", + SWITCH_DATA_INPUT, switch_n_node->GetName().c_str(), switch_n_node->GetType().c_str()); GELOGE(FAILED, "Check in_data_anchor failed, SwitchN:%s.", switch_n_node->GetName().c_str()); return FAILED; } OutDataAnchorPtr peer_data_anchor = in_data_anchor->GetPeerOutAnchor(); if (peer_data_anchor == nullptr) { + REPORT_INNER_ERROR("E19999", "Index:%u in data anchor of node:%s(%s), its peer ahcnhor is nullptr, check invalid", + SWITCH_DATA_INPUT, switch_n_node->GetName().c_str(), switch_n_node->GetType().c_str()); GELOGE(FAILED, "Check peer_data_anchor failed, SwitchN:%s.", switch_n_node->GetName().c_str()); return FAILED; } @@ -519,11 +592,17 @@ Status MultiBatchPass::BypassSwitchN(const NodePtr &switch_n_node, const NodePtr // Remove SwitchN data input if (GraphUtils::RemoveEdge(peer_data_anchor, in_data_anchor) != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "Remove edge between op:%s(%s)(index:%d) and op:%s(%s)(index:%u) failed", + data_input->GetName().c_str(), data_input->GetType().c_str(), peer_data_anchor->GetIdx(), + switch_n_node->GetName().c_str(), switch_n_node->GetType().c_str(), SWITCH_DATA_INPUT); GELOGE(FAILED, "Remove SwitchN in_data_edge failed, %s->%s.", data_input->GetName().c_str(), switch_n_node->GetName().c_str()); return FAILED; } if (GraphUtils::AddEdge(data_input->GetOutControlAnchor(), switch_case->GetInControlAnchor()) != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "Add control edge between op:%s(%s) and op:%s(%s) failed", + data_input->GetName().c_str(), data_input->GetType().c_str(), + switch_case->GetName().c_str(), switch_case->GetType().c_str()); GELOGE(FAILED, "Add StreamSwitchN in_control_edge failed, %s->%s.", data_input->GetName().c_str(), switch_case->GetName().c_str()); return FAILED; @@ -535,11 +614,20 @@ Status MultiBatchPass::BypassSwitchN(const NodePtr &switch_n_node, const NodePtr NodePtr data_output = peer_in_anchor->GetOwnerNode(); if ((GraphUtils::RemoveEdge(out_data_anchor, peer_in_anchor) != GRAPH_SUCCESS) || (GraphUtils::AddEdge(peer_data_anchor, peer_in_anchor) != GRAPH_SUCCESS)) { + REPORT_CALL_ERROR("E19999", "Remove edge between op:%s(%s)(index:%d) and op:%s(%s)(index:%d) or " + "Add edge between op:%s(%s)(index:%d) and op:%s(%s)(index:%d) failed", + switch_n_node->GetName().c_str(), switch_n_node->GetType().c_str(), out_data_anchor->GetIdx(), + data_output->GetName().c_str(), data_output->GetType().c_str(), peer_in_anchor->GetIdx(), + data_input->GetName().c_str(), data_input->GetType().c_str(), peer_data_anchor->GetIdx(), + data_output->GetName().c_str(), data_output->GetType().c_str(), peer_in_anchor->GetIdx()); GELOGE(FAILED, "Bypass SwitchN data_edge failed, %s->%s->%s.", data_input->GetName().c_str(), switch_n_node->GetName().c_str(), data_output->GetName().c_str()); return FAILED; } if (GraphUtils::AddEdge(switch_case->GetOutControlAnchor(), data_output->GetInControlAnchor()) != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "Add control edge between op:%s(%s) and op:%s(%s) failed", + switch_case->GetName().c_str(), switch_case->GetType().c_str(), + data_output->GetName().c_str(), data_output->GetType().c_str()); GELOGE(FAILED, "Add SwitchCase out_control_edge failed, %s->%s.", switch_case->GetName().c_str(), data_output->GetName().c_str()); return FAILED; @@ -602,10 +690,15 @@ Status MultiBatchPass::AttachBatchLabel(uint32_t batch_idx) { if (cur_desc->HasAttr(ATTR_NAME_BATCH_LABEL)) { std::string tmp_label; if (!AttrUtils::GetStr(cur_desc, ATTR_NAME_BATCH_LABEL, tmp_label)) { + REPORT_CALL_ERROR("E19999", "Get Attr:%s from op:%s(%s) failed", ATTR_NAME_BATCH_LABEL.c_str(), + cur_desc->GetName().c_str(), cur_desc->GetType().c_str()); GELOGE(FAILED, "get attr ATTR_NAME_BATCH_LABEL failed, node: %s.", cur_desc->GetName().c_str()); return FAILED; } if (tmp_label != batch_label) { + REPORT_INNER_ERROR("E19999", "Attr:%s from op:%s(%s) value:%s not equal to expect:%s, check invalid", + ATTR_NAME_BATCH_LABEL.c_str(), cur_desc->GetName().c_str(), cur_desc->GetType().c_str(), + tmp_label.c_str(), batch_label.c_str()); GELOGE(FAILED, "Reach other batch_branch, node:%s, cur_label:%s, batch_label:%s.", cur_desc->GetName().c_str(), tmp_label.c_str(), batch_label.c_str()); return FAILED; @@ -613,6 +706,8 @@ Status MultiBatchPass::AttachBatchLabel(uint32_t batch_idx) { } GELOGD("Attach batch_label %s to node %s.", batch_label.c_str(), cur_desc->GetName().c_str()); if (!AttrUtils::SetStr(cur_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(), + cur_desc->GetName().c_str(), cur_desc->GetType().c_str()); GELOGE(FAILED, "set attr ATTR_NAME_BATCH_LABEL failed, node:%s.", cur_desc->GetName().c_str()); return FAILED; } @@ -625,6 +720,8 @@ Status MultiBatchPass::AttachBatchLabel(uint32_t batch_idx) { continue; } if (type == NETOUTPUT) { + REPORT_CALL_ERROR("E19999", "SReach net_output without Merge, cur_node:%s(%s), check invalid", + cur_node->GetName().c_str(), cur_node->GetType().c_str()); GELOGE(FAILED, "Reach net_output without Merge, cur_node:%s.", cur_node->GetName().c_str()); return FAILED; } @@ -661,6 +758,8 @@ Status MultiBatchPass::AttachStreamLabel(uint32_t batch_idx, const std::string & GELOGD("Attach stream_label %s to node %s.", stream_label.c_str(), cur_desc->GetName().c_str()); if (SetStreamLabel(cur_node, stream_label) != SUCCESS) { + REPORT_CALL_ERROR("E19999", "Set stream_label:%s to op:%s(%s) failed", + stream_label.c_str(), cur_node->GetName().c_str(), cur_node->GetType().c_str()); GELOGE(FAILED, "Set stream_label failed, node:%s.", cur_node->GetName().c_str()); return FAILED; } diff --git a/ge/graph/passes/net_output_pass.cc b/ge/graph/passes/net_output_pass.cc index 28916706..3ac1100d 100644 --- a/ge/graph/passes/net_output_pass.cc +++ b/ge/graph/passes/net_output_pass.cc @@ -48,10 +48,14 @@ Status NetOutputPass::GetRetvalOutputInfo(const ge::NodePtr &node, GE_CHECK_NOTNULL(node->GetOpDesc()); int64_t output_index = 0; if (!AttrUtils::GetInt(node->GetOpDesc(), RETVAL_ATTR_NAME_INDEX, output_index)) { + REPORT_CALL_ERROR("E19999", "Get Attr:%s from op:%s(%s) failed", RETVAL_ATTR_NAME_INDEX.c_str(), + node->GetName().c_str(), node->GetType().c_str()); GELOGE(PARAM_INVALID, "Get output index failed."); return PARAM_INVALID; } if (retval_node_index_map.count(output_index) > 0) { + REPORT_INNER_ERROR("E19999", "Attr:%s from op:%s(%s), value:%ld duplicate with other node, check invalid", + RETVAL_ATTR_NAME_INDEX.c_str(), node->GetName().c_str(), node->GetType().c_str(), output_index); GELOGE(PARAM_INVALID, "Retval has duplicate index."); return PARAM_INVALID; } @@ -138,10 +142,13 @@ Status NetOutputPass::CheckOutputNodeInfo(const ComputeGraphPtr &graph, const st for (auto &item : outputs) { NodePtr node = item.output_node; if (node == nullptr) { + REPORT_INNER_ERROR("E19999", "Param outputs has item which output_node is nullptr, check invalid"); GELOGE(PARAM_INVALID, "Node in outputs is null."); return PARAM_INVALID; } else { if (graph->FindNode(node->GetName()) == nullptr) { + REPORT_INNER_ERROR("E19999", "Find node:%s from graph:%s failed", + node->GetName().c_str(), graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "Out node (%s) is not in graph.", node->GetName().c_str()); return INTERNAL_ERROR; } @@ -149,6 +156,8 @@ Status NetOutputPass::CheckOutputNodeInfo(const ComputeGraphPtr &graph, const st int32_t out_size = node->GetOpDesc()->GetOutputsSize(); int32_t index = item.node_output_index; if (index < 0 || index >= out_size) { + REPORT_INNER_ERROR("E19999", "Index:%d in param outputs item, < 0 or > output size:%d of node:%s(%s)", + index, out_size, node->GetName().c_str(), node->GetType().c_str()); GELOGE(PARAM_INVALID, "User declared out node (%s) output index:%d must be smaller " "than node ouput size:%d and cann't be negative!", @@ -178,6 +187,8 @@ Status NetOutputPass::RemoveUnusedNode(const ge::ComputeGraphPtr &graph) { continue; } if (graph->RemoveNode(node) != GRAPH_SUCCESS) { + REPORT_INNER_ERROR("E19999", "Remove node:%s(%s) from graph:%s failed", + node->GetName().c_str(), node->GetType().c_str(), graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "Remove node failed, node name:%s.", node->GetName().c_str()); return INTERNAL_ERROR; } @@ -188,10 +199,13 @@ Status NetOutputPass::RemoveUnusedNode(const ge::ComputeGraphPtr &graph) { Status NetOutputPass::UpdateNetOutputDesc(const ge::NodePtr &net_output) { OpDescPtr net_output_desc = net_output->GetOpDesc(); if (net_output_desc == nullptr) { + REPORT_INNER_ERROR("E19999", "OpDesc in Param net_output is nullptr, check invalid"); GELOGE(INTERNAL_ERROR, "Opdesc of net output node is nullptr."); return INTERNAL_ERROR; } if (net_output_desc->GetInputsSize() == 0) { + REPORT_INNER_ERROR("E19999", "Input desc num of node:%s(%s) is 0, check invalid", + net_output_desc->GetName().c_str(), net_output_desc->GetType().c_str()); GELOGE(INTERNAL_ERROR, "Net output node input is empty."); return INTERNAL_ERROR; } @@ -201,6 +215,9 @@ Status NetOutputPass::UpdateNetOutputDesc(const ge::NodePtr &net_output) { GE_CHECK_NOTNULL(in_anchor); uint32_t index = static_cast(in_anchor->GetIdx()); if (index >= net_output_desc->GetAllInputsDesc().size()) { + REPORT_INNER_ERROR("E19999", "Node:%s(%s) has in_anchor index:%u >= its input desc num:%zu, check invalid", + net_output_desc->GetName().c_str(), net_output_desc->GetType().c_str(), index, + net_output_desc->GetAllInputsDesc().size()); GELOGE(INTERNAL_ERROR, "Index is invalid, index:%u, size:%zu.", index, net_output_desc->GetAllInputsDesc().size()); return INTERNAL_ERROR; @@ -212,6 +229,8 @@ Status NetOutputPass::UpdateNetOutputDesc(const ge::NodePtr &net_output) { uint32_t peer_index = static_cast(in_anchor->GetPeerOutAnchor()->GetIdx()); ge::GeTensorDesc output_in_desc = src_op_desc->GetOutputDesc(peer_index); if (net_output_desc->UpdateInputDesc(index, output_in_desc) != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "Update input desc of op:%s(%s) failed, index:%u", + net_output_desc->GetName().c_str(), net_output_desc->GetType().c_str(), index); GELOGE(INTERNAL_ERROR, "Update input desc failed, index:%u.", index); return INTERNAL_ERROR; } @@ -225,6 +244,7 @@ Status NetOutputPass::UpdateNetOutputDesc(const ge::NodePtr &net_output) { Status NetOutputPass::AddCtrlEdgeForTargets(const ge::NodePtr &net_out_node) { if (net_out_node == nullptr) { + REPORT_INNER_ERROR("E19999", "Param net_out_node is nullptr, check invalid"); GELOGE(PARAM_INVALID, "net out node is null."); return PARAM_INVALID; } @@ -236,6 +256,9 @@ Status NetOutputPass::AddCtrlEdgeForTargets(const ge::NodePtr &net_out_node) { // no need to check null because have handled it in run SaveAndRemoveTargets function graphStatus status = GraphUtils::AddEdge(node->GetOutControlAnchor(), net_out_node->GetInControlAnchor()); if (status != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "Add control edge between op:%s(%s) and op:%s(%s) failed", + node->GetName().c_str(), node->GetType().c_str(), + net_out_node->GetName().c_str(), net_out_node->GetType().c_str()); GELOGE(INTERNAL_ERROR, "Add ctrl edge to netoutput node[%s] for target node [%s] failed!", net_out_node->GetName().c_str(), node->GetName().c_str()); return INTERNAL_ERROR; @@ -267,6 +290,9 @@ Status NetOutputPass::AddEdgesForNetOutput(const ge::ComputeGraphPtr &graph, con graphStatus status = GraphUtils::AddEdge(src_node->GetOutDataAnchor(item.node_output_index), net_out_node->GetInDataAnchor(net_input_index)); if (status != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(index:%u) and op:%s(%s)(index:%d) failed", + src_node->GetName().c_str(), src_node->GetType().c_str(), item.node_output_index, + net_out_node->GetName().c_str(), net_out_node->GetType().c_str(), net_input_index); GELOGE(INTERNAL_ERROR, "AddEdge failed, src name:%s, src index:%d, dst index:%d.", src_node->GetName().c_str(), item.node_output_index, net_input_index); return INTERNAL_ERROR; @@ -278,10 +304,15 @@ Status NetOutputPass::AddEdgesForNetOutput(const ge::ComputeGraphPtr &graph, con graph->GetName().c_str()); auto input_desc = net_out_node->GetOpDesc()->MutableInputDesc(net_input_index); if (input_desc == nullptr) { + REPORT_CALL_ERROR("E19999", "Node:%s(%s) has no input desc index is %d, check invalid", + net_out_node->GetName().c_str(), net_out_node->GetType().c_str(), net_input_index); GELOGE(INTERNAL_ERROR, "Can not find intput tensor desc from NetOutput, index %d", net_input_index); return INTERNAL_ERROR; } if (!AttrUtils::SetInt(input_desc, ATTR_NAME_PARENT_NODE_INDEX, item.parent_node_index)) { + REPORT_CALL_ERROR("E19999", "Set Attr:%s to input:%d tensor of op:%s(%s) failed", + ATTR_NAME_PARENT_NODE_INDEX.c_str(), net_input_index, + net_out_node->GetName().c_str(), net_out_node->GetType().c_str()); GELOGE(INTERNAL_ERROR, "Failed to add parent index to NetOutput, index %d", net_input_index); return INTERNAL_ERROR; } @@ -298,6 +329,8 @@ Status NetOutputPass::AddEdgesForNetOutput(const ge::ComputeGraphPtr &graph, con } // Add true stream, netoutput is 0 GE_IF_BOOL_EXEC(!ge::AttrUtils::SetInt(net_out_node->GetOpDesc(), ATTR_NAME_TRUE_BRANCH_STREAM, 0), + REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed", ATTR_NAME_TRUE_BRANCH_STREAM.c_str(), + net_out_node->GetName().c_str(), net_out_node->GetType().c_str()); GELOGE(INTERNAL_ERROR, "set ATTR_NAME_TRUE_BRANCH_STREAM failed"); return INTERNAL_ERROR); return SUCCESS; @@ -314,6 +347,7 @@ bool NetOutputPass::CheckNodeIsInOutputNodes(const ge::ComputeGraphPtr &graph, c } Status NetOutputPass::UnLinkDataAnchorOfNetoutput(const ge::ComputeGraphPtr &graph, const ge::NodePtr &net_out_node) { if (net_out_node == nullptr) { + REPORT_INNER_ERROR("E19999", "Param net_out_node is nullptr, check invalid"); GELOGE(PARAM_INVALID, "net out node is null."); return PARAM_INVALID; } @@ -335,6 +369,10 @@ Status NetOutputPass::UnLinkDataAnchorOfNetoutput(const ge::ComputeGraphPtr &gra if (!CheckNodeIsInOutputNodes(graph, node)) { ret = in_data_anchor->Unlink(peer_out_anchor); if (ret != SUCCESS) { + REPORT_CALL_ERROR("E19999", + "Op:%s(%s) out index:%d unlink from op:%s(%s) in index:%d failed", + net_out_node->GetName().c_str(), net_out_node->GetType().c_str(), in_data_anchor->GetIdx(), + node->GetName().c_str(), node->GetType().c_str(), peer_out_anchor->GetIdx()); GELOGE(INTERNAL_ERROR, "Unlink peer_out_anchor fail!"); return ret; } @@ -349,12 +387,14 @@ Status NetOutputPass::UnLinkDataAnchorOfNetoutput(const ge::ComputeGraphPtr &gra Status NetOutputPass::UnLinkControlAnchorOfNetoutput(const ge::ComputeGraphPtr &graph, const ge::NodePtr &net_out_node) { if (net_out_node == nullptr) { + REPORT_INNER_ERROR("E19999", "Param net_out_node is nullptr, check invalid"); GELOGE(PARAM_INVALID, "net out node is null."); return PARAM_INVALID; } Status ret = SUCCESS; auto in_control_anchor = net_out_node->GetInControlAnchor(); if (in_control_anchor == nullptr) { + REPORT_INNER_ERROR("E19999", "Param net_out_node's in control anchor is nullptr, check invalid"); GELOGE(PARAM_INVALID, "in control anchor is null."); return PARAM_INVALID; } @@ -369,6 +409,9 @@ Status NetOutputPass::UnLinkControlAnchorOfNetoutput(const ge::ComputeGraphPtr & if (CheckNodeIsInOutputNodes(graph, node) == false) { ret = in_control_anchor->Unlink(peer_out_data_anchor); if (ret != SUCCESS) { + REPORT_CALL_ERROR("E19999", "Op:%s(%s) unlink control edge from op:%s(%s) failed", + net_out_node->GetName().c_str(), net_out_node->GetType().c_str(), + node->GetName().c_str(), node->GetType().c_str()); GELOGE(INTERNAL_ERROR, "Unlink peer_out_anchor fail!"); return ret; } @@ -441,8 +484,8 @@ Status NetOutputPass::AddCtrlEdgesBetweenLeafAndNetOutput(const ge::ComputeGraph if ((node->GetInControlNodes().size() != 0 || node->GetInDataNodes().size() != 0 || graph_has_only_one_node_except_netoutput) && node->GetOutDataNodesSize() == 0 && node->GetOutControlNodes().size() == 0) { - GE_CHK_STATUS_RET(GraphUtils::AddEdge(node->GetOutControlAnchor(), net_out_node->GetInControlAnchor()), - "add edge failed"); + GE_CHK_GRAPH_STATUS_RET(GraphUtils::AddEdge(node->GetOutControlAnchor(), net_out_node->GetInControlAnchor()), + "add edge failed"); GELOGD("Add ctrl edge success. src name :%s, dst name :%s", node->GetName().c_str(), net_out_node->GetName().c_str()); } @@ -456,6 +499,7 @@ Status NetOutputPass::CreateNetOutputNode(OpDescPtr &net_output_desc, const ge:: (graph->GetParentGraph() != nullptr) ? (graph->GetName() + "_" + NODE_NAME_NET_OUTPUT) : NODE_NAME_NET_OUTPUT; net_output_desc = MakeShared(node_name, NETOUTPUT); if (net_output_desc == nullptr) { + REPORT_CALL_ERROR("E19999", "New OpDesc failed"); GELOGE(MEMALLOC_FAILED, "Make shared net output op failed."); return MEMALLOC_FAILED; } @@ -466,6 +510,7 @@ Status NetOutputPass::CreateNetOutputNode(OpDescPtr &net_output_desc, const ge:: Status NetOutputPass::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."); return GE_GRAPH_PARAM_NULLPTR; } @@ -518,12 +563,17 @@ Status NetOutputPass::AddNetOutputNodeToGraph(const ge::ComputeGraphPtr &graph, // because retval node is contained by output_nodes_info, here means targets is non-empty output_node = graph->AddNode(net_output_desc); if (output_node == nullptr) { + REPORT_CALL_ERROR("E19999", "Add node:%s(%s) to graph:%s failed", + net_output_desc->GetName().c_str(), net_output_desc->GetType().c_str(), + graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "Add output node failed."); return INTERNAL_ERROR; } GE_CHK_STATUS_RET(AddCtrlEdgeForTargets(output_node), "add ctrl edge for targets failed"); // Add true stream, netoutput is 0 GE_IF_BOOL_EXEC(!ge::AttrUtils::SetInt(output_node->GetOpDesc(), ATTR_NAME_TRUE_BRANCH_STREAM, 0), + REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed", ATTR_NAME_TRUE_BRANCH_STREAM.c_str(), + output_node->GetName().c_str(), output_node->GetType().c_str()); GELOGE(INTERNAL_ERROR, "set ATTR_NAME_TRUE_BRANCH_STREAM failed"); return INTERNAL_ERROR); return SUCCESS; @@ -532,6 +582,9 @@ Status NetOutputPass::AddNetOutputNodeToGraph(const ge::ComputeGraphPtr &graph, AddInOutForNetOutputOp(graph, net_output_desc, output_nodes_info); output_node = graph->AddNode(net_output_desc); if (output_node == nullptr) { + REPORT_CALL_ERROR("E19999", "Add node:%s(%s) to graph:%s failed", + net_output_desc->GetName().c_str(), net_output_desc->GetType().c_str(), + graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "Add output node failed."); return INTERNAL_ERROR; } @@ -565,6 +618,8 @@ void NetOutputPass::AddInOutForNetOutputOp(const ComputeGraphPtr &graph, OpDescP /// Get the output attribute of src_node, /// and set to the input/output of net_out_node. if (src_node == nullptr || src_node->GetOpDesc() == nullptr || net_output_desc == nullptr) { + REPORT_INNER_ERROR("E19999", "Param output_nodes_info has RetvalInfo item, which src_node is invalid; " + "or Param net_output_desc is nullptr, check invalid"); GELOGE(INTERNAL_ERROR, "src node or net output desc is null."); return; } @@ -664,10 +719,14 @@ Status NetOutputPass::SetUserDefDTypeAndFormatFromAtcParams(const NodePtr &outpu } } if (!userdef_dtypes.empty() && !ge::AttrUtils::SetListStr(op_desc, ATTR_ATC_USER_DEFINE_DATATYPE, userdef_dtypes)) { + REPORT_INNER_ERROR("E19999", "User define datatype is empty or Set Attr:%s to op:%s(%s) failed", + ATTR_ATC_USER_DEFINE_DATATYPE.c_str(), op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(INTERNAL_ERROR, "Set user_define_dtype attr list for netoutput failed."); return INTERNAL_ERROR; } if (!userdef_formats.empty() && !ge::AttrUtils::SetListStr(op_desc, ATTR_ATC_USER_DEFINE_FORMAT, userdef_formats)) { + REPORT_INNER_ERROR("E19999", "User define format is empty or Set Attr:%s to op:%s(%s) failed", + ATTR_ATC_USER_DEFINE_FORMAT.c_str(), op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(INTERNAL_ERROR, "Set user_define_format attr list for netoutput failed."); return INTERNAL_ERROR; } diff --git a/ge/graph/passes/next_iteration_pass.cc b/ge/graph/passes/next_iteration_pass.cc index 201eff3d..c52e6743 100644 --- a/ge/graph/passes/next_iteration_pass.cc +++ b/ge/graph/passes/next_iteration_pass.cc @@ -71,6 +71,8 @@ Status NextIterationPass::GroupEnterNode(const NodePtr &enter_node) { GE_CHECK_NOTNULL(enter_desc); std::string frame_name; if (!ge::AttrUtils::GetStr(enter_desc, ENTER_ATTR_FRAME_NAME, frame_name) || frame_name.empty()) { + REPORT_CALL_ERROR("E19999", "Get Attr:%s from op:%s(%s) failed", ENTER_ATTR_FRAME_NAME.c_str(), + enter_desc->GetName().c_str(), enter_desc->GetType().c_str()); GELOGE(FAILED, "Get attr ENTER_ATTR_FRAME_NAME failed, node: %s", enter_desc->GetName().c_str()); return FAILED; } @@ -84,6 +86,7 @@ Status NextIterationPass::GroupEnterNode(const NodePtr &enter_node) { if (iter == loop_group_map_.end()) { LoopCondGroupPtr loop_group = MakeShared(); if (loop_group == nullptr) { + REPORT_CALL_ERROR("E19999", "New LoopCondGroup failed"); GELOGE(FAILED, "MakeShared for LoopCondGroup failed."); return FAILED; } @@ -127,6 +130,8 @@ Status NextIterationPass::FindWhileGroups() { continue; } if (!AttrUtils::SetInt(switch_node->GetOpDesc(), ATTR_NAME_STREAM_SWITCH_TYPE, kLoopType)) { + REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed", ATTR_NAME_STREAM_SWITCH_TYPE.c_str(), + switch_node->GetName().c_str(), switch_node->GetType().c_str()); GELOGE(INTERNAL_ERROR, "set int failed"); return INTERNAL_ERROR; } @@ -138,6 +143,7 @@ Status NextIterationPass::FindWhileGroups() { if (loop_group_iter.second->loop_cond == nullptr) { loop_group_iter.second->loop_cond = loop_cond; } else if (loop_group_iter.second->loop_cond != loop_cond) { + REPORT_INNER_ERROR("E19999", "Multi LoopCond nodes exist, frame_name:%s, check invalid", frame_name.c_str()); GELOGE(FAILED, "Multi LoopCond nodes exist, frame_name: %s.", frame_name.c_str()); return FAILED; } @@ -157,16 +163,20 @@ bool NextIterationPass::VerifyWhileGroup() { for (const auto &loop_group_iter : loop_group_map_) { const std::string &frame_name = loop_group_iter.first; if (frame_name.empty()) { + REPORT_INNER_ERROR("E19999", "Verify while group failed, frame_name is empty"); GELOGE(INTERNAL_ERROR, "Verify while group failed, frame_name is empty."); return false; } if (loop_group_iter.second->loop_cond == nullptr) { + REPORT_INNER_ERROR("E19999", "Verify while group failed, LoopCond is null, frame_name:%s.", frame_name.c_str()); GELOGE(INTERNAL_ERROR, "Verify while group failed, LoopCond is null, frame_name: %s.", frame_name.c_str()); return false; } for (const auto &pair_iter : loop_group_iter.second->merge_next_pairs) { if ((pair_iter.first == nullptr) || (pair_iter.second == nullptr)) { + REPORT_INNER_ERROR("E19999", "Verify while group failed, merge_node/next_node is null, frame_name:%s.", + frame_name.c_str()); GELOGE(INTERNAL_ERROR, "Verify while group failed, merge_node/next_node is null, frame_name: %s.", frame_name.c_str()); return false; @@ -198,6 +208,9 @@ Status NextIterationPass::HandleWhileGroup(ComputeGraphPtr &graph) { for (const auto &enter_node : loop_cond_iter.second->enter_nodes) { // Enter --> Active if (GraphUtils::AddEdge(enter_node->GetOutControlAnchor(), enter_active->GetInControlAnchor()) != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "Add control edge between op:%s(%s) and op:%s(%s) failed", + enter_node->GetName().c_str(), enter_node->GetType().c_str(), + enter_active->GetName().c_str(), enter_active->GetType().c_str()); GELOGE(INTERNAL_ERROR, "Add control edge from %s to %s failed.", enter_node->GetName().c_str(), enter_active->GetName().c_str()); return INTERNAL_ERROR; @@ -209,12 +222,18 @@ Status NextIterationPass::HandleWhileGroup(ComputeGraphPtr &graph) { NodePtr next_node = pair.second; // Active --> Merge if (GraphUtils::AddEdge(enter_active->GetOutControlAnchor(), merge_node->GetInControlAnchor()) != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "Add control edge between op:%s(%s) and op:%s(%s) failed", + enter_active->GetName().c_str(), enter_active->GetType().c_str(), + merge_node->GetName().c_str(), merge_node->GetType().c_str()); GELOGE(INTERNAL_ERROR, "Add control edge failed."); return INTERNAL_ERROR; } // NextIteration --> Active if (GraphUtils::AddEdge(next_node->GetOutControlAnchor(), next_active->GetInControlAnchor()) != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "Add control edge between op:%s(%s) and op:%s(%s) failed", + next_node->GetName().c_str(), next_node->GetType().c_str(), + next_active->GetName().c_str(), next_active->GetType().c_str()); GELOGE(INTERNAL_ERROR, "Add control edge failed."); return INTERNAL_ERROR; } @@ -245,17 +264,22 @@ Status NextIterationPass::HandleWhileGroup(ComputeGraphPtr &graph) { NodePtr NextIterationPass::CreateActiveNode(ComputeGraphPtr &graph, const std::string &name) { OpDescPtr op_desc = MakeShared(name, STREAMACTIVE); if (op_desc == nullptr) { + REPORT_CALL_ERROR("E19999", "New OpDesc failed"); return nullptr; } GELOGI("Create StreamActive op:%s.", op_desc->GetName().c_str()); NodePtr active_node = graph->AddNode(op_desc); if (active_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 node[%s] failed.", name.c_str()); return nullptr; } if (SetSwitchBranchNodeLabel(active_node, name) != SUCCESS) { + REPORT_CALL_ERROR("E19999", "Set switch branch node label:%s to node:%s(%s) failed", + name.c_str(), op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(INTERNAL_ERROR, "Set attr SWITCH_BRANCH_NODE_LABEL for node: %s failed.", active_node->GetName().c_str()); return nullptr; } @@ -280,11 +304,17 @@ Status NextIterationPass::BreakNextIteration(const NodePtr &next_node, NodePtr & continue; } if (GraphUtils::RemoveEdge(out_anchor, in_anchor) != SUCCESS) { + REPORT_CALL_ERROR("E19999", "Remove edge between op:%s(%s)(index:%d) and op:%s(%s)(index:%d) failed", + out_anchor->GetOwnerNode()->GetName().c_str(), out_anchor->GetOwnerNode()->GetType().c_str(), + out_anchor->GetIdx(), + merge_node->GetName().c_str(), merge_node->GetType().c_str(), in_anchor->GetIdx()); GELOGE(INTERNAL_ERROR, "Remove data edge failed, %s->%s.", next_node->GetName().c_str(), merge_node->GetName().c_str()); return INTERNAL_ERROR; } if (SetNextIteration(merge_node, next_node->GetName()) != SUCCESS) { + REPORT_CALL_ERROR("E19999", "Set attr NEXT_ITERATION value:%s to node:%s(%s) failed", + next_node->GetName().c_str(), merge_node->GetName().c_str(), merge_node->GetType().c_str()); GELOGE(INTERNAL_ERROR, "Set attr NEXT_ITERATION for node %s failed.", merge_node->GetName().c_str()); return INTERNAL_ERROR; } @@ -303,6 +333,7 @@ Status NextIterationPass::BreakNextIteration(const NodePtr &next_node, NodePtr & Status NextIterationPass::FindTargetNode(const NodePtr &node, const std::string &target_type, bool is_input, NodePtr &target_node) { if (node == nullptr) { + REPORT_INNER_ERROR("E19999", "Param node is nullptr, check invalid"); GELOGE(PARAM_INVALID, "node is null."); return PARAM_INVALID; } @@ -330,6 +361,8 @@ Status NextIterationPass::FindTargetNode(const NodePtr &node, const std::string } if ((target_type != SWITCH) && (target_node == nullptr)) { + REPORT_INNER_ERROR("E19999", "Find target_type:%s node around node:%s(%s) failed", + target_type.c_str(), node->GetName().c_str(), node->GetType().c_str()); GELOGE(INTERNAL_ERROR, "Find node %s failed.", target_type.c_str()); return INTERNAL_ERROR; } diff --git a/ge/graph/passes/no_use_reshape_remove_pass.cc b/ge/graph/passes/no_use_reshape_remove_pass.cc index 1da939c6..ca71378e 100644 --- a/ge/graph/passes/no_use_reshape_remove_pass.cc +++ b/ge/graph/passes/no_use_reshape_remove_pass.cc @@ -37,6 +37,7 @@ Status NoUseReshapeRemovePass::Run(ge::NodePtr &node) { GE_CHECK_NOTNULL(node); 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(PARAM_INVALID, "NoUseReshapeRemovePass enter. OpDesc is null."); return PARAM_INVALID; } @@ -48,6 +49,8 @@ Status NoUseReshapeRemovePass::Run(ge::NodePtr &node) { bool to_be_deleted = true; // compare input and output dims if (op_desc_ptr->GetAllInputsDesc().empty() || op_desc_ptr->GetAllOutputsDesc().empty()) { + REPORT_INNER_ERROR("E19999", "Input or Output desc num is zero in node:%s(%s), check invalid", + op_desc_ptr->GetName().c_str(), op_desc_ptr->GetType().c_str()); GELOGE(INTERNAL_ERROR, "Input or output num is zero. node name:%s, input size:%zu, output size:%zu", op_desc_ptr->GetName().c_str(), op_desc_ptr->GetAllInputsDesc().size(), op_desc_ptr->GetAllOutputsDesc().size()); @@ -107,6 +110,8 @@ Status NoUseReshapeRemovePass::TryRemoveConstShapeInput(ge::NodePtr &reshape_nod // const input can unlink but should copy control_dependency auto ret = PassUtils::UnlinkNodeWithControlCopy(reshape_node, kReshapeShapeIndex); if (ret != SUCCESS) { + REPORT_CALL_ERROR("E19999", "Unlink op:%s(%s) data input:%u with control edge copy failed", + reshape_node->GetName().c_str(), reshape_node->GetType().c_str(), kReshapeShapeIndex); GELOGE(ret, "Unlink node %s with control copy failed.", shape_input->GetName().c_str()); return ret; } diff --git a/ge/graph/passes/parallel_concat_start_op_pass.cc b/ge/graph/passes/parallel_concat_start_op_pass.cc index 508d9b19..f64fa2f3 100755 --- a/ge/graph/passes/parallel_concat_start_op_pass.cc +++ b/ge/graph/passes/parallel_concat_start_op_pass.cc @@ -43,6 +43,9 @@ Status ParallelConcatStartOpPass::Run(NodePtr &node) { GELOGI("Start to replace operator _ParallelConcatStart with Constant, node name: %s.", node_name.c_str()); if (node_op_desc->GetOutputsSize() != kParallelConcatStartOutputSize) { + REPORT_INNER_ERROR("E19999", "Output tensor num:%zu of node:%s(%s) != %zu, check invalid", + node_op_desc->GetOutputsSize(), node_op_desc->GetName().c_str(), + node_op_desc->GetType().c_str(), kParallelConcatStartOutputSize); GELOGE(PARAM_INVALID, "Node[%s] output size is unexpected, the value is %zu.", node_name.c_str(), node_op_desc->GetOutputsSize()); return PARAM_INVALID; @@ -50,12 +53,15 @@ Status ParallelConcatStartOpPass::Run(NodePtr &node) { auto output_tensor_desc = node_op_desc->GetOutputDesc(kParallelConcatStartOutputDataIndex); GeTensorPtr output_ptr = MakeShared(output_tensor_desc); if (output_ptr == nullptr) { + REPORT_CALL_ERROR("E19999", "New GeTensor failed"); GELOGE(MEMALLOC_FAILED, "Malloc GeTensor failed, node name %s.", node_name.c_str()); return FAILED; } ge::DataType attr_dtype; if (!ge::AttrUtils::GetDataType(node_op_desc, kAttrDtype, attr_dtype)) { + REPORT_CALL_ERROR("E19999", "Get Attr:%s from op:%s(%s) failed", kAttrDtype, + node_op_desc->GetName().c_str(), node_op_desc->GetType().c_str()); GELOGE(PARAM_INVALID, "Node:%s failed to get attribute dtype.", node_name.c_str()); return PARAM_INVALID; } @@ -63,6 +69,8 @@ Status ParallelConcatStartOpPass::Run(NodePtr &node) { vector attr_shape_list; if (!ge::AttrUtils::GetListInt(node_op_desc, kAttrShape, attr_shape_list)) { + REPORT_CALL_ERROR("E19999", "Get Attr:%s from op:%s(%s) failed", kAttrShape, + node_op_desc->GetName().c_str(), node_op_desc->GetType().c_str()); GELOGE(PARAM_INVALID, "Node:%s failed to get attribute shape.", node_name.c_str()); return PARAM_INVALID; } diff --git a/ge/graph/passes/pass_utils.cc b/ge/graph/passes/pass_utils.cc index b827e88a..69fe479e 100644 --- a/ge/graph/passes/pass_utils.cc +++ b/ge/graph/passes/pass_utils.cc @@ -36,6 +36,7 @@ #include "graph/utils/tensor_utils.h" #include "graph/utils/type_utils.h" #include "utils/node_utils.h" +#include "common/formats/utils/formats_trans_utils.h" namespace ge { Status PassUtils::ConstructTensorDescWithData(const GeTensorDesc &out_desc, std::vector &data, @@ -46,11 +47,13 @@ Status PassUtils::ConstructTensorDescWithData(const GeTensorDesc &out_desc, std: if (data_type == DT_INT32) { unique_ptr buf(new (std::nothrow) int32_t[dim_size]()); if (buf == nullptr) { + REPORT_CALL_ERROR("E19999", "New buffer failed, size:%u", dim_size); GELOGE(MEMALLOC_FAILED, "new failed"); return MEMALLOC_FAILED; } for (uint32_t i = 0; i < dim_size; i++) { if (data[i] >= INT_MAX) { + REPORT_CALL_ERROR("E19999", "Param data:%s will overflow after multi", formats::JoinToString(data).c_str()); GELOGE(PARAM_INVALID, "int32 overflow, data[%u]:%ld", i, data[i]); return PARAM_INVALID; } @@ -60,6 +63,7 @@ Status PassUtils::ConstructTensorDescWithData(const GeTensorDesc &out_desc, std: } else if (data_type == DT_INT64) { unique_ptr buf(new (std::nothrow) int64_t[dim_size]()); if (buf == nullptr) { + REPORT_CALL_ERROR("E19999", "New buffer failed, size:%u", dim_size); GELOGE(MEMALLOC_FAILED, "new failed"); return MEMALLOC_FAILED; } @@ -68,6 +72,8 @@ Status PassUtils::ConstructTensorDescWithData(const GeTensorDesc &out_desc, std: } ret = ConstructTensorDescWithData(out_desc, buf.get(), dim_size, v_output, scalar_output); } else { + REPORT_CALL_ERROR("E19999", "Only support DT_INT32 and DT_INT64. Input data_type:%s not support", + formats::JoinToString(data).c_str()); GELOGE(PARAM_INVALID, "Only support DT_INT32 and DT_INT64. data_type:%s", TypeUtils::DataTypeToSerialString(data_type).c_str()); return PARAM_INVALID; @@ -92,6 +98,7 @@ Status PassUtils::ConstructTensorDescWithData(const GeTensorDesc &out_desc, T *b GeTensorPtr output_tensor_ptr = MakeShared( output_tensor_desc, reinterpret_cast(buf), sizeof(T) * len); if (output_tensor_ptr == nullptr) { + REPORT_CALL_ERROR("E19999", "New GeTensor failed"); GELOGE(MEMALLOC_FAILED, "Make shared failed"); return MEMALLOC_FAILED; } @@ -102,6 +109,7 @@ Status PassUtils::ConstructTensorDescWithData(const GeTensorDesc &out_desc, T *b bool PassUtils::IsConstant(const ConstNodePtr &node) { if (node == nullptr) { + REPORT_INNER_ERROR("E19999", "Param node is nullptr, check invalid"); GELOGE(PARAM_INVALID, "node is null"); return false; } @@ -112,19 +120,25 @@ bool PassUtils::IsConstant(const ConstNodePtr &node) { } Status PassUtils::SetOutNodeWeight(const OutDataAnchorPtr &out_data_anchor, const NodePtr &src_node) { - GE_IF_BOOL_EXEC(src_node == nullptr, GELOGE(PARAM_INVALID, "src_node is null"); return PARAM_INVALID); + GE_IF_BOOL_EXEC(src_node == nullptr, + REPORT_INNER_ERROR("E19999", "Param src_node is nullptr, check invalid"); + GELOGE(PARAM_INVALID, "src_node is null"); return PARAM_INVALID); if (!IsConstant(src_node)) { return SUCCESS; } auto weights = OpDescUtils::MutableWeights(src_node); if (weights.empty()) { + REPORT_INNER_ERROR("E19999", "Weight of node:%s(%s) is empty, check invalid", + src_node->GetName().c_str(), src_node->GetType().c_str()); return PARAM_INVALID; } auto weight = weights.at(0); auto src_in_ctrl = src_node->GetInControlAnchor(); if ((src_in_ctrl == nullptr) || (out_data_anchor == nullptr)) { + REPORT_INNER_ERROR("E19999", "Param out_data_anchor or in control anchor in Param src_node:%s(%s) is nullptr, " + "check invalid", src_node->GetName().c_str(), src_node->GetType().c_str()); GELOGE(FAILED, "parameter is null."); return FAILED; } @@ -143,7 +157,7 @@ Status PassUtils::SetOutNodeWeight(const OutDataAnchorPtr &out_data_anchor, cons dst_op_desc->SetIsInputConst(is_input_const); } - GE_CHK_STATUS_RET(GraphUtils::RemoveEdge(out_data_anchor, dst_in_data), "remove edge failed"); + GE_CHK_GRAPH_STATUS_RET(GraphUtils::RemoveEdge(out_data_anchor, dst_in_data), "remove edge failed"); graphStatus ret = OpDescUtils::AddConstOpToAnchor(dst_in_data, weight); if (ret != SUCCESS) { return ret; @@ -155,7 +169,7 @@ Status PassUtils::SetOutNodeWeight(const OutDataAnchorPtr &out_data_anchor, cons // restore control inputs to dynamically added constant ops, if any for (const auto &src_out_control_anchor : src_out_control_anchors) { - GE_CHK_STATUS_RET(GraphUtils::AddEdge(src_out_control_anchor, dynamic_const_node->GetInControlAnchor()), + GE_CHK_GRAPH_STATUS_RET(GraphUtils::AddEdge(src_out_control_anchor, dynamic_const_node->GetInControlAnchor()), "add edge failed"); } } @@ -166,7 +180,7 @@ Status PassUtils::SetOutNodeWeight(const OutDataAnchorPtr &out_data_anchor, cons /// Op1 - - - > Op2 for (const auto &dst_in_ctrl : out_data_anchor->GetPeerInControlAnchors()) { for (const auto &src_out_control_anchor : src_out_control_anchors) { - GE_CHK_STATUS_RET(GraphUtils::AddEdge(src_out_control_anchor, dst_in_ctrl), "add edge failed"); + GE_CHK_GRAPH_STATUS_RET(GraphUtils::AddEdge(src_out_control_anchor, dst_in_ctrl), "add edge failed"); } } @@ -176,6 +190,7 @@ Status PassUtils::SetOutNodeWeight(const OutDataAnchorPtr &out_data_anchor, cons Status PassUtils::RemoveBranch(const NodePtr &node, std::vector &delete_nodes, std::vector &end_nodes) { if (node == nullptr) { + REPORT_INNER_ERROR("E19999", "Param node is nullptr, check invalid"); GELOGE(FAILED, "parameter is null."); return FAILED; } @@ -201,6 +216,8 @@ Status PassUtils::RemoveBranch(const NodePtr &node, std::vector &delete GE_CHK_STATUS_RET(GetOriginalType(dst_node, node_type), "get original type failed"); if (node_type == NETOUTPUT) { if (dst_in_anchor->IsTypeOf()) { + REPORT_INNER_ERROR("E19999", "Node:%s(%s) nactive branch connected to NetOutput with data anchor, " + "check invalid", node->GetName().c_str(), node->GetType().c_str()); GELOGE(INTERNAL_ERROR, "[%s] Inactive branch connected to " "NetOutput with data anchor.", @@ -208,13 +225,13 @@ Status PassUtils::RemoveBranch(const NodePtr &node, std::vector &delete return INTERNAL_ERROR; } else { // safe to unlink control edges - GE_CHK_STATUS_RET(GraphUtils::RemoveEdge(src_out_anchor, dst_in_anchor), "remove edge failed"); + GE_CHK_GRAPH_STATUS_RET(GraphUtils::RemoveEdge(src_out_anchor, dst_in_anchor), "remove edge failed"); end_nodes.push_back(dst_node); } } else if (node_type == MERGE) { /// Unlink connection between the inactive branch and Merge/NetOutput. /// The removal of inactive nodes will be handled in PrunePass - GE_CHK_STATUS_RET(GraphUtils::RemoveEdge(src_out_anchor, dst_in_anchor), "remove edge failed"); + GE_CHK_GRAPH_STATUS_RET(GraphUtils::RemoveEdge(src_out_anchor, dst_in_anchor), "remove edge failed"); end_nodes.push_back(dst_node); GELOGD("Reach the end merge node %s, the branch removing stop", dst_node->GetName().c_str()); } else { @@ -273,6 +290,7 @@ bool PassUtils::IsNeedTrainIteFlowCtrl(const ComputeGraphPtr &compute_graph) { int PassUtils::GetUniqueInDataAnchorIndex(const NodePtr &node_ptr) { const int invalid_index = -1; if (node_ptr == nullptr) { + REPORT_INNER_ERROR("E19999", "Param node_ptr is nullptr, check invalid"); GELOGE(INTERNAL_ERROR, "GetUniqueInDataAnchorIndex: node is null"); return invalid_index; } @@ -282,6 +300,9 @@ int PassUtils::GetUniqueInDataAnchorIndex(const NodePtr &node_ptr) { return (in_anchor->GetIdx()); } } + + REPORT_INNER_ERROR("E19999", "Failed to find in data anchor of node:%s(%s) with a valid peer out node", + node_ptr->GetName().c_str(), node_ptr->GetType().c_str()); GELOGE(INTERNAL_ERROR, "GetUniqueInDataAnchorIndex: [%s] failed to find " "in data anchor with a valid peer out node", @@ -291,6 +312,7 @@ int PassUtils::GetUniqueInDataAnchorIndex(const NodePtr &node_ptr) { Status PassUtils::UnlinkNodeWithControlCopy(NodePtr &node, int index) { if (node == nullptr) { + REPORT_INNER_ERROR("E19999", "Param node is nullptr, check invalid"); GELOGE(PARAM_INVALID, "node is null."); return PARAM_INVALID; } @@ -301,6 +323,8 @@ Status PassUtils::UnlinkNodeWithControlCopy(NodePtr &node, int index) { } auto out_data_anchor = in_data_anchor->GetPeerOutAnchor(); if (out_data_anchor == nullptr) { + REPORT_INNER_ERROR("E19999", "Index:%d in data anchor of node:%s(%s), its peer anchor is nullptr, check invalid", + index, node->GetName().c_str(), node->GetType().c_str()); GELOGE(FAILED, "[%s] peer out_data_anchor is null with index [%d].", node->GetName().c_str(), index); return FAILED; } @@ -318,6 +342,7 @@ Status PassUtils::UnlinkNodeWithControlCopy(NodePtr &node, int index) { Status PassUtils::RemoveInactiveBranchToMerge(const OutDataAnchorPtr &inactive_output_anchor, std::vector &delete_nodes, std::vector &end_nodes) { if (inactive_output_anchor == nullptr) { + REPORT_INNER_ERROR("E19999", "Param inactive_output_anchor is nullptr, check invalid"); GELOGE(FAILED, "parameter is null."); return FAILED; } @@ -331,7 +356,7 @@ Status PassUtils::RemoveInactiveBranchToMerge(const OutDataAnchorPtr &inactive_o GE_CHK_STATUS_RET(GetOriginalType(dst_node, dst_node_type), "get original type failed"); if (dst_node_type == MERGE) { GELOGD("[%s] Switch connected directly to Merge", inactive_output_anchor->GetOwnerNode()->GetName().c_str()); - GE_CHK_STATUS_RET(GraphUtils::RemoveEdge(inactive_output_anchor, dst_anchor), "remove edge failed"); + GE_CHK_GRAPH_STATUS_RET(GraphUtils::RemoveEdge(inactive_output_anchor, dst_anchor), "remove edge failed"); continue; } diff --git a/ge/graph/passes/permute_pass.cc b/ge/graph/passes/permute_pass.cc index 73d9a7f1..8ac3aedf 100644 --- a/ge/graph/passes/permute_pass.cc +++ b/ge/graph/passes/permute_pass.cc @@ -108,6 +108,8 @@ Status PermutePass::Run(ComputeGraphPtr graph) { OpDescPtr op_desc_ptr = outNode->GetOpDesc(); GE_CHECK_NOTNULL(op_desc_ptr); if (!AttrUtils::SetBool(op_desc_ptr, ATTR_NAME_PRED_PERMUTE_DELETED, true)) { + REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed", ATTR_NAME_PRED_PERMUTE_DELETED.c_str(), + op_desc_ptr->GetName().c_str(), op_desc_ptr->GetType().c_str()); GELOGE(INTERNAL_ERROR, "set ATTR_NAME_PRED_PERMUTE_DELETED failed"); return INTERNAL_ERROR; } diff --git a/ge/graph/passes/print_op_pass.cc b/ge/graph/passes/print_op_pass.cc index 28b2332b..0b20da84 100755 --- a/ge/graph/passes/print_op_pass.cc +++ b/ge/graph/passes/print_op_pass.cc @@ -21,6 +21,7 @@ namespace ge { Status PrintOpPass::Run(ge::NodePtr &node) { GELOGD("PrintOpPass running"); if (node == nullptr) { + REPORT_INNER_ERROR("E19999", "Param node is nullptr, check invalid"); GELOGE(PARAM_INVALID, "param [node] must not be null."); return PARAM_INVALID; } diff --git a/ge/graph/passes/prune_pass.cc b/ge/graph/passes/prune_pass.cc index 3c95f3b1..49daa037 100644 --- a/ge/graph/passes/prune_pass.cc +++ b/ge/graph/passes/prune_pass.cc @@ -29,6 +29,7 @@ namespace ge { Status PrunePass::Run(ge::ComputeGraphPtr graph) { GELOGD("PrunePass Start, graph is [%s]", graph->GetName().c_str()); if (graph == nullptr) { + REPORT_INNER_ERROR("E19999", "Param graph is nullptr, check invalid"); GELOGE(GE_GRAPH_ISNULL, "input compute graph is NULL."); return GE_GRAPH_ISNULL; } @@ -70,6 +71,9 @@ Status PrunePass::Run(ge::ComputeGraphPtr graph) { if (node_ptr->GetOpDesc()->GetType() == DATA || node_ptr->GetOpDesc()->GetType() == AIPPDATA) { Status status = ge::GraphUtils::AddEdge(node_ptr->GetOutControlAnchor(), out_nodes[0]->GetInControlAnchor()); if (status != ge::SUCCESS) { + REPORT_CALL_ERROR("E19999", "Add control edge between op:%s(%s) and op:%s(%s) failed", + node_ptr->GetName().c_str(), node_ptr->GetType().c_str(), + out_nodes[0]->GetName().c_str(), out_nodes[0]->GetType().c_str()); GELOGE(INTERNAL_ERROR, "[PrunePass] add control edge fail between DATA node[%s] and NETOUTPUT node[%s]!", node_ptr->GetOpDesc()->GetName().c_str(), out_nodes[0]->GetOpDesc()->GetName().c_str()); return INTERNAL_ERROR; diff --git a/ge/graph/passes/ref_identity_delete_op_pass.cc b/ge/graph/passes/ref_identity_delete_op_pass.cc index 95f710f2..b729b443 100644 --- a/ge/graph/passes/ref_identity_delete_op_pass.cc +++ b/ge/graph/passes/ref_identity_delete_op_pass.cc @@ -29,6 +29,8 @@ Status RefIdentityDeleteOpPass::Run(ComputeGraphPtr graph) { int input_index = 0; NodePtr ref_node = GetRefNode(node, input_index); CHECK_FALSE_EXEC(GetRefNode(node, input_index) != nullptr, + REPORT_CALL_ERROR("E19999", "Get Ref node of node:%s(%s) failed", + node->GetName().c_str(), node->GetType().c_str()); GELOGE(FAILED, "Ref node of RefIdentity[%s] not found", node->GetName().c_str()); return FAILED); CHECK_FALSE_EXEC(DealNoOutputRef(ref_node, node, input_index, graph) == SUCCESS, @@ -61,6 +63,8 @@ Status RefIdentityDeleteOpPass::DealNoOutputRef(const NodePtr &node, const NodeP NodePtr first_node = nullptr; NodePtr variable_ref = GetVariableRef(node, ref_identity, first_node); if (variable_ref == nullptr) { + REPORT_CALL_ERROR("E19999", "Get variable ref of node:%s(%s) failed", + node->GetName().c_str(), node->GetType().c_str()); GELOGE(FAILED, "[RefIdentityDeleteOpPass]Can not find variable ref for %s:%d", node->GetName().c_str(), input_index); return FAILED; @@ -83,11 +87,17 @@ Status RefIdentityDeleteOpPass::DealNoOutputRef(const NodePtr &node, const NodeP // +-----------+ +-----------+ auto ret = ge::GraphUtils::AddEdge(node->GetOutControlAnchor(), first_node->GetInControlAnchor()); if (ret != SUCCESS) { + REPORT_CALL_ERROR("E19999", "Add control edge between op:%s(%s) and op:%s(%s) failed", + node->GetName().c_str(), node->GetType().c_str(), + first_node->GetName().c_str(), first_node->GetType().c_str()); GELOGE(FAILED, "Add control edge between ref node and trans node failed"); return FAILED; } ret = ge::GraphUtils::RemoveEdge(node->GetOutControlAnchor(), variable_ref->GetInControlAnchor()); if (ret != SUCCESS) { + REPORT_CALL_ERROR("E19999", "Remove control edge between op:%s(%s) and op:%s(%s) failed", + node->GetName().c_str(), node->GetType().c_str(), + first_node->GetName().c_str(), first_node->GetType().c_str()); GELOGE(FAILED, "Remove control edge between ref node and its peer node failed"); return FAILED; } @@ -113,11 +123,15 @@ Status RefIdentityDeleteOpPass::DealNoOutputRef(const NodePtr &node, const NodeP } // remove ref identity if (GraphUtils::IsolateNode(ref_identity, {0}) != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "Isolate op:%s(%s) failed", + ref_identity->GetName().c_str(), ref_identity->GetType().c_str()); GELOGE(INTERNAL_ERROR, "Isolate removed node: %s, type: %s failed", ref_identity->GetName().c_str(), variable_ref->GetType().c_str()); return FAILED; } if (GraphUtils::RemoveNodeWithoutRelink(graph, ref_identity) != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "Remove node:%s(%s) without relink in graph:%s failed", + ref_identity->GetName().c_str(), ref_identity->GetType().c_str(), graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "Remove node: %s, type: %s without relink failed", ref_identity->GetName().c_str(), ref_identity->GetType().c_str()); return FAILED; @@ -214,6 +228,9 @@ Status RefIdentityDeleteOpPass::RemoveUselessControlEdge(const NodePtr &ref, con if (out_nodes_map.find(peer_node->GetName()) != out_nodes_map.end()) { auto ret = ge::GraphUtils::RemoveEdge(out_control_anchor, peer_in_control_anchor); if (ret != SUCCESS) { + REPORT_CALL_ERROR("E19999", "Remove control edge between op:%s(%s) and op:%s(%s) failed", + variable_ref->GetName().c_str(), variable_ref->GetType().c_str(), + peer_node->GetName().c_str(), peer_node->GetType().c_str()); GELOGE(FAILED, "Remove control edge between variable ref node[%s] and ref node's peer node[%s] failed", variable_ref->GetName().c_str(), peer_node->GetName().c_str()); return FAILED; diff --git a/ge/graph/passes/remove_same_const_pass.cc b/ge/graph/passes/remove_same_const_pass.cc index 3d18a92d..ec38a0af 100644 --- a/ge/graph/passes/remove_same_const_pass.cc +++ b/ge/graph/passes/remove_same_const_pass.cc @@ -85,6 +85,9 @@ Status RemoveSameConstPass::Run(ComputeGraphPtr graph) { ret = GraphUtils::ReplaceNodeAnchors(iter->second, node, {}, output_map); if (ret != GRAPH_SUCCESS) { + 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, ret=%u", node->GetName().c_str(), iter->second->GetName().c_str(), ret); return INTERNAL_ERROR; @@ -94,6 +97,8 @@ Status RemoveSameConstPass::Run(ComputeGraphPtr graph) { ret = GraphUtils::RemoveNodeWithoutRelink(graph, 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()); return INTERNAL_ERROR; } diff --git a/ge/graph/passes/replace_transshape_pass.cc b/ge/graph/passes/replace_transshape_pass.cc index 9004df4e..ac654083 100644 --- a/ge/graph/passes/replace_transshape_pass.cc +++ b/ge/graph/passes/replace_transshape_pass.cc @@ -43,6 +43,8 @@ Status ReplaceTransShapePass::ReplaceTransShapeNode(ComputeGraphPtr &graph, Node std::string op_type; auto ret = GetOriginalType(trans_shape_node, op_type); if (ret != SUCCESS) { + REPORT_CALL_ERROR("E19999", "Get OriginalType of op:%s(%s) failed", + trans_shape_node->GetName().c_str(), trans_shape_node->GetType().c_str()); GELOGE(FAILED, "Get node %s original type failede", trans_shape_node->GetName().c_str()); return FAILED; } @@ -52,6 +54,7 @@ Status ReplaceTransShapePass::ReplaceTransShapeNode(ComputeGraphPtr &graph, Node std::string node_name = trans_shape_node->GetName() + "ToMemcpy"; auto dst_op_desc = MakeShared(node_name, MEMCPYASYNC); if (dst_op_desc == nullptr) { + REPORT_CALL_ERROR("E19999", "New OpDesc failed"); GELOGE(FAILED, "Make node %s opdesc failed", node_name.c_str()); return FAILED; } @@ -59,6 +62,8 @@ Status ReplaceTransShapePass::ReplaceTransShapeNode(ComputeGraphPtr &graph, Node for (InDataAnchorPtr &in_anchor : trans_shape_node->GetAllInDataAnchors()) { auto ret = dst_op_desc->AddInputDesc(src_op_desc->GetInputDesc(in_anchor->GetIdx())); if (ret != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "Add input desc to op:%s(%s) failed", + dst_op_desc->GetName().c_str(), dst_op_desc->GetType().c_str()); GELOGE(FAILED, "Add input desc failed"); return FAILED; } @@ -66,6 +71,8 @@ Status ReplaceTransShapePass::ReplaceTransShapeNode(ComputeGraphPtr &graph, Node for (OutDataAnchorPtr &out_anchor : trans_shape_node->GetAllOutDataAnchors()) { auto ret = dst_op_desc->AddOutputDesc(src_op_desc->GetOutputDesc(out_anchor->GetIdx())); if (ret != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "Add output desc to op:%s(%s) failed", + src_op_desc->GetName().c_str(), src_op_desc->GetType().c_str()); GELOGE(FAILED, "Add output desc failed"); return FAILED; } diff --git a/ge/graph/passes/replace_with_empty_const_pass.cc b/ge/graph/passes/replace_with_empty_const_pass.cc index 5962fe0e..bfa6ff95 100644 --- a/ge/graph/passes/replace_with_empty_const_pass.cc +++ b/ge/graph/passes/replace_with_empty_const_pass.cc @@ -26,10 +26,12 @@ namespace ge { Status ReplaceWithEmptyConstPass::Run(NodePtr &node) { GELOGD("ReplaceWithEmptyConstPass in."); if (node == nullptr) { + REPORT_INNER_ERROR("E19999", "Param node is nullptr, check invalid"); GELOGE(PARAM_INVALID, "Parameter is null."); return PARAM_INVALID; } if (node->GetOpDesc() == nullptr) { + REPORT_INNER_ERROR("E19999", "Param node's op_desc is nullptr, check invalid"); GELOGE(PARAM_INVALID, "Param [opDesc] must not be null."); return PARAM_INVALID; } diff --git a/ge/graph/passes/reshape_recovery_pass.cc b/ge/graph/passes/reshape_recovery_pass.cc index 84050e87..7a9d085b 100644 --- a/ge/graph/passes/reshape_recovery_pass.cc +++ b/ge/graph/passes/reshape_recovery_pass.cc @@ -23,18 +23,25 @@ NodePtr CreateReshape(const ConstGeTensorDescPtr &src, const ConstGeTensorDescPt auto next_num = reshape_num.fetch_add(1); auto reshape = MakeShared("Reshape_ReshapeRecoveryPass_" + std::to_string(next_num), RESHAPE); if (reshape == nullptr) { + REPORT_CALL_ERROR("E19999", "New OpDesc failed"); return nullptr; } auto ret = reshape->AddInputDesc("x", *src); if (ret != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "Add input desc to op:%s(%s) failed, name:x", + reshape->GetName().c_str(), reshape->GetType().c_str()); return nullptr; } ret = reshape->AddInputDesc("shape", GeTensorDesc(GeShape(), Format(), DT_INT32)); if (ret != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "Add input desc to op:%s(%s) failed, name:shape", + reshape->GetName().c_str(), reshape->GetType().c_str()); return nullptr; } ret = reshape->AddOutputDesc("y", *dst); if (ret != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "Add input desc to op:%s(%s) failed, name:y", + reshape->GetName().c_str(), reshape->GetType().c_str()); return nullptr; } @@ -71,6 +78,11 @@ Status InsertReshapeIfNeed(const NodePtr &node) { GE_CHECK_NOTNULL(reshape); auto ret = GraphUtils::InsertNodeBetweenDataAnchors(src_anchor, dst_anchor, reshape); if (ret != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", + "Insert node:%s(%s) between node:%s(%s)(out_index:%d) and node:%s(%s)(out_index:%d) failed", + reshape->GetName().c_str(), reshape->GetType().c_str(), + node->GetName().c_str(), node->GetType().c_str(), src_anchor->GetIdx(), + dst_node->GetName().c_str(), dst_node->GetType().c_str(), dst_anchor->GetIdx()); GELOGE(INTERNAL_ERROR, "Failed to insert reshape between node %s and %s", node->GetName().c_str(), dst_node->GetName().c_str()); return INTERNAL_ERROR; diff --git a/ge/graph/passes/resource_pair_add_control_pass.cc b/ge/graph/passes/resource_pair_add_control_pass.cc index 29a19f26..cd93725d 100755 --- a/ge/graph/passes/resource_pair_add_control_pass.cc +++ b/ge/graph/passes/resource_pair_add_control_pass.cc @@ -83,6 +83,9 @@ Status ResourcePairAddControlPass::Run(ComputeGraphPtr graph) { GE_CHECK_NOTNULL(to_anchor); graphStatus ret = from_anchor->LinkTo(to_anchor); if (ret != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "Op:%s(%s) link control edge to op:%s(%s) failed", + from_node->GetName().c_str(), from_node->GetType().c_str(), + to_node->GetName().c_str(), to_node->GetType().c_str()); GELOGE(PARAM_INVALID, "link fail, from_node:%s, to_node:%s, from_type:%s, to_type:%s", from_node->GetName().c_str(), to_node->GetName().c_str(), resource_type_pair.first.c_str(), resource_type_pair.second.c_str()); diff --git a/ge/graph/passes/resource_pair_remove_control_pass.cc b/ge/graph/passes/resource_pair_remove_control_pass.cc index 7048ed1d..64b04a13 100755 --- a/ge/graph/passes/resource_pair_remove_control_pass.cc +++ b/ge/graph/passes/resource_pair_remove_control_pass.cc @@ -82,6 +82,9 @@ Status ResourcePairRemoveControlPass::Run(ComputeGraphPtr graph) { auto to_anchor = to_node->GetInControlAnchor(); graphStatus ret = from_anchor->Unlink(to_anchor); if (ret != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "Op:%s(%s) unlink control edge to op:%s(%s) failed", + from_node->GetName().c_str(), from_node->GetType().c_str(), + to_node->GetName().c_str(), to_node->GetType().c_str()); GELOGE(INTERNAL_ERROR, "unlink fail, from_node:%s, to_node:%s, from_type:%s, to_type:%s", from_node->GetName().c_str(), to_node->GetName().c_str(), resource_type_pair.first.c_str(), resource_type_pair.second.c_str()); diff --git a/ge/graph/preprocess/graph_preprocess.cc b/ge/graph/preprocess/graph_preprocess.cc index c6b8810b..4fb80646 100644 --- a/ge/graph/preprocess/graph_preprocess.cc +++ b/ge/graph/preprocess/graph_preprocess.cc @@ -99,7 +99,7 @@ const int64_t kInvalidDynaimcDimsType = -1; OpDescPtr CreateTensorShape(const GeTensorDesc &data_tensor) { GeTensorPtr tensor = MakeShared(); if (tensor == nullptr) { - REPORT_CALL_ERROR("E19999", "New GeTensor failed when %s", __FUNCTION__); + REPORT_CALL_ERROR("E19999", "New GeTensor failed"); GELOGE(INTERNAL_ERROR, "Create shared ptr for GeTensor failed"); return nullptr; } @@ -111,7 +111,7 @@ OpDescPtr CreateTensorShape(const GeTensorDesc &data_tensor) { tensor->MutableTensorDesc().SetShape(GeShape()); 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 when %s", __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Set data to tensor failed"); GELOGE(INTERNAL_ERROR, "tensor set data failed"); return nullptr; } @@ -119,7 +119,7 @@ OpDescPtr CreateTensorShape(const GeTensorDesc &data_tensor) { tensor->MutableTensorDesc().SetShape(GeShape(std::vector({dim_cnt}))); unique_ptr dst_shape(new (std::nothrow) int32_t[dim_cnt]()); if (dst_shape == nullptr) { - REPORT_CALL_ERROR("E19999", "Malloc buffer failed, size:%zu, when %s", dim_cnt, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Malloc buffer failed, size:%zu", dim_cnt); GELOGE(INTERNAL_ERROR, "Create unique ptr failed"); return nullptr; } @@ -129,7 +129,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 when %s", __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Set data to tensor failed"); GELOGE(INTERNAL_ERROR, "tensor set data failed"); return nullptr;) } @@ -176,15 +176,15 @@ void AddTransNodeAttr(const std::string &node_type, const GeTensorDesc &input, c NodePtr CreateTransNode(const std::string &name, const std::string &node_type, const GeTensorDesc &input, const GeTensorDesc &output, NodePtr &node) { if (node == nullptr) { - REPORT_INNER_ERROR("E19999", "Param node is nullptr, trans_name:%s, trans_type:%s, check invalid when %s", - name.c_str(), node_type.c_str(), __FUNCTION__); + 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."); 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 when %s", - name.c_str(), node_type.c_str(), __FUNCTION__); + 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()); return nullptr; } @@ -199,8 +199,8 @@ NodePtr CreateTransNode(const std::string &name, const std::string &node_type, c } OpDescPtr op_desc = MakeShared(name, node_type); if (op_desc == nullptr) { - REPORT_CALL_ERROR("E19999", "New OpDesc failed, trans_name:%s, trans_type:%s, when %s", - name.c_str(), node_type.c_str(), __FUNCTION__); + 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"); return nullptr; } @@ -213,15 +213,15 @@ NodePtr CreateTransNode(const std::string &name, const std::string &node_type, c // Default single input and single output auto ret = op_desc->AddInputDesc(input); if (ret != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Add input desc into op:%s(%s) failed when %s", - op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + 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()); return nullptr; } ret = op_desc->AddOutputDesc(output); if (ret != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Add output desc into op:%s(%s) failed when %s", - op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + 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()); return nullptr; } @@ -238,17 +238,17 @@ NodePtr CreateTransNode(const std::string &name, const std::string &node_type, c } ret = op_desc->AddInputDesc(shape_desc->GetOutputDesc(0)); if (ret != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Add input desc into op:%s(%s) failed when %s", - op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + 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()); return nullptr; } shape_node = graph->AddNode(shape_desc); if (shape_node == nullptr) { - REPORT_CALL_ERROR("E19999", "Add node:%s(%s) to graph:%s failed when %s", + 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(), __FUNCTION__); + 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()); return nullptr; } @@ -256,18 +256,18 @@ NodePtr CreateTransNode(const std::string &name, const std::string &node_type, c auto trans_node = graph->AddNode(op_desc); if (trans_node == nullptr) { - REPORT_CALL_ERROR("E19999", "Add node:%s(%s) to graph:%s failed when %s", + 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(), __FUNCTION__); + graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "Failed to add trans node %s to graph", name.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 " - "when %s", shape_node->GetName().c_str(), shape_node->GetType().c_str(), - trans_node->GetName().c_str(), trans_node->GetType().c_str(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(out_index:0) and op:%s(%s)(in_index:0) 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()); return nullptr; } @@ -286,9 +286,9 @@ Status RecoverOneTransNodeForVar(const std::string &name, const TransNodeInfo &t auto ret = GraphUtils::ReplaceNodeDataAnchors(trans_node, node, {}, {0}); if (ret != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Replace out anchors of node:%s(%s) by node:%s(%s) failed when %s", + 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(), __FUNCTION__); + 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()); return INTERNAL_ERROR; @@ -296,9 +296,9 @@ Status RecoverOneTransNodeForVar(const std::string &name, const TransNodeInfo &t ret = GraphUtils::AddEdge(node->GetOutDataAnchor(0), trans_node->GetInDataAnchor(0)); if (ret != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(out_index:0) and op:%s(%s)(in_index:0) failed when %s", + 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(), __FUNCTION__); + 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()); return INTERNAL_ERROR; @@ -306,9 +306,9 @@ Status RecoverOneTransNodeForVar(const std::string &name, const TransNodeInfo &t ret = GraphUtils::MoveOutCtrlEdges(node, trans_node); if (ret != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Move out control edges from node:%s(%s) to node:%s(%s) failed when %s", + 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(), __FUNCTION__); + 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()); return INTERNAL_ERROR; @@ -327,9 +327,9 @@ Status RecoverOneTransNodeForVarRef(const std::string &name, const TransNodeInfo auto ret = GraphUtils::ReplaceNodeDataAnchors(trans_node, node, {0}, {}); if (ret != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Replace out anchors of node:%s(%s) by node:%s(%s) failed when %s", + 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(), __FUNCTION__); + 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()); return INTERNAL_ERROR; @@ -337,9 +337,9 @@ Status RecoverOneTransNodeForVarRef(const std::string &name, const TransNodeInfo ret = GraphUtils::AddEdge(trans_node->GetOutDataAnchor(0), node->GetInDataAnchor(0)); if (ret != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(out_index:0) and op:%s(%s)(in_index:0) failed when %s", + 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(), __FUNCTION__); + 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()); return INTERNAL_ERROR; @@ -347,9 +347,9 @@ Status RecoverOneTransNodeForVarRef(const std::string &name, const TransNodeInfo 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 when %s", + 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(), __FUNCTION__); + 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()); return INTERNAL_ERROR; @@ -370,8 +370,8 @@ Status UpdateVarFormats(const NodePtr &var, const GeTensorDesc &tensor_desc) { output_desc.SetOriginDataType(tensor_desc.GetOriginDataType()); output_desc.SetOriginShape(tensor_desc.GetOriginShape()); 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, when %s", - var->GetName().c_str(), var->GetType().c_str(), __FUNCTION__); + 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"); return INTERNAL_ERROR;); } @@ -385,8 +385,8 @@ Status UpdateVarFormats(const NodePtr &var, const GeTensorDesc &tensor_desc) { desc.SetOriginDataType(tensor_desc.GetOriginDataType()); desc.SetOriginShape(tensor_desc.GetOriginShape()); 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, when %s", - var->GetName().c_str(), var->GetType().c_str(), __FUNCTION__); + 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"); return INTERNAL_ERROR;) } @@ -413,12 +413,18 @@ Status RecoverTransRoadForVar(const NodePtr &var, const VarTransRoad &road) { std::string stream_label; (void)AttrUtils::GetStr(var_desc, ATTR_NAME_STREAM_LABEL, stream_label); if (!stream_label.empty()) { - GE_CHK_STATUS_RET(SetStreamLabel(last_node, stream_label), "set stream label failed"); + auto status = SetStreamLabel(last_node, stream_label); + 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."); + return status; + } } GE_CHK_BOOL_EXEC((ge::AttrUtils::SetBool(last_node->GetOpDesc(), ge::ATTR_INSERTED_BY_GE, true)), - REPORT_CALL_ERROR("E19999", "Set Attr:%s to node:%s(%s) failed when %s", + 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(), __FUNCTION__); + last_node->GetName().c_str(), last_node->GetType().c_str()); return INTERNAL_ERROR, "Set attr ATTR_INSERTED_BY_GE failed."); GELOGD("Recover trans node %s type %s success", trans_name.c_str(), iter->node_type.c_str()); } @@ -450,13 +456,19 @@ Status RecoverTransRoadForVarRef(const std::set &nodes, const VarTransR std::string stream_label; (void)AttrUtils::GetStr(var_desc, ATTR_NAME_STREAM_LABEL, stream_label); if (!stream_label.empty()) { - GE_CHK_STATUS_RET(SetStreamLabel(last_node, stream_label), "set stream label failed"); + auto status = SetStreamLabel(last_node, stream_label); + 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."); + return status; + } } GE_CHK_BOOL_EXEC((ge::AttrUtils::SetBool(last_node->GetOpDesc(), ge::ATTR_INSERTED_BY_GE, true)), - REPORT_CALL_ERROR("E19999", "Set Attr:%s of node:%s(%s) failed when %s", + 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(), __FUNCTION__); + last_node->GetName().c_str(), last_node->GetType().c_str()); return INTERNAL_ERROR, "Set attr ATTR_INSERTED_BY_GE failed."); } if (!(road.empty()) && (UpdateVarFormats(var, road.rbegin()->output) != SUCCESS)) { @@ -472,7 +484,7 @@ VarNamesToRefs CollectVarNamesToRefs(const ComputeGraphPtr &graph) { VarNamesToRefs names_to_refs; std::string var_name; if (graph == nullptr) { - REPORT_INNER_ERROR("E19999", "Param graph is nullptr, check invalid when %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Param graph is nullptr, check invalid"); GELOGE(PARAM_INVALID, "graph is null."); return names_to_refs; } @@ -516,8 +528,8 @@ Status ModifyInputFormatAndShape(NodePtr &node_ptr) { ge::DataType dt = input->GetDataType(); std::vector dst_shape_dims; 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), when %s", - op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + 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"); return FAILED; } @@ -533,8 +545,8 @@ Status ModifyInputFormatAndShape(NodePtr &node_ptr) { int64_t size = 0; graphStatus graph_status = TensorUtils::GetTensorMemorySizeInBytes(*output, size); if (graph_status != ge::GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Get output tensor size failed, op:%s(%s), index:0 when %s", - op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + 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!"); return FAILED; } @@ -579,8 +591,8 @@ Status ModifyDataNetOutputFormatAndShape(OpDescPtr &op_desc, uint32_t index, For int64_t size = 0; graphStatus graph_status = TensorUtils::GetTensorMemorySizeInBytes(*output, size); if (graph_status != ge::GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Get output tensor size failed, op:%s(%s), index:%u when %s", - op_desc->GetName().c_str(), op_desc->GetType().c_str(), index, __FUNCTION__); + 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!"); return FAILED; } @@ -690,8 +702,8 @@ Status ProcessInputDtDynShape(NodePtr &node_ptr, bool &is_dynamic_batch, NodePtr ge::graphStatus input_graph_status = ge::TensorUtils::GetTensorSizeInBytes(*input, input_shape_size); ge::graphStatus output_graph_status = ge::TensorUtils::GetTensorMemorySizeInBytes(*input, output_shape_size); if (input_graph_status != ge::GRAPH_SUCCESS && output_graph_status != ge::GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Get input tensor size failed, op:%s(%s), index:0 when %s", - op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Get input tensor size failed, op:%s(%s), index:0", + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(GRAPH_FAILED, "[Process][InputOp] Get tensor size of op [%s] failed!", node_ptr->GetName().c_str()); return FAILED; } @@ -742,8 +754,8 @@ Status ProcessInputNC1HWC0DynShape(NodePtr &node_ptr, bool &is_dynamic_batch, No GE_CHECK_NOTNULL(switchn_op_desc); const GeTensorDescPtr &switchn_input = switchn_op_desc->MutableInputDesc(0); if (ModifyFormatAndShapeForSingleTensor(switchn_input) != SUCCESS) { - REPORT_CALL_ERROR("E19999", "Modify format and shape of input:0 in op:%s(%s) failed when %s", - switchn_op_desc->GetName().c_str(), switchn_op_desc->GetType().c_str(), __FUNCTION__); + 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"); return FAILED; } @@ -753,8 +765,8 @@ Status ProcessInputNC1HWC0DynShape(NodePtr &node_ptr, bool &is_dynamic_batch, No old_format = switchn_output->GetFormat(); old_shape = switchn_output->GetShape(); if (ModifyFormatAndShapeForSingleTensor(switchn_output) != SUCCESS) { - REPORT_CALL_ERROR("E19999", "Modify format and shape of output:%u in op:%s(%s) failed when %s", i, - switchn_op_desc->GetName().c_str(), switchn_op_desc->GetType().c_str(), __FUNCTION__); + 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"); return FAILED; } @@ -855,9 +867,9 @@ Status ProcessNetoutputNodeFp16Nc1hwc0DynShape(GeTensorDesc &src_desc, GeTensorD std::vector dst_shape_dims; std::vector src_shape_dims = src_shape.GetDims(); if (TransferShape2NC1HWC0(src_format, src_shape_dims, DT_FLOAT16, FORMAT_NC1HWC0, dst_shape_dims) != SUCCESS) { - REPORT_CALL_ERROR("E19999", "Transfer output:0 shape of op:%s(%s) to NC1HWC0 format failed, shape:%s, format:%s, " - "when %s", src_op_desc->GetName().c_str(), src_op_desc->GetType().c_str(), - src_shape.ToString().c_str(), TypeUtils::FormatToSerialString(src_format).c_str(), __FUNCTION__); + 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"); return FAILED; } @@ -868,8 +880,8 @@ Status ProcessNetoutputNodeFp16Nc1hwc0DynShape(GeTensorDesc &src_desc, GeTensorD auto merge_out = src_op_desc->MutableOutputDesc(0); GE_CHECK_NOTNULL(merge_out); if (ModifyFormatAndShapeForSingleTensor(merge_out) != SUCCESS) { - REPORT_CALL_ERROR("E19999", "Modify format and shape of output:0 in op:%s(%s) failed when %s", - src_op_desc->GetName().c_str(), src_op_desc->GetType().c_str(), __FUNCTION__); + 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"); return FAILED; } @@ -877,8 +889,8 @@ Status ProcessNetoutputNodeFp16Nc1hwc0DynShape(GeTensorDesc &src_desc, GeTensorD auto merge_in = src_op_desc->MutableInputDesc(i); GE_CHECK_NOTNULL(merge_in); if (ModifyFormatAndShapeForSingleTensor(merge_in) != SUCCESS) { - REPORT_CALL_ERROR("E19999", "Modify format and shape of input:%u in op:%s(%s) failed when %s", i, - src_op_desc->GetName().c_str(), src_op_desc->GetType().c_str(), __FUNCTION__); + 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"); return FAILED; } @@ -984,13 +996,13 @@ long StringToLongNoThrow(const string &str) { return std::stol(str); } catch (const std::invalid_argument) { GELOGE(PARAM_INVALID, - "Parse shape range of input failed when transfer from string to int64. Given %s, while correct example: " + "Parse shape range of input failed when transfer from string to int64. Given %s, while correct example:" "\"[1~20,3,3~6,-1],[1~20,3,3~6,-1]\"", str.c_str()); return PARAM_INVALID; } catch (const std::out_of_range) { GELOGE(PARAM_INVALID, - "Parse shape range of input failed when transfer from string to int64. Given %s, while correct example: " + "Parse shape range of input failed when transfer from string to int64. Given %s, while correct example:" "\"[1~20,3,3~6,-1],[1~20,3,3~6,-1]\"", str.c_str()); return PARAM_INVALID; @@ -1004,7 +1016,7 @@ long StringToLongNoThrow(const string &str) { Status ParseDynamicInputShapeRange(const std::string &shape_range, std::vector>> &range) { if (shape_range.size() < 2) { - REPORT_INNER_ERROR("E19999", "shape_range.size:%zu < 2, check invalid when %s", shape_range.size(), __FUNCTION__); + REPORT_INNER_ERROR("E19999", "shape_range.size:%zu < 2, check invalid", shape_range.size()); GELOGE(PARAM_INVALID, "Shape range %s is invalid.", shape_range.c_str()); return PARAM_INVALID; } @@ -1096,8 +1108,8 @@ Status GetDynamicInputShapeRange(const std::vector &user_input, const } else if (!enable_dynamic_execute_mode && !enable_input_shape_range) { return SUCCESS; } else { - REPORT_INNER_ERROR("E19999", "Graph option: %s and %s should be enabled at the same time, check invalid when %s", - OPTION_EXEC_DYNAMIC_EXECUTE_MODE, OPTION_EXEC_DATA_INPUTS_SHAPE_RANGE, __FUNCTION__); + 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.", OPTION_EXEC_DYNAMIC_EXECUTE_MODE, OPTION_EXEC_DATA_INPUTS_SHAPE_RANGE); return PARAM_INVALID; @@ -1120,8 +1132,8 @@ Status UpdateDynamicInputShapeRange(const ge::GeAttrValue::INT index, auto current_shape_range_vec = range_vec.at(index); if (current_shape_range_vec.size() != origin_shape.GetDimNum()) { REPORT_INNER_ERROR("E19999", "Given shape_range dim num is %zu, current dim:%s num is %zu, not match, " - "check invalid when %s", current_shape_range_vec.size(), origin_shape.ToString().c_str(), - origin_shape.GetDimNum(), __FUNCTION__); + "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()); return PARAM_INVALID; @@ -1134,7 +1146,7 @@ Status UpdateDynamicInputShapeRange(const ge::GeAttrValue::INT index, // given shape_range is known dim, check is same as origin or not 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 when %s", left_range, curr_dim, i, __FUNCTION__); + "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); return PARAM_INVALID; @@ -1145,8 +1157,8 @@ Status UpdateDynamicInputShapeRange(const ge::GeAttrValue::INT index, if (right_range != UNKNOWN_DIM) { if ((curr_dim < left_range) || (curr_dim > right_range)) { REPORT_INNER_ERROR("E19999", "Given shape range is [%ld~%ld], current dim shape is %ld, out of range, " - "dim_index:%zu, check invalid when %s", - left_range, right_range, curr_dim, i, __FUNCTION__); + "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); return PARAM_INVALID; @@ -1159,9 +1171,9 @@ Status UpdateDynamicInputShapeRange(const ge::GeAttrValue::INT index, desc.SetShapeRange(current_shape_range_vec); graphStatus graph_ret = op->UpdateInputDesc(0, desc); - GE_CHK_STATUS_RET(graph_ret, "UpdateInputDesc fail, graph ret: %u", graph_ret); + GE_CHK_GRAPH_STATUS_RET(graph_ret, "UpdateInputDesc fail, graph ret: %u", graph_ret); graph_ret = op->UpdateOutputDesc(0, desc); - GE_CHK_STATUS_RET(graph_ret, "UpdateInputDesc fail, graph ret: %u", graph_ret); + GE_CHK_GRAPH_STATUS_RET(graph_ret, "UpdateInputDesc fail, graph ret: %u", graph_ret); return SUCCESS; } } // namespace @@ -1235,21 +1247,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 when GraphPrepare %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "compute_graph_ is nullptr, check invalid"); GELOGE(GE_GRAPH_INIT_FAILED, "Graph prepare init 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 when GraphPrepare %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "nodes in graph is empty, check invalid"); GELOGE(GE_GRAPH_INIT_FAILED, "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 when GraphPrepare %s", - __FUNCTION__); + REPORT_INNER_ERROR("E19999", "node without opdesc exist in graph, check invalid"); GELOGE(GE_GRAPH_INIT_FAILED, "Check Graph node opdesc is NULL"); return GE_GRAPH_INIT_FAILED; } @@ -1285,9 +1296,9 @@ Status GraphPrepare::CheckRefInputNode(const NodePtr &node, const std::string &i auto input_type = input_op_desc->GetType(); if (input_type == ge::FRAMEWORKOP) { if (!ge::AttrUtils::GetStr(input_op_desc, ATTR_NAME_FRAMEWORK_ORIGINAL_TYPE, input_type)) { - REPORT_INNER_ERROR("E19999", "Get Attr:%s of op:%s(%s) failed when GraphPrepare %s", + 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(), __FUNCTION__); + input_op_desc->GetName().c_str(), input_op_desc->GetType().c_str()); GELOGE(PARAM_INVALID, "Get original type failed."); return PARAM_INVALID; } @@ -1311,15 +1322,13 @@ Status GraphPrepare::CheckRefOp() { std::set ref_nodes; for (const NodePtr &node : compute_graph_->GetDirectNode()) { if (node == nullptr) { - REPORT_INNER_ERROR("E19999", "nullptr node exist in graph, check invalid when GraphPrepare %s", - __FUNCTION__); + REPORT_INNER_ERROR("E19999", "nullptr node exist in graph, check invalid"); GELOGE(PARAM_INVALID, "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 when GraphPrepare %s", - __FUNCTION__); + REPORT_INNER_ERROR("E19999", "node without opdesc exist in graph, check invalid"); GELOGE(PARAM_INVALID, "OpDesc of param [node] must not be null."); return PARAM_INVALID; } @@ -1353,15 +1362,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 when GraphPrepare %s", - __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Param node is nullptr, check invalid"); GELOGE(GE_GRAPH_GRAPH_NODE_NULL, "Input node is NULL"); 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 when GraphPrepare %s", - __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Param node's op_desc is nullptr, check invalid"); GELOGE(GE_GRAPH_GRAPH_NODE_NULL, "Input node opdesc is NULL"); return GE_GRAPH_GRAPH_NODE_NULL; } @@ -1383,8 +1390,8 @@ Status GraphPrepare::AdjustDataOpOutput(const NodePtr &node) { TensorUtils::SetSize(output, tensor_size); graphStatus graph_ret = op_desc_ptr->UpdateOutputDesc(0, output); if (graph_ret != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Update output desc of op:%s(%s) failed, index:0, when GraphPrepare %s", - op_desc_ptr->GetName().c_str(), op_desc_ptr->GetType().c_str(), __FUNCTION__); + 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); return graph_ret; } @@ -1455,8 +1462,7 @@ Status GraphPrepare::UpdateInput(const std::vector &user_input, GE_IF_BOOL_EXEC(shape_size == 0 && desc.GetShape().GetDimNum() == 0, shape_size = static_cast(length)); 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, " - "when GraphPrepare %s", index, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Get size of user input tensor failed, index:%ld", index); GELOGE(INTERNAL_ERROR, "TensorUtils GetSize failed"); return FAILED); bool size_check = (size != 0 && shape_size != size); @@ -1472,8 +1478,8 @@ Status GraphPrepare::UpdateInput(const std::vector &user_input, if (!tune_flag) { graphStatus graph_ret = op->UpdateInputDesc(0, desc); if (graph_ret != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Update input desc of op:%s(%s) failed, index:0, when GraphPrepare %s", - op->GetName().c_str(), op->GetType().c_str(), __FUNCTION__); + 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); return graph_ret; } @@ -1481,8 +1487,8 @@ Status GraphPrepare::UpdateInput(const std::vector &user_input, ge::TensorUtils::SetSize(desc, 0); graph_ret = op->UpdateOutputDesc(0, desc); if (graph_ret != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Update output desc of op:%s(%s) failed, index:0, when GraphPrepare %s", - op->GetName().c_str(), op->GetType().c_str(), __FUNCTION__); + 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); return graph_ret; } @@ -1581,8 +1587,7 @@ Status GraphPrepare::ResourcePairProcess(const std::string &action) { new ResourcePairRemoveControlPass); } } catch (std::bad_alloc &e) { - REPORT_INNER_ERROR("E19999", "bad memory allocation occur when add ResourcePair Pass, when GraphPrepare %s", - __FUNCTION__); + 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()); return INTERNAL_ERROR; } @@ -1719,7 +1724,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 when GraphPrepare %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Param compute_graph is nullptr, check invalid"); GELOGE(GE_GRAPH_NULL_INPUT, "Input Graph is NULL"); return GE_GRAPH_NULL_INPUT; } @@ -1735,7 +1740,7 @@ Status GraphPrepare::SwitchOpOptimize(ComputeGraphPtr &compute_graph) { } ret = compute_graph->TopologicalSorting(); if (ret != SUCCESS) { - REPORT_CALL_ERROR("E19999", "Topological sorting failed when GraphPrepare %s", __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Topological sorting failed"); GELOGE(ret, "Graph topological sort failed, ret:%u.", ret); return ret; } @@ -1746,7 +1751,7 @@ Status GraphPrepare::SwitchOpOptimize(ComputeGraphPtr &compute_graph) { Status GraphPrepare::GenerateInfershapeGraph(ConstGraphPtr graph) { if (graph == nullptr) { - REPORT_INNER_ERROR("E19999", "Param graph is nullptr, check invalid when GraphPrepare %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Param graph is nullptr, check invalid"); GELOGE(GE_GRAPH_NULL_INPUT, "Input Graph is NULL"); return GE_GRAPH_NULL_INPUT; } @@ -1761,7 +1766,7 @@ Status GraphPrepare::GenerateInfershapeGraph(ConstGraphPtr graph) { ret = compute_graph_->InferOriginFormat(); GE_DUMP(compute_graph_, "after_inferformat"); if (ret != SUCCESS) { - REPORT_CALL_ERROR("E19999", "Infer OriginFormat failed when GraphPrepare %s", __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Infer OriginFormat failed"); GELOGE(ret, "Prepare Graph inferformat failed"); return ret; } @@ -1788,7 +1793,7 @@ Status GraphPrepare::CheckConstOp() { } else if (node_ptr->GetType() == FRAMEWORKOP) { auto op_desc = node_ptr->GetOpDesc(); if (op_desc == nullptr) { - REPORT_INNER_ERROR("E19999", "op_desc is nullptr, check invalid when GraphPrepare %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "op_desc is nullptr, check invalid"); GELOGE(PARAM_INVALID, "Get op desc failed"); return PARAM_INVALID; } @@ -1810,8 +1815,8 @@ Status GraphPrepare::VerifyConstOp(const NodePtr &node) { GE_CHECK_NOTNULL(op_desc); ConstGeTensorPtr ge_tensor_ptr; if (!(AttrUtils::GetTensor(op_desc, ATTR_NAME_WEIGHTS, ge_tensor_ptr))) { - REPORT_INNER_ERROR("E19999", "Get Attr:%s of op:%s(%s) failed when GraphPrepare %s", ATTR_NAME_WEIGHTS.c_str(), - op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + 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"); return PARAM_INVALID; } @@ -1886,8 +1891,8 @@ Status GraphPrepare::CheckUserInput(const std::vector &user_input) { data_num++; GeAttrValue::INT index = 0; if (!(AttrUtils::GetInt(op, ATTR_NAME_INDEX, index))) { - REPORT_INNER_ERROR("E19999", "Get Attr:%s of op:%s(%s) failed when GraphPrepare %s", ATTR_NAME_WEIGHTS.c_str(), - op->GetName().c_str(), op->GetType().c_str(), __FUNCTION__); + 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"); return GE_GRAPH_INIT_FAILED; } @@ -1992,7 +1997,7 @@ Status GraphPrepare::PrepareOptimize() { (void)original_graph_passes.AddPass("PrepareOptimize::ReplaceTransShapePass", new ReplaceTransShapePass); (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, when GraphPrepare %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "bad memory allocation occur when add Pass"); GELOGE(INTERNAL_ERROR, "Add pass failed, bad memory allocation occurs."); return INTERNAL_ERROR; } @@ -2056,7 +2061,7 @@ Status GraphPrepare::PrepareOptimize() { // can't move to optimize1/2 directly, may cause more identity insert, cause CI fail (void)graph_pass.AddPass("PrepareOptimize::HcclMemcpyPass", new HcclMemcpyPass); } catch (std::bad_alloc &e) { - REPORT_INNER_ERROR("E19999", "bad memory allocation occur when add Pass, when GraphPrepare %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "bad memory allocation occur when add Pass"); GELOGE(INTERNAL_ERROR, "Add pass failed, bad memory allocation occurs."); return INTERNAL_ERROR; } @@ -2073,7 +2078,7 @@ Status GraphPrepare::PrepareOptimize() { ret = compute_graph_->TopologicalSorting(); if (ret != SUCCESS) { - REPORT_CALL_ERROR("E19999", "Topological sorting failed when GraphPrepare %s", __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Topological sorting failed"); GELOGE(ret, "Graph topological sort failed, ret:%u.", ret); return ret; } @@ -2144,7 +2149,7 @@ Status GraphPrepare::ProcessNetOutput() { graph_passes_before_infershape.AddPass("ProcessNetOutput::DataPass", new (std::nothrow) DataPass); // Add NetOutput first. } catch (std::bad_alloc) { - REPORT_INNER_ERROR("E19999", "bad memory allocation occur when add Pass, when GraphPrepare %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "bad memory allocation occur when add Pass"); GELOGE(INTERNAL_ERROR, "Add pass failed, bad memory allocation occurs."); return INTERNAL_ERROR; } @@ -2184,7 +2189,7 @@ Status GraphPrepare::CheckAndUpdateInput(const std::vector &user_input } else { ret = compute_graph_->TopologicalSorting(); if (ret != SUCCESS) { - REPORT_CALL_ERROR("E19999", "Topological sorting failed when GraphPrepare %s", __FUNCTION__); + REPORT_CALL_ERROR("E19999", "Topological sorting failed"); GELOGE(ret, "graph prepare error: compute_graph_->Topological Sorting"); 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 96d1e044..d46cb0f3 100755 --- a/ge/graph/preprocess/insert_op/ge_aipp_op.cc +++ b/ge/graph/preprocess/insert_op/ge_aipp_op.cc @@ -162,7 +162,7 @@ Format GetAndCheckFormat() { 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 when AippOp %s", __FUNCTION__); + REPORT_CALL_ERROR("E19999", "New AippOpParams failed"); return FAILED; } aipp_params_->CopyFrom(*aipp_params); @@ -197,13 +197,12 @@ Status AippOp::InsertAippToGraph(ComputeGraphPtr &graph, std::string &aippConfig auto ret = GraphUtils::InsertNodeBetweenDataAnchors(out_in_anchors.first, out_in_anchors.second, aipp); if (ret != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Insert aipp:%s(%s) node between op:%s(%s) and op:%s:%s failed when AippOp %s", + REPORT_CALL_ERROR("E19999", "Insert aipp:%s(%s) node 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(), - __FUNCTION__); + out_in_anchors.second->GetOwnerNode()->GetType().c_str()); GELOGE(INTERNAL_ERROR, "Failed to link edges for aipp node %s", aipp->GetName().c_str()); return INTERNAL_ERROR; } @@ -223,11 +222,10 @@ Status AippOp::InsertAippToGraph(ComputeGraphPtr &graph, std::string &aippConfig auto &aipp = iter->second; auto ret = out_in_anchors.second->LinkFrom(aipp->GetOutDataAnchor(0)); if (ret != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "link aipp:%s(%s) to peer op:%s(%s) failed when AippOp %s", + REPORT_CALL_ERROR("E19999", "link aipp:%s(%s) to peer op:%s(%s) failed", aipp->GetName().c_str(), aipp->GetType().c_str(), out_in_anchors.second->GetOwnerNode()->GetName().c_str(), - out_in_anchors.second->GetOwnerNode()->GetType().c_str(), - __FUNCTION__); + 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(), out_in_anchors.second->GetOwnerNode()->GetName().c_str()); return INTERNAL_ERROR; @@ -243,7 +241,7 @@ NodePtr AippOp::CreateAipp(const OutDataAnchorPtr &out_anchor, std::string current_name = node->GetName() + "_" + std::to_string(out_anchor->GetIdx()) + "_huawei_aipp"; auto aipp_opdesc_ptr = MakeShared(current_name, AIPP); if (aipp_opdesc_ptr == nullptr) { - REPORT_CALL_ERROR("E19999", "New OpDesc failed when AippOp %s", __FUNCTION__); + REPORT_CALL_ERROR("E19999", "New OpDesc failed"); GELOGE(OUT_OF_MEMORY, "Failed to alloc aipp desc, name %s", current_name.c_str()); return nullptr; } @@ -270,9 +268,9 @@ NodePtr AippOp::CreateAipp(const OutDataAnchorPtr &out_anchor, // but the InferFormat process before InferShape can not infer the format // if the tensor on the Aipp has an unknown shape if (aipp_opdesc_ptr->UpdateInputDesc(kAippImageInputIndex, opdesc_src_data) != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Update the output desc from node:%s(%s) to aipp:%s(%s) failed when AippOp %s", + 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(), __FUNCTION__); + 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()); return nullptr; @@ -364,8 +362,8 @@ Status AippOp::GetAndCheckTarget(const ComputeGraphPtr &graph, int rank, NodePtr GeAttrValue::NAMED_ATTRS aipp_attr; ConvertParamToAttr(aipp_attr); if (!AttrUtils::SetNamedAttrs(data_opdesc, ATTR_NAME_AIPP, aipp_attr)) { - REPORT_INNER_ERROR("E19999", "Set Attr:%s for op:%s(%s) failed when AippOp %s", ATTR_NAME_AIPP.c_str(), - data_opdesc->GetName().c_str(), data_opdesc->GetType().c_str(), __FUNCTION__); + 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); return INTERNAL_ERROR; } @@ -397,8 +395,8 @@ Status AippOp::GetStaticTargetNode(const ComputeGraphPtr &graph, NodePtr &data_n if (AttrUtils::GetStr(data_node->GetOpDesc(), kMbatchSwitchnName, related_node_name)) { if (related_node_name.empty()) { REPORT_INNER_ERROR("E19999", "The data node %s has switchn node flag, but the value of attr:%s is empty, " - "check invalid when AippOp %s", data_node->GetName().c_str(), - kMbatchSwitchnName, __FUNCTION__); + "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()); return INTERNAL_ERROR; @@ -406,8 +404,7 @@ Status AippOp::GetStaticTargetNode(const ComputeGraphPtr &graph, NodePtr &data_n 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 when AippOp %s", data_node->GetName().c_str(), related_node_name.c_str(), - __FUNCTION__); + "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", data_node->GetName().c_str(), related_node_name.c_str()); return INTERNAL_ERROR; @@ -497,9 +494,9 @@ Status AippOp::GetTargetPosition(ComputeGraphPtr graph, NodePtr &target_input, for (const auto &name : func_desc->GetSubgraphInstanceNames()) { const auto &subgraph = graph->GetSubgraph(name); if (subgraph == nullptr) { - REPORT_INNER_ERROR("E19999", "Subgraph:%s of op:%s(%s) not find in graph:%s, check invalid when AippOp %s", + 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(), __FUNCTION__); + graph->GetName().c_str()); GELOGE(GE_GRAPH_EMPTY_SUBGRAPH, "Subgraph not found, name: %s", name.c_str()); return GE_GRAPH_EMPTY_SUBGRAPH; } @@ -700,15 +697,15 @@ Status AippOp::GenerateOpDesc(OpDescPtr op_desc) { // Add two InputDesc, add the second after the first one is added successfully. if ((op_desc->AddInputDesc(GeTensorDesc()) != GRAPH_SUCCESS) || (op_desc->AddInputDesc(GeTensorDesc()) != GRAPH_SUCCESS)) { - REPORT_CALL_ERROR("E19999", "Add input desc into op:%s(%s) failed when AippOp %s", - op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + 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"); return FAILED; } if (op_desc->AddOutputDesc(GeTensorDesc()) != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Add output desc into op:%s(%s) failed when AippOp %s", - op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + 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."); return FAILED; } @@ -716,8 +713,8 @@ Status AippOp::GenerateOpDesc(OpDescPtr op_desc) { ConvertParamToAttr(aipp_attrs); 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 when AippOp %s", ATTR_NAME_AIPP.c_str(), - op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + 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"); return FAILED); @@ -898,18 +895,18 @@ Status AippOp::AddNodeToGraph(const NodePtr &aipp_node, int64_t max_dynamic_aipp // add node desc for aipp node auto stat3 = aipp_node->GetOpDesc()->UpdateInputDesc(kAippParamsInputIndex, output_tensor); 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, when AippOp %s", - aipp_node->GetName().c_str(), aipp_node->GetType().c_str(), kAippParamsInputIndex, __FUNCTION__); + 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!"); return INTERNAL_ERROR; } // aipp_node should have two input data but now tbe only one input if (GraphUtils::AddEdge(aipp_data_node_ptr->GetOutDataAnchor(kAippDataOutputIndex), aipp_node->GetInDataAnchor(kAippParamsInputIndex)) != GRAPH_SUCCESS) { - REPORT_INNER_ERROR("E19999", "Add edge between op:%s(%s)(out_index:%u) and op:%s(%s)(in_index:%u) failed " - "when AippOp %s", aipp_data_node_ptr->GetName().c_str(), aipp_data_node_ptr->GetType().c_str(), + REPORT_INNER_ERROR("E19999", "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, __FUNCTION__); + kAippParamsInputIndex); GELOGE(INTERNAL_ERROR, "Add Anchor anchor between aipp data node and aipp failed!"); return INTERNAL_ERROR; } 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 486c78e2..3bc8e3e4 100755 --- a/ge/graph/preprocess/insert_op/util_insert_aipp_op.cc +++ b/ge/graph/preprocess/insert_op/util_insert_aipp_op.cc @@ -99,7 +99,7 @@ Status InsertNewOpUtil::InsertAippOps(ComputeGraphPtr &graph, std::string &aippC GE_CHK_STATUS_RET(CheckGraph(graph), "after inserting all ops, check graph failed"); - GE_CHK_STATUS_RET(graph->TopologicalSorting(), "after insert dynamic op, sort graph failed"); + GE_CHK_GRAPH_STATUS_RET(graph->TopologicalSorting(), "after insert dynamic op, sort graph failed"); ClearNewOps(); @@ -306,9 +306,9 @@ Status InsertNewOpUtil::FindMaxSizeNode(const ComputeGraphPtr &graph, const Node for (const auto &name : func_desc->GetSubgraphInstanceNames()) { const auto &subgraph = graph->GetSubgraph(name); if (subgraph == nullptr) { - REPORT_INNER_ERROR("E19999", "Subgraph:%s of op:%s(%s) not find in graph:%s, check invalid " - "when InsertNewOpUtil %s", name.c_str(), func_desc->GetName().c_str(), - func_desc->GetType().c_str(), graph->GetName().c_str(), __FUNCTION__); + 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()); return GE_GRAPH_EMPTY_SUBGRAPH; } @@ -328,9 +328,9 @@ Status InsertNewOpUtil::FindMaxSizeNode(const ComputeGraphPtr &graph, const Node uint32_t parent_index = 0; if (!AttrUtils::GetInt(src_op, ATTR_NAME_PARENT_NODE_INDEX, parent_index)) { - REPORT_INNER_ERROR("E19999", "Get Attr:%s of op:%s(%s) failed when InsertNewOpUtil %s", + 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(), __FUNCTION__); + src_op->GetName().c_str(), src_op->GetType().c_str()); GELOGE(FAILED, "Parent index not found, name: %s", src_op->GetName().c_str()); return FAILED; } @@ -382,16 +382,16 @@ Status InsertNewOpUtil::UpdateCaseNode(const ComputeGraphPtr &graph, const NodeP auto ret = data_opdesc->UpdateOutputDesc(0, *input_desc); if (ret != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Update OutputDesc to op:%s(%s) failed, index:0, when InsertNewOpUtil %s", - data_opdesc->GetName().c_str(), data_opdesc->GetType().c_str(), __FUNCTION__); + 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()); 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, when InsertNewOpUtil %s", - data_opdesc->GetName().c_str(), data_opdesc->GetType().c_str(), __FUNCTION__); + 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()); return INTERNAL_ERROR; @@ -414,15 +414,15 @@ Status InsertNewOpUtil::UpdatePrevNodeByAipp(NodePtr &node, std::set &s int64_t size = 0; graphStatus graph_ret = ge::TensorUtils::GetSize(*aipp_input, size); if (graph_ret != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Get input size of op:%s(%s), index:0, failed, when InsertNewOpUtil %s", - aipp_op_desc->GetName().c_str(), aipp_op_desc->GetType().c_str(), __FUNCTION__); + 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); 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 when InsertNewOpUtil %s", - aipp_op_desc->GetName().c_str(), aipp_op_desc->GetType().c_str(), __FUNCTION__); + 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()); return FAILED; } @@ -509,16 +509,16 @@ Status InsertNewOpUtil::UpdateDataBySwitchN(const NodePtr &switchn, const NodePt auto ret = data_opdesc->UpdateOutputDesc(0, *input_desc); if (ret != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Update OutputDesc to op:%s(%s) failed, index:0, when InsertNewOpUtil %s", - data_opdesc->GetName().c_str(), data_opdesc->GetType().c_str(), __FUNCTION__); + 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()); 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, when InsertNewOpUtil %s", - data_opdesc->GetName().c_str(), data_opdesc->GetType().c_str(), __FUNCTION__); + 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()); return INTERNAL_ERROR; @@ -618,9 +618,9 @@ Status InsertNewOpUtil::GetAllAipps(const NodePtr &data_node, const NodePtr &nod for (const auto &name : op->GetSubgraphInstanceNames()) { const auto &subgraph = graph->GetSubgraph(name); if (subgraph == nullptr) { - REPORT_INNER_ERROR("E19999", "Subgraph:%s of op:%s(%s) not find in graph:%s, check invalid " - "when InsertNewOpUtil %s", name.c_str(), op->GetName().c_str(), - op->GetType().c_str(), graph->GetName().c_str(), __FUNCTION__); + 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()); return GE_GRAPH_EMPTY_SUBGRAPH; } @@ -632,9 +632,9 @@ Status InsertNewOpUtil::GetAllAipps(const NodePtr &data_node, const NodePtr &nod GE_CHECK_NOTNULL(src_op); uint32_t parent_index = 0; if (!AttrUtils::GetInt(src_op, ATTR_NAME_PARENT_NODE_INDEX, parent_index)) { - REPORT_INNER_ERROR("E19999", "Get Attr:%s of op:%s(%s) failed when InsertNewOpUtil %s", + 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(), __FUNCTION__); + src_op->GetName().c_str(), src_op->GetType().c_str()); GELOGE(FAILED, "Parent index not found, name: %s", src_op->GetName().c_str()); return FAILED; } @@ -774,9 +774,9 @@ 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 when InsertNewOpUtil %s", + REPORT_INNER_ERROR("E19999", "Set Attr:%s of op:%s(%s) failed", ATTR_NAME_INPUT_DIMS.c_str(), - data_opdesc->GetName().c_str(), data_opdesc->GetType().c_str(), __FUNCTION__); + data_opdesc->GetName().c_str(), data_opdesc->GetType().c_str()); GELOGE(FAILED, "SetListInt of %s failed.", ATTR_NAME_INPUT_DIMS.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 d4ccf060..22f39d26 100644 --- a/ge/graph/preprocess/multi_batch_copy_graph.cc +++ b/ge/graph/preprocess/multi_batch_copy_graph.cc @@ -78,7 +78,7 @@ inline bool IsGetNextType(const NodePtr &node) { NodePtr InsertMergeNodeToGraph(const std::string &name, size_t input_num, const ComputeGraphPtr &graph) { OpDescPtr desc = MakeShared(); if (desc == nullptr) { - REPORT_CALL_ERROR("E19999", "New OpDesc failed when %s", __FUNCTION__); + REPORT_CALL_ERROR("E19999", "New OpDesc failed"); GELOGE(OUT_OF_MEMORY, "Failed to insert merge node, name %s", name.c_str()); return nullptr; } @@ -88,33 +88,33 @@ 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, when %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(), __FUNCTION__); + ("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); 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, when %s", - desc->GetName().c_str(), desc->GetType().c_str(), "y", __FUNCTION__); + 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); 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, when %s", - desc->GetName().c_str(), desc->GetType().c_str(), "value_index", __FUNCTION__); + 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); return nullptr; } if (!AttrUtils::SetBool(desc, ATTR_INSERT_BY_MBATCH, true)) { - REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed when %s", ATTR_INSERT_BY_MBATCH.c_str(), - desc->GetName().c_str(), desc->GetType().c_str(), __FUNCTION__); + 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()); return nullptr; } @@ -125,15 +125,15 @@ NodePtr InsertCopyNode(const NodePtr &node, size_t n) { const std::string &name = node->GetName() + "_ascend_mbatch_batch_" + std::to_string(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 when %s", __FUNCTION__); + 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()); 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 when %s", - src_op_desc->GetName().c_str(), src_op_desc->GetType().c_str(), __FUNCTION__); + 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()); return nullptr); @@ -143,8 +143,8 @@ NodePtr InsertCopyNode(const NodePtr &node, size_t n) { for (uint32_t i = 0; i < node->GetAllInDataAnchorsSize(); ++i) { auto input_desc = desc->MutableInputDesc(i); GE_IF_BOOL_EXEC(input_desc == nullptr, - REPORT_INNER_ERROR("E19999", "Input desc of op:%s(%s) not exist, index:%u, check invalid when %s", - desc->GetName().c_str(), desc->GetType().c_str(), i, __FUNCTION__); + REPORT_INNER_ERROR("E19999", "Input desc of op:%s(%s) not exist, index:%u, check invalid", + desc->GetName().c_str(), desc->GetType().c_str(), i); GELOGW("Get null input desc by index %u from node %s when copy from %s", i, desc->GetName().c_str(), node->GetName().c_str()); continue); @@ -154,8 +154,8 @@ NodePtr InsertCopyNode(const NodePtr &node, size_t n) { for (uint32_t i = 0; i < node->GetAllOutDataAnchorsSize(); ++i) { auto output_desc = desc->MutableOutputDesc(i); GE_IF_BOOL_EXEC(output_desc == nullptr, - REPORT_INNER_ERROR("E19999", "Ouput desc of op:%s(%s) not exist, index:%u, check invalid when %s", - desc->GetName().c_str(), desc->GetType().c_str(), i, __FUNCTION__); + 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()); return nullptr); @@ -164,8 +164,8 @@ NodePtr InsertCopyNode(const NodePtr &node, size_t n) { } const std::string &batch_label = "Batch_" + std::to_string(n); if (!AttrUtils::SetStr(desc, ATTR_NAME_BATCH_LABEL, batch_label)) { - REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed when %s", ATTR_NAME_BATCH_LABEL.c_str(), - desc->GetName().c_str(), desc->GetType().c_str(), __FUNCTION__); + 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()); return nullptr; } @@ -188,7 +188,7 @@ bool IsAllDimsPositive(const std::vector &dims) { NodePtr InsertConst(const std::string &name, const ComputeGraphPtr &graph) { auto desc = MakeShared(); if (desc == nullptr) { - REPORT_CALL_ERROR("E19999", "New OpDesc failed when %s", __FUNCTION__); + REPORT_CALL_ERROR("E19999", "New OpDesc failed"); GELOGE(OUT_OF_MEMORY, "Failed to create const op %s, out of memory", name.c_str()); return nullptr; } @@ -197,20 +197,20 @@ NodePtr InsertConst(const std::string &name, const ComputeGraphPtr &graph) { GeTensor tensor; tensor.SetData(std::vector({0})); if (!AttrUtils::SetTensor(desc, ATTR_NAME_WEIGHTS, tensor)) { - REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed when %s", ATTR_NAME_WEIGHTS.c_str(), - desc->GetName().c_str(), desc->GetType().c_str(), __FUNCTION__); + 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()); return nullptr; } if (!AttrUtils::SetBool(desc, ATTR_INSERT_BY_MBATCH, true)) { - REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed when %s", ATTR_INSERT_BY_MBATCH.c_str(), - desc->GetName().c_str(), desc->GetType().c_str(), __FUNCTION__); + 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()); return nullptr; } if (desc->AddOutputDesc(GeTensorDesc()) != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Add output desc to op:%s(%s) failed when %s", - desc->GetName().c_str(), desc->GetType().c_str(), __FUNCTION__); + 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()); return nullptr; } @@ -325,7 +325,7 @@ Status MultiBatchGraphCopyer::RelinkConstCtrlEdge() { continue; } if (!out_ctrl_anchor_of_in_ctrl_node->IsLinkedWith(out_node->GetInControlAnchor())) { - GE_CHK_STATUS_RET(out_ctrl_anchor_of_in_ctrl_node->LinkTo(out_node->GetInControlAnchor())) + GE_CHK_GRAPH_STATUS_RET(out_ctrl_anchor_of_in_ctrl_node->LinkTo(out_node->GetInControlAnchor())) } } } @@ -399,9 +399,9 @@ Status MultiBatchGraphCopyer::GetEnterNodesGroupByFrame(mapGetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(FAILED, "Get attr frame_name of enter[%s] failed.", node->GetName().c_str()); return FAILED; } @@ -466,7 +466,7 @@ Status MultiBatchGraphCopyer::MoveInEntersInDataAnchorDown(NodePtr &node, OpDesc GE_CHECK_NOTNULL(peer_out_data_anchor); auto peer_in_data_node = peer_out_data_anchor->GetOwnerNode(); if (IsEnterType(peer_in_data_node->GetType())) { - GE_CHK_STATUS_RET(peer_out_data_anchor->Unlink(in_data_anchor)) + GE_CHK_GRAPH_STATUS_RET(peer_out_data_anchor->Unlink(in_data_anchor)) GELOGD("Unlink data edge from %s to %s.", peer_in_data_node->GetName().c_str(), node->GetName().c_str()); auto enter_in_data_anchors = peer_in_data_node->GetAllInDataAnchors(); for (auto &enter_in_data_anchor : enter_in_data_anchors) { @@ -475,7 +475,7 @@ Status MultiBatchGraphCopyer::MoveInEntersInDataAnchorDown(NodePtr &node, OpDesc if (peer_out_data_anchor_of_enter->IsLinkedWith(in_data_anchor)) { continue; } - GE_CHK_STATUS_RET(peer_out_data_anchor_of_enter->LinkTo(in_data_anchor)) + GE_CHK_GRAPH_STATUS_RET(peer_out_data_anchor_of_enter->LinkTo(in_data_anchor)) GELOGD("Relink data edge from %s to %s.", peer_out_data_anchor_of_enter->GetOwnerNode()->GetName().c_str(), node->GetName().c_str()); } @@ -512,17 +512,17 @@ Status MultiBatchGraphCopyer::InsertEnterAfterNode(NodePtr &node, const OpDescPt GELOGD("Create Enter op %s after %s.", name.c_str(), node->GetName().c_str()); auto enter_desc = AttrUtils::CopyOpDesc(copy_desc); enter_desc->SetName(name); - GE_CHK_STATUS_RET( + GE_CHK_GRAPH_STATUS_RET( enter_desc->UpdateInputDesc("x", node_desc->GetOutputDesc(outanchor_inanchors_nodes.first->GetIdx()))) - GE_CHK_STATUS_RET( + GE_CHK_GRAPH_STATUS_RET( enter_desc->UpdateOutputDesc("y", node_desc->GetOutputDesc(outanchor_inanchors_nodes.first->GetIdx()))) auto enter_node = graph_->AddNode(enter_desc); GE_CHECK_NOTNULL(enter_node); - GE_CHK_STATUS_RET(outanchor_inanchors_nodes.first->LinkTo(enter_node->GetInDataAnchor(kDataInIndex))) + GE_CHK_GRAPH_STATUS_RET(outanchor_inanchors_nodes.first->LinkTo(enter_node->GetInDataAnchor(kDataInIndex))) GE_CHECK_NOTNULL(enter_node->GetOutDataAnchor(kDataInIndex)); for (auto &inanchor_node : outanchor_inanchors_nodes.second) { - GE_CHK_STATUS_RET(outanchor_inanchors_nodes.first->Unlink(inanchor_node.first)) - GE_CHK_STATUS_RET(enter_node->GetOutDataAnchor(kDataInIndex)->LinkTo(inanchor_node.first)) + GE_CHK_GRAPH_STATUS_RET(outanchor_inanchors_nodes.first->Unlink(inanchor_node.first)) + GE_CHK_GRAPH_STATUS_RET(enter_node->GetOutDataAnchor(kDataInIndex)->LinkTo(inanchor_node.first)) GELOGD("Unlink from %s to %s, link from %s to %s then to %s.", node->GetName().c_str(), inanchor_node.second->GetName().c_str(), node->GetName().c_str(), enter_node->GetName().c_str(), inanchor_node.second->GetName().c_str()); @@ -538,14 +538,14 @@ Status MultiBatchGraphCopyer::MoveCtrlEdgeToOutNodes(NodePtr &node, set GE_CHECK_NOTNULL(in_ctrl_anchor); auto peer_out_ctrl_anchors = in_ctrl_anchor->GetPeerOutControlAnchors(); for (auto &peer_out_ctrl_anchor : peer_out_ctrl_anchors) { - GE_CHK_STATUS_RET(peer_out_ctrl_anchor->Unlink(in_ctrl_anchor)) + GE_CHK_GRAPH_STATUS_RET(peer_out_ctrl_anchor->Unlink(in_ctrl_anchor)) GELOGD("Unlink control edge from %s to %s.", peer_out_ctrl_anchor->GetOwnerNode()->GetName().c_str(), node->GetName().c_str()); for (auto &out_node : out_nodes) { auto in_ctrl_anchor_of_out_node = out_node->GetInControlAnchor(); GE_CHECK_NOTNULL(in_ctrl_anchor_of_out_node); if (!peer_out_ctrl_anchor->IsLinkedWith(in_ctrl_anchor_of_out_node)) { - GE_CHK_STATUS_RET(peer_out_ctrl_anchor->LinkTo(in_ctrl_anchor_of_out_node)) + GE_CHK_GRAPH_STATUS_RET(peer_out_ctrl_anchor->LinkTo(in_ctrl_anchor_of_out_node)) GELOGD("Link control edge from %s to %s.", peer_out_ctrl_anchor->GetOwnerNode()->GetName().c_str(), out_node->GetName().c_str()); } @@ -562,8 +562,8 @@ Status MultiBatchGraphCopyer::DeleteEnterWithoutDataOut() { auto out_nodes = node->GetOutAllNodes(); if (out_nodes.empty()) { GELOGD("Delete enter node: %s which has no output.", node->GetName().c_str()); - GE_CHK_STATUS_RET(GraphUtils::IsolateNode(node, {})) - GE_CHK_STATUS_RET(GraphUtils::RemoveNodeWithoutRelink(graph_, node)) + GE_CHK_GRAPH_STATUS_RET(GraphUtils::IsolateNode(node, {})) + GE_CHK_GRAPH_STATUS_RET(GraphUtils::RemoveNodeWithoutRelink(graph_, node)) } } } @@ -610,7 +610,7 @@ Status MultiBatchGraphCopyer::LabelInBatchBranchStatus() { for (const auto &data : origin_data_nodes_) { 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 when %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "op_desc in origin_data_nodes_ is nullptr, check invalid"); GELOGE(PARAM_INVALID, "Op desc is nullptr."); return PARAM_INVALID); LabelStatusForData(data); @@ -887,8 +887,8 @@ NodePtr MultiBatchGraphCopyer::FindSwitchnNodeForDataEdge(const OutDataAnchorPtr for (const auto &peer_in_anchor : data_out_anchor->GetPeerInDataAnchors()) { if (peer_in_anchor->GetOwnerNode()->GetOpDesc() == nullptr) { REPORT_INNER_ERROR("E19999", "peer op_desc of op:%s(%s)'s out_index:%d anchor exist nullptr, " - "check invalid when MultiBatchGraphCopyer %s", - data_node->GetName().c_str(), data_node->GetType().c_str(), output_idx, __FUNCTION__); + "check invalid", + data_node->GetName().c_str(), data_node->GetType().c_str(), output_idx); GELOGE(INTERNAL_ERROR, "Op desc should not be nullptr."); return nullptr; } @@ -900,9 +900,9 @@ NodePtr MultiBatchGraphCopyer::FindSwitchnNodeForDataEdge(const OutDataAnchorPtr referenced_index >= getnext_nodes_to_switchn_.at(output_idx).size()) { REPORT_INNER_ERROR("E19999", "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, " - "check invalid when %s", output_idx, + "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(), __FUNCTION__); + 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); return nullptr; } @@ -932,10 +932,10 @@ Status MultiBatchGraphCopyer::CopyInDataEdges(const NodePtr &origin_node, int ba if (switchn != nullptr) { auto ret = GraphUtils::AddEdge(switchn->GetOutDataAnchor(batch_num), dst_anchor); if (ret != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(out_index:%d) and op:%s(%s)(in_index:%d) failed " - "when MultiBatchGraphCopyer %s", switchn->GetName().c_str(), switchn->GetType().c_str(), + REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(out_index:%d) and op:%s(%s)(in_index:%d) failed", + switchn->GetName().c_str(), switchn->GetType().c_str(), batch_num, copyed_node->GetName().c_str(), copyed_node->GetType().c_str(), - in_anchor->GetIdx(), __FUNCTION__); + in_anchor->GetIdx()); GELOGE(INTERNAL_ERROR, "Failed to add data edge between %s(%d) to %s(%d), error-code %u", switchn->GetName().c_str(), batch_num, copyed_node->GetName().c_str(), in_anchor->GetIdx(), ret); @@ -951,11 +951,11 @@ Status MultiBatchGraphCopyer::CopyInDataEdges(const NodePtr &origin_node, int ba auto src_batch_node = batch_branch_iter->second.at(batch_num); auto ret = GraphUtils::AddEdge(src_batch_node->GetOutDataAnchor(origin_src_anchor->GetIdx()), dst_anchor); if (ret != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(out_index:%d) and op:%s(%s)(in_index:%d) failed " - "when MultiBatchGraphCopyer %s", src_batch_node->GetName().c_str(), + REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(out_index:%d) and op:%s(%s)(in_index:%d) failed", + src_batch_node->GetName().c_str(), src_batch_node->GetType().c_str(), origin_src_anchor->GetIdx(), copyed_node->GetName().c_str(), copyed_node->GetType().c_str(), - in_anchor->GetIdx(), __FUNCTION__); + in_anchor->GetIdx()); GELOGE(INTERNAL_ERROR, "Failed to add data edge between %s(%d) to %s(%d), error-code %u", src_batch_node->GetName().c_str(), batch_num, copyed_node->GetName().c_str(), in_anchor->GetIdx(), ret); return INTERNAL_ERROR; @@ -967,11 +967,11 @@ Status MultiBatchGraphCopyer::CopyInDataEdges(const NodePtr &origin_node, int ba auto ret = GraphUtils::AddEdge(origin_src_anchor, dst_anchor); if (ret != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(out_index:%d) and op:%s(%s)(in_index:%d) failed " - "when MultiBatchGraphCopyer %s", origin_src_node->GetName().c_str(), + REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(out_index:%d) and op:%s(%s)(in_index:%d) failed", + origin_src_node->GetName().c_str(), origin_src_node->GetType().c_str(), origin_src_anchor->GetIdx(), copyed_node->GetName().c_str(), copyed_node->GetType().c_str(), - in_anchor->GetIdx(), __FUNCTION__); + in_anchor->GetIdx()); GELOGE(INTERNAL_ERROR, "Failed to add data edge between origin node %s(%d) to copyed %s(%d)", origin_src_node->GetName().c_str(), origin_src_anchor->GetIdx(), copyed_node->GetName().c_str(), dst_anchor->GetIdx()); @@ -991,10 +991,9 @@ Status MultiBatchGraphCopyer::CopyInControlEdges(const NodePtr &node, int batch_ // reconnect data node auto ret = GraphUtils::AddEdge(switchn_iter->second->GetOutControlAnchor(), copyed_node->GetInControlAnchor()); if (ret != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Add ctrl edge between op:%s(%s) and op:%s(%s) failed " - "when MultiBatchGraphCopyer %s", + 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(), __FUNCTION__); + 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", switchn_iter->second->GetName().c_str(), copyed_node->GetName().c_str(), ret); return INTERNAL_ERROR; @@ -1009,10 +1008,9 @@ Status MultiBatchGraphCopyer::CopyInControlEdges(const NodePtr &node, int batch_ auto src_batch_node = batch_branch_iter->second.at(batch_num); auto ret = GraphUtils::AddEdge(src_batch_node->GetOutControlAnchor(), copyed_node->GetInControlAnchor()); if (ret != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Add ctrl edge between op:%s(%s) and op:%s(%s) failed " - "when MultiBatchGraphCopyer %s", + 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(), __FUNCTION__); + 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", src_batch_node->GetName().c_str(), copyed_node->GetName().c_str(), ret); return INTERNAL_ERROR; @@ -1023,10 +1021,9 @@ Status MultiBatchGraphCopyer::CopyInControlEdges(const NodePtr &node, int batch_ auto ret = GraphUtils::AddEdge(origin_src_node->GetOutControlAnchor(), copyed_node->GetInControlAnchor()); if (ret != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Add ctrl edge between op:%s(%s) and op:%s(%s) failed " - "when MultiBatchGraphCopyer %s", + 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(), __FUNCTION__); + copyed_node->GetName().c_str(), copyed_node->GetType().c_str()); GELOGE(INTERNAL_ERROR, "Failed to add control edge from origin %s to copyed %s", origin_src_node->GetName().c_str(), copyed_node->GetName().c_str()); return INTERNAL_ERROR; @@ -1040,7 +1037,7 @@ Status MultiBatchGraphCopyer::CopyInControlEdges(const NodePtr &node, int batch_ NodePtr MultiBatchGraphCopyer::InsertShapeDataNode() { auto desc = MakeShared(); if (desc == nullptr) { - REPORT_CALL_ERROR("E19999", "New OpDesc failed when MultiBatchGraphCopyer %s", __FUNCTION__); + REPORT_CALL_ERROR("E19999", "New OpDesc failed"); GELOGE(OUT_OF_MEMORY, "Failed to create shape data node, out of memory"); return nullptr; } @@ -1055,38 +1052,38 @@ NodePtr MultiBatchGraphCopyer::InsertShapeDataNode() { GeTensorDesc tensor_desc(GeShape({static_cast(shapes_.at(0).size())}), FORMAT_ND, DT_INT64); auto ret = desc->AddInputDesc(tensor_desc); if (ret != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Add input desc to op:%s(%s) failed when MultiBatchGraphCopyer %s", - desc->GetName().c_str(), desc->GetType().c_str(), __FUNCTION__); + 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"); return nullptr; } ret = desc->AddOutputDesc(tensor_desc); if (ret != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Add output desc into op:%s(%s) failed when MultiBatchGraphCopyer %s", - desc->GetName().c_str(), desc->GetType().c_str(), __FUNCTION__); + 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"); return nullptr; } if (!AttrUtils::SetBool(desc, ATTR_INSERT_BY_MBATCH, true)) { - REPORT_CALL_ERROR("E19999", "Set Attr:%s to node:%s(%s) failed when MultiBatchGraphCopyer %s", - ATTR_INSERT_BY_MBATCH.c_str(), desc->GetName().c_str(), desc->GetType().c_str(), __FUNCTION__); + 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"); return nullptr; } auto data_node = graph_->AddNode(desc); if (data_node == nullptr) { - REPORT_CALL_ERROR("E19999", "Add node:%s(%s) to graph:%s failed when MultiBatchGraphCopyer %s", - desc->GetName().c_str(), desc->GetType().c_str(), graph_->GetName().c_str(), __FUNCTION__); + 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"); return nullptr; } ret = GraphUtils::AppendInputNode(graph_, data_node); if (ret != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Append input node:%s(%s) to graph:%s failed when MultiBatchGraphCopyer %s", + 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(), __FUNCTION__); + graph_->GetName().c_str()); GELOGE(INTERNAL_ERROR, "Failed to append data node %s as input to graph", data_node->GetName().c_str()); return nullptr; } @@ -1098,7 +1095,7 @@ NodePtr MultiBatchGraphCopyer::InsertGetDynamicDimsNode() { GELOGD("Start insert getdynamicdims node to get shape info."); auto desc = MakeShared(); if (desc == nullptr) { - REPORT_CALL_ERROR("E19999", "New OpDesc failed when MultiBatchGraphCopyer %s", __FUNCTION__); + REPORT_CALL_ERROR("E19999", "New OpDesc failed"); GELOGE(OUT_OF_MEMORY, "Failed to create shape data node, out of memory"); return nullptr; } @@ -1121,8 +1118,8 @@ NodePtr MultiBatchGraphCopyer::InsertGetDynamicDimsNode() { tensor_desc.SetDataType(DT_INT64); auto ret = desc->AddInputDesc(tensor_desc); GE_IF_BOOL_EXEC(ret != GRAPH_SUCCESS, - REPORT_CALL_ERROR("E19999", "Add input desc to op:%s(%s) failed when MultiBatchGraphCopyer %s", - desc->GetName().c_str(), desc->GetType().c_str(), __FUNCTION__); + 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"); return nullptr); continue; @@ -1130,8 +1127,8 @@ NodePtr MultiBatchGraphCopyer::InsertGetDynamicDimsNode() { GeTensorDesc tensor_desc(GeShape({static_cast(input_shape_dims)}), FORMAT_ND, DT_INT64); auto ret = desc->AddInputDesc(tensor_desc); GE_IF_BOOL_EXEC(ret != GRAPH_SUCCESS, - REPORT_CALL_ERROR("E19999", "Add input desc to op:%s(%s) failed when MultiBatchGraphCopyer %s", - desc->GetName().c_str(), desc->GetType().c_str(), __FUNCTION__); + 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"); return nullptr); } @@ -1139,30 +1136,30 @@ NodePtr MultiBatchGraphCopyer::InsertGetDynamicDimsNode() { GeTensorDesc tensor_desc(GeShape({static_cast(shapes_.at(0).size())}), FORMAT_ND, DT_INT64); auto ret = desc->AddOutputDesc(tensor_desc); GE_IF_BOOL_EXEC(ret != GRAPH_SUCCESS, - REPORT_CALL_ERROR("E19999", "Add output desc to op:%s(%s) failed when MultiBatchGraphCopyer %s", - desc->GetName().c_str(), desc->GetType().c_str(), __FUNCTION__); + 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"); return nullptr); if (!AttrUtils::SetBool(desc, ATTR_INSERT_BY_MBATCH, true)) { - REPORT_CALL_ERROR("E19999", "Set Attr:%s to node:%s(%s) failed when MultiBatchGraphCopyer %s", - ATTR_INSERT_BY_MBATCH.c_str(), desc->GetName().c_str(), desc->GetType().c_str(), __FUNCTION__); + 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"); return nullptr; } auto data_node = graph_->AddNode(desc); if (data_node == nullptr) { - REPORT_CALL_ERROR("E19999", "Add node:%s(%s) to graph:%s failed when MultiBatchGraphCopyer %s", - desc->GetName().c_str(), desc->GetType().c_str(), graph_->GetName().c_str(), __FUNCTION__); + 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"); return nullptr; } ret = GraphUtils::AppendInputNode(graph_, data_node); if (ret != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Append input node:%s(%s) to graph:%s failed when MultiBatchGraphCopyer %s", + 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(), __FUNCTION__); + graph_->GetName().c_str()); GELOGE(INTERNAL_ERROR, "Failed to append data node %s as input to graph", data_node->GetName().c_str()); return nullptr; } @@ -1172,7 +1169,7 @@ NodePtr MultiBatchGraphCopyer::InsertGetDynamicDimsNode() { Status MultiBatchGraphCopyer::CheckArguments() { if (graph_ == nullptr) { - REPORT_INNER_ERROR("E19999", "graph_ is nullptr, check invalid when MultiBatchGraphCopyer %s", __FUNCTION__); + REPORT_INNER_ERROR("E19999", "graph_ is nullptr, check invalid"); GELOGE(PARAM_INVALID, "Failed to copy graph, the graph is null"); return PARAM_INVALID; } @@ -1219,10 +1216,9 @@ Status MultiBatchGraphCopyer::LinkDataToMerge(const NodePtr &data, const NodePtr for (size_t i = 0; i < shapes_.size(); ++i) { auto ret = GraphUtils::AddEdge(switchn->GetOutDataAnchor(i), merge->GetInDataAnchor(i)); 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 " - "when MultiBatchGraphCopyer %s", + 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, __FUNCTION__); + 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", switchn->GetName().c_str(), i, merge->GetName().c_str(), i, ret); return INTERNAL_ERROR); @@ -1234,9 +1230,8 @@ Status MultiBatchGraphCopyer::LinkNodeToMerge(const NodePtr &node, int out_index auto ©ed_nodes = nodes_to_batch_nodes_[node.get()]; if (copyed_nodes.size() != shapes_.size()) { REPORT_INNER_ERROR("E19999", "Create merge node for node %s failed, " - "the copyed nodes for it count %zu different with shape %zu, " - "check invalid when MultiBatchGraphCopyer %s", - node->GetName().c_str(), copyed_nodes.size(), shapes_.size(), __FUNCTION__); + "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", node->GetName().c_str(), copyed_nodes.size(), shapes_.size()); @@ -1259,10 +1254,9 @@ Status MultiBatchGraphCopyer::LinkNodeToMerge(const NodePtr &node, int out_index auto ret = GraphUtils::AddEdge(src_node->GetOutControlAnchor(), const_node->GetInControlAnchor()); GE_IF_BOOL_EXEC(ret != GRAPH_SUCCESS, - REPORT_CALL_ERROR("E19999", "Add ctrl edge between op:%s(%s) and op:%s(%s) failed " - "when MultiBatchGraphCopyer %s", + 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(), __FUNCTION__); + 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()); return INTERNAL_ERROR); @@ -1271,10 +1265,9 @@ Status MultiBatchGraphCopyer::LinkNodeToMerge(const NodePtr &node, int out_index } auto ret = GraphUtils::AddEdge(src_node->GetOutDataAnchor(out_index), merge->GetInDataAnchor(i)); if (ret != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(index:%d) and op:%s(%s)(index:%zu) failed " - "when MultiBatchGraphCopyer %s", + REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(index:%d) and op:%s(%s)(index:%zu) failed", src_node->GetName().c_str(), src_node->GetType().c_str(), out_index, - merge->GetName().c_str(), merge->GetType().c_str(), i, __FUNCTION__); + 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", copyed_nodes[i]->GetName().c_str(), out_index, merge->GetName().c_str(), i, ret); @@ -1333,8 +1326,8 @@ Status MultiBatchGraphCopyer::UpdateShapeOfShapeNode(const NodePtr &node, size_t GeShape output_shape(output_dims); output_desc.SetShape(output_shape); if (node->GetOpDesc()->UpdateOutputDesc(shape_index, output_desc) != SUCCESS) { - REPORT_CALL_ERROR("E19999", "Update output desc to op:%s(%s) failed, index:%zu, when MultiBatchGraphCopyer %s", - node->GetName().c_str(), node->GetType().c_str(), shape_index, __FUNCTION__); + 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."); return FAILED; } @@ -1369,10 +1362,9 @@ Status MultiBatchGraphCopyer::UpdateMaxShapeToData(const NodePtr &node, size_t o int64_t size = 1; for (auto dim : data_to_dynamic_info_.at(data_name).at(i)) { if (INT64_MAX / dim < size) { - REPORT_CALL_ERROR("E19999", "Op:%s(%s)'s shape:%s size will overflow after multi, " - "check invalid when MultiBatchGraphCopyer %s", + 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(), __FUNCTION__); + formats::ShapeToString(data_to_dynamic_info_[data_name].at(i)).c_str()); GELOGE(PARAM_INVALID, "The shape %s size overflow", formats::ShapeToString(data_to_dynamic_info_[data_name].at(i)).c_str()); return PARAM_INVALID; @@ -1387,11 +1379,11 @@ 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_STATUS_RET(ret, "Failed to update output shape for data %s", node->GetName().c_str()); + GE_CHK_GRAPH_STATUS_RET(ret, "Failed to update output shape for data %s", node->GetName().c_str()); // getnext_sink not has input if (!getnext_sink_dynamic_dims_) { ret = NodeUtils::UpdateInputShape(*node, kDataInIndex, data_shape); - GE_CHK_STATUS_RET(ret, "Failed to update input shape for data %s", node->GetName().c_str()); + GE_CHK_GRAPH_STATUS_RET(ret, "Failed to update input shape for data %s", 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"); @@ -1420,7 +1412,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 when MultiBatchGraphCopyer %s", __FUNCTION__); + REPORT_CALL_ERROR("E19999", "New OpDesc failed"); GELOGE(OUT_OF_MEMORY, "Failed to create switchn for data %s", node->GetName().c_str()); return OUT_OF_MEMORY); string switchn_name = node->GetName() + "_ascend_mbatch_switchn"; @@ -1434,18 +1426,16 @@ Status MultiBatchGraphCopyer::InsertSwitchNForData(const NodePtr &node, const si GeTensorDesc tensor(NodeUtils::GetOutputDesc(*node, out_anchor_index)); GE_IF_BOOL_EXEC(switchn_desc->AddInputDesc("data", tensor) != GRAPH_SUCCESS, - REPORT_CALL_ERROR("E19999", "Add input desc to op:%s(%s) failed, input desc name:%s, " - "when MultiBatchGraphCopyer %s", + 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", __FUNCTION__); + "data"); GELOGE(OUT_OF_MEMORY, "Failed to add input tensor desc for %s", switchn_desc->GetName().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, " - "when MultiBatchGraphCopyer %s", + 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", __FUNCTION__); + "pred_value"); GELOGE(OUT_OF_MEMORY, "Failed to add input pred tensor desc for %s", switchn_desc->GetName().c_str()); return OUT_OF_MEMORY); std::vector input_dims_str; @@ -1469,18 +1459,17 @@ Status MultiBatchGraphCopyer::InsertSwitchNForData(const NodePtr &node, const si formats::JoinToString(tensor.GetShape().GetDims()); input_dims_str.emplace_back(input_str); if (!AttrUtils::SetListInt(tensor, ATTR_NAME_SWITCHN_PRED_VALUE, shapes_.at(i))) { - REPORT_CALL_ERROR("E19999", "Set Attr:%s to output tensor of node:%s(%s) failed, index:%zu, " - "when MultiBatchGraphCopyer %s", ATTR_NAME_SWITCHN_PRED_VALUE.c_str(), - node->GetName().c_str(), node->GetType().c_str(), out_anchor_index, __FUNCTION__); + 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); return INTERNAL_ERROR; } (void) AttrUtils::SetListInt(tensor, ATTR_NAME_COMBINED_DYNAMIC_DIMS, shape.GetDims()); if (switchn_desc->AddOutputDesc("output" + std::to_string(i), tensor) != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Add output desc to op:%s(%s) failed, output desc name:%s, " - "when MultiBatchGraphCopyer %s", + 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(), __FUNCTION__); + ("output" + std::to_string(i)).c_str()); GELOGE(GRAPH_FAILED, "Opdesc AddOutputDesc failed"); return GRAPH_FAILED; } @@ -1488,23 +1477,22 @@ Status MultiBatchGraphCopyer::InsertSwitchNForData(const NodePtr &node, const si } (void)AttrUtils::SetListStr(node->GetOpDesc(), "_all_origin_gears_inputs", input_dims_str); if (!AttrUtils::SetListStr(switchn_desc, ATTR_USER_DESIGNEATE_SHAPE_ORDER, data_name_order_)) { - REPORT_CALL_ERROR("E19999", "Set Attr:%s to node:%s(%s) failed when MultiBatchGraphCopyer %s", + 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(), __FUNCTION__); + 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()); 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 when MultiBatchGraphCopyer %s", - ATTR_INSERT_BY_MBATCH.c_str(), switchn_desc->GetName().c_str(), switchn_desc->GetType().c_str(), - __FUNCTION__); + 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()); return INTERNAL_ERROR; } if (!AttrUtils::SetStr(node->GetOpDesc(), kMbatchSwitchnName, switchn_desc->GetName())) { - REPORT_CALL_ERROR("E19999", "Set Attr:%s to node:%s(%s) failed when MultiBatchGraphCopyer %s", - kMbatchSwitchnName, node->GetName().c_str(), node->GetType().c_str(), __FUNCTION__); + 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()); return INTERNAL_ERROR; } @@ -1515,9 +1503,9 @@ Status MultiBatchGraphCopyer::InsertSwitchNForData(const NodePtr &node, const si auto switchn = graph_->AddNode(switchn_desc); GE_IF_BOOL_EXEC(switchn == nullptr, - REPORT_CALL_ERROR("E19999", "Add node:%s(%s) to graph:%s failed when MultiBatchGraphCopyer %s", + 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(), __FUNCTION__); + graph_->GetName().c_str()); GELOGE(OUT_OF_MEMORY, "Failed to create switchn %s from desc", switchn_desc->GetName().c_str()); return OUT_OF_MEMORY); if (!getnext_sink_dynamic_dims_) { @@ -1563,8 +1551,8 @@ Status MultiBatchGraphCopyer::LinkGetDynamicDimsToNetOutput(const NodePtr &node) if (node->GetType() == NETOUTPUT) { if (!GetLocalOmgContext().dynamic_node_type.empty()) { if (!AttrUtils::SetStr(node->GetOpDesc(), ATTR_ALL_GEARS_INFO, GetLocalOmgContext().dynamic_dims)) { - REPORT_CALL_ERROR("E19999", "Set Attr:%s to node:%s(%s) failed when MultiBatchGraphCopyer %s", - ATTR_ALL_GEARS_INFO.c_str(), node->GetName().c_str(), node->GetType().c_str(), __FUNCTION__); + 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()); return INTERNAL_ERROR; } @@ -1572,8 +1560,8 @@ Status MultiBatchGraphCopyer::LinkGetDynamicDimsToNetOutput(const NodePtr &node) if (getnext_sink_dynamic_dims_) { size_t input_index = node->GetAllInDataAnchors().size(); if (NodeUtils::AppendInputAnchor(node, input_index + 1) != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Append %zu input anchors to node:%s(%s) failed when MultiBatchGraphCopyer %s", - input_index + 1, node->GetName().c_str(), node->GetType().c_str(), __FUNCTION__); + 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); return INTERNAL_ERROR; } @@ -1581,17 +1569,15 @@ Status MultiBatchGraphCopyer::LinkGetDynamicDimsToNetOutput(const NodePtr &node) ge::GraphUtils::AddEdge(shape_data_->GetOutDataAnchor(kDataOutIndex), node->GetInDataAnchor(input_index)); GE_IF_BOOL_EXEC( ret != GRAPH_SUCCESS, - REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(index:%d) and op:%s(%s)(index:%zu) failed " - "when MultiBatchGraphCopyer %s", + 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, __FUNCTION__); + 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()); 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 when MultiBatchGraphCopyer %s", - ATTR_GETNEXT_SINK_DYNMAIC.c_str(), node->GetName().c_str(), node->GetType().c_str(), - __FUNCTION__); + 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()); return INTERNAL_ERROR; } @@ -1619,9 +1605,9 @@ Status MultiBatchGraphCopyer::AddAttrForGetDynamicDims(const NodePtr &node) { GELOGD("Add attr for :%s, type is %s:", shape_data_->GetName().c_str(), shape_data_->GetType().c_str()); size_t data_count = node->GetAllOutDataAnchors().size() / kDivisionConst; if (!AttrUtils::SetInt(shape_data_->GetOpDesc(), ATTR_GETNEXT_SINK_DATA_COUNT, data_count)) { - REPORT_CALL_ERROR("E19999", "Set Attr:%s to node:%s(%s) failed when MultiBatchGraphCopyer %s", + 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(), __FUNCTION__); + shape_data_->GetName().c_str(), shape_data_->GetType().c_str()); GELOGE(INTERNAL_ERROR, "set ATTR_GETNEXT_SINK_DATA_COUNT failed"); return INTERNAL_ERROR; } @@ -1638,9 +1624,9 @@ Status MultiBatchGraphCopyer::AddAttrForGetDynamicDims(const NodePtr &node) { } } if (!AttrUtils::SetListInt(shape_data_->GetOpDesc(), ATTR_GETNEXT_SINK_SHAPE_INFO, shape_info)) { - REPORT_CALL_ERROR("E19999", "Set Attr:%s to node:%s(%s) failed when MultiBatchGraphCopyer %s", + 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(), __FUNCTION__); + shape_data_->GetName().c_str(), shape_data_->GetType().c_str()); GELOGE(INTERNAL_ERROR, "set ATTR_GETNEXT_SINK_SHAPE_INFO failed"); return INTERNAL_ERROR; } @@ -1659,9 +1645,9 @@ Status MultiBatchGraphCopyer::AddLinkForGetDynamicDims(const NodePtr &node) { 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 " - "when MultiBatchGraphCopyer %s", node->GetName().c_str(), node->GetType().c_str(), out_index, - shape_data_->GetName().c_str(), shape_data_->GetType().c_str(), input_index, __FUNCTION__); + 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); @@ -1677,9 +1663,9 @@ Status MultiBatchGraphCopyer::LinkEdges() { if (data_nodes_to_switchn_.count(node.get()) > 0) { auto switchn = data_nodes_to_switchn_[node.get()]; GE_IF_BOOL_EXEC(switchn == nullptr, - REPORT_INNER_ERROR("E19999", "swithn in data_nodes_to_switchn_ for op:%s(%s) is nullptr, " - "check invalid when MultiBatchGraphCopyer %s", - node->GetName().c_str(), node->GetType().c_str(), __FUNCTION__); + 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()); return OUT_OF_MEMORY); ret = LinkDataToSwitchN(node, switchn, kDataOutIndex); @@ -1721,10 +1707,9 @@ Status MultiBatchGraphCopyer::LinkDataToSwitchN(const NodePtr &data, const NodeP 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 " - "when MultiBatchGraphCopyer %s", + 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, __FUNCTION__); + 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); @@ -1732,10 +1717,9 @@ Status MultiBatchGraphCopyer::LinkDataToSwitchN(const NodePtr &data, const NodeP 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 " - "when MultiBatchGraphCopyer %s", + 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, __FUNCTION__); + 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); @@ -1781,7 +1765,7 @@ Status MultiBatchGraphCopyer::LinkToMerge(const NodePtr &node) { continue; } REPORT_INNER_ERROR("E19999", "The merge node %s is created, index %zu, but can not find the src node, " - "check invalid when MultiBatchGraphCopyer %s", merge_node->GetName().c_str(), i, __FUNCTION__); + "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", merge_node->GetName().c_str(), i); return INTERNAL_ERROR; @@ -1819,9 +1803,9 @@ Status MultiBatchGraphCopyer::LinkToNodeOutBranch(const NodePtr &node) { auto iter = nodes_to_merge_nodes_.find(in_node.get()); if (iter == nodes_to_merge_nodes_.end()) { REPORT_INNER_ERROR("E19999", "Failed to link data edge from %s(%s)(index:%d) to %s(%s)(index:%d), " - "cause no merge node found, check invalid when MultiBatchGraphCopyer %s", + "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(), __FUNCTION__); + 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", in_node->GetName().c_str(), src_out_anchor->GetIdx(), node->GetName().c_str(), in_data_anchor->GetIdx()); return INTERNAL_ERROR; @@ -1829,29 +1813,27 @@ Status MultiBatchGraphCopyer::LinkToNodeOutBranch(const NodePtr &node) { auto merge_node = iter->second[src_out_anchor->GetIdx()]; if (merge_node == nullptr) { REPORT_INNER_ERROR("E19999", "Failed to link data edge from %s(%s)(index:%d) to %s(%s)(index:%d), " - "cause no merge node found, check invalid when MultiBatchGraphCopyer %s", + "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(), __FUNCTION__); + 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", in_node->GetName().c_str(), src_out_anchor->GetIdx(), node->GetName().c_str(), in_data_anchor->GetIdx()); return INTERNAL_ERROR; } auto ret = src_out_anchor->Unlink(in_data_anchor); if (ret != GRAPH_SUCCESS) { - REPORT_INNER_ERROR("E19999", "Unlink edge from %s(%s)(index:%d) to %s(%s)(index:%d) failed, " - "when MultiBatchGraphCopyer %s", + 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(), __FUNCTION__); + 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()); return INTERNAL_ERROR; } ret = GraphUtils::AddEdge(merge_node->GetOutDataAnchor(kMergeDataOutIndex), in_data_anchor); if (ret != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(index:%d) and op:%s(%s)(index:%d) failed " - "when MultiBatchGraphCopyer %s", + 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(), __FUNCTION__); + 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()); return INTERNAL_ERROR; @@ -1867,45 +1849,43 @@ Status MultiBatchGraphCopyer::LinkToNodeOutBranch(const NodePtr &node) { auto iter = nodes_to_merge_nodes_.find(in_node.get()); if (iter == nodes_to_merge_nodes_.end()) { REPORT_INNER_ERROR("E19999", "Failed to link IO control edge from %s(%s) to %s(%s), no merge node found," - "check invalid when MultiBatchGraphCopyer %s", + "check invalid", in_node->GetName().c_str(), in_node->GetType().c_str(), - node->GetName().c_str(), node->GetType().c_str(), __FUNCTION__); + 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", in_node->GetName().c_str(), node->GetName().c_str()); return INTERNAL_ERROR; } auto merge_node = iter->second[0]; if (merge_node == nullptr) { - REPORT_INNER_ERROR("E19999", "Failed to link IO control edge from %s(%s) to %s(%s), no merge node found," - "check invalid when MultiBatchGraphCopyer %s", + REPORT_INNER_ERROR("E19999", + "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(), __FUNCTION__); + 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", in_node->GetName().c_str(), node->GetName().c_str()); return INTERNAL_ERROR; } GE_IF_BOOL_EXEC(in_node->GetOutControlAnchor() == nullptr, - REPORT_INNER_ERROR("E19999", "Out control anchor of op:%s(%s) is nullptr, " - "check invalid when MultiBatchGraphCopyer %s", - in_node->GetName().c_str(), in_node->GetType().c_str(), __FUNCTION__); + 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"); 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, " - "when MultiBatchGraphCopyer %s", + 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(), __FUNCTION__); + 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()); return INTERNAL_ERROR); ret = GraphUtils::AddEdge(merge_node->GetOutControlAnchor(), node->GetInControlAnchor()); GE_IF_BOOL_EXEC( ret != GRAPH_SUCCESS, - REPORT_CALL_ERROR("E19999", "Add ctrl edge between op:%s(%s) and op:%s(%s) failed " - "when MultiBatchGraphCopyer %s", merge_node->GetName().c_str(), merge_node->GetType().c_str(), - node->GetName().c_str(), node->GetType().c_str(), __FUNCTION__); + 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()); return INTERNAL_ERROR); @@ -2004,8 +1984,8 @@ void GetDynamicShapeByGraph(const ComputeGraphPtr &graph, const NodePtr &node, for (size_t j = 0; j < dynamic_branch_names.size(); ++j) { const auto &subgraph = graph->GetSubgraph(dynamic_branch_names[j]); if (subgraph == nullptr) { - REPORT_INNER_ERROR("E19999", "Get subgraph:%s from graph:%s failed when MultiBatchGraphCopyer %s", - dynamic_branch_names[j].c_str(), graph->GetName().c_str(), __FUNCTION__); + 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()); dynamic_output_dims.clear(); return; @@ -2013,8 +1993,8 @@ void GetDynamicShapeByGraph(const ComputeGraphPtr &graph, const NodePtr &node, const auto &out_node = subgraph->FindFirstNodeMatchType(NETOUTPUT); if (out_node == nullptr) { - REPORT_INNER_ERROR("E19999", "No netoutput node exist in subgraph:%s, check invalid " - "when MultiBatchGraphCopyer %s", subgraph->GetName().c_str(), __FUNCTION__); + 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()); dynamic_output_dims.clear(); return; @@ -2023,9 +2003,9 @@ void GetDynamicShapeByGraph(const ComputeGraphPtr &graph, const NodePtr &node, GELOGI("Find the subgraph Output node %s and the index is %zu", out_node->GetName().c_str(), i); const auto &out_desc = out_node->GetOpDesc(); if (out_desc == nullptr || out_desc->GetInputsSize() <= i) { - REPORT_INNER_ERROR("E19999", "op_desc of node in subgraph:%s is nullptr or input desc size:%zu <= %zu, " - "check invalid when MultiBatchGraphCopyer %s", subgraph->GetName().c_str(), - out_desc->GetInputsSize(), i, __FUNCTION__); + 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); dynamic_output_dims.clear(); return; @@ -2127,9 +2107,9 @@ Status GetDynamicOutputShape(ComputeGraphPtr &graph) { if ((net_output != nullptr) && !dynamic_output_dims.empty()) { GetDirectOutputShape(graph, net_output, dynamic_output_index, dynamic_output_dims); if (!AttrUtils::SetListStr(net_output->GetOpDesc(), ATTR_NAME_DYNAMIC_OUTPUT_DIMS, dynamic_output_dims)) { - REPORT_CALL_ERROR("E19999", "Set Attr:%s to node:%s(%s) failed when MultiBatchGraphCopyer %s", + 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(), __FUNCTION__); + net_output->GetName().c_str(), net_output->GetType().c_str()); GELOGE(FAILED, "Set dynamic output dims attr failed"); return FAILED; } diff --git a/ge/graph/preprocess/multi_batch_options.cc b/ge/graph/preprocess/multi_batch_options.cc index 38968661..b82d1034 100644 --- a/ge/graph/preprocess/multi_batch_options.cc +++ b/ge/graph/preprocess/multi_batch_options.cc @@ -103,9 +103,8 @@ Status CheckSequenceOfData(ComputeGraphPtr &graph, const vector &data_n GELOGD("Start check input sequence from data nodes and input shape."); if (data_nodes.size() != GetLocalOmgContext().user_input_dims.size()) { REPORT_INNER_ERROR("E19999", "Count:%zu of data_nodes in graph:%s should be equal to " - "input_shape count:%zu from option, check invalid when %s", - data_nodes.size(), graph->GetName().c_str(), GetLocalOmgContext().user_input_dims.size(), - __FUNCTION__); + "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()); return PARAM_INVALID; @@ -124,10 +123,10 @@ Status CheckSequenceOfData(ComputeGraphPtr &graph, const vector &data_n } if (dynamic_dims.size() != output_shape.size()) { REPORT_INNER_ERROR("E19999", "The output shape of %s is %s, the input shape from options of %s is %s, graph:%s," - "check invalid when %s", data_node->GetName().c_str(), + "check invalid", 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(), graph->GetName().c_str(), __FUNCTION__); + 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.", 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()); @@ -136,10 +135,10 @@ Status CheckSequenceOfData(ComputeGraphPtr &graph, const vector &data_n for (size_t j = 0; j < dynamic_dims.size(); ++j) { if (dynamic_dims.at(j) != kDynmaicDims && dynamic_dims.at(j) != output_shape.at(j)) { REPORT_INNER_ERROR("E19999", "Value of input shape %s from option and output shape %s of data op:%s " - "should be equal to %d, index:%zu, graph:%s, check invalid when %s", + "should be equal to %d, index:%zu, graph:%s, check invalid", formats::JoinToString(dynamic_dims).c_str(), formats::JoinToString(output_shape).c_str(), data_node->GetName().c_str(), kDynmaicDims, - j, graph->GetName().c_str(), __FUNCTION__); + 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()); return INTERNAL_ERROR; @@ -153,8 +152,8 @@ Status CheckSequenceOfGetnext(ComputeGraphPtr &graph, const vector &get GELOGD("Start check input sequence from getnext sink nodes and input shape."); if (getnext_sink_node.size() != kNumOfGetnextNode) { REPORT_INNER_ERROR("E19999", "Not support dynamic dims when a graph with multi getnext nodes, graph:%s, " - "num of getnext node:%zu, check invalid when %s", - graph->GetName().c_str(), getnext_sink_node.size(), __FUNCTION__); + "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."); return PARAM_INVALID; } @@ -165,8 +164,8 @@ Status CheckSequenceOfGetnext(ComputeGraphPtr &graph, const vector &get 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, " - "graph:%s, check invalid when %s", op_desc->GetName().c_str(), data_count, - GetLocalOmgContext().user_input_dims.size(), graph->GetName().c_str(), __FUNCTION__); + "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()); return PARAM_INVALID; @@ -182,11 +181,11 @@ Status CheckSequenceOfGetnext(ComputeGraphPtr &graph, const vector &get } if (dynamic_dims.size() != output_shape.size()) { REPORT_INNER_ERROR("E19999", "The %zu output_shape of %s is %s not equal to the input_shape:%s " - "from options of %s, graph:%s, check invalid when %s", i, + "from options of %s, graph:%s, check invalid", 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(), __FUNCTION__); + 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()); @@ -195,10 +194,10 @@ Status CheckSequenceOfGetnext(ComputeGraphPtr &graph, const vector &get for (size_t j = 0; j < dynamic_dims.size(); ++j) { if (dynamic_dims.at(j) != kDynmaicDims && dynamic_dims.at(j) != output_shape.at(j)) { REPORT_INNER_ERROR("E19999", "Value of input shape %s from option and output shape %s of data op:%s " - "should be equal to %d, index:%zu, graph:%s, check invalid when %s", + "should be equal to %d, index:%zu, graph:%s, check invalid", formats::JoinToString(dynamic_dims).c_str(), formats::JoinToString(output_shape).c_str(), data_node->GetName().c_str(), kDynmaicDims, - j, graph->GetName().c_str(), __FUNCTION__); + 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()); return INTERNAL_ERROR; @@ -247,9 +246,8 @@ Status UpdateNameOfData(ComputeGraphPtr &graph, const vector &data_node GELOGD("Update first value of input shape by data nodes."); if (data_nodes.size() != GetLocalOmgContext().user_input_dims.size()) { REPORT_INNER_ERROR("E19999", "Count:%zu of data_nodes in graph:%s should be equal to " - "input_shape count:%zu from option, check invalid when %s", - data_nodes.size(), graph->GetName().c_str(), GetLocalOmgContext().user_input_dims.size(), - __FUNCTION__); + "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()); return PARAM_INVALID; @@ -265,8 +263,8 @@ Status UpdateNameOfGetnext(ComputeGraphPtr &graph, const vector &getnex GELOGD("Update first value of input shape by getnext sink nodes."); if (getnext_sink_nodes.size() != kNumOfGetnextNode) { REPORT_INNER_ERROR("E19999", "Not support dynamic dims when a graph with multi getnext nodes, graph:%s, " - "num of getnext node:%zu, check invalid when %s", - graph->GetName().c_str(), getnext_sink_nodes.size(), __FUNCTION__); + "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."); return PARAM_INVALID; } @@ -278,8 +276,8 @@ Status UpdateNameOfGetnext(ComputeGraphPtr &graph, const vector &getnex 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, " - "graph:%s, check invalid when %s", op_desc->GetName().c_str(), data_count, - GetLocalOmgContext().user_input_dims.size(), graph->GetName().c_str(), __FUNCTION__); + "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()); return PARAM_INVALID; @@ -340,9 +338,8 @@ Status DeleteIdentityInsertByAdapter(ComputeGraphPtr &graph) { if (dst_node->GetType() == IDENTITY) { GELOGI("Need to remove %s.", dst_node->GetName().c_str()); if (ge::GraphUtils::RemoveNodeWithoutRelink(graph, dst_node) != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Remove node:%s(%s) from graph:%s failed when %s", - dst_node->GetName().c_str(), dst_node->GetType().c_str(), graph->GetName().c_str(), - __FUNCTION__); + 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()); return FAILED; } @@ -367,7 +364,7 @@ Status CheckNegativeCountOfOptions(const std::vector> &shap for (size_t i = 0; i < shapes.size(); ++i) { 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 when %s", shapes.at(i).size(), negative_count, __FUNCTION__); + "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); return PARAM_INVALID; @@ -579,8 +576,8 @@ Status StampDynamicType(const OpDescPtr &op_desc) { dynamic_type = static_cast(DYNAMIC_DIMS); } if (!AttrUtils::SetInt(op_desc, ATTR_DYNAMIC_TYPE, dynamic_type)) { - REPORT_CALL_ERROR("E19999", "Set Attr:%s to node:%s(%s) failed when %s", - ATTR_DYNAMIC_TYPE.c_str(), op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); + 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()); return INTERNAL_ERROR; } diff --git a/inc/framework/common/debug/log.h b/inc/framework/common/debug/log.h index 422bd020..f06faa1b 100644 --- a/inc/framework/common/debug/log.h +++ b/inc/framework/common/debug/log.h @@ -86,12 +86,13 @@ } while (0); // If expr is not GRAPH_SUCCESS, print the log and return FAILED -#define GE_CHK_GRAPH_STATUS_RET(expr, ...) \ - do { \ - if ((expr) != ge::GRAPH_SUCCESS) { \ - DOMI_LOGE(__VA_ARGS__); \ - return FAILED; \ - } \ +#define GE_CHK_GRAPH_STATUS_RET(expr, ...) \ + do { \ + if ((expr) != ge::GRAPH_SUCCESS) { \ + REPORT_CALL_ERROR("E19999", "Operator graph failed"); \ + DOMI_LOGE(__VA_ARGS__); \ + return FAILED; \ + } \ } while (0); // If expr is not SUCCESS, print the log and execute a custom statement @@ -232,14 +233,14 @@ } // If expr is not RT_ERROR_NONE, print the log and return -#define GE_CHK_RT_RET(expr) \ - do { \ - rtError_t _rt_ret = (expr); \ - if (_rt_ret != RT_ERROR_NONE) { \ - REPORT_CALL_ERROR("E19999", "Call %s fail, ret: 0x%X when %s", #expr, _rt_ret, __FUNCTION__); \ - DOMI_LOGE("Call rt api failed, ret: 0x%X", _rt_ret); \ - return RT_ERROR_TO_GE_STATUS(_rt_ret); \ - } \ +#define GE_CHK_RT_RET(expr) \ + do { \ + rtError_t _rt_ret = (expr); \ + if (_rt_ret != RT_ERROR_NONE) { \ + REPORT_CALL_ERROR("E19999", "Call %s fail, ret: 0x%X", #expr, _rt_ret); \ + DOMI_LOGE("Call rt api failed, ret: 0x%X", _rt_ret); \ + return RT_ERROR_TO_GE_STATUS(_rt_ret); \ + } \ } while (0); // If expr is true, execute exec_expr without printing logs diff --git a/metadef b/metadef index 366b1557..1e88df1d 160000 --- a/metadef +++ b/metadef @@ -1 +1 @@ -Subproject commit 366b15574218befa11454311879a4f436eeb67a9 +Subproject commit 1e88df1d6bfe60faae0aa9fa2d87f273b793aeb0 diff --git a/parser b/parser index d744541c..df9abef6 160000 --- a/parser +++ b/parser @@ -1 +1 @@ -Subproject commit d744541c6ca7f6966c1befacc9f83f53b0829e0a +Subproject commit df9abef65f902f37ca664f6dda4c60727dac2aca