add error msg

pull/1465/head
wangxiaotian22 4 years ago
parent b964b15ee4
commit a4182c0bf8

@ -111,8 +111,8 @@ Status FileSaver::SaveWithFileHeader(const std::string &file_path, const ModelFi
} while (0); } while (0);
// Close file // Close file
if (mmClose(fd) != 0) { // mmClose 0: success if (mmClose(fd) != 0) { // mmClose 0: success
GELOGE(FAILED, "[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.", ret); REPORT_INNER_ERROR("E19999", "Close file failed, error_code:%u errmsg:%s", ret, strerror(errno));
ret = FAILED; ret = FAILED;
} }
return ret; return ret;
@ -148,7 +148,11 @@ Status FileSaver::SaveWithFileHeader(const std::string &file_path, const ModelFi
} }
} while (0); } while (0);
// Close file // 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_INNER_ERROR("E19999", "Close file failed, error_code:%u errmsg:%s", ret, strerror(errno));
ret = FAILED;
}
return ret; return ret;
} }
@ -346,7 +350,7 @@ Status FileSaver::SaveWithFileHeader(const std::string &file_path, const ModelFi
// Write partition data // Write partition data
auto &cur_partition_datas = all_partition_datas[index]; auto &cur_partition_datas = all_partition_datas[index];
for (const auto &partition_data : cur_partition_datas) { 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( GE_CHK_BOOL_TRUE_EXEC_WITH_LOG(
WriteData(static_cast<const void *>(partition_data.data), partition_data.size, fd) != SUCCESS, ret = FAILED; WriteData(static_cast<const void *>(partition_data.data), partition_data.size, fd) != SUCCESS, ret = FAILED;
break); break);
@ -354,7 +358,11 @@ Status FileSaver::SaveWithFileHeader(const std::string &file_path, const ModelFi
} }
} while (0); } while (0);
// Close file // 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_INNER_ERROR("E19999", "Close file failed, error_code:%u errmsg:%s", ret, strerror(errno));
ret = FAILED;
}
return ret; return ret;
} }
@ -377,8 +385,8 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status FileSaver::SaveToFile(co
// Close file // Close file
if (mmClose(fd) != 0) { // mmClose 0: success if (mmClose(fd) != 0) { // mmClose 0: success
GELOGE(FAILED, "[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.", ret); REPORT_INNER_ERROR("E19999", "Close file failed, error_code:%u errmsg:%s", ret, strerror(errno));
ret = FAILED; ret = FAILED;
} }
return ret; return ret;

@ -77,7 +77,7 @@ Status HandleSubgraphNode(NodePtr &src_node, OutDataAnchorPtr &src_out_anchor) {
Status HandleSubgraphDataNode(NodePtr &src_node, OutDataAnchorPtr &src_out_anchor) { Status HandleSubgraphDataNode(NodePtr &src_node, OutDataAnchorPtr &src_out_anchor) {
uint32_t index = 0; uint32_t index = 0;
if (!AttrUtils::GetInt(src_node->GetOpDesc(), ATTR_NAME_PARENT_NODE_INDEX, index)) { 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()); 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()); GELOGE(FAILED, "Get attr ATTR_NAME_PARENT_NODE_INDEX failed, node:%s.", src_node->GetName().c_str());
return FAILED; return FAILED;
@ -111,7 +111,7 @@ Status GraphBuilder::CalcOpParam(const ge::ComputeGraphPtr &graph) {
GE_CHECK_NOTNULL(graph); GE_CHECK_NOTNULL(graph);
auto instance_ptr = ge::GELib::GetInstance(); auto instance_ptr = ge::GELib::GetInstance();
if (instance_ptr == nullptr || !instance_ptr->InitFlag()) { 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()); graph->GetName().c_str());
GELOGE(GE_CLI_GE_NOT_INITIALIZED, "GraphBuilder: GE is not initialized"); GELOGE(GE_CLI_GE_NOT_INITIALIZED, "GraphBuilder: GE is not initialized");
return GE_CLI_GE_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); (void)instance_ptr->DNNEngineManagerObj().GetDNNEngineName(node_ptr);
kernel_lib_name = node_ptr->GetOpDesc()->GetOpKernelLibName(); kernel_lib_name = node_ptr->GetOpDesc()->GetOpKernelLibName();
if (kernel_lib_name.empty()) { 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()); 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(), GELOGE(INTERNAL_ERROR, "Get node:%s(%s) kernel lib failed.", node_ptr->GetName().c_str(),
node_ptr->GetType().c_str()); node_ptr->GetType().c_str());
@ -135,7 +135,7 @@ Status GraphBuilder::CalcOpParam(const ge::ComputeGraphPtr &graph) {
auto ret = SetInputSize(node_ptr); auto ret = SetInputSize(node_ptr);
if (ret != SUCCESS) { 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()); 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()); GELOGE(ret, "Set node inputDesc size failed, node name is %s", node_ptr->GetName().c_str());
return ret; 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) { Status GraphBuilder::Build(ComputeGraphPtr &comp_graph, GeRootModelPtr &ge_root_model_ptr, uint64_t session_id) {
if (comp_graph == nullptr) { 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."); GELOGE(GE_GRAPH_PARAM_NULLPTR, "Graph build comp_graph is null.");
return GE_GRAPH_PARAM_NULLPTR; return GE_GRAPH_PARAM_NULLPTR;
} }
@ -313,7 +313,7 @@ Status GraphBuilder::SetConstantInputOffset(ComputeGraphPtr &comp_graph) {
std::vector<GeTensorPtr> weights = OpDescUtils::MutableWeights(peer_node); std::vector<GeTensorPtr> weights = OpDescUtils::MutableWeights(peer_node);
if (weights.empty()) { 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()); node->GetName().c_str(), node->GetType().c_str());
GELOGE(FAILED, "weights size of node %s is empty", node->GetName().c_str()); GELOGE(FAILED, "weights size of node %s is empty", node->GetName().c_str());
return FAILED; return FAILED;
@ -649,7 +649,7 @@ Status GraphBuilder::SetInputSize(const ge::NodePtr &node_ptr) {
Status GraphBuilder::UpdateDataInputSize(const ge::NodePtr &node_ptr) { Status GraphBuilder::UpdateDataInputSize(const ge::NodePtr &node_ptr) {
const auto &op_desc = node_ptr->GetOpDesc(); const auto &op_desc = node_ptr->GetOpDesc();
if (op_desc == nullptr) { 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."); GELOGE(FAILED, "Op desc is nullptr.");
return FAILED; return FAILED;
} }
@ -667,7 +667,7 @@ Status GraphBuilder::UpdateDataInputSize(const ge::NodePtr &node_ptr) {
int64_t real_dim_size = 0; int64_t real_dim_size = 0;
ge::graphStatus graph_status = TensorUtils::GetTensorSizeInBytes(output_desc, real_dim_size); ge::graphStatus graph_status = TensorUtils::GetTensorSizeInBytes(output_desc, real_dim_size);
if (graph_status != GRAPH_SUCCESS) { 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()); op_desc->GetName().c_str(), op_desc->GetType().c_str());
GELOGE(FAILED, "Get tensor size in bytes failed."); GELOGE(FAILED, "Get tensor size in bytes failed.");
return FAILED; return FAILED;
@ -676,7 +676,7 @@ Status GraphBuilder::UpdateDataInputSize(const ge::NodePtr &node_ptr) {
ge::GeTensorDesc input_desc = op_desc->GetInputDesc(0); ge::GeTensorDesc input_desc = op_desc->GetInputDesc(0);
ge::TensorUtils::SetSize(input_desc, real_dim_size); ge::TensorUtils::SetSize(input_desc, real_dim_size);
if (op_desc->UpdateInputDesc(0, input_desc) != GRAPH_SUCCESS) { 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()); op_desc->GetName().c_str(), op_desc->GetType().c_str());
GELOGE(FAILED, "Update input desc size failed."); GELOGE(FAILED, "Update input desc size failed.");
return FAILED; return FAILED;
@ -706,8 +706,7 @@ Status GraphBuilder::CalcDynShapeRootGraphDataSize(const ge::OpDescPtr &op_desc)
int64_t real_dim_size = 0; int64_t real_dim_size = 0;
ge::graphStatus graph_status = TensorUtils::GetTensorSizeInBytes(output_desc, real_dim_size); ge::graphStatus graph_status = TensorUtils::GetTensorSizeInBytes(output_desc, real_dim_size);
if (graph_status != GRAPH_SUCCESS) { if (graph_status != GRAPH_SUCCESS) {
REPORT_CALL_ERROR("E19999", "Get tensor size in bytes failed for op:%s(%s) index:0 " REPORT_CALL_ERROR("E19999", "Get tensor size in bytes failed for op:%s(%s) index:0 ",
"when CalcDynShapeRootGraphDataSize",
op_desc->GetName().c_str(), op_desc->GetType().c_str()); op_desc->GetName().c_str(), op_desc->GetType().c_str());
GELOGE(FAILED, "Get tensor size in bytes failed."); GELOGE(FAILED, "Get tensor size in bytes failed.");
return FAILED; return FAILED;
@ -716,8 +715,7 @@ Status GraphBuilder::CalcDynShapeRootGraphDataSize(const ge::OpDescPtr &op_desc)
ge::TensorUtils::SetSize(output_desc, real_dim_size); ge::TensorUtils::SetSize(output_desc, real_dim_size);
GELOGI("Update dynamic shape graph data output size to [%ld].", 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) { if (op_desc->UpdateOutputDesc(0, output_desc) != GRAPH_SUCCESS) {
REPORT_CALL_ERROR("E19999", "Update output desc size failed for op:%s(%s) index:0 " REPORT_CALL_ERROR("E19999", "Update output desc size failed for op:%s(%s) index:0 ",
"when CalcDynShapeRootGraphDataSize",
op_desc->GetName().c_str(), op_desc->GetType().c_str()); op_desc->GetName().c_str(), op_desc->GetType().c_str());
GELOGE(FAILED, "Update dynamic shape graph data output desc size failed."); GELOGE(FAILED, "Update dynamic shape graph data output desc size failed.");
return FAILED; return FAILED;
@ -736,7 +734,7 @@ Status GraphBuilder::SecondPartition(ge::ComputeGraphPtr &comp_graph) {
GE_CHK_STATUS_RET(ret, "Graph partition Failed."); GE_CHK_STATUS_RET(ret, "Graph partition Failed.");
const auto &graph_2_subgraphlist = graph_partitioner_.GetSubGraphMap(); const auto &graph_2_subgraphlist = graph_partitioner_.GetSubGraphMap();
if (graph_2_subgraphlist.find(comp_graph) == graph_2_subgraphlist.end()) { 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()); comp_graph->GetName().c_str());
GELOGE(FAILED, "Find subgraph failed."); GELOGE(FAILED, "Find subgraph failed.");
return FAILED; return FAILED;
@ -766,7 +764,7 @@ Status GraphBuilder::AddOutputMemTypeForNode(const NodePtr &node) {
mem_type); mem_type);
if (!AttrUtils::SetInt(src_desc->MutableOutputDesc(src_out_anchor->GetIdx()), ATTR_OUTPUT_MEMORY_TYPE, if (!AttrUtils::SetInt(src_desc->MutableOutputDesc(src_out_anchor->GetIdx()), ATTR_OUTPUT_MEMORY_TYPE,
mem_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(), ATTR_OUTPUT_MEMORY_TYPE.c_str(), src_desc->GetName().c_str(), src_desc->GetType().c_str(),
src_out_anchor->GetIdx()); src_out_anchor->GetIdx());
GELOGE(INTERNAL_ERROR, "Set out_memory_type attr for [%s:%d] failed.", src_desc->GetName().c_str(), GELOGE(INTERNAL_ERROR, "Set out_memory_type attr for [%s:%d] failed.", src_desc->GetName().c_str(),

@ -28,7 +28,7 @@ LabelAllocator::LabelAllocator(const ComputeGraphPtr &graph) : compute_graph_(gr
Status LabelAllocator::AssignFunctionalLabels() { Status LabelAllocator::AssignFunctionalLabels() {
if (compute_graph_ == nullptr) { 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."); GELOGE(INTERNAL_ERROR, "ComputeGraph not set, Assign labels failed.");
return INTERNAL_ERROR; return INTERNAL_ERROR;
} }
@ -47,14 +47,14 @@ Status LabelAllocator::AssignFunctionalLabels() {
for (auto node : functional_nodes) { for (auto node : functional_nodes) {
LabelMakerPtr maker = LabelMakerFactory::Instance().Create(node->GetType(), compute_graph_, node); LabelMakerPtr maker = LabelMakerFactory::Instance().Create(node->GetType(), compute_graph_, node);
if (maker == nullptr) { 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()); node->GetName().c_str(), node->GetType().c_str());
GELOGE(INTERNAL_ERROR, "Node: %s label maker not registed.", node->GetType().c_str()); GELOGE(INTERNAL_ERROR, "Node: %s label maker not registed.", node->GetType().c_str());
return INTERNAL_ERROR; return INTERNAL_ERROR;
} }
if (maker->Run(label_index) != SUCCESS) { 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()); node->GetName().c_str(), node->GetType().c_str());
GELOGE(INTERNAL_ERROR, "Node: %s run label maker failed.", node->GetType().c_str()); GELOGE(INTERNAL_ERROR, "Node: %s run label maker failed.", node->GetType().c_str());
return INTERNAL_ERROR; return INTERNAL_ERROR;
@ -68,7 +68,7 @@ Status LabelAllocator::AssignFunctionalLabels() {
bool LabelAllocator::CollectFunctionalNode(ComputeGraphPtr &graph, std::set<NodePtr> &functional_nodes) { bool LabelAllocator::CollectFunctionalNode(ComputeGraphPtr &graph, std::set<NodePtr> &functional_nodes) {
if (graph == nullptr) { 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."); GELOGE(INTERNAL_ERROR, "Sub ComputeGraph is null.");
return false; return false;
} }

@ -339,8 +339,8 @@ Status NodeStreamUpdatePass::Run(ComputeGraphPtr graph, const vector<SubgraphPtr
const string &engine_name = subgraph->engine_conf.id; const string &engine_name = subgraph->engine_conf.id;
if (!IsEngineSkip(*subgraph) && !HasAssignedStream(*subgraph)) { if (!IsEngineSkip(*subgraph) && !HasAssignedStream(*subgraph)) {
REPORT_INNER_ERROR("E19999", "Subgraph %s has not yet been assigned a stream (engine: %s) " 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()); 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(), GELOGE(INTERNAL_ERROR, "Subgraph %s has not yet been assigned a stream (engine: %s).", subgraph->name.c_str(),
engine_name.c_str()); engine_name.c_str());
return INTERNAL_ERROR; return INTERNAL_ERROR;
@ -681,7 +681,7 @@ Status LogicalStreamAllocator::ConvertSubgraphs(const vector<SubGraphInfoPtr> &s
const string &engine_name = subgraph_info->GetEngineName(); const string &engine_name = subgraph_info->GetEngineName();
auto engine_conf_iter = engine_confs.find(engine_name); auto engine_conf_iter = engine_confs.find(engine_name);
if ((engine_conf_iter == engine_confs.end()) || (engine_conf_iter->second == nullptr)) { 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()); 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(), GELOGE(INTERNAL_ERROR, "Engine conf of subgraph %s not found (engine name: %s).", subgraph_name.c_str(),
engine_name.c_str()); engine_name.c_str());

@ -119,7 +119,7 @@ Status GraphMemoryAssigner::AssignMemory() {
if (variable_assigner == nullptr) { if (variable_assigner == nullptr) {
GELOGE(ge::FAILED, "[New][Object:VariableMemoryAssigner]graph_id:%u, graph_name:%s", GELOGE(ge::FAILED, "[New][Object:VariableMemoryAssigner]graph_id:%u, graph_name:%s",
compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); 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()); "graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str());
return ge::FAILED; return ge::FAILED;
} }
@ -141,7 +141,7 @@ ge::Status GraphMemoryAssigner::AssignVarAttr2Nodes() {
if (variable_assigner == nullptr) { if (variable_assigner == nullptr) {
GELOGE(ge::FAILED, "[New][Object:VariableMemoryAssigner]graph_id:%u, graph_name:%s", GELOGE(ge::FAILED, "[New][Object:VariableMemoryAssigner]graph_id:%u, graph_name:%s",
compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); 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()); "graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str());
return ge::FAILED; return ge::FAILED;
} }
@ -157,7 +157,7 @@ ge::Status GraphMemoryAssigner::AssignMemory2HasRefAttrNode() {
if (variable_assigner == nullptr) { if (variable_assigner == nullptr) {
GELOGE(ge::FAILED, "[New][Object:VariableMemoryAssigner]graph_id:%u, graph_name:%s", GELOGE(ge::FAILED, "[New][Object:VariableMemoryAssigner]graph_id:%u, graph_name:%s",
compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); 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()); "graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str());
} }
if (variable_assigner->AssignMemory2HasRefAttrNode() != ge::SUCCESS) { 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); graphStatus graph_status = ge::TensorUtils::GetSize(*output_desc, out_size);
if (graph_status != GRAPH_SUCCESS) { if (graph_status != GRAPH_SUCCESS) {
GELOGE(FAILED, "[Get][TensorSize]"); 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; return FAILED;
} }
@ -223,8 +223,8 @@ ge::Status CalculateTensorRealSizeAndOutSize(const ge::ConstGeTensorDescPtr &out
Status GraphMemoryAssigner::ReAssignMemory(bool is_loop_graph, map<int64_t, size_t> &mem_type_to_offset) { Status GraphMemoryAssigner::ReAssignMemory(bool is_loop_graph, map<int64_t, size_t> &mem_type_to_offset) {
if (memory_offset_.empty()) { if (memory_offset_.empty()) {
REPORT_INNER_ERROR("E19999", "InnerData memory_offset_ empty, not expected when ReAssignMemory, " REPORT_INNER_ERROR("E19999", "InnerData memory_offset_ empty, not expected, graph_id:%u, graph_name:%s",
"graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); compute_graph_->GetGraphID(), compute_graph_->GetName().c_str());
GELOGE(FAILED, "[Check][InnerData:memory_offset_]empty is not expected, " GELOGE(FAILED, "[Check][InnerData:memory_offset_]empty is not expected, "
"graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); "graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str());
return ge::FAILED; return ge::FAILED;
@ -261,8 +261,8 @@ Status GraphMemoryAssigner::ReAssignMemory(bool is_loop_graph, map<int64_t, size
Status GraphMemoryAssigner::AssignZeroCopyMemory(map<int64_t, size_t> &mem_offset, size_t &zero_mem_copy_size) { Status GraphMemoryAssigner::AssignZeroCopyMemory(map<int64_t, size_t> &mem_offset, size_t &zero_mem_copy_size) {
BlockMemAssignerPtr priority_assigner = std::move(mem_assigner_->GetPriorityAssinger()); BlockMemAssignerPtr priority_assigner = std::move(mem_assigner_->GetPriorityAssinger());
if (priority_assigner == nullptr) { if (priority_assigner == nullptr) {
REPORT_INNER_ERROR("E19999", "InnerData priority_assigner nullptr, not expected when AssignZeroCopyMemory, " REPORT_INNER_ERROR("E19999", "InnerData priority_assigner nullptr, not expected, graph_id:%u, graph_name:%s",
"graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); compute_graph_->GetGraphID(), compute_graph_->GetName().c_str());
GELOGE(FAILED, "[Check][InnerData:priority_assigner]nullptr is invalid, " GELOGE(FAILED, "[Check][InnerData:priority_assigner]nullptr is invalid, "
"graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); "graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str());
return ge::FAILED; return ge::FAILED;
@ -286,8 +286,7 @@ Status GraphMemoryAssigner::AssignZeroCopyMemory(map<int64_t, size_t> &mem_offse
zero_mem_copy_size = mem_offset[RT_MEMORY_HBM] - mem_offset_tmp; zero_mem_copy_size = mem_offset[RT_MEMORY_HBM] - mem_offset_tmp;
auto iter = memory_offset_.find(RT_MEMORY_HBM); auto iter = memory_offset_.find(RT_MEMORY_HBM);
if (iter == memory_offset_.end()) { if (iter == memory_offset_.end()) {
REPORT_INNER_ERROR("E19999", "InnerData memory_offset_ does not have type[HBM], " REPORT_INNER_ERROR("E19999", "InnerData memory_offset_ does not have type[HBM], not expected, "
"not expected when AssignZeroCopyMemory, "
"graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); "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]" 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()); "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, Status GetMemorySize(const OpDescPtr &op_desc, const ge::ConstGeTensorDescPtr &output_desc, uint32_t continuous_type,
int64_t &tensor_size, int64_t &nopadding_size) { int64_t &tensor_size, int64_t &nopadding_size) {
if ((op_desc == nullptr) || (output_desc == nullptr)) { if ((op_desc == nullptr) || (output_desc == nullptr)) {
REPORT_INNER_ERROR("E19999", "InnerData param op_desc or output_desc is nullptr, " REPORT_INNER_ERROR("E19999", "InnerData param op_desc or output_desc is nullptr, not expected");
"not expected when GetMemorySize");
GELOGE(FAILED, "[Check][Param]op_desc or output_desc is nullptr"); GELOGE(FAILED, "[Check][Param]op_desc or output_desc is nullptr");
} }
tensor_size = 0; tensor_size = 0;
@ -358,7 +356,7 @@ Status GetMemorySize(const OpDescPtr &op_desc, const ge::ConstGeTensorDescPtr &o
int64_t attr_dim_index; 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); 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) { 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()); ATTR_NAME_REUSE_INPUT_ON_DIM_INDEX.c_str(), op_desc->GetName().c_str());
GELOGE(FAILED, "[Get][Attr:%s]fail for op_name:%s", GELOGE(FAILED, "[Get][Attr:%s]fail for op_name:%s",
ATTR_NAME_REUSE_INPUT_ON_DIM_INDEX.c_str(), op_desc->GetName().c_str()); 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(); nodes_stack.pop_back();
auto iter = node_2_continuous_type.find(node); auto iter = node_2_continuous_type.find(node);
if (iter == node_2_continuous_type.end()) { if (iter == node_2_continuous_type.end()) {
REPORT_INNER_ERROR("E19999", "Inner data error when process continuous memory alloc for node:%s, " REPORT_INNER_ERROR("E19999", "Get ContinuousType from node_2_continuous_type map failed for node:%s",
"but has no continuous type", node->GetName().c_str()); node->GetName().c_str());
GELOGE(FAILED, "[Get][ContinuousType] find fail for node:%s", node->GetName().c_str()); GELOGE(FAILED, "[Get][ContinuousType] find fail for node:%s", node->GetName().c_str());
return FAILED; return FAILED;
} }
@ -496,7 +494,7 @@ Status GraphMemoryAssigner::AssignContinuousInputMemory(const ge::NodePtr &node,
auto iter = memory_offset_.find(memory_type); auto iter = memory_offset_.find(memory_type);
if (iter == memory_offset_.end()) { if (iter == memory_offset_.end()) {
REPORT_INNER_ERROR("E19999", "find memory offset fail for mem_type:%ld, " 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", GELOGE(FAILED, "[Find][MemOffset]fail for mem_type:%ld, when AssignContinuousInputMemory for node:%s",
memory_type, node->GetName().c_str()); memory_type, node->GetName().c_str());
return FAILED; return FAILED;
@ -511,7 +509,7 @@ Status GraphMemoryAssigner::AssignContinuousInputMemory(const ge::NodePtr &node,
GE_CHECK_NOTNULL(op_desc); GE_CHECK_NOTNULL(op_desc);
vector<int64_t> output_list_this = op_desc->GetOutputOffset(); vector<int64_t> output_list_this = op_desc->GetOutputOffset();
if (output_list_this.empty()) { 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()); node->GetName().c_str());
GELOGE(FAILED, "[Get][OutputOffset] empty is invalid, node:%s", node->GetName().c_str()); GELOGE(FAILED, "[Get][OutputOffset] empty is invalid, node:%s", node->GetName().c_str());
return FAILED; return FAILED;
@ -619,29 +617,26 @@ Status GraphMemoryAssigner::AssignContinuousInputMemory(const ge::NodePtr &node,
Status GetFirstInputPeerOutOutputOffset(const ge::NodePtr &node, int64_t &mem_offset) { Status GetFirstInputPeerOutOutputOffset(const ge::NodePtr &node, int64_t &mem_offset) {
auto in_data_anchor_list = node->GetAllInDataAnchors(); auto in_data_anchor_list = node->GetAllInDataAnchors();
if (in_data_anchor_list.empty()) { 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()); node->GetName().c_str());
GELOGE(FAILED, "[Get][InAnchor]empty is invalid, node:%s", node->GetName().c_str()); GELOGE(FAILED, "[Get][InAnchor]empty is invalid, node:%s", node->GetName().c_str());
return FAILED; return FAILED;
} }
auto peer_out_data_anchor = in_data_anchor_list.at(0)->GetPeerOutAnchor(); auto peer_out_data_anchor = in_data_anchor_list.at(0)->GetPeerOutAnchor();
GE_IF_BOOL_EXEC(peer_out_data_anchor == nullptr, GE_IF_BOOL_EXEC(peer_out_data_anchor == nullptr,
REPORT_INNER_ERROR("E19999", "PeerAcnhor is null, " REPORT_INNER_ERROR("E19999", "PeerAcnhor is null, not expect for node:%s",
"not expect when GetFirstInputPeerOutOutputOffset for node:%s",
node->GetName().c_str()); node->GetName().c_str());
GELOGE(ge::FAILED, "[Check][PeerAnchor]null is invalid, node:%s", node->GetName().c_str()); GELOGE(ge::FAILED, "[Check][PeerAnchor]null is invalid, node:%s", node->GetName().c_str());
return ge::FAILED); return ge::FAILED);
auto peer_op_desc = peer_out_data_anchor->GetOwnerNode()->GetOpDesc(); auto peer_op_desc = peer_out_data_anchor->GetOwnerNode()->GetOpDesc();
GE_IF_BOOL_EXEC(peer_op_desc == nullptr, GE_IF_BOOL_EXEC(peer_op_desc == nullptr,
REPORT_INNER_ERROR("E19999", "PeerOpDesc is null, " REPORT_INNER_ERROR("E19999", "PeerOpDesc is null, not expect for node:%s",
"not expect when GetFirstInputPeerOutOutputOffset for node:%s",
node->GetName().c_str()); node->GetName().c_str());
GELOGE(ge::FAILED, "[Check][PeerOpDesc]null is invalid, node:%s", node->GetName().c_str()); GELOGE(ge::FAILED, "[Check][PeerOpDesc]null is invalid, node:%s", node->GetName().c_str());
return ge::FAILED); return ge::FAILED);
vector<int64_t> in_node_output_offsets = peer_op_desc->GetOutputOffset(); vector<int64_t> in_node_output_offsets = peer_op_desc->GetOutputOffset();
if (peer_out_data_anchor->GetIdx() >= static_cast<int>(in_node_output_offsets.size())) { if (peer_out_data_anchor->GetIdx() >= static_cast<int>(in_node_output_offsets.size())) {
REPORT_INNER_ERROR("E19999", "PeerAnchorIndex:%d bigger than in_offset size:%lu, " REPORT_INNER_ERROR("E19999", "PeerAnchorIndex:%d bigger than in_offset size:%lu, judge invalid for node:%s",
"judge invalid when GetFirstInputPeerOutOutputOffset for node:%s",
peer_out_data_anchor->GetIdx(), in_node_output_offsets.size(), node->GetName().c_str()); 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", 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()); 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()); GELOGI("Current node %s needs continuous output.", node->GetName().c_str());
auto out_op_desc = node->GetOpDesc(); auto out_op_desc = node->GetOpDesc();
GE_IF_BOOL_EXEC(out_op_desc == nullptr, GE_IF_BOOL_EXEC(out_op_desc == nullptr,
REPORT_INNER_ERROR("E19999", "OpDesc is null, " REPORT_INNER_ERROR("E19999", "OpDesc is null, not expect for node:%s",
"not expect when AssignContinuousOutputMemory for node:%s",
node->GetName().c_str()); node->GetName().c_str());
GELOGE(ge::FAILED, "[Check][OpDesc]null is invalid, node:%s", node->GetName().c_str())); GELOGE(ge::FAILED, "[Check][OpDesc]null is invalid, node:%s", node->GetName().c_str()));
vector<int64_t> output_list = out_op_desc->GetOutputOffset(); vector<int64_t> output_list = out_op_desc->GetOutputOffset();
if ((out_op_desc->GetOutputsSize() > output_list.size()) || (output_list.size() == 0)) { 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, " REPORT_INNER_ERROR("E19999", "Output size:%zu more than output offset size:%zu, invalid in node:%s",
"when AssignContinuousOutputMemory",
out_op_desc->GetOutputsSize(), output_list.size(), node->GetName().c_str()); 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", 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()); 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); auto mem_iter = memory_offset_.find(RT_MEMORY_HBM);
if (mem_iter == memory_offset_.end()) { if (mem_iter == memory_offset_.end()) {
REPORT_INNER_ERROR("E19999", "InnerData memory_offset_ does not have type[HBM], " REPORT_INNER_ERROR("E19999", "InnerData memory_offset_ does not have type[HBM], not expected, "
"not expected when ReAssignAtomicMemory, "
"graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); "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]" 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()); "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<NodePtr> &connect_netoutput_nodes) { Status GraphMemoryAssigner::AssignConnectNetOutputAtomicMemory(vector<NodePtr> &connect_netoutput_nodes) {
auto iter = memory_offset_.find(RT_MEMORY_HBM); auto iter = memory_offset_.find(RT_MEMORY_HBM);
if (iter == memory_offset_.end()) { if (iter == memory_offset_.end()) {
REPORT_INNER_ERROR("E19999", "InnerData memory_offset_ does not have type[HBM], " REPORT_INNER_ERROR("E19999", "InnerData memory_offset_ does not have type[HBM], not expected, "
"not expected when AssignConnectNetOutputAtomicMemory, "
"graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); "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]" 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()); "graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str());
@ -930,8 +921,7 @@ Status GraphMemoryAssigner::AssignReferenceMemory() {
vector<int64_t> output_list = out_op_desc->GetOutputOffset(); vector<int64_t> output_list = out_op_desc->GetOutputOffset();
if (out_op_desc->GetOutputsSize() > output_list.size()) { 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 " REPORT_INNER_ERROR("E19999", "Output size:%zu more than output offset size:%zu, judge invalid in node:%s",
"when AssignReferenceMemory",
out_op_desc->GetOutputsSize(), output_list.size(), node->GetName().c_str()); 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", 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()); 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<int64_t>(output_list.size()); auto output_list_size = static_cast<int64_t>(output_list.size());
auto iter = memory_offset_.find(RT_MEMORY_HBM); auto iter = memory_offset_.find(RT_MEMORY_HBM);
if (iter == memory_offset_.end()) { if (iter == memory_offset_.end()) {
REPORT_INNER_ERROR("E19999", "InnerData memory_offset_ does not have type[HBM], " REPORT_INNER_ERROR("E19999", "InnerData memory_offset_ does not have type[HBM], not expected, "
"not expected when AssignAtomicOutputMemory, "
"graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); "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]" 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()); "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()); GELOGI("Begin to reassign normal atomic memory, node = %s.", op_desc->GetName().c_str());
auto mem_type_iter = memory_offset_.find(RT_MEMORY_HBM); auto mem_type_iter = memory_offset_.find(RT_MEMORY_HBM);
if (mem_type_iter == memory_offset_.end()) { if (mem_type_iter == memory_offset_.end()) {
REPORT_INNER_ERROR("E19999", "InnerData memory_offset_ does not have type[HBM], " REPORT_INNER_ERROR("E19999", "InnerData memory_offset_ does not have type[HBM], not expected, "
"not expected when AssignOrdinaryAtomicWorkspaceMemory, "
"graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); "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]" 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()); "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()); GELOGI("Begin to reassign fusion atomic memory, node = %s.", op_desc->GetName().c_str());
auto mem_type_iter = memory_offset_.find(RT_MEMORY_HBM); auto mem_type_iter = memory_offset_.find(RT_MEMORY_HBM);
if (mem_type_iter == memory_offset_.end()) { if (mem_type_iter == memory_offset_.end()) {
REPORT_INNER_ERROR("E19999", "InnerData memory_offset_ does not have type[HBM], " REPORT_INNER_ERROR("E19999", "InnerData memory_offset_ does not have type[HBM], not expected, "
"not expected when AssignFusionAtomicWorkspaceMemory, "
"graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); "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]" 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()); "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)); 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))) { 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()); EXT_ATTR_ATOMIC_WORKSPACE_OFFSET.c_str(), op_desc->GetName().c_str());
GELOGE(FAILED, "[Set][Attr:%s]fail for node:%s.", GELOGE(FAILED, "[Set][Attr:%s]fail for node:%s.",
EXT_ATTR_ATOMIC_WORKSPACE_OFFSET.c_str(), op_desc->GetName().c_str()); EXT_ATTR_ATOMIC_WORKSPACE_OFFSET.c_str(), op_desc->GetName().c_str());
@ -1269,8 +1256,8 @@ Status GraphMemoryAssigner::CheckOffset() {
ge::Status GraphMemoryAssigner::SetInputOffset() { ge::Status GraphMemoryAssigner::SetInputOffset() {
if (memory_offset_.empty()) { if (memory_offset_.empty()) {
REPORT_INNER_ERROR("E19999", "InnerData memory_offset_ empty, not expected when SetInputOffset, " REPORT_INNER_ERROR("E19999", "InnerData memory_offset_ empty, not expected, graph_id:%u, graph_name:%s",
"graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); compute_graph_->GetGraphID(), compute_graph_->GetName().c_str());
GELOGE(FAILED, "[Check][InnerData:memory_offset_]empty is not expected, " GELOGE(FAILED, "[Check][InnerData:memory_offset_]empty is not expected, "
"graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); "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); (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()); 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), 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()); ATTR_NAME_AUTOMIC_ADD_START.c_str(), node_op_desc->GetName().c_str());
GELOGE(FAILED, "[Set][Attr:%s]fail for op_name:%s", GELOGE(FAILED, "[Set][Attr:%s]fail for op_name:%s",
ATTR_NAME_AUTOMIC_ADD_START.c_str(), node_op_desc->GetName().c_str()); 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); (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()); 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), 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()); ATTR_NAME_AUTOMIC_ADD_MEM_SIZE.c_str(), node_op_desc->GetName().c_str());
GELOGE(FAILED, "[Set][Attr:%s]fail for op_name:%s", GELOGE(FAILED, "[Set][Attr:%s]fail for op_name:%s",
ATTR_NAME_AUTOMIC_ADD_MEM_SIZE.c_str(), node_op_desc->GetName().c_str()); ATTR_NAME_AUTOMIC_ADD_MEM_SIZE.c_str(), node_op_desc->GetName().c_str());

@ -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); 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(); string node_name = n->GetName();
GE_IF_BOOL_EXEC(n->GetOpDesc()->GetAllOutputsDesc().empty(), 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()); n->GetName().c_str());
GELOGE(FAILED, "node:%s has no OutputDesc.", n->GetName().c_str()); GELOGE(FAILED, "node:%s has no OutputDesc.", n->GetName().c_str());
return FAILED); return FAILED);
@ -118,7 +118,7 @@ Status VarMemAssignUtil::SetOutVariableAttr(const ge::NodePtr &node, const ge::N
GE_CHECK_NOTNULL(node->GetOpDesc()); GE_CHECK_NOTNULL(node->GetOpDesc());
output_list = node->GetOpDesc()->GetOutputOffset(); output_list = node->GetOpDesc()->GetOutputOffset();
if (output_list.empty()) { 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()); node->GetName().c_str());
GELOGE(PARAM_INVALID, "Output_list is empty"); GELOGE(PARAM_INVALID, "Output_list is empty");
return PARAM_INVALID; return PARAM_INVALID;
@ -131,8 +131,8 @@ Status VarMemAssignUtil::SetOutVariableAttr(const ge::NodePtr &node, const ge::N
int out_list_size = static_cast<int>(output_list.size()); int out_list_size = static_cast<int>(output_list.size());
if (index >= out_list_size) { if (index >= out_list_size) {
REPORT_INNER_ERROR("E19999", "param index:%d >= output_list.size() %d in node %s, " REPORT_INNER_ERROR("E19999", "param index:%d >= output_list.size() %d in node %s, check invalid",
"check invalid when SetOutVariableAttr", index, out_list_size, node->GetName().c_str()); index, out_list_size, node->GetName().c_str());
GELOGE(FAILED, "index %d >= output_list.size() %d", index, out_list_size); GELOGE(FAILED, "index %d >= output_list.size() %d", index, out_list_size);
return FAILED; return FAILED;
} }

File diff suppressed because it is too large Load Diff

@ -62,7 +62,7 @@ Status RunContextUtil::CreateRtModelResources(uint32_t stream_num, uint32_t even
// Create rt model // Create rt model
rtError_t rt_ret = rtModelCreate(&rt_model_, 0); rtError_t rt_ret = rtModelCreate(&rt_model_, 0);
if (rt_ret != RT_ERROR_NONE) { if (rt_ret != RT_ERROR_NONE) {
REPORT_CALL_ERROR("E19999", "call rtModelCreate fail, ret:%d, when %s", static_cast<int>(rt_ret), __FUNCTION__); REPORT_CALL_ERROR("E19999", "call rtModelCreate failed, ret:%d,", static_cast<int>(rt_ret));
GELOGE(RT_FAILED, "rtModelCreate failed. rt_ret = %d", static_cast<int>(rt_ret)); GELOGE(RT_FAILED, "rtModelCreate failed. rt_ret = %d", static_cast<int>(rt_ret));
return RT_FAILED; return RT_FAILED;
} }
@ -72,8 +72,8 @@ Status RunContextUtil::CreateRtModelResources(uint32_t stream_num, uint32_t even
rtStream_t stream = nullptr; rtStream_t stream = nullptr;
rt_ret = rtStreamCreate(&stream, 0); rt_ret = rtStreamCreate(&stream, 0);
if (rt_ret != RT_ERROR_NONE) { if (rt_ret != RT_ERROR_NONE) {
REPORT_CALL_ERROR("E19999", "call rtStreamCreate fail, ret:%d, index:%u, when %s", REPORT_CALL_ERROR("E19999", "call rtStreamCreate failed, ret:%d, index:%u,",
static_cast<int>(rt_ret), i, __FUNCTION__); static_cast<int>(rt_ret), i);
GELOGE(RT_FAILED, "rtStreamCreate failed. rt_ret = %d, index = %u", static_cast<int>(rt_ret), i); GELOGE(RT_FAILED, "rtStreamCreate failed. rt_ret = %d, index = %u", static_cast<int>(rt_ret), i);
return RT_FAILED; return RT_FAILED;
} }
@ -81,8 +81,8 @@ Status RunContextUtil::CreateRtModelResources(uint32_t stream_num, uint32_t even
rt_ret = rtModelBindStream(rt_model_, stream, 0); rt_ret = rtModelBindStream(rt_model_, stream, 0);
if (rt_ret != RT_ERROR_NONE) { if (rt_ret != RT_ERROR_NONE) {
REPORT_CALL_ERROR("E19999", "call rtModelBindStream fail, ret:%d, index:%u, when %s", REPORT_CALL_ERROR("E19999", "call rtModelBindStream failed, ret:%d, index:%u,",
static_cast<int>(rt_ret), i, __FUNCTION__); static_cast<int>(rt_ret), i);
GELOGE(RT_FAILED, "Bind stream and model failed. rt_ret = %d, index = %u", static_cast<int>(rt_ret), i); GELOGE(RT_FAILED, "Bind stream and model failed. rt_ret = %d, index = %u", static_cast<int>(rt_ret), i);
return RT_FAILED; return RT_FAILED;
} }
@ -95,8 +95,8 @@ Status RunContextUtil::CreateRtModelResources(uint32_t stream_num, uint32_t even
rtEvent_t event = nullptr; rtEvent_t event = nullptr;
rt_ret = rtEventCreateWithFlag(&event, create_flag); rt_ret = rtEventCreateWithFlag(&event, create_flag);
if (rt_ret != RT_ERROR_NONE) { if (rt_ret != RT_ERROR_NONE) {
REPORT_CALL_ERROR("E19999", "call rtEventCreate fail, ret:%d, index:%u, when %s", REPORT_CALL_ERROR("E19999", "call rtEventCreate failed, ret:%d, index:%u,",
static_cast<int>(rt_ret), i, __FUNCTION__); static_cast<int>(rt_ret), i);
GELOGE(RT_FAILED, "rtEventCreate failed. rt_ret = %d, index = %u", static_cast<int>(rt_ret), i); GELOGE(RT_FAILED, "rtEventCreate failed. rt_ret = %d, index = %u", static_cast<int>(rt_ret), i);
return RT_FAILED; return RT_FAILED;
} }
@ -108,8 +108,8 @@ Status RunContextUtil::CreateRtModelResources(uint32_t stream_num, uint32_t even
rtLabel_t label = nullptr; rtLabel_t label = nullptr;
rt_ret = rtLabelCreateV2(&label, rt_model_); rt_ret = rtLabelCreateV2(&label, rt_model_);
if (rt_ret != RT_ERROR_NONE) { if (rt_ret != RT_ERROR_NONE) {
REPORT_CALL_ERROR("E19999", "call rtLabelCreateV2 fail, ret:%d, index:%u, when %s", REPORT_CALL_ERROR("E19999", "call rtLabelCreateV2 failed, ret:%d, index:%u,",
static_cast<int>(rt_ret), i, __FUNCTION__); static_cast<int>(rt_ret), i);
GELOGE(RT_FAILED, "rtLabelCreate failed. rt_ret = %d, index = %u", static_cast<int>(rt_ret), i); GELOGE(RT_FAILED, "rtLabelCreate failed. rt_ret = %d, index = %u", static_cast<int>(rt_ret), i);
return RT_FAILED; 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); GELOGD("Begin to Create RunContext, session_id = %lu", session_id);
// check params // check params
if (graph == nullptr) { 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); GELOGE(PARAM_INVALID, "CreateRunContext param graph is null. session_id=%lu", session_id);
return PARAM_INVALID; return PARAM_INVALID;
} }
uint32_t stream_num = 0; uint32_t stream_num = 0;
if (!AttrUtils::GetInt(&model, ATTR_MODEL_STREAM_NUM, stream_num)) { if (!AttrUtils::GetInt(&model, ATTR_MODEL_STREAM_NUM, stream_num)) {
REPORT_INNER_ERROR("Get Attr:%s fail for model, session_id:%lu, when %s", REPORT_INNER_ERROR("E19999", "Get Attr:%s failed for model, session_id:%lu,",
ATTR_MODEL_STREAM_NUM.c_str(), session_id, __FUNCTION__); ATTR_MODEL_STREAM_NUM.c_str(), session_id);
GELOGE(INTERNAL_ERROR, "Get stream_num attr from model_def failed. session_id=%lu", session_id); GELOGE(INTERNAL_ERROR, "Get stream_num attr from model_def failed. session_id=%lu", session_id);
return INTERNAL_ERROR; return INTERNAL_ERROR;
} }
@ -177,8 +177,8 @@ Status RunContextUtil::CreateRunContext(Model &model, const ComputeGraphPtr &gra
uint32_t event_num = 0; uint32_t event_num = 0;
if (!AttrUtils::GetInt(&model, ATTR_MODEL_EVENT_NUM, event_num)) { if (!AttrUtils::GetInt(&model, ATTR_MODEL_EVENT_NUM, event_num)) {
REPORT_INNER_ERROR("Get Attr:%s fail for model, session_id:%lu, when %s", REPORT_INNER_ERROR("E19999", "Get Attr:%s failed for model, session_id:%lu,",
ATTR_MODEL_EVENT_NUM.c_str(), session_id, __FUNCTION__); ATTR_MODEL_EVENT_NUM.c_str(), session_id);
GELOGE(INTERNAL_ERROR, "Get event_num attr from model failed. session_id=%lu", session_id); GELOGE(INTERNAL_ERROR, "Get event_num attr from model failed. session_id=%lu", session_id);
return INTERNAL_ERROR; return INTERNAL_ERROR;
} }
@ -186,8 +186,8 @@ Status RunContextUtil::CreateRunContext(Model &model, const ComputeGraphPtr &gra
uint32_t label_num = 0; uint32_t label_num = 0;
if (!AttrUtils::GetInt(&model, ATTR_MODEL_LABEL_NUM, label_num)) { if (!AttrUtils::GetInt(&model, ATTR_MODEL_LABEL_NUM, label_num)) {
REPORT_INNER_ERROR("Get Attr:%s fail for model, session_id:%lu, when %s", REPORT_INNER_ERROR("E19999", "Get Attr:%s failed for model, session_id:%lu,",
ATTR_MODEL_LABEL_NUM.c_str(), session_id, __FUNCTION__); ATTR_MODEL_LABEL_NUM.c_str(), session_id);
GELOGE(INTERNAL_ERROR, "Get label_num attr from model failed. session_id=%lu", session_id); GELOGE(INTERNAL_ERROR, "Get label_num attr from model failed. session_id=%lu", session_id);
return INTERNAL_ERROR; return INTERNAL_ERROR;
} }

File diff suppressed because it is too large Load Diff

@ -126,8 +126,8 @@ Status StreamGraphOptimizer::OptimizeStreamedSubGraph(const ComputeGraphPtr &com
int64_t stream_id = op_desc->GetStreamId(); int64_t stream_id = op_desc->GetStreamId();
if (static_cast<size_t>(stream_id) >= run_context.graphStreamList.size()) { if (static_cast<size_t>(stream_id) >= run_context.graphStreamList.size()) {
REPORT_INNER_ERROR("E19999", "Check stream_id:%ld in op:%s(%s) is bigger than " 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(), "run_context.graphStreamList.size():%zu", stream_id, op_desc->GetName().c_str(),
op_desc->GetType().c_str(), run_context.graphStreamList.size(), __FUNCTION__); op_desc->GetType().c_str(), run_context.graphStreamList.size());
GELOGE(FAILED, "stream_id %ld is bigger than run_context.graphStreamList.size() %zu", stream_id, GELOGE(FAILED, "stream_id %ld is bigger than run_context.graphStreamList.size() %zu", stream_id,
run_context.graphStreamList.size()); run_context.graphStreamList.size());
return FAILED; return FAILED;

File diff suppressed because it is too large Load Diff

@ -111,14 +111,14 @@ class BCast {
const std::function<OutT(InT const &, InT const &)> &func) { const std::function<OutT(InT const &, InT const &)> &func) {
Status ret; Status ret;
if (func == nullptr) { 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"); GELOGE(domi::PARAM_INVALID, "Param func is null");
return domi::PARAM_INVALID; return domi::PARAM_INVALID;
} }
// Min input num is 2 // Min input num is 2
if (input.size() < kMinDimNum) { if (input.size() < kMinDimNum) {
REPORT_INNER_ERROR("E19999", "Param input.size():%zu < %zu, check invalid when %s", REPORT_INNER_ERROR("E19999", "Param input.size():%zu < %zu, check invalid",
input.size(), kMinDimNum, __FUNCTION__); input.size(), kMinDimNum);
GELOGE(domi::PARAM_INVALID, "Input size is smaller than two."); GELOGE(domi::PARAM_INVALID, "Input size is smaller than two.");
return domi::PARAM_INVALID; return domi::PARAM_INVALID;
} }
@ -152,14 +152,14 @@ class BCast {
Status BCastComputeCheck(const std::vector<ConstGeTensorPtr> &input, std::vector<OutT> &v_output, Status BCastComputeCheck(const std::vector<ConstGeTensorPtr> &input, std::vector<OutT> &v_output,
const std::function<OutT(InT const &, InT const &, DataType &type, Status &)> &func) { const std::function<OutT(InT const &, InT const &, DataType &type, Status &)> &func) {
if (func == nullptr) { 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"); GELOGE(PARAM_INVALID, "Param func is null");
return PARAM_INVALID; return PARAM_INVALID;
} }
// Min input num is 2 // Min input num is 2
if (input.size() < kMinDimNum) { if (input.size() < kMinDimNum) {
REPORT_INNER_ERROR("E19999", "Param input.size():%zu < %zu, check invalid when %s", REPORT_INNER_ERROR("E19999", "Param input.size():%zu < %zu, check invalid",
input.size(), kMinDimNum, __FUNCTION__); input.size(), kMinDimNum);
GELOGE(PARAM_INVALID, "Input size is smaller than two."); GELOGE(PARAM_INVALID, "Input size is smaller than two.");
return PARAM_INVALID; return PARAM_INVALID;
} }

@ -38,8 +38,8 @@ Status GetOriginalType(const ge::NodePtr &node, string &type) {
GE_CHECK_NOTNULL(node->GetOpDesc()); GE_CHECK_NOTNULL(node->GetOpDesc());
bool ret = ge::AttrUtils::GetStr(node->GetOpDesc(), ATTR_NAME_FRAMEWORK_ORIGINAL_TYPE, type); bool ret = ge::AttrUtils::GetStr(node->GetOpDesc(), ATTR_NAME_FRAMEWORK_ORIGINAL_TYPE, type);
if (!ret) { if (!ret) {
REPORT_INNER_ERROR("E19999", "Get Attr:%s fail for op:%s(%s) when %s", ATTR_NAME_FRAMEWORK_ORIGINAL_TYPE.c_str(), 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(), __FUNCTION__); node->GetName().c_str(), node->GetType().c_str());
GELOGE(INTERNAL_ERROR, "Get FrameWorkOp original type [%s]", type.c_str()); GELOGE(INTERNAL_ERROR, "Get FrameWorkOp original type [%s]", type.c_str());
return INTERNAL_ERROR; return INTERNAL_ERROR;
} }
@ -59,8 +59,8 @@ Status SetStreamLabel(const ge::NodePtr &node, const std::string &label) {
GE_CHECK_NOTNULL(tmp_desc); GE_CHECK_NOTNULL(tmp_desc);
if (!AttrUtils::SetStr(tmp_desc, ge::ATTR_NAME_STREAM_LABEL, label)) { 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(), 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(), __FUNCTION__); node->GetName().c_str(), node->GetType().c_str());
GELOGE(FAILED, "Op: %s set ATTR_NAME_STREAM_LABEL failed", node->GetName().c_str()); GELOGE(FAILED, "Op: %s set ATTR_NAME_STREAM_LABEL failed", node->GetName().c_str());
return FAILED; return FAILED;
} }
@ -78,8 +78,8 @@ Status SetCycleEvent(const ge::NodePtr &node) {
OpDescPtr tmp_desc = node->GetOpDesc(); OpDescPtr tmp_desc = node->GetOpDesc();
GE_CHECK_NOTNULL(tmp_desc); GE_CHECK_NOTNULL(tmp_desc);
if (!AttrUtils::SetBool(tmp_desc, ge::ATTR_NAME_STREAM_CYCLE_EVENT_FLAG, true)) { 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(), 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(), __FUNCTION__); node->GetName().c_str(), node->GetType().c_str());
GELOGE(FAILED, "Op: %s set ATTR_NAME_STREAM_CYCLE_EVENT_FLAG failed", node->GetName().c_str()); GELOGE(FAILED, "Op: %s set ATTR_NAME_STREAM_CYCLE_EVENT_FLAG failed", node->GetName().c_str());
return FAILED; return FAILED;
} }
@ -98,8 +98,8 @@ Status SetActiveLabelList(const ge::NodePtr &node, const std::vector<std::string
OpDescPtr tmp_desc = node->GetOpDesc(); OpDescPtr tmp_desc = node->GetOpDesc();
GE_CHECK_NOTNULL(tmp_desc); GE_CHECK_NOTNULL(tmp_desc);
if (!AttrUtils::SetListStr(tmp_desc, ge::ATTR_NAME_ACTIVE_LABEL_LIST, active_label_list)) { 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(), 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(), __FUNCTION__); node->GetName().c_str(), node->GetType().c_str());
GELOGE(FAILED, "Op: %s set ATTR_NAME_ACTIVE_LABEL_LIST failed", node->GetName().c_str()); GELOGE(FAILED, "Op: %s set ATTR_NAME_ACTIVE_LABEL_LIST failed", node->GetName().c_str());
return FAILED; return FAILED;
} }
@ -118,8 +118,8 @@ Status SetSwitchBranchNodeLabel(const ge::NodePtr &node, const std::string &bran
OpDescPtr tmp_desc = node->GetOpDesc(); OpDescPtr tmp_desc = node->GetOpDesc();
GE_CHECK_NOTNULL(tmp_desc); GE_CHECK_NOTNULL(tmp_desc);
if (!AttrUtils::SetStr(tmp_desc, ge::ATTR_NAME_SWITCH_BRANCH_NODE_LABEL, branch_label)) { 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(), 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(), __FUNCTION__); node->GetName().c_str(), node->GetType().c_str());
GELOGE(FAILED, "Op: %s set ATTR_NAME_SWITCH_BRANCH_NODE_LABEL failed", node->GetName().c_str()); GELOGE(FAILED, "Op: %s set ATTR_NAME_SWITCH_BRANCH_NODE_LABEL failed", node->GetName().c_str());
return FAILED; return FAILED;
} }
@ -138,8 +138,8 @@ Status SetSwitchTrueBranchFlag(const ge::NodePtr &node, bool value) {
OpDescPtr tmp_desc = node->GetOpDesc(); OpDescPtr tmp_desc = node->GetOpDesc();
GE_CHECK_NOTNULL(tmp_desc); GE_CHECK_NOTNULL(tmp_desc);
if (!AttrUtils::SetBool(tmp_desc, ge::ATTR_NAME_SWITCH_TRUE_BRANCH_FLAG, value)) { 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(), 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(), __FUNCTION__); node->GetName().c_str(), node->GetType().c_str());
GELOGE(FAILED, "Op: %s set ATTR_NAME_SWITCH_TRUE_BRANCH_FLAG failed", node->GetName().c_str()); GELOGE(FAILED, "Op: %s set ATTR_NAME_SWITCH_TRUE_BRANCH_FLAG failed", node->GetName().c_str());
return FAILED; return FAILED;
} }
@ -158,8 +158,8 @@ Status SetOriginalNodeName(const ge::NodePtr &node, const std::string &orig_name
OpDescPtr tmp_desc = node->GetOpDesc(); OpDescPtr tmp_desc = node->GetOpDesc();
GE_CHECK_NOTNULL(tmp_desc); GE_CHECK_NOTNULL(tmp_desc);
if (!AttrUtils::SetStr(tmp_desc, ge::ATTR_NAME_ORIG_NODE_NAME, orig_name)) { 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(), 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(), __FUNCTION__); node->GetName().c_str(), node->GetType().c_str());
GELOGE(FAILED, "Op: %s set ATTR_NAME_ORIG_NODE_NAME failed", node->GetName().c_str()); GELOGE(FAILED, "Op: %s set ATTR_NAME_ORIG_NODE_NAME failed", node->GetName().c_str());
return FAILED; return FAILED;
} }
@ -177,8 +177,8 @@ Status SetCyclicDependenceFlag(const ge::NodePtr &node) {
OpDescPtr tmp_desc = node->GetOpDesc(); OpDescPtr tmp_desc = node->GetOpDesc();
GE_CHECK_NOTNULL(tmp_desc); GE_CHECK_NOTNULL(tmp_desc);
if (!AttrUtils::SetBool(tmp_desc, ge::ATTR_NAME_CYCLIC_DEPENDENCE_FLAG, true)) { 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(), 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(), __FUNCTION__); node->GetName().c_str(), node->GetType().c_str());
GELOGE(FAILED, "Op: %s set ATTR_NAME_CYCLIC_DEPENDENCE_FLAG failed", node->GetName().c_str()); GELOGE(FAILED, "Op: %s set ATTR_NAME_CYCLIC_DEPENDENCE_FLAG failed", node->GetName().c_str());
return FAILED; return FAILED;
} }
@ -198,8 +198,8 @@ Status SetNextIteration(const ge::NodePtr &node, const std::string &next) {
GE_CHECK_NOTNULL(tmp_desc); GE_CHECK_NOTNULL(tmp_desc);
if (!AttrUtils::SetStr(tmp_desc, ge::ATTR_NAME_NEXT_ITERATION, next)) { 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(), 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(), __FUNCTION__); node->GetName().c_str(), node->GetType().c_str());
GELOGE(FAILED, "Op: %s set ATTR_NAME_NEXT_ITERATION failed", node->GetName().c_str()); GELOGE(FAILED, "Op: %s set ATTR_NAME_NEXT_ITERATION failed", node->GetName().c_str());
return FAILED; return FAILED;
} }

@ -40,7 +40,7 @@ GraphExecutor::~GraphExecutor() {
rtError_t rt_ret; rtError_t rt_ret;
rt_ret = rtFreeHost(buffer_addr); rt_ret = rtFreeHost(buffer_addr);
if (rt_ret != RT_ERROR_NONE) { 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); 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, Status GraphExecutor::SetCondition(std::mutex *mutex, std::condition_variable *cond,
std::shared_ptr<GraphModelListener> listener) { std::shared_ptr<GraphModelListener> listener) {
if (mutex == nullptr) { 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."); GELOGE(GE_GRAPH_PARAM_NULLPTR, "[SetCondition] input param mutex is nullptr.");
return GE_GRAPH_PARAM_NULLPTR; return GE_GRAPH_PARAM_NULLPTR;
} }
if (cond == 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."); GELOGE(GE_GRAPH_PARAM_NULLPTR, "[SetCondition] input param cond is nullptr.");
return GE_GRAPH_PARAM_NULLPTR; return GE_GRAPH_PARAM_NULLPTR;
} }
if (listener == 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."); GELOGE(GE_GRAPH_PARAM_NULLPTR, "[SetCondition] input param listener is nullptr.");
return GE_GRAPH_PARAM_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) { Status GraphExecutor::SetGraphContext(GraphContextPtr graph_context_ptr) {
if (graph_context_ptr == nullptr) { 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"); GELOGE(GE_GRAPH_PARAM_NULLPTR, "[SetGraphContext] input param graph_context_ptr is nullptr");
return GE_GRAPH_PARAM_NULLPTR; return GE_GRAPH_PARAM_NULLPTR;
} }
@ -106,7 +106,7 @@ Status GraphExecutor::FreeInOutBuffer() {
rtError_t rt_ret; rtError_t rt_ret;
rt_ret = rtFreeHost(*iter); rt_ret = rtFreeHost(*iter);
if (rt_ret != RT_ERROR_NONE) { 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); GELOGE(RT_FAILED, "[GraphManager] subgraph free buffer failed, ret: 0x%X", rt_ret);
(void)buffer_addr_.erase(buffer_addr_.begin(), iter); (void)buffer_addr_.erase(buffer_addr_.begin(), iter);
return GE_GRAPH_FREE_FAILED; return GE_GRAPH_FREE_FAILED;
@ -152,8 +152,8 @@ Status GraphExecutor::MallocInOutBuffer(const std::vector<uint64_t> &buffer_size
void *tmp_buf = nullptr; void *tmp_buf = nullptr;
rt_ret = rtMallocHost(&tmp_buf, buffer_size[i]); rt_ret = rtMallocHost(&tmp_buf, buffer_size[i]);
if (rt_ret != RT_ERROR_NONE) { if (rt_ret != RT_ERROR_NONE) {
REPORT_CALL_ERROR("E19999", "Call rtMallocHost failed, size:%lu, ret:0x%X when %s", REPORT_CALL_ERROR("E19999", "Call rtMallocHost failed, size:%lu, ret:0x%X",
buffer_size[i], rt_ret, __FUNCTION__); buffer_size[i], rt_ret);
GELOGE(RT_FAILED, "[GraphManager] subgraph malloc buffer failed, ret: 0x%X", rt_ret); GELOGE(RT_FAILED, "[GraphManager] subgraph malloc buffer failed, ret: 0x%X", rt_ret);
return GE_GRAPH_MALLOC_FAILED; return GE_GRAPH_MALLOC_FAILED;
} }
@ -199,8 +199,8 @@ Status GraphExecutor::PrepareInputData(const std::vector<GeTensor> &input_tensor
rtError_t rt_ret = rtMemcpy(addrVec[i], bufferSizeVec[i], in_tensor->GetData().data(), rtError_t rt_ret = rtMemcpy(addrVec[i], bufferSizeVec[i], in_tensor->GetData().data(),
in_tensor->GetData().size(), RT_MEMCPY_HOST_TO_HOST); in_tensor->GetData().size(), RT_MEMCPY_HOST_TO_HOST);
if (rt_ret != RT_ERROR_NONE) { if (rt_ret != RT_ERROR_NONE) {
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, dst_size:%lu, src_size:%zu, ret:0x%X when %s", REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, dst_size:%lu, src_size:%zu, ret:0x%X",
bufferSizeVec[i], in_tensor->GetData().size(), rt_ret, __FUNCTION__); bufferSizeVec[i], in_tensor->GetData().size(), rt_ret);
GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret);
return RT_FAILED; return RT_FAILED;
} }
@ -260,8 +260,8 @@ Status GraphExecutor::SyncExecuteModel(uint32_t model_id, const std::vector<GeTe
} }
if (graph_run_listener_->ResetResult() != SUCCESS) { if (graph_run_listener_->ResetResult() != SUCCESS) {
REPORT_CALL_ERROR("E19999", "Call graph_run_listener_.ResetResult fail, model_id:%u, when %s", REPORT_CALL_ERROR("E19999", "Call graph_run_listener_.ResetResult fail, model_id:%u",
model_id, __FUNCTION__); model_id);
GELOGE(GE_GRAPH_EXECUTE_FAILED, "Reset result failed"); GELOGE(GE_GRAPH_EXECUTE_FAILED, "Reset result failed");
return GE_GRAPH_EXECUTE_FAILED; return GE_GRAPH_EXECUTE_FAILED;
} }
@ -285,8 +285,8 @@ Status GraphExecutor::SyncExecuteModel(uint32_t model_id, const std::vector<GeTe
// Run graph return // Run graph return
uint32_t result_code = graph_run_listener_->GetResultCode(); uint32_t result_code = graph_run_listener_->GetResultCode();
if (result_code != SUCCESS && result_code != END_OF_SEQUENCE) { 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", REPORT_CALL_ERROR("E19999", "Graph_run_listener_ run fail, result:%u, model_id:%u",
result_code, model_id, __FUNCTION__); result_code, model_id);
GELOGE(GE_GRAPH_EXECUTE_FAILED, "[GraphExecutor] execute model failed, ret=%u, modelId=%u.", result_code, GELOGE(GE_GRAPH_EXECUTE_FAILED, "[GraphExecutor] execute model failed, ret=%u, modelId=%u.", result_code,
model_id); model_id);
return GE_GRAPH_EXECUTE_FAILED; return GE_GRAPH_EXECUTE_FAILED;
@ -295,14 +295,14 @@ Status GraphExecutor::SyncExecuteModel(uint32_t model_id, const std::vector<GeTe
for (size_t i = 0; i < output_data.blobs.size(); ++i) { for (size_t i = 0; i < output_data.blobs.size(); ++i) {
DataBuffer outputDataTmp = output_data.blobs[i]; DataBuffer outputDataTmp = output_data.blobs[i];
CHECK_FALSE_EXEC(outputDataTmp.length != 0, CHECK_FALSE_EXEC(outputDataTmp.length != 0,
REPORT_INNER_ERROR("E19999", "Param output_data.length is 0 in model:%u, check invalid, when %s", REPORT_INNER_ERROR("E19999", "Param output_data.length is 0 in model:%u, check invalid",
model_id, __FUNCTION__); model_id);
GELOGE(GE_GRAPH_EXECUTE_FAILED, "Failed to allocate memory, length is 0."); GELOGE(GE_GRAPH_EXECUTE_FAILED, "Failed to allocate memory, length is 0.");
return GE_GRAPH_EXECUTE_FAILED); return GE_GRAPH_EXECUTE_FAILED);
std::unique_ptr<uint8_t> outBufTmp(new (std::nothrow) uint8_t[outputDataTmp.length]); std::unique_ptr<uint8_t> outBufTmp(new (std::nothrow) uint8_t[outputDataTmp.length]);
if (outBufTmp == nullptr) { if (outBufTmp == nullptr) {
REPORT_CALL_ERROR("E19999", "New output buffer fail, length:%lu, model:%u, when %s", REPORT_CALL_ERROR("E19999", "New output buffer fail, length:%lu, model:%u",
outputDataTmp.length, model_id, __FUNCTION__); outputDataTmp.length, model_id);
GELOGE(FAILED, "Failed to allocate memory."); GELOGE(FAILED, "Failed to allocate memory.");
return FAILED; return FAILED;
} }
@ -310,8 +310,8 @@ Status GraphExecutor::SyncExecuteModel(uint32_t model_id, const std::vector<GeTe
rtError_t ret_value = rtMemcpy(outBufTmp.get(), outputDataTmp.length, outputDataTmp.data, outputDataTmp.length, rtError_t ret_value = rtMemcpy(outBufTmp.get(), outputDataTmp.length, outputDataTmp.data, outputDataTmp.length,
RT_MEMCPY_HOST_TO_HOST); RT_MEMCPY_HOST_TO_HOST);
CHECK_FALSE_EXEC(ret_value == RT_ERROR_NONE, CHECK_FALSE_EXEC(ret_value == RT_ERROR_NONE,
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, dst_size:%lu, src_size:%zu, ret:0x%X when %s", REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, dst_size:%lu, src_size:%zu, ret:0x%X",
outputDataTmp.length, outputDataTmp.length, ret_value, __FUNCTION__); outputDataTmp.length, outputDataTmp.length, ret_value);
GELOGE(GE_GRAPH_EXECUTE_FAILED, "Call rt api rtMemcpy failed, ret: 0x%X", ret); GELOGE(GE_GRAPH_EXECUTE_FAILED, "Call rt api rtMemcpy failed, ret: 0x%X", ret);
return GE_GRAPH_EXECUTE_FAILED); return GE_GRAPH_EXECUTE_FAILED);
GeTensor outTensor; GeTensor outTensor;
@ -364,8 +364,8 @@ Status GraphExecutor::ExecuteGraph(GraphId graph_id, const GeRootModelPtr &ge_ro
last_graph_id_ = graph_id; last_graph_id_ = graph_id;
if (!init_flag_) { if (!init_flag_) {
REPORT_INNER_ERROR("E19999", "No SetCondition called before, graph:%u, check invalid when %s", REPORT_INNER_ERROR("E19999", "No SetCondition called before, graph:%u, check invalid",
graph_id, __FUNCTION__); graph_id);
GELOGE(GE_GRAPH_EXECUTE_NOT_INIT, "[GraphExecutor] AI Core Engine without calling SetCondition!"); GELOGE(GE_GRAPH_EXECUTE_NOT_INIT, "[GraphExecutor] AI Core Engine without calling SetCondition!");
return GE_GRAPH_EXECUTE_NOT_INIT; return GE_GRAPH_EXECUTE_NOT_INIT;
} }
@ -414,12 +414,12 @@ Status GraphExecutor::AsyncExecuteModel(uint32_t model_id, const std::vector<Inp
GELOGI("RunAsync success."); GELOGI("RunAsync success.");
} catch (std::bad_alloc &) { } catch (std::bad_alloc &) {
REPORT_INNER_ERROR("E19999", "Bad memory allocation exception occur when %s failed", __FUNCTION__); REPORT_INNER_ERROR("E19999", "Bad memory allocation exception occur failed");
GELOGE(MEMALLOC_FAILED, "RunAsync failed, bad memory allocation occur !"); GELOGE(MEMALLOC_FAILED, "RunAsync failed, bad memory allocation occur !");
CsaInteract::GetInstance().WriteErrorCode(FAILED, ERROR_MODULE_FMK, JOBSUBSTATE_GRAPH_EXEC); CsaInteract::GetInstance().WriteErrorCode(FAILED, ERROR_MODULE_FMK, JOBSUBSTATE_GRAPH_EXEC);
return MEMALLOC_FAILED; return MEMALLOC_FAILED;
} catch (...) { } catch (...) {
REPORT_INNER_ERROR("E19999", "Some exceptions occur when %s failed", __FUNCTION__); REPORT_INNER_ERROR("E19999", "Some exceptions occur failed");
GELOGE(FAILED, "RunAsync failed, some exceptions occur !"); GELOGE(FAILED, "RunAsync failed, some exceptions occur !");
CsaInteract::GetInstance().WriteErrorCode(FAILED, ERROR_MODULE_FMK, JOBSUBSTATE_GRAPH_EXEC); CsaInteract::GetInstance().WriteErrorCode(FAILED, ERROR_MODULE_FMK, JOBSUBSTATE_GRAPH_EXEC);
return FAILED; return FAILED;
@ -439,12 +439,12 @@ Status GraphExecutor::DataInput(const InputData &input_data, OutputData &output_
return ret; return ret;
} }
} catch (std::bad_alloc &) { } catch (std::bad_alloc &) {
REPORT_INNER_ERROR("E19999", "Bad memory allocation exception occur when %s failed", __FUNCTION__); REPORT_INNER_ERROR("E19999", "Bad memory allocation exception occur failed");
GELOGE(MEMALLOC_FAILED, "DataInput failed, bad memory allocation occur !"); GELOGE(MEMALLOC_FAILED, "DataInput failed, bad memory allocation occur !");
CsaInteract::GetInstance().WriteErrorCode(FAILED, ERROR_MODULE_FMK, JOBSUBSTATE_GRAPH_EXEC); CsaInteract::GetInstance().WriteErrorCode(FAILED, ERROR_MODULE_FMK, JOBSUBSTATE_GRAPH_EXEC);
return MEMALLOC_FAILED; return MEMALLOC_FAILED;
} catch (...) { } catch (...) {
REPORT_INNER_ERROR("E19999", "Some exceptions occur when %s failed", __FUNCTION__); REPORT_INNER_ERROR("E19999", "Some exceptions occur failed");
GELOGE(FAILED, "DataInput failed, some exceptions occur !"); GELOGE(FAILED, "DataInput failed, some exceptions occur !");
CsaInteract::GetInstance().WriteErrorCode(FAILED, ERROR_MODULE_FMK, JOBSUBSTATE_GRAPH_EXEC); CsaInteract::GetInstance().WriteErrorCode(FAILED, ERROR_MODULE_FMK, JOBSUBSTATE_GRAPH_EXEC);
return FAILED; return FAILED;
@ -465,12 +465,12 @@ Status GraphExecutor::GetInputOutputDescInfo(const uint32_t model_id, vector<Inp
return ret; return ret;
} }
} catch (std::bad_alloc &) { } catch (std::bad_alloc &) {
REPORT_INNER_ERROR("E19999", "Bad memory allocation exception occur when %s failed", __FUNCTION__); REPORT_INNER_ERROR("E19999", "Bad memory allocation exception occur failed");
GELOGE(MEMALLOC_FAILED, "GetInputOutputDescInfo failed, bad memory allocation occur !"); GELOGE(MEMALLOC_FAILED, "GetInputOutputDescInfo failed, bad memory allocation occur !");
CsaInteract::GetInstance().WriteErrorCode(FAILED, ERROR_MODULE_FMK, JOBSUBSTATE_GRAPH_EXEC); CsaInteract::GetInstance().WriteErrorCode(FAILED, ERROR_MODULE_FMK, JOBSUBSTATE_GRAPH_EXEC);
return MEMALLOC_FAILED; return MEMALLOC_FAILED;
} catch (...) { } catch (...) {
REPORT_INNER_ERROR("E19999", "Some exceptions occur when %s failed", __FUNCTION__); REPORT_INNER_ERROR("E19999", "Some exceptions occur failed");
GELOGE(FAILED, "GetInputOutputDescInfo failed, some exceptions occur !"); GELOGE(FAILED, "GetInputOutputDescInfo failed, some exceptions occur !");
CsaInteract::GetInstance().WriteErrorCode(FAILED, ERROR_MODULE_FMK, JOBSUBSTATE_GRAPH_EXEC); CsaInteract::GetInstance().WriteErrorCode(FAILED, ERROR_MODULE_FMK, JOBSUBSTATE_GRAPH_EXEC);
return FAILED; return FAILED;
@ -494,12 +494,12 @@ Status GraphExecutor::GetInputOutputDescInfo(const uint32_t model_id, vector<Inp
return ret; return ret;
} }
} catch (std::bad_alloc &) { } catch (std::bad_alloc &) {
REPORT_INNER_ERROR("E19999", "Bad memory allocation exception occur when %s failed", __FUNCTION__); REPORT_INNER_ERROR("E19999", "Bad memory allocation exception occur failed");
GELOGE(MEMALLOC_FAILED, "GetInputOutputDescInfo failed, bad memory allocation occur !"); GELOGE(MEMALLOC_FAILED, "GetInputOutputDescInfo failed, bad memory allocation occur !");
CsaInteract::GetInstance().WriteErrorCode(FAILED, ERROR_MODULE_FMK, JOBSUBSTATE_GRAPH_EXEC); CsaInteract::GetInstance().WriteErrorCode(FAILED, ERROR_MODULE_FMK, JOBSUBSTATE_GRAPH_EXEC);
return MEMALLOC_FAILED; return MEMALLOC_FAILED;
} catch (...) { } catch (...) {
REPORT_INNER_ERROR("E19999", "Some exceptions occur when %s failed", __FUNCTION__); REPORT_INNER_ERROR("E19999", "Some exceptions occur failed");
GELOGE(FAILED, "GetInputOutputDescInfo failed, some exceptions occur !"); GELOGE(FAILED, "GetInputOutputDescInfo failed, some exceptions occur !");
CsaInteract::GetInstance().WriteErrorCode(FAILED, ERROR_MODULE_FMK, JOBSUBSTATE_GRAPH_EXEC); CsaInteract::GetInstance().WriteErrorCode(FAILED, ERROR_MODULE_FMK, JOBSUBSTATE_GRAPH_EXEC);
return FAILED; return FAILED;

@ -42,8 +42,8 @@ Status CaseOpLabelMaker::Run(uint32_t &label_index) {
const auto graph_names = case_desc->GetSubgraphInstanceNames(); const auto graph_names = case_desc->GetSubgraphInstanceNames();
if (graph_names.empty() || graph_names.size() > kMaxCaseBranch) { 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(), 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(), __FUNCTION__); case_desc->GetType().c_str(), graph_names.size());
GELOGE(INTERNAL_ERROR, "Node: %s has invalid subgraph, graph size: %zu.", case_desc->GetName().c_str(), GELOGE(INTERNAL_ERROR, "Node: %s has invalid subgraph, graph size: %zu.", case_desc->GetName().c_str(),
graph_names.size()); graph_names.size());
return FAILED; return FAILED;
@ -69,8 +69,8 @@ Status CaseOpLabelMaker::Run(uint32_t &label_index) {
parent_node_->GetName() + "/StreamActive_" + std::to_string(index); // rtStreamActive parent_node_->GetName() + "/StreamActive_" + std::to_string(index); // rtStreamActive
NodePtr stream_active = AddStreamActive(graph, stream_active_name); NodePtr stream_active = AddStreamActive(graph, stream_active_name);
if (stream_active == nullptr) { if (stream_active == nullptr) {
REPORT_CALL_ERROR("E19999", "Add StreamActive node in graph:%s fail when %s", REPORT_CALL_ERROR("E19999", "Add StreamActive node in graph:%s fail",
graph->GetName().c_str(), __FUNCTION__); graph->GetName().c_str());
GELOGE(INTERNAL_ERROR, "Subgraph: %s add stream active failed.", graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "Subgraph: %s add stream active failed.", graph->GetName().c_str());
return FAILED; 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 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); NodePtr label = AddLabelSetEnter(graph, label_set_name, curr_label_index, stream_active);
if (label == nullptr) { if (label == nullptr) {
REPORT_CALL_ERROR("E19999", "Add LabelSetEnter node in graph:%s fail when %s", REPORT_CALL_ERROR("E19999", "Add LabelSetEnter node in graph:%s fail",
graph->GetName().c_str(), __FUNCTION__); graph->GetName().c_str());
GELOGE(INTERNAL_ERROR, "Subgraph: %s add label set failed.", graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "Subgraph: %s add label set failed.", graph->GetName().c_str());
return FAILED; return FAILED;
} }
@ -94,8 +94,8 @@ Status CaseOpLabelMaker::Run(uint32_t &label_index) {
// middle node, add goto node to tail. // middle node, add goto node to tail.
std::string label_goto_name = parent_node_->GetName() + "/LabelGoto_" + std::to_string(index); // rtLabelGoto std::string label_goto_name = parent_node_->GetName() + "/LabelGoto_" + std::to_string(index); // rtLabelGoto
if (AddLabelGotoLeave(graph, label_goto_name, last_label_index) == nullptr) { if (AddLabelGotoLeave(graph, label_goto_name, last_label_index) == nullptr) {
REPORT_CALL_ERROR("E19999", "Add LabelGotoLeave node in graph:%s fail when %s", REPORT_CALL_ERROR("E19999", "Add LabelGotoLeave node in graph:%s fail",
graph->GetName().c_str(), __FUNCTION__); graph->GetName().c_str());
GELOGE(INTERNAL_ERROR, "Subgraph: %s add label goto failed.", graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "Subgraph: %s add label goto failed.", graph->GetName().c_str());
return FAILED; return FAILED;
} }
@ -103,8 +103,8 @@ Status CaseOpLabelMaker::Run(uint32_t &label_index) {
// last node, add label node to tail. // last node, add label node to tail.
std::string last_label_name = parent_node_->GetName() + "/LabelSet_Last"; // rtLabelSet std::string last_label_name = parent_node_->GetName() + "/LabelSet_Last"; // rtLabelSet
if (AddLabelSetLeave(graph, last_label_name, last_label_index) == nullptr) { if (AddLabelSetLeave(graph, last_label_name, last_label_index) == nullptr) {
REPORT_CALL_ERROR("E19999", "Add LabelSetLeave node in graph:%s fail when %s", REPORT_CALL_ERROR("E19999", "Add LabelSetLeave node in graph:%s fail",
graph->GetName().c_str(), __FUNCTION__); graph->GetName().c_str());
GELOGE(INTERNAL_ERROR, "Subgraph: %s add label set failed.", graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "Subgraph: %s add label set failed.", graph->GetName().c_str());
return FAILED; return FAILED;
} }
@ -120,16 +120,16 @@ Status CaseOpLabelMaker::Run(uint32_t &label_index) {
const GeTensorDesc &pred_desc = case_desc->GetInputDesc(kCasePredIndex); const GeTensorDesc &pred_desc = case_desc->GetInputDesc(kCasePredIndex);
NodePtr switch_node = AddLabelSwitchEnter(first_graph, label_switch_name, pred_desc, switch_labels); NodePtr switch_node = AddLabelSwitchEnter(first_graph, label_switch_name, pred_desc, switch_labels);
if (switch_node == nullptr) { if (switch_node == nullptr) {
REPORT_CALL_ERROR("E19999", "Add LabelSwitchEnter node in graph:%s fail when %s", REPORT_CALL_ERROR("E19999", "Add LabelSwitchEnter node in graph:%s fail",
first_graph->GetName().c_str(), __FUNCTION__); first_graph->GetName().c_str());
GELOGE(INTERNAL_ERROR, "Subgraph: %s add label switch failed.", first_graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "Subgraph: %s add label switch failed.", first_graph->GetName().c_str());
return FAILED; return FAILED;
} }
// Link control edge to then branch head. // Link control edge to then branch head.
if (GraphUtils::AddEdge(switch_node->GetOutControlAnchor(), first_label->GetInControlAnchor()) != SUCCESS) { 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(), 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(), __FUNCTION__); 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()); GELOGE(INTERNAL_ERROR, "LabelSwitchByIndex: Add ctrl edge to %s failed.", first_label->GetName().c_str());
return FAILED; return FAILED;
} }
@ -137,8 +137,8 @@ Status CaseOpLabelMaker::Run(uint32_t &label_index) {
uint32_t parent_index = 0; // Case cond input is first. uint32_t parent_index = 0; // Case cond input is first.
const std::string data_name = parent_node_->GetName() + "/SwitchIndexData"; const std::string data_name = parent_node_->GetName() + "/SwitchIndexData";
if (AddLabelSwitchIndex(first_graph, data_name, pred_desc, switch_node, parent_index) == nullptr) { 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", REPORT_CALL_ERROR("E19999", "Add LabelSwitchIndex node in graph:%s fail",
first_graph->GetName().c_str(), __FUNCTION__); first_graph->GetName().c_str());
GELOGE(INTERNAL_ERROR, "Subgraph: %s add switch input failed.", first_graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "Subgraph: %s add switch input failed.", first_graph->GetName().c_str());
return FAILED; return FAILED;
} }

@ -44,9 +44,9 @@ Status IfOpLabelMaker::Run(uint32_t &label_index) {
const std::string else_branch_name = if_desc->GetSubgraphInstanceName(kElseBranchIndex); const std::string else_branch_name = if_desc->GetSubgraphInstanceName(kElseBranchIndex);
if (then_branch_name.empty() || else_branch_name.empty()) { if (then_branch_name.empty() || else_branch_name.empty()) {
REPORT_INNER_ERROR("E19999", "Node:%s(%s), check subgraph invalid, " 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(), 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.", 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()); if_desc->GetName().c_str(), then_branch_name.c_str(), else_branch_name.c_str());
return FAILED; return FAILED;
@ -70,44 +70,44 @@ Status IfOpLabelMaker::Run(uint32_t &label_index) {
NodePtr then_stream_active = AddStreamActive(then_sub_graph, then_active_name); NodePtr then_stream_active = AddStreamActive(then_sub_graph, then_active_name);
if (then_stream_active == nullptr) { if (then_stream_active == nullptr) {
REPORT_CALL_ERROR("E19999", "Add StreamActive node in graph:%s fail when %s", REPORT_CALL_ERROR("E19999", "Add StreamActive node in graph:%s fail",
then_sub_graph->GetName().c_str(), __FUNCTION__); then_sub_graph->GetName().c_str());
GELOGE(INTERNAL_ERROR, "Subgraph: %s add stream active failed.", then_sub_graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "Subgraph: %s add stream active failed.", then_sub_graph->GetName().c_str());
return FAILED; return FAILED;
} }
NodePtr then_enter_label = AddLabelSetEnter(then_sub_graph, then_label_name, then_enter_index, then_stream_active); NodePtr then_enter_label = AddLabelSetEnter(then_sub_graph, then_label_name, then_enter_index, then_stream_active);
if (then_enter_label == nullptr) { if (then_enter_label == nullptr) {
REPORT_CALL_ERROR("E19999", "Add LabelSetEnter node in graph:%s fail when %s", REPORT_CALL_ERROR("E19999", "Add LabelSetEnter node in graph:%s fail",
then_sub_graph->GetName().c_str(), __FUNCTION__); then_sub_graph->GetName().c_str());
GELOGE(INTERNAL_ERROR, "Subgraph: %s add label set failed.", then_sub_graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "Subgraph: %s add label set failed.", then_sub_graph->GetName().c_str());
return FAILED; return FAILED;
} }
if (AddLabelGotoLeave(then_sub_graph, then_leave_name, else_leave_index) == nullptr) { 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", REPORT_CALL_ERROR("E19999", "Add LabelGotoLeave node in graph:%s fail",
then_sub_graph->GetName().c_str(), __FUNCTION__); then_sub_graph->GetName().c_str());
GELOGE(INTERNAL_ERROR, "Subgraph: %s add label goto failed.", then_sub_graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "Subgraph: %s add label goto failed.", then_sub_graph->GetName().c_str());
return FAILED; return FAILED;
} }
NodePtr else_stream_active = AddStreamActive(else_sub_graph, else_active_name); NodePtr else_stream_active = AddStreamActive(else_sub_graph, else_active_name);
if (else_stream_active == nullptr) { if (else_stream_active == nullptr) {
REPORT_CALL_ERROR("E19999", "Add StreamActive node in graph:%s fail when %s", REPORT_CALL_ERROR("E19999", "Add StreamActive node in graph:%s fail",
else_stream_active->GetName().c_str(), __FUNCTION__); else_stream_active->GetName().c_str());
GELOGE(INTERNAL_ERROR, "Subgraph: %s add stream active failed.", else_sub_graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "Subgraph: %s add stream active failed.", else_sub_graph->GetName().c_str());
return FAILED; return FAILED;
} }
if (AddLabelSetEnter(else_sub_graph, else_enter_name, else_enter_index, else_stream_active) == nullptr) { 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", REPORT_CALL_ERROR("E19999", "Add LabelSetEnter node in graph:%s fail",
else_sub_graph->GetName().c_str(), __FUNCTION__); else_sub_graph->GetName().c_str());
GELOGE(INTERNAL_ERROR, "Subgraph: %s add label set failed.", else_sub_graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "Subgraph: %s add label set failed.", else_sub_graph->GetName().c_str());
return FAILED; return FAILED;
} }
if (AddLabelSetLeave(else_sub_graph, else_leave_name, else_leave_index) == nullptr) { 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", REPORT_CALL_ERROR("E19999", "Add LabelSetLeave node in graph:%s fail",
else_sub_graph->GetName().c_str(), __FUNCTION__); else_sub_graph->GetName().c_str());
GELOGE(INTERNAL_ERROR, "Subgraph: %s add label set failed.", else_sub_graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "Subgraph: %s add label set failed.", else_sub_graph->GetName().c_str());
return FAILED; return FAILED;
} }
@ -119,16 +119,16 @@ Status IfOpLabelMaker::Run(uint32_t &label_index) {
const GeTensorDesc &pred_desc = if_desc->GetInputDesc(kIfPredIndex); const GeTensorDesc &pred_desc = if_desc->GetInputDesc(kIfPredIndex);
NodePtr switch_node = AddLabelSwitchEnter(then_sub_graph, then_enter_name, pred_desc, switch_labels); NodePtr switch_node = AddLabelSwitchEnter(then_sub_graph, then_enter_name, pred_desc, switch_labels);
if (switch_node == nullptr) { if (switch_node == nullptr) {
REPORT_CALL_ERROR("E19999", "Add LabelSwitchEnter node in graph:%s fail when %s", REPORT_CALL_ERROR("E19999", "Add LabelSwitchEnter node in graph:%s fail",
then_sub_graph->GetName().c_str(), __FUNCTION__); then_sub_graph->GetName().c_str());
GELOGE(INTERNAL_ERROR, "Subgraph: %s add label switch failed.", then_sub_graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "Subgraph: %s add label switch failed.", then_sub_graph->GetName().c_str());
return FAILED; return FAILED;
} }
// Link control edge to then branch head. // Link control edge to then branch head.
if (GraphUtils::AddEdge(switch_node->GetOutControlAnchor(), then_enter_label->GetInControlAnchor()) != SUCCESS) { 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(), 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(), __FUNCTION__); 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()); GELOGE(INTERNAL_ERROR, "LabelSwitchByIndex: Add ctrl edge to %s failed.", then_enter_label->GetName().c_str());
return FAILED; return FAILED;
} }
@ -136,8 +136,8 @@ Status IfOpLabelMaker::Run(uint32_t &label_index) {
uint32_t parent_index = 0; // If cond input is first. uint32_t parent_index = 0; // If cond input is first.
const std::string data_name = parent_node_->GetName() + "/SwitchIndexData"; const std::string data_name = parent_node_->GetName() + "/SwitchIndexData";
if (AddLabelSwitchIndex(then_sub_graph, data_name, pred_desc, switch_node, parent_index) == nullptr) { 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", REPORT_CALL_ERROR("E19999", "Add LabelSwitchIndex node in graph:%s fail",
then_sub_graph->GetName().c_str(), __FUNCTION__); then_sub_graph->GetName().c_str());
GELOGE(INTERNAL_ERROR, "Subgraph: %s add switch input failed.", then_sub_graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "Subgraph: %s add switch input failed.", then_sub_graph->GetName().c_str());
return FAILED; return FAILED;
} }

@ -56,8 +56,8 @@ void LabelMaker::LinkToGraphHead(const ComputeGraphPtr &graph, const NodePtr &no
} }
if (GraphUtils::AddEdge(node->GetOutControlAnchor(), n->GetInControlAnchor()) != SUCCESS) { 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(), 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(), __FUNCTION__); 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()); 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) { 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(), 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(), __FUNCTION__); 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()); GELOGE(INTERNAL_ERROR, "Add ctrl edge from %s to %s failed.", tail->GetName().c_str(), node->GetName().c_str());
} }
return; return;
@ -100,7 +100,7 @@ NodePtr LabelMaker::AddStreamActive(const ComputeGraphPtr &graph, const std::str
const auto &node_list = graph->GetDirectNode(); const auto &node_list = graph->GetDirectNode();
if (node_list.empty()) { 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()); GELOGE(INTERNAL_ERROR, "LabelSet: Graph %s node is empty.", graph->GetName().c_str());
return nullptr; return nullptr;
} }
@ -136,7 +136,7 @@ NodePtr LabelMaker::AddLabelSetEnter(const ComputeGraphPtr &graph, const std::st
const auto &node_list = graph->GetDirectNode(); const auto &node_list = graph->GetDirectNode();
if (node_list.empty()) { 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()); GELOGE(INTERNAL_ERROR, "LabelSet: Graph %s node is empty.", graph->GetName().c_str());
return nullptr; return nullptr;
} }
@ -151,8 +151,8 @@ NodePtr LabelMaker::AddLabelSetEnter(const ComputeGraphPtr &graph, const std::st
GE_CHECK_NOTNULL_EXEC(label_set, return nullptr); GE_CHECK_NOTNULL_EXEC(label_set, return nullptr);
if (GraphUtils::AddEdge(label_set->GetOutControlAnchor(), stream_active->GetInControlAnchor()) != SUCCESS) { 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(), 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(), __FUNCTION__); 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(), GELOGE(INTERNAL_ERROR, "Add ctrl edge from %s to %s failed.", label_set->GetName().c_str(),
stream_active->GetName().c_str()); stream_active->GetName().c_str());
return nullptr; return nullptr;
@ -201,7 +201,7 @@ NodePtr LabelMaker::AddLabelGotoEnter(const ComputeGraphPtr &graph, const std::s
const auto &node_list = graph->GetDirectNode(); const auto &node_list = graph->GetDirectNode();
auto it = node_list.begin(); auto it = node_list.begin();
if (it == node_list.end()) { 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()); GELOGE(INTERNAL_ERROR, "LabelGoto: Graph %s node is empty.", graph->GetName().c_str());
return nullptr; 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); (void)AttrUtils::SetInt(op_desc, ATTR_NAME_LABEL_SWITCH_INDEX, index);
NodePtr label_goto = graph->AddNodeFront(op_desc); NodePtr label_goto = graph->AddNodeFront(op_desc);
if (label_goto == nullptr) { if (label_goto == nullptr) {
REPORT_CALL_ERROR("E19999", "Add node:%s(%s) to graph:%s fail when %s", 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(), __FUNCTION__); 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()); GELOGE(INTERNAL_ERROR, "LabelGoto: Add to graph %s failed.", graph->GetName().c_str());
return nullptr; return nullptr;
} }
@ -264,7 +264,7 @@ NodePtr LabelMaker::AddLabelSwitchEnter(const ComputeGraphPtr &graph, const std:
const auto &node_list = graph->GetDirectNode(); const auto &node_list = graph->GetDirectNode();
auto it = node_list.begin(); auto it = node_list.begin();
if (it == node_list.end()) { 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()); GELOGE(INTERNAL_ERROR, "LabelSwitchByIndex: Graph %s node is empty.", graph->GetName().c_str());
return nullptr; return nullptr;
} }
@ -275,23 +275,23 @@ NodePtr LabelMaker::AddLabelSwitchEnter(const ComputeGraphPtr &graph, const std:
GELOGI("LabelSwitchByIndex: Create node %s.", op_desc->GetName().c_str()); GELOGI("LabelSwitchByIndex: Create node %s.", op_desc->GetName().c_str());
if (op_desc->AddInputDesc(desc) != GRAPH_SUCCESS) { if (op_desc->AddInputDesc(desc) != GRAPH_SUCCESS) {
REPORT_CALL_ERROR("E19999", "Add input desc into node:%s(%s) in graph:%s fail when %s", 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(), __FUNCTION__); op_desc->GetName().c_str(), op_desc->GetType().c_str(), graph->GetName().c_str());
GELOGE(INTERNAL_ERROR, "LabelSwitchByIndex: Add input desc failed."); GELOGE(INTERNAL_ERROR, "LabelSwitchByIndex: Add input desc failed.");
return nullptr; return nullptr;
} }
if (!AttrUtils::SetListInt(op_desc, ATTR_NAME_LABEL_SWITCH_LIST, labels)) { 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(), 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(), __FUNCTION__); op_desc->GetName().c_str(), op_desc->GetType().c_str());
GELOGE(INTERNAL_ERROR, "LabelSwitchByIndex: Add %s failed.", ATTR_NAME_LABEL_SWITCH_INDEX.c_str()); GELOGE(INTERNAL_ERROR, "LabelSwitchByIndex: Add %s failed.", ATTR_NAME_LABEL_SWITCH_INDEX.c_str());
return nullptr; return nullptr;
} }
NodePtr label_switch = graph->AddNodeFront(op_desc); NodePtr label_switch = graph->AddNodeFront(op_desc);
if (label_switch == nullptr) { if (label_switch == nullptr) {
REPORT_CALL_ERROR("E19999", "Add node:%s(%s) to graph:%s ahead fail when %s", 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(), __FUNCTION__); 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()); GELOGE(INTERNAL_ERROR, "LabelSwitchByIndex: Add to graph %s failed.", graph->GetName().c_str());
return nullptr; return nullptr;
} }
@ -318,15 +318,15 @@ NodePtr LabelMaker::AddLabelSwitchLeave(const ComputeGraphPtr &graph, const std:
GELOGI("LabelSwitchByIndex: Create node %s.", op_desc->GetName().c_str()); GELOGI("LabelSwitchByIndex: Create node %s.", op_desc->GetName().c_str());
if (op_desc->AddInputDesc(desc) != GRAPH_SUCCESS) { if (op_desc->AddInputDesc(desc) != GRAPH_SUCCESS) {
REPORT_CALL_ERROR("E19999", "Add input desc into node:%s(%s) in graph:%s fail when %s", 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(), __FUNCTION__); op_desc->GetName().c_str(), op_desc->GetType().c_str(), graph->GetName().c_str());
GELOGE(INTERNAL_ERROR, "LabelSwitchByIndex: Add input desc failed."); GELOGE(INTERNAL_ERROR, "LabelSwitchByIndex: Add input desc failed.");
return nullptr; return nullptr;
} }
if (!AttrUtils::SetListInt(op_desc, ATTR_NAME_LABEL_SWITCH_LIST, labels)) { 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(), 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(), __FUNCTION__); op_desc->GetName().c_str(), op_desc->GetType().c_str());
GELOGE(INTERNAL_ERROR, "LabelSwitchByIndex: Add %s failed.", ATTR_NAME_LABEL_SWITCH_INDEX.c_str()); GELOGE(INTERNAL_ERROR, "LabelSwitchByIndex: Add %s failed.", ATTR_NAME_LABEL_SWITCH_INDEX.c_str());
return nullptr; return nullptr;
} }
@ -358,21 +358,21 @@ NodePtr LabelMaker::AddLabelSwitchIndex(const ComputeGraphPtr &graph, const std:
GELOGI("Data: Create node %s.", op_desc->GetName().c_str()); GELOGI("Data: Create node %s.", op_desc->GetName().c_str());
if (op_desc->AddInputDesc(desc) != GRAPH_SUCCESS) { if (op_desc->AddInputDesc(desc) != GRAPH_SUCCESS) {
REPORT_CALL_ERROR("E19999", "Add input desc into node:%s(%s) in graph:%s fail when %s", 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(), __FUNCTION__); op_desc->GetName().c_str(), op_desc->GetType().c_str(), graph->GetName().c_str());
GELOGE(INTERNAL_ERROR, "LabelSwitchByIndex: Add data input desc failed."); GELOGE(INTERNAL_ERROR, "LabelSwitchByIndex: Add data input desc failed.");
return nullptr; return nullptr;
} }
if (op_desc->AddOutputDesc(desc) != GRAPH_SUCCESS) { if (op_desc->AddOutputDesc(desc) != GRAPH_SUCCESS) {
REPORT_CALL_ERROR("E19999", "Add output desc into node:%s(%s) in graph:%s fail when %s", 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(), __FUNCTION__); op_desc->GetName().c_str(), op_desc->GetType().c_str(), graph->GetName().c_str());
GELOGE(INTERNAL_ERROR, "LabelSwitchByIndex: Add data output desc failed."); GELOGE(INTERNAL_ERROR, "LabelSwitchByIndex: Add data output desc failed.");
return nullptr; return nullptr;
} }
if (!AttrUtils::SetInt(op_desc, ATTR_NAME_PARENT_NODE_INDEX, parent_index)) { 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(), 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(), __FUNCTION__); op_desc->GetName().c_str(), op_desc->GetType().c_str());
GELOGE(INTERNAL_ERROR, "LabelSwitchByIndex: Add %s failed.", ATTR_NAME_PARENT_NODE_INDEX.c_str()); GELOGE(INTERNAL_ERROR, "LabelSwitchByIndex: Add %s failed.", ATTR_NAME_PARENT_NODE_INDEX.c_str());
return nullptr; return nullptr;
} }
@ -382,8 +382,8 @@ NodePtr LabelMaker::AddLabelSwitchIndex(const ComputeGraphPtr &graph, const std:
// Link control edge to graph head. // Link control edge to graph head.
if (GraphUtils::AddEdge(op_data->GetOutDataAnchor(0), sw_node->GetInDataAnchor(0)) != SUCCESS) { 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(), 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(), __FUNCTION__); sw_node->GetName().c_str(), graph->GetName().c_str());
GELOGE(INTERNAL_ERROR, "LabelSwitchByIndex: Add input edge to %s failed.", op_data->GetName().c_str()); GELOGE(INTERNAL_ERROR, "LabelSwitchByIndex: Add input edge to %s failed.", op_data->GetName().c_str());
return nullptr; return nullptr;
} }

@ -39,17 +39,17 @@ Status PartitionedCallLabelMaker::Run(uint32_t &label_index) {
std::string sub_graph_name = call_desc->GetSubgraphInstanceName(kSubGraphIndex); std::string sub_graph_name = call_desc->GetSubgraphInstanceName(kSubGraphIndex);
if (sub_graph_name.empty()) { if (sub_graph_name.empty()) {
REPORT_INNER_ERROR("E19999", "Node:%s(%s) subgraph_index:%d name is empty, check invalid when %s", 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, __FUNCTION__); 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()); GELOGE(INTERNAL_ERROR, "Node: %s has no subgraph name.", sub_graph_name.c_str());
return FAILED; return FAILED;
} }
ComputeGraphPtr sub_graph = parent_graph_->GetSubgraph(sub_graph_name); ComputeGraphPtr sub_graph = parent_graph_->GetSubgraph(sub_graph_name);
if (sub_graph == nullptr) { 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(), 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()); GELOGE(INTERNAL_ERROR, "Node: %s has no subgraph.", sub_graph_name.c_str());
return FAILED; return FAILED;
} }
@ -57,8 +57,8 @@ Status PartitionedCallLabelMaker::Run(uint32_t &label_index) {
const std::string stream_active_name = parent_node_->GetName() + "/StreamActive"; // rtStreamActive const std::string stream_active_name = parent_node_->GetName() + "/StreamActive"; // rtStreamActive
NodePtr stream_active = AddStreamActive(sub_graph, stream_active_name); NodePtr stream_active = AddStreamActive(sub_graph, stream_active_name);
if (stream_active == nullptr) { if (stream_active == nullptr) {
REPORT_CALL_ERROR("E19999", "Add StreamActive node in graph:%s fail when %s", REPORT_CALL_ERROR("E19999", "Add StreamActive node in graph:%s fail",
sub_graph->GetName().c_str(), __FUNCTION__); sub_graph->GetName().c_str());
GELOGE(INTERNAL_ERROR, "Subgraph: %s add stream active node failed.", sub_graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "Subgraph: %s add stream active node failed.", sub_graph->GetName().c_str());
return FAILED; return FAILED;
} }

@ -45,8 +45,8 @@ Status WhileOpLabelMaker::Run(uint32_t &label_index) {
std::string body_name = while_desc->GetSubgraphInstanceName(kBodyBranchIndex); std::string body_name = while_desc->GetSubgraphInstanceName(kBodyBranchIndex);
if (cond_name.empty() || body_name.empty()) { 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, " 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(), "check invalid", while_desc->GetName().c_str(), while_desc->GetType().c_str(),
kCondBranchIndex, kBodyBranchIndex, __FUNCTION__); kCondBranchIndex, kBodyBranchIndex);
GELOGE(INTERNAL_ERROR, "Node: %s has invalid subgraph, cond branch: %s, body branch: %s.", 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()); while_desc->GetName().c_str(), cond_name.c_str(), body_name.c_str());
return FAILED; return FAILED;
@ -70,44 +70,44 @@ Status WhileOpLabelMaker::Run(uint32_t &label_index) {
NodePtr cond_stream_active = AddStreamActive(cond_graph, cond_active_name); NodePtr cond_stream_active = AddStreamActive(cond_graph, cond_active_name);
if (cond_stream_active == nullptr) { if (cond_stream_active == nullptr) {
REPORT_CALL_ERROR("E19999", "Add StreamActive node in graph:%s fail when %s", REPORT_CALL_ERROR("E19999", "Add StreamActive node in graph:%s fail",
cond_graph->GetName().c_str(), __FUNCTION__); cond_graph->GetName().c_str());
GELOGE(INTERNAL_ERROR, "Subgraph: %s add stream active failed.", cond_graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "Subgraph: %s add stream active failed.", cond_graph->GetName().c_str());
return FAILED; return FAILED;
} }
if (AddLabelSetEnter(cond_graph, cond_enter_name, cond_enter_index, cond_stream_active) == nullptr) { 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", REPORT_CALL_ERROR("E19999", "Add LabelSetEnter node in graph:%s fail",
cond_graph->GetName().c_str(), __FUNCTION__); cond_graph->GetName().c_str());
GELOGE(INTERNAL_ERROR, "Subgraph: %s add label set failed.", cond_graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "Subgraph: %s add label set failed.", cond_graph->GetName().c_str());
return FAILED; return FAILED;
} }
NodePtr body_stream_active = AddStreamActive(body_graph, body_active_name); NodePtr body_stream_active = AddStreamActive(body_graph, body_active_name);
if (body_stream_active == nullptr) { if (body_stream_active == nullptr) {
REPORT_CALL_ERROR("E19999", "Add StreamActive node in graph:%s fail when %s", REPORT_CALL_ERROR("E19999", "Add StreamActive node in graph:%s fail",
body_graph->GetName().c_str(), __FUNCTION__); body_graph->GetName().c_str());
GELOGE(INTERNAL_ERROR, "Subgraph: %s add stream active failed.", body_graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "Subgraph: %s add stream active failed.", body_graph->GetName().c_str());
return FAILED; return FAILED;
} }
if (AddLabelSetEnter(body_graph, body_enter_name, body_enter_index, body_stream_active) == nullptr) { 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", REPORT_CALL_ERROR("E19999", "Add LabelSetEnter node in graph:%s fail",
body_graph->GetName().c_str(), __FUNCTION__); body_graph->GetName().c_str());
GELOGE(INTERNAL_ERROR, "Subgraph: %s add label set failed.", body_graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "Subgraph: %s add label set failed.", body_graph->GetName().c_str());
return FAILED; return FAILED;
} }
if (AddLabelGotoLeave(body_graph, goto_leave_name, cond_enter_index) == nullptr) { if (AddLabelGotoLeave(body_graph, goto_leave_name, cond_enter_index) == nullptr) {
REPORT_CALL_ERROR("E19999", "Add LabelGotoLeave node in graph:%s fail when %s", REPORT_CALL_ERROR("E19999", "Add LabelGotoLeave node in graph:%s fail",
body_graph->GetName().c_str(), __FUNCTION__); body_graph->GetName().c_str());
GELOGE(INTERNAL_ERROR, "Subgraph: %s add label goto failed.", body_graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "Subgraph: %s add label goto failed.", body_graph->GetName().c_str());
return FAILED; return FAILED;
} }
if (AddLabelSetLeave(body_graph, body_leave_name, body_leave_index) == nullptr) { if (AddLabelSetLeave(body_graph, body_leave_name, body_leave_index) == nullptr) {
REPORT_CALL_ERROR("E19999", "Add LabelSetLeave node in graph:%s fail when %s", REPORT_CALL_ERROR("E19999", "Add LabelSetLeave node in graph:%s fail",
body_graph->GetName().c_str(), __FUNCTION__); body_graph->GetName().c_str());
GELOGE(INTERNAL_ERROR, "Subgraph: %s add label set failed.", body_graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "Subgraph: %s add label set failed.", body_graph->GetName().c_str());
return FAILED; return FAILED;
} }
@ -124,8 +124,8 @@ Status WhileOpLabelMaker::Run(uint32_t &label_index) {
const std::vector<uint32_t> switch_labels = {body_leave_index, body_enter_index}; const std::vector<uint32_t> switch_labels = {body_leave_index, body_enter_index};
NodePtr switch_node = AddLabelSwitchLeave(cond_graph, cond_leave_name, pred_desc, switch_labels); NodePtr switch_node = AddLabelSwitchLeave(cond_graph, cond_leave_name, pred_desc, switch_labels);
if (switch_node == nullptr) { if (switch_node == nullptr) {
REPORT_CALL_ERROR("E19999", "Add LabelSwitchLeave node in graph:%s fail when %s", REPORT_CALL_ERROR("E19999", "Add LabelSwitchLeave node in graph:%s fail",
cond_graph->GetName().c_str(), __FUNCTION__); cond_graph->GetName().c_str());
GELOGE(INTERNAL_ERROR, "Subgraph: %s add label switch failed.", cond_graph->GetName().c_str()); GELOGE(INTERNAL_ERROR, "Subgraph: %s add label switch failed.", cond_graph->GetName().c_str());
return FAILED; return FAILED;
} }
@ -141,9 +141,9 @@ Status WhileOpLabelMaker::Run(uint32_t &label_index) {
InDataAnchorPtr in_anchor = all_in_data.at(kCondOutputIndex); InDataAnchorPtr in_anchor = all_in_data.at(kCondOutputIndex);
GE_CHECK_NOTNULL(in_anchor); GE_CHECK_NOTNULL(in_anchor);
if (GraphUtils::AddEdge(in_anchor->GetPeerOutAnchor(), switch_node->GetInDataAnchor(kCondOutputIndex)) != SUCCESS) { 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(), 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()); GELOGE(FAILED, "Node: %s Add pred data input failed.", switch_node->GetName().c_str());
return FAILED; return FAILED;
} }

@ -52,15 +52,14 @@ Status GraphLoader::LoadModelOnline(uint32_t &model_id, const std::shared_ptr<ge
GELOGI("Load model online begin."); GELOGI("Load model online begin.");
rtError_t rt_ret = rtSetDevice(GetContext().DeviceId()); rtError_t rt_ret = rtSetDevice(GetContext().DeviceId());
if (rt_ret != RT_ERROR_NONE) { if (rt_ret != RT_ERROR_NONE) {
REPORT_CALL_ERROR("E19999", "Call rtSetDevice failed, device_id:%u, ret:0x%X, when GraphLoader %s", REPORT_CALL_ERROR("E19999", "Call rtSetDevice failed, device_id:%u, ret:0x%X",
GetContext().DeviceId(), rt_ret, __FUNCTION__); GetContext().DeviceId(), rt_ret);
GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret);
CsaInteract::GetInstance().WriteErrorCode(rt_ret, ERROR_MODULE_RUNTIME, JOBSUBSTATE_GRAPH_LOAD); CsaInteract::GetInstance().WriteErrorCode(rt_ret, ERROR_MODULE_RUNTIME, JOBSUBSTATE_GRAPH_LOAD);
return RT_FAILED; return RT_FAILED;
} }
if (ge_root_model_ptr == nullptr) { if (ge_root_model_ptr == nullptr) {
REPORT_INNER_ERROR("E19999", "Check param ge_root_model_ptr nullptr, check invalid when GraphLoader %s", REPORT_INNER_ERROR("E19999", "Check param ge_root_model_ptr nullptr, check invalid");
__FUNCTION__);
GELOGE(GE_GRAPH_PARAM_NULLPTR, "[LoadGraph] GE load graph model_ptr is nullptr."); GELOGE(GE_GRAPH_PARAM_NULLPTR, "[LoadGraph] GE load graph model_ptr is nullptr.");
return GE_GRAPH_PARAM_NULLPTR; return GE_GRAPH_PARAM_NULLPTR;
} }
@ -75,8 +74,8 @@ Status GraphLoader::LoadModelOnline(uint32_t &model_id, const std::shared_ptr<ge
rt_ret = rtDeviceReset(GetContext().DeviceId()); rt_ret = rtDeviceReset(GetContext().DeviceId());
if (rt_ret != RT_ERROR_NONE) { if (rt_ret != RT_ERROR_NONE) {
REPORT_CALL_ERROR("E19999", "Call rtDeviceReset failed, device_id:%u, ret:0x%X, when GraphLoader %s", REPORT_CALL_ERROR("E19999", "Call rtDeviceReset failed, device_id:%u, ret:0x%X",
GetContext().DeviceId(), rt_ret, __FUNCTION__); GetContext().DeviceId(), rt_ret);
GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret);
} }
return ret; return ret;
@ -90,8 +89,8 @@ Status GraphLoader::LoadModelOnline(uint32_t &model_id, const std::shared_ptr<ge
rt_ret = rtDeviceReset(GetContext().DeviceId()); rt_ret = rtDeviceReset(GetContext().DeviceId());
if (rt_ret != RT_ERROR_NONE) { if (rt_ret != RT_ERROR_NONE) {
REPORT_CALL_ERROR("E19999", "Call rtDeviceReset failed, device_id:%u, ret:0x%X, when GraphLoader %s", REPORT_CALL_ERROR("E19999", "Call rtDeviceReset failed, device_id:%u, ret:0x%X",
GetContext().DeviceId(), rt_ret, __FUNCTION__); GetContext().DeviceId(), rt_ret);
GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret);
} }
@ -101,8 +100,8 @@ Status GraphLoader::LoadModelOnline(uint32_t &model_id, const std::shared_ptr<ge
} }
rt_ret = rtDeviceReset(GetContext().DeviceId()); rt_ret = rtDeviceReset(GetContext().DeviceId());
if (rt_ret != RT_ERROR_NONE) { if (rt_ret != RT_ERROR_NONE) {
REPORT_CALL_ERROR("E19999", "Call rtDeviceReset failed, device_id:%u, ret:0x%X, when GraphLoader %s", REPORT_CALL_ERROR("E19999", "Call rtDeviceReset failed, device_id:%u, ret:0x%X",
GetContext().DeviceId(), rt_ret, __FUNCTION__); GetContext().DeviceId(), rt_ret);
GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret);
return RT_FAILED; return RT_FAILED;
} }
@ -131,8 +130,8 @@ Status GraphLoader::LoadDataFromFile(const std::string &path, const std::string
GELOGI("Load model begin, model path is: %s", path.c_str()); GELOGI("Load model begin, model path is: %s", path.c_str());
if (!key_path.empty() && !CheckInputPathValid(key_path)) { if (!key_path.empty() && !CheckInputPathValid(key_path)) {
REPORT_INNER_ERROR("E19999", "Param key_path:%s empty or invalid, when GraphLoader %s", REPORT_INNER_ERROR("E19999", "Param key_path:%s empty or invalid",
key_path.c_str(), __FUNCTION__); key_path.c_str());
GELOGE(ACL_ERROR_GE_PARAM_INVALID, "decrypt_key path is invalid: %s", key_path.c_str()); GELOGE(ACL_ERROR_GE_PARAM_INVALID, "decrypt_key path is invalid: %s", key_path.c_str());
return ACL_ERROR_GE_PARAM_INVALID; return ACL_ERROR_GE_PARAM_INVALID;
} }
@ -159,12 +158,12 @@ Status GraphLoader::CommandHandle(const Command &command) {
return ret; return ret;
} }
} catch (std::bad_alloc &) { } catch (std::bad_alloc &) {
REPORT_INNER_ERROR("E19999", "Bad memory allocation occur when GraphLoader %s", __FUNCTION__); REPORT_INNER_ERROR("E19999", "Bad memory allocation occur");
GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "Command handle failed, bad memory allocation occur !"); GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "Command handle failed, bad memory allocation occur !");
return ACL_ERROR_GE_MEMORY_ALLOCATION; return ACL_ERROR_GE_MEMORY_ALLOCATION;
} catch (...) { } catch (...) {
REPORT_INNER_ERROR("E19999", "Some exceptions occur when GraphLoader %s", __FUNCTION__); REPORT_INNER_ERROR("E19999", "Some exceptions occur");
GELOGE(FAILED, "Command handle failed, some exceptions occur !"); GELOGE(FAILED, "Command handle failed, some exceptions occur !");
return FAILED; return FAILED;
@ -246,8 +245,8 @@ Status GraphLoader::ExecuteModel(uint32_t model_id, rtStream_t stream, bool asyn
Status GraphLoader::GetMemoryInfo(int64_t &free) { Status GraphLoader::GetMemoryInfo(int64_t &free) {
rtError_t rt_ret = rtSetDevice(GetContext().DeviceId()); rtError_t rt_ret = rtSetDevice(GetContext().DeviceId());
if (rt_ret != RT_ERROR_NONE) { if (rt_ret != RT_ERROR_NONE) {
REPORT_CALL_ERROR("E19999", "Call rtSetDevice failed, device_id:%u, ret:0x%X, when GraphLoader %s", REPORT_CALL_ERROR("E19999", "Call rtSetDevice failed, device_id:%u, ret:0x%X",
GetContext().DeviceId(), rt_ret, __FUNCTION__); GetContext().DeviceId(), rt_ret);
GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret);
CsaInteract::GetInstance().WriteErrorCode(rt_ret, ERROR_MODULE_RUNTIME, JOBSUBSTATE_GRAPH_LOAD); CsaInteract::GetInstance().WriteErrorCode(rt_ret, ERROR_MODULE_RUNTIME, JOBSUBSTATE_GRAPH_LOAD);
return RT_FAILED; return RT_FAILED;
@ -256,14 +255,14 @@ Status GraphLoader::GetMemoryInfo(int64_t &free) {
size_t free_mem = 0; size_t free_mem = 0;
rt_ret = rtMemGetInfo(&free_mem, &total_mem); rt_ret = rtMemGetInfo(&free_mem, &total_mem);
if (rt_ret != RT_ERROR_NONE) { if (rt_ret != RT_ERROR_NONE) {
REPORT_CALL_ERROR("E19999", "Call rtMemGetInfo failed, ret:0x%X, when GraphLoader %s", rt_ret, __FUNCTION__); REPORT_CALL_ERROR("E19999", "Call rtMemGetInfo failed, ret:0x%X", rt_ret);
GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret);
return RT_FAILED; return RT_FAILED;
} }
rt_ret = rtDeviceReset(GetContext().DeviceId()); rt_ret = rtDeviceReset(GetContext().DeviceId());
if (rt_ret != RT_ERROR_NONE) { if (rt_ret != RT_ERROR_NONE) {
REPORT_CALL_ERROR("E19999", "Call rtDeviceReset failed, device_id:%u, ret:0x%X, when GraphLoader %s", REPORT_CALL_ERROR("E19999", "Call rtDeviceReset failed, device_id:%u, ret:0x%X",
GetContext().DeviceId(), rt_ret, __FUNCTION__); GetContext().DeviceId(), rt_ret);
GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret);
return RT_FAILED; return RT_FAILED;
} }

File diff suppressed because it is too large Load Diff

@ -325,7 +325,7 @@ Status DataDumper::GenerateOutput(aicpu::dump::Output &output, const OpDesc::Vis
} }
int64_t output_size = 0; int64_t output_size = 0;
if (TensorUtils::GetTensorSizeInBytes(tensor_descs.at(index), output_size) != SUCCESS) { 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"); GELOGE(PARAM_INVALID, "Get output size filed");
return PARAM_INVALID; 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 auto &output_descs = inner_dump_info.op->GetAllOutputsDesc();
const std::vector<void *> output_addrs = ModelUtils::GetOutputDataAddrs(*runtime_param_, inner_dump_info.op); const std::vector<void *> output_addrs = ModelUtils::GetOutputDataAddrs(*runtime_param_, inner_dump_info.op);
if (output_descs.size() != output_addrs.size()) { 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(), 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(), 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()); inner_dump_info.op->GetName().c_str(), output_descs.size());
return PARAM_INVALID; 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); GELOGI("[L1Fusion] DumpOutputWithTask[%s] output[%zu] is l1 addr.", inner_dump_info.op->GetName().c_str(), i);
int64_t output_size = 0; int64_t output_size = 0;
if (TensorUtils::GetTensorSizeInBytes(output_descs.at(i), output_size) != SUCCESS) { 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", 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, inner_dump_info.op->GetName().c_str(), inner_dump_info.op->GetType().c_str(), i);
__FUNCTION__);
GELOGE(PARAM_INVALID, "Get output size failed."); GELOGE(PARAM_INVALID, "Get output size failed.");
return PARAM_INVALID; return PARAM_INVALID;
} }
@ -446,9 +445,9 @@ Status DataDumper::DumpOutput(const InnerDumpInfo &inner_dump_info, aicpu::dump:
const std::vector<void *> output_addrs = ModelUtils::GetOutputDataAddrs(*runtime_param_, inner_dump_info.op); const std::vector<void *> output_addrs = ModelUtils::GetOutputDataAddrs(*runtime_param_, inner_dump_info.op);
if (output_tensor == nullptr) { if (output_tensor == nullptr) {
REPORT_INNER_ERROR("E19999", "output_desc tensor is nullptr in op:%s(%s), index:%u, " 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.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, GELOGE(PARAM_INVALID, "output_tensor is null, index: %d, size: %zu.", inner_dump_info.output_anchor_index,
inner_dump_info.op->GetOutputsSize()); inner_dump_info.op->GetOutputsSize());
return PARAM_INVALID; 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 // due to lhisi virtual addr bug, cannot use args now
if (inner_dump_info.output_anchor_index >= static_cast<int>(output_addrs.size())) { if (inner_dump_info.output_anchor_index >= static_cast<int>(output_addrs.size())) {
REPORT_INNER_ERROR("E19999", "output_anchor_index:%u >= output addr size:%zu in op:%s(%s), " 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(), "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(), __FUNCTION__); inner_dump_info.op->GetName().c_str(), inner_dump_info.op->GetType().c_str());
GELOGE(FAILED, "Index is out of range."); GELOGE(FAILED, "Index is out of range.");
return FAILED; 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)) { 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); GELOGI("Get aipp input size according to attr is %ld", input_size);
} else if (TensorUtils::GetTensorSizeInBytes(tensor_descs.at(index), input_size) != SUCCESS) { } 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"); GELOGE(PARAM_INVALID, "Get input size filed");
return PARAM_INVALID; 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 auto &input_descs = inner_dump_info.op->GetAllInputsDesc();
const std::vector<void *> input_addrs = ModelUtils::GetInputDataAddrs(*runtime_param_, inner_dump_info.op); const std::vector<void *> input_addrs = ModelUtils::GetInputDataAddrs(*runtime_param_, inner_dump_info.op);
if (input_descs.size() != input_addrs.size()) { 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(), 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(), 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()); inner_dump_info.op->GetName().c_str(), input_descs.size());
return PARAM_INVALID; 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)) { 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); GELOGI("Get aipp input size according to attr is %ld", input_size);
} else if (TensorUtils::GetTensorSizeInBytes(input_descs.at(i), input_size) != SUCCESS) { } 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", 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, inner_dump_info.op->GetName().c_str(), inner_dump_info.op->GetType().c_str(), i);
__FUNCTION__);
GELOGE(PARAM_INVALID, "Get input size failed."); GELOGE(PARAM_INVALID, "Get input size failed.");
return PARAM_INVALID; return PARAM_INVALID;
} }
@ -616,7 +614,7 @@ Status DataDumper::ExecuteLoadDumpInfo(aicpu::dump::OpMappingInfo &op_mapping_in
size_t proto_size = op_mapping_info.ByteSizeLong(); size_t proto_size = op_mapping_info.ByteSizeLong();
bool ret = op_mapping_info.SerializeToString(&proto_str); bool ret = op_mapping_info.SerializeToString(&proto_str);
if (!ret || proto_size == 0) { 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); GELOGE(PARAM_INVALID, "Protobuf SerializeToString failed, proto size %zu.", proto_size);
return PARAM_INVALID; 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); rtError_t rt_ret = rtMalloc(&dev_mem_load_, proto_size, RT_MEMORY_HBM);
if (rt_ret != RT_ERROR_NONE) { if (rt_ret != RT_ERROR_NONE) {
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%zu, ret:0x%X, when DataDumper %s", REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%zu, ret:0x%X",
proto_size, rt_ret, __FUNCTION__); proto_size, rt_ret);
GELOGE(RT_FAILED, "Call rtMalloc failed, ret: 0x%X", rt_ret); GELOGE(RT_FAILED, "Call rtMalloc failed, ret: 0x%X", rt_ret);
return RT_ERROR_TO_GE_STATUS(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); 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) { if (rt_ret != RT_ERROR_NONE) {
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret:0x%X, when DataDumper %s", REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret:0x%X",
proto_size, rt_ret, __FUNCTION__); proto_size, rt_ret);
GELOGE(RT_FAILED, "Call rtMemcpy failed, ret: 0x%X", rt_ret); GELOGE(RT_FAILED, "Call rtMemcpy failed, ret: 0x%X", rt_ret);
return RT_ERROR_TO_GE_STATUS(rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret);
} }
rt_ret = rtDatadumpInfoLoad(dev_mem_load_, proto_size); rt_ret = rtDatadumpInfoLoad(dev_mem_load_, proto_size);
if (rt_ret != RT_ERROR_NONE) { 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); GELOGE(RT_FAILED, "Call rtDatadumpInfoLoad failed, ret: 0x%X", rt_ret);
return RT_ERROR_TO_GE_STATUS(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(); size_t proto_size = op_mapping_info.ByteSizeLong();
bool ret = op_mapping_info.SerializeToString(&proto_str); bool ret = op_mapping_info.SerializeToString(&proto_str);
if (!ret || proto_size == 0) { 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); GELOGE(PARAM_INVALID, "Protobuf SerializeToString failed, proto size %zu.", proto_size);
return PARAM_INVALID; 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); rtError_t rt_ret = rtMalloc(&dev_mem_unload_, proto_size, RT_MEMORY_HBM);
if (rt_ret != RT_ERROR_NONE) { if (rt_ret != RT_ERROR_NONE) {
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%zu, ret:0x%X, when DataDumper %s", REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%zu, ret:0x%X",
proto_size, rt_ret, __FUNCTION__); proto_size, rt_ret);
GELOGE(RT_FAILED, "Call rtMalloc failed, ret: 0x%X", rt_ret); GELOGE(RT_FAILED, "Call rtMalloc failed, ret: 0x%X", rt_ret);
return RT_ERROR_TO_GE_STATUS(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); 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) { if (rt_ret != RT_ERROR_NONE) {
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret:0x%X, when DataDumper %s", REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret:0x%X",
proto_size, rt_ret, __FUNCTION__); proto_size, rt_ret);
GELOGE(RT_FAILED, "Call rtMemcpy failed, ret: 0x%X", rt_ret); GELOGE(RT_FAILED, "Call rtMemcpy failed, ret: 0x%X", rt_ret);
return RT_ERROR_TO_GE_STATUS(rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret);
} }
rt_ret = rtDatadumpInfoLoad(dev_mem_unload_, proto_size); rt_ret = rtDatadumpInfoLoad(dev_mem_unload_, proto_size);
if (rt_ret != RT_ERROR_NONE) { 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); GELOGE(RT_FAILED, "Call rtDatadumpInfoLoad failed, ret: 0x%X", rt_ret);
return RT_ERROR_TO_GE_STATUS(rt_ret); return RT_ERROR_TO_GE_STATUS(rt_ret);
} }
@ -974,7 +972,7 @@ Status DataDumper::DumpExceptionInfo(const std::vector<rtExceptionInfo> exceptio
std::unique_ptr<char[]> proto_msg(new (std::nothrow) char[proto_size]); std::unique_ptr<char[]> proto_msg(new (std::nothrow) char[proto_size]);
bool ret = dump_data.SerializeToArray(proto_msg.get(), proto_size); bool ret = dump_data.SerializeToArray(proto_msg.get(), proto_size);
if (!ret || proto_size == 0) { 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"); GELOGE(PARAM_INVALID, "Dump data proto serialize failed");
return PARAM_INVALID; return PARAM_INVALID;
} }

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -26,8 +26,8 @@
do { \ do { \
if (SIZE <= static_cast<uint64_t>(OFFSET)) { \ if (SIZE <= static_cast<uint64_t>(OFFSET)) { \
REPORT_INNER_ERROR("E19999", \ REPORT_INNER_ERROR("E19999", \
"Node:%s(%s) offset:%ld out of range size:%lu, check invalid when ModelUtils %s", \ "Node:%s(%s) offset:%ld out of range size:%lu, check invalid", \
OP->GetName().c_str(), OP->GetType().c_str(), OFFSET, SIZE, __FUNCTION__); \ 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); \ GELOGE(OUT_OF_MEMORY, "Node: %s, memory out of range[%lu: %ld]", OP->GetName().c_str(), SIZE, OFFSET); \
return {}; \ return {}; \
} \ } \
@ -308,9 +308,9 @@ vector<void *> ModelUtils::GetInputDataAddrs(const RuntimeParam &model_param, Co
vector<int64_t> v_memory_type; vector<int64_t> v_memory_type;
bool has_mem_type_attr = ge::AttrUtils::GetListInt(op_desc, ATTR_NAME_INPUT_MEM_TYPE_LIST, 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)) { 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 " 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, 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__); 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", 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); op_desc->GetName().c_str(), v_memory_type.size(), inputs_size);
return v_input_data_addr; return v_input_data_addr;
@ -390,7 +390,7 @@ Status ModelUtils::GetVarAddr(const RuntimeParam &model_param, const ConstOpDesc
switch (mem_type) { switch (mem_type) {
case RT_MEMORY_RDMA_HBM: case RT_MEMORY_RDMA_HBM:
if (offset < 0) { 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", GELOGE(PARAM_INVALID, "rdma var addr is invalid, addr=%p",
reinterpret_cast<uint8_t *>(static_cast<uintptr_t>(offset))); reinterpret_cast<uint8_t *>(static_cast<uintptr_t>(offset)));
return PARAM_INVALID; 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; var_addr = model_param.var_base + offset - model_param.logic_var_base;
break; break;
default: default:
REPORT_INNER_ERROR("E19999", "Get mem_type:%d for offset:%ld is unsupported, check invalid when ModelUtils %s", REPORT_INNER_ERROR("E19999", "Get mem_type:%d for offset:%ld is unsupported, check invalid",
mem_type, offset, __FUNCTION__); mem_type, offset);
GELOGE(PARAM_INVALID, "unsupported memory type %u", mem_type); GELOGE(PARAM_INVALID, "unsupported memory type %u", mem_type);
return PARAM_INVALID; return PARAM_INVALID;
} }
@ -429,9 +429,9 @@ vector<void *> ModelUtils::GetOutputDataAddrs(const RuntimeParam &model_param, C
vector<int64_t> v_memory_type; vector<int64_t> v_memory_type;
bool has_mem_type_attr = ge::AttrUtils::GetListInt(op_desc, ATTR_NAME_OUTPUT_MEM_TYPE_LIST, 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)) { 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 " 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, 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__); op_desc->GetName().c_str(), op_desc->GetType().c_str());
GELOGE(PARAM_INVALID, GELOGE(PARAM_INVALID,
"Fusion: check output size failed, op: %s, output v_memory_type size: %lu output numbers: %zu", "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); op_desc->GetName().c_str(), v_memory_type.size(), outputs_size);
@ -580,7 +580,7 @@ Status ModelUtils::GetRtAddress(const RuntimeParam &param, uintptr_t logic_addr,
param.var_size); param.var_size);
} else if (logic_addr != 0) { } else if (logic_addr != 0) {
mem_addr = nullptr; 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); GELOGE(PARAM_INVALID, "The logic addr:0x%lx is abnormal", logic_addr);
return PARAM_INVALID; return PARAM_INVALID;
} }

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save