@@ -111,8 +111,8 @@ Status FileSaver::SaveWithFileHeader(const std::string &file_path, const ModelFi | |||
} while (0); | |||
// Close file | |||
if (mmClose(fd) != 0) { // mmClose 0: success | |||
GELOGE(FAILED, "[Close][File]Failed, error_code:%u.", ret); | |||
REPORT_INNER_ERROR("E19999", "Close file failed, error_code:%u.", ret); | |||
GELOGE(FAILED, "[Close][File]Failed, error_code:%u errmsg:%s", ret, strerror(errno)); | |||
REPORT_INNER_ERROR("E19999", "Close file failed, error_code:%u errmsg:%s", ret, strerror(errno)); | |||
ret = FAILED; | |||
} | |||
return ret; | |||
@@ -148,7 +148,11 @@ Status FileSaver::SaveWithFileHeader(const std::string &file_path, const ModelFi | |||
} | |||
} while (0); | |||
// Close file | |||
GE_CHK_BOOL_RET_STATUS(mmClose(fd) == EN_OK, FAILED, "Close file failed."); | |||
if (mmClose(fd) != EN_OK) { | |||
GELOGE(FAILED, "[Close][File]Failed, error_code:%u errmsg:%s", ret, strerror(errno)); | |||
REPORT_INNER_ERROR("E19999", "Close file failed, error_code:%u errmsg:%s", ret, strerror(errno)); | |||
ret = FAILED; | |||
} | |||
return ret; | |||
} | |||
@@ -346,7 +350,7 @@ Status FileSaver::SaveWithFileHeader(const std::string &file_path, const ModelFi | |||
// Write partition data | |||
auto &cur_partition_datas = all_partition_datas[index]; | |||
for (const auto &partition_data : cur_partition_datas) { | |||
GELOGI("GC:size[%u]", partition_data.size); | |||
GELOGI("part_size[%u]", partition_data.size); | |||
GE_CHK_BOOL_TRUE_EXEC_WITH_LOG( | |||
WriteData(static_cast<const void *>(partition_data.data), partition_data.size, fd) != SUCCESS, ret = FAILED; | |||
break); | |||
@@ -354,7 +358,11 @@ Status FileSaver::SaveWithFileHeader(const std::string &file_path, const ModelFi | |||
} | |||
} while (0); | |||
// Close file | |||
GE_CHK_BOOL_RET_STATUS(mmClose(fd) == EN_OK, FAILED, "Close file failed."); | |||
if (mmClose(fd) != 0) { // mmClose 0: success | |||
GELOGE(FAILED, "[Close][File]Failed, error_code:%u errmsg:%s", ret, strerror(errno)); | |||
REPORT_INNER_ERROR("E19999", "Close file failed, error_code:%u errmsg:%s", ret, strerror(errno)); | |||
ret = FAILED; | |||
} | |||
return ret; | |||
} | |||
@@ -377,8 +385,8 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status FileSaver::SaveToFile(co | |||
// Close file | |||
if (mmClose(fd) != 0) { // mmClose 0: success | |||
GELOGE(FAILED, "[Close][File]Failed, error_code:%u.", ret); | |||
REPORT_INNER_ERROR("E19999", "Close file failed, error_code:%u.", ret); | |||
GELOGE(FAILED, "[Close][File]Failed, error_code:%u errmsg:%s", ret, strerror(errno)); | |||
REPORT_INNER_ERROR("E19999", "Close file failed, error_code:%u errmsg:%s", ret, strerror(errno)); | |||
ret = FAILED; | |||
} | |||
return ret; | |||
@@ -77,7 +77,7 @@ Status HandleSubgraphNode(NodePtr &src_node, OutDataAnchorPtr &src_out_anchor) { | |||
Status HandleSubgraphDataNode(NodePtr &src_node, OutDataAnchorPtr &src_out_anchor) { | |||
uint32_t index = 0; | |||
if (!AttrUtils::GetInt(src_node->GetOpDesc(), ATTR_NAME_PARENT_NODE_INDEX, index)) { | |||
REPORT_INNER_ERROR("E19999", "get attr:%s failed from node:%s when HandleSubgraphDataNode", | |||
REPORT_INNER_ERROR("E19999", "get attr:%s failed from node:%s", | |||
ATTR_NAME_PARENT_NODE_INDEX.c_str(), src_node->GetName().c_str()); | |||
GELOGE(FAILED, "Get attr ATTR_NAME_PARENT_NODE_INDEX failed, node:%s.", src_node->GetName().c_str()); | |||
return FAILED; | |||
@@ -111,7 +111,7 @@ Status GraphBuilder::CalcOpParam(const ge::ComputeGraphPtr &graph) { | |||
GE_CHECK_NOTNULL(graph); | |||
auto instance_ptr = ge::GELib::GetInstance(); | |||
if (instance_ptr == nullptr || !instance_ptr->InitFlag()) { | |||
REPORT_INNER_ERROR("E19999", "check gelib instance null when CalcOpParam for graph:%s", | |||
REPORT_INNER_ERROR("E19999", "check gelib instance null, graph:%s", | |||
graph->GetName().c_str()); | |||
GELOGE(GE_CLI_GE_NOT_INITIALIZED, "GraphBuilder: GE is not initialized"); | |||
return GE_CLI_GE_NOT_INITIALIZED; | |||
@@ -125,7 +125,7 @@ Status GraphBuilder::CalcOpParam(const ge::ComputeGraphPtr &graph) { | |||
(void)instance_ptr->DNNEngineManagerObj().GetDNNEngineName(node_ptr); | |||
kernel_lib_name = node_ptr->GetOpDesc()->GetOpKernelLibName(); | |||
if (kernel_lib_name.empty()) { | |||
REPORT_INNER_ERROR("E19999", "op kernel lib is empty in node:%s(%s) when CalcOpParam", | |||
REPORT_INNER_ERROR("E19999", "op kernel lib is empty in node:%s(%s)", | |||
node_ptr->GetName().c_str(), node_ptr->GetType().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Get node:%s(%s) kernel lib failed.", node_ptr->GetName().c_str(), | |||
node_ptr->GetType().c_str()); | |||
@@ -135,7 +135,7 @@ Status GraphBuilder::CalcOpParam(const ge::ComputeGraphPtr &graph) { | |||
auto ret = SetInputSize(node_ptr); | |||
if (ret != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Set node:%s(%s) inputDesc size failed when CalcOpParam", | |||
REPORT_CALL_ERROR("E19999", "Set node:%s(%s) inputDesc size failed", | |||
node_ptr->GetName().c_str(), node_ptr->GetType().c_str()); | |||
GELOGE(ret, "Set node inputDesc size failed, node name is %s", node_ptr->GetName().c_str()); | |||
return ret; | |||
@@ -201,7 +201,7 @@ Status GraphBuilder::UpdateParentNodeOutputSize(const ge::ComputeGraphPtr &graph | |||
Status GraphBuilder::Build(ComputeGraphPtr &comp_graph, GeRootModelPtr &ge_root_model_ptr, uint64_t session_id) { | |||
if (comp_graph == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "check compute_graph nullptr when BuildGraph, session_id:%lu", session_id); | |||
REPORT_INNER_ERROR("E19999", "check compute_graph nullptr, session_id:%lu", session_id); | |||
GELOGE(GE_GRAPH_PARAM_NULLPTR, "Graph build comp_graph is null."); | |||
return GE_GRAPH_PARAM_NULLPTR; | |||
} | |||
@@ -313,7 +313,7 @@ Status GraphBuilder::SetConstantInputOffset(ComputeGraphPtr &comp_graph) { | |||
std::vector<GeTensorPtr> weights = OpDescUtils::MutableWeights(peer_node); | |||
if (weights.empty()) { | |||
REPORT_INNER_ERROR("E19999", "check weights size of node %s(%s) is empty when SetConstantInputOffset", | |||
REPORT_INNER_ERROR("E19999", "check weights size of node %s(%s) is empty", | |||
node->GetName().c_str(), node->GetType().c_str()); | |||
GELOGE(FAILED, "weights size of node %s is empty", node->GetName().c_str()); | |||
return FAILED; | |||
@@ -649,7 +649,7 @@ Status GraphBuilder::SetInputSize(const ge::NodePtr &node_ptr) { | |||
Status GraphBuilder::UpdateDataInputSize(const ge::NodePtr &node_ptr) { | |||
const auto &op_desc = node_ptr->GetOpDesc(); | |||
if (op_desc == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "check op_desc is nullptr when UpdateDataInputSize"); | |||
REPORT_INNER_ERROR("E19999", "check op_desc is nullptr"); | |||
GELOGE(FAILED, "Op desc is nullptr."); | |||
return FAILED; | |||
} | |||
@@ -667,7 +667,7 @@ Status GraphBuilder::UpdateDataInputSize(const ge::NodePtr &node_ptr) { | |||
int64_t real_dim_size = 0; | |||
ge::graphStatus graph_status = TensorUtils::GetTensorSizeInBytes(output_desc, real_dim_size); | |||
if (graph_status != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Get tensor size in bytes failed for op:%s(%s) index:0 when UpdateDataInputSize", | |||
REPORT_CALL_ERROR("E19999", "Get tensor size in bytes failed for op:%s(%s) index:0", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(FAILED, "Get tensor size in bytes failed."); | |||
return FAILED; | |||
@@ -676,7 +676,7 @@ Status GraphBuilder::UpdateDataInputSize(const ge::NodePtr &node_ptr) { | |||
ge::GeTensorDesc input_desc = op_desc->GetInputDesc(0); | |||
ge::TensorUtils::SetSize(input_desc, real_dim_size); | |||
if (op_desc->UpdateInputDesc(0, input_desc) != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Update input desc size failed for op:%s(%s) index:0 when UpdateDataInputSize", | |||
REPORT_CALL_ERROR("E19999", "Update input desc size failed for op:%s(%s) index:0", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(FAILED, "Update input desc size failed."); | |||
return FAILED; | |||
@@ -706,8 +706,7 @@ Status GraphBuilder::CalcDynShapeRootGraphDataSize(const ge::OpDescPtr &op_desc) | |||
int64_t real_dim_size = 0; | |||
ge::graphStatus graph_status = TensorUtils::GetTensorSizeInBytes(output_desc, real_dim_size); | |||
if (graph_status != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Get tensor size in bytes failed for op:%s(%s) index:0 " | |||
"when CalcDynShapeRootGraphDataSize", | |||
REPORT_CALL_ERROR("E19999", "Get tensor size in bytes failed for op:%s(%s) index:0 ", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(FAILED, "Get tensor size in bytes failed."); | |||
return FAILED; | |||
@@ -716,8 +715,7 @@ Status GraphBuilder::CalcDynShapeRootGraphDataSize(const ge::OpDescPtr &op_desc) | |||
ge::TensorUtils::SetSize(output_desc, real_dim_size); | |||
GELOGI("Update dynamic shape graph data output size to [%ld].", real_dim_size); | |||
if (op_desc->UpdateOutputDesc(0, output_desc) != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Update output desc size failed for op:%s(%s) index:0 " | |||
"when CalcDynShapeRootGraphDataSize", | |||
REPORT_CALL_ERROR("E19999", "Update output desc size failed for op:%s(%s) index:0 ", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(FAILED, "Update dynamic shape graph data output desc size failed."); | |||
return FAILED; | |||
@@ -736,7 +734,7 @@ Status GraphBuilder::SecondPartition(ge::ComputeGraphPtr &comp_graph) { | |||
GE_CHK_STATUS_RET(ret, "Graph partition Failed."); | |||
const auto &graph_2_subgraphlist = graph_partitioner_.GetSubGraphMap(); | |||
if (graph_2_subgraphlist.find(comp_graph) == graph_2_subgraphlist.end()) { | |||
REPORT_INNER_ERROR("E19999", "find subgraphlis in graph:%s failed when SecondPartition", | |||
REPORT_INNER_ERROR("E19999", "find subgraphlis in graph:%s failed", | |||
comp_graph->GetName().c_str()); | |||
GELOGE(FAILED, "Find subgraph failed."); | |||
return FAILED; | |||
@@ -766,7 +764,7 @@ Status GraphBuilder::AddOutputMemTypeForNode(const NodePtr &node) { | |||
mem_type); | |||
if (!AttrUtils::SetInt(src_desc->MutableOutputDesc(src_out_anchor->GetIdx()), ATTR_OUTPUT_MEMORY_TYPE, | |||
mem_type)) { | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s for node:%s(%s) out_index:%u failed when AddOutputMemTypeForNode", | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s for node:%s(%s) out_index:%u failed", | |||
ATTR_OUTPUT_MEMORY_TYPE.c_str(), src_desc->GetName().c_str(), src_desc->GetType().c_str(), | |||
src_out_anchor->GetIdx()); | |||
GELOGE(INTERNAL_ERROR, "Set out_memory_type attr for [%s:%d] failed.", src_desc->GetName().c_str(), | |||
@@ -28,7 +28,7 @@ LabelAllocator::LabelAllocator(const ComputeGraphPtr &graph) : compute_graph_(gr | |||
Status LabelAllocator::AssignFunctionalLabels() { | |||
if (compute_graph_ == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "check param compute_graph nullptr when AssignFunctionalLabels"); | |||
REPORT_INNER_ERROR("E19999", "check param compute_graph nullptr"); | |||
GELOGE(INTERNAL_ERROR, "ComputeGraph not set, Assign labels failed."); | |||
return INTERNAL_ERROR; | |||
} | |||
@@ -47,14 +47,14 @@ Status LabelAllocator::AssignFunctionalLabels() { | |||
for (auto node : functional_nodes) { | |||
LabelMakerPtr maker = LabelMakerFactory::Instance().Create(node->GetType(), compute_graph_, node); | |||
if (maker == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "Check Node:%s(%s) label maker not registed when AssignFunctionalLabels", | |||
REPORT_CALL_ERROR("E19999", "Check Node:%s(%s) label maker not registed", | |||
node->GetName().c_str(), node->GetType().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Node: %s label maker not registed.", node->GetType().c_str()); | |||
return INTERNAL_ERROR; | |||
} | |||
if (maker->Run(label_index) != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Node:%s(%s) run label maker failed when AssignFunctionalLabels", | |||
REPORT_CALL_ERROR("E19999", "Node:%s(%s) run label maker failed", | |||
node->GetName().c_str(), node->GetType().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Node: %s run label maker failed.", node->GetType().c_str()); | |||
return INTERNAL_ERROR; | |||
@@ -68,7 +68,7 @@ Status LabelAllocator::AssignFunctionalLabels() { | |||
bool LabelAllocator::CollectFunctionalNode(ComputeGraphPtr &graph, std::set<NodePtr> &functional_nodes) { | |||
if (graph == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "check param compute_graph nullptr when CollectFunctionalNode"); | |||
REPORT_INNER_ERROR("E19999", "check param compute_graph nullptr"); | |||
GELOGE(INTERNAL_ERROR, "Sub ComputeGraph is null."); | |||
return false; | |||
} | |||
@@ -339,8 +339,8 @@ Status NodeStreamUpdatePass::Run(ComputeGraphPtr graph, const vector<SubgraphPtr | |||
const string &engine_name = subgraph->engine_conf.id; | |||
if (!IsEngineSkip(*subgraph) && !HasAssignedStream(*subgraph)) { | |||
REPORT_INNER_ERROR("E19999", "Subgraph %s has not yet been assigned a stream (engine: %s) " | |||
" when run NodeStreamUpdatePass", subgraph->name.c_str(), engine_name.c_str()); | |||
REPORT_INNER_ERROR("E19999", "Subgraph %s has not yet been assigned a stream (engine: %s)", | |||
subgraph->name.c_str(), engine_name.c_str()); | |||
GELOGE(INTERNAL_ERROR, "Subgraph %s has not yet been assigned a stream (engine: %s).", subgraph->name.c_str(), | |||
engine_name.c_str()); | |||
return INTERNAL_ERROR; | |||
@@ -681,7 +681,7 @@ Status LogicalStreamAllocator::ConvertSubgraphs(const vector<SubGraphInfoPtr> &s | |||
const string &engine_name = subgraph_info->GetEngineName(); | |||
auto engine_conf_iter = engine_confs.find(engine_name); | |||
if ((engine_conf_iter == engine_confs.end()) || (engine_conf_iter->second == nullptr)) { | |||
REPORT_INNER_ERROR("E19999", "Engine conf of subgraph %s not found (engine name: %s) when ConvertSubgraphs", | |||
REPORT_INNER_ERROR("E19999", "Engine conf of subgraph %s not found (engine name: %s)", | |||
subgraph_name.c_str(), engine_name.c_str()); | |||
GELOGE(INTERNAL_ERROR, "Engine conf of subgraph %s not found (engine name: %s).", subgraph_name.c_str(), | |||
engine_name.c_str()); | |||
@@ -119,7 +119,7 @@ Status GraphMemoryAssigner::AssignMemory() { | |||
if (variable_assigner == nullptr) { | |||
GELOGE(ge::FAILED, "[New][Object:VariableMemoryAssigner]graph_id:%u, graph_name:%s", | |||
compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); | |||
REPORT_CALL_ERROR("E19999", "New Object:VariableMemoryAssigner failed when assign graph memory, " | |||
REPORT_CALL_ERROR("E19999", "New Object:VariableMemoryAssigner failed, " | |||
"graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); | |||
return ge::FAILED; | |||
} | |||
@@ -141,7 +141,7 @@ ge::Status GraphMemoryAssigner::AssignVarAttr2Nodes() { | |||
if (variable_assigner == nullptr) { | |||
GELOGE(ge::FAILED, "[New][Object:VariableMemoryAssigner]graph_id:%u, graph_name:%s", | |||
compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); | |||
REPORT_CALL_ERROR("E19999", "New Object:VariableMemoryAssigner failed when assign graph memory, " | |||
REPORT_CALL_ERROR("E19999", "New Object:VariableMemoryAssigner failed, " | |||
"graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); | |||
return ge::FAILED; | |||
} | |||
@@ -157,7 +157,7 @@ ge::Status GraphMemoryAssigner::AssignMemory2HasRefAttrNode() { | |||
if (variable_assigner == nullptr) { | |||
GELOGE(ge::FAILED, "[New][Object:VariableMemoryAssigner]graph_id:%u, graph_name:%s", | |||
compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); | |||
REPORT_CALL_ERROR("E19999", "New Object:VariableMemoryAssigner failed when assign graph memory, " | |||
REPORT_CALL_ERROR("E19999", "New Object:VariableMemoryAssigner failed, " | |||
"graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); | |||
} | |||
if (variable_assigner->AssignMemory2HasRefAttrNode() != ge::SUCCESS) { | |||
@@ -172,7 +172,7 @@ ge::Status CalculateTensorRealSizeAndOutSize(const ge::ConstGeTensorDescPtr &out | |||
graphStatus graph_status = ge::TensorUtils::GetSize(*output_desc, out_size); | |||
if (graph_status != GRAPH_SUCCESS) { | |||
GELOGE(FAILED, "[Get][TensorSize]"); | |||
REPORT_INNER_ERROR("E19999", "Get tensor size failed when %s", __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Get tensor size failed"); | |||
return FAILED; | |||
} | |||
@@ -223,8 +223,8 @@ ge::Status CalculateTensorRealSizeAndOutSize(const ge::ConstGeTensorDescPtr &out | |||
Status GraphMemoryAssigner::ReAssignMemory(bool is_loop_graph, map<int64_t, size_t> &mem_type_to_offset) { | |||
if (memory_offset_.empty()) { | |||
REPORT_INNER_ERROR("E19999", "InnerData memory_offset_ empty, not expected when ReAssignMemory, " | |||
"graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); | |||
REPORT_INNER_ERROR("E19999", "InnerData memory_offset_ empty, not expected, graph_id:%u, graph_name:%s", | |||
compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); | |||
GELOGE(FAILED, "[Check][InnerData:memory_offset_]empty is not expected, " | |||
"graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); | |||
return ge::FAILED; | |||
@@ -261,8 +261,8 @@ Status GraphMemoryAssigner::ReAssignMemory(bool is_loop_graph, map<int64_t, 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()); | |||
if (priority_assigner == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "InnerData priority_assigner nullptr, not expected when AssignZeroCopyMemory, " | |||
"graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); | |||
REPORT_INNER_ERROR("E19999", "InnerData priority_assigner nullptr, not expected, graph_id:%u, graph_name:%s", | |||
compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); | |||
GELOGE(FAILED, "[Check][InnerData:priority_assigner]nullptr is invalid, " | |||
"graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); | |||
return ge::FAILED; | |||
@@ -286,8 +286,7 @@ Status GraphMemoryAssigner::AssignZeroCopyMemory(map<int64_t, size_t> &mem_offse | |||
zero_mem_copy_size = mem_offset[RT_MEMORY_HBM] - mem_offset_tmp; | |||
auto iter = memory_offset_.find(RT_MEMORY_HBM); | |||
if (iter == memory_offset_.end()) { | |||
REPORT_INNER_ERROR("E19999", "InnerData memory_offset_ does not have type[HBM], " | |||
"not expected when AssignZeroCopyMemory, " | |||
REPORT_INNER_ERROR("E19999", "InnerData memory_offset_ does not have type[HBM], not expected, " | |||
"graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); | |||
GELOGE(FAILED, "[Check][InnerData]memory_offset_ does not have memory type[HBM]" | |||
"graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); | |||
@@ -347,8 +346,7 @@ uint32_t GetContinuousMemoryType(const OpDescPtr &op_desc) { | |||
Status GetMemorySize(const OpDescPtr &op_desc, const ge::ConstGeTensorDescPtr &output_desc, uint32_t continuous_type, | |||
int64_t &tensor_size, int64_t &nopadding_size) { | |||
if ((op_desc == nullptr) || (output_desc == nullptr)) { | |||
REPORT_INNER_ERROR("E19999", "InnerData param op_desc or output_desc is nullptr, " | |||
"not expected when GetMemorySize"); | |||
REPORT_INNER_ERROR("E19999", "InnerData param op_desc or output_desc is nullptr, not expected"); | |||
GELOGE(FAILED, "[Check][Param]op_desc or output_desc is nullptr"); | |||
} | |||
tensor_size = 0; | |||
@@ -358,7 +356,7 @@ Status GetMemorySize(const OpDescPtr &op_desc, const ge::ConstGeTensorDescPtr &o | |||
int64_t attr_dim_index; | |||
bool get_attr_dim_flag = ge::AttrUtils::GetInt(op_desc, ATTR_NAME_REUSE_INPUT_ON_DIM_INDEX, attr_dim_index); | |||
if (!get_attr_dim_flag) { | |||
REPORT_INNER_ERROR("E19999", "Get Attr:%s failed when GetMemorySize, op_name:%s", | |||
REPORT_INNER_ERROR("E19999", "Get Attr:%s failed, op_name:%s", | |||
ATTR_NAME_REUSE_INPUT_ON_DIM_INDEX.c_str(), op_desc->GetName().c_str()); | |||
GELOGE(FAILED, "[Get][Attr:%s]fail for op_name:%s", | |||
ATTR_NAME_REUSE_INPUT_ON_DIM_INDEX.c_str(), op_desc->GetName().c_str()); | |||
@@ -475,8 +473,8 @@ Status GraphMemoryAssigner::ReAssignContinuousMemory(bool is_loop_graph) { | |||
nodes_stack.pop_back(); | |||
auto iter = node_2_continuous_type.find(node); | |||
if (iter == node_2_continuous_type.end()) { | |||
REPORT_INNER_ERROR("E19999", "Inner data error when process continuous memory alloc for node:%s, " | |||
"but has no continuous type", node->GetName().c_str()); | |||
REPORT_INNER_ERROR("E19999", "Get ContinuousType from node_2_continuous_type map failed for node:%s", | |||
node->GetName().c_str()); | |||
GELOGE(FAILED, "[Get][ContinuousType] find fail for node:%s", node->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -496,7 +494,7 @@ Status GraphMemoryAssigner::AssignContinuousInputMemory(const ge::NodePtr &node, | |||
auto iter = memory_offset_.find(memory_type); | |||
if (iter == memory_offset_.end()) { | |||
REPORT_INNER_ERROR("E19999", "find memory offset fail for mem_type:%ld, " | |||
"when assign continuous input memory for node:%s, ", memory_type, node->GetName().c_str()); | |||
"for node:%s, ", memory_type, node->GetName().c_str()); | |||
GELOGE(FAILED, "[Find][MemOffset]fail for mem_type:%ld, when AssignContinuousInputMemory for node:%s", | |||
memory_type, node->GetName().c_str()); | |||
return FAILED; | |||
@@ -511,7 +509,7 @@ Status GraphMemoryAssigner::AssignContinuousInputMemory(const ge::NodePtr &node, | |||
GE_CHECK_NOTNULL(op_desc); | |||
vector<int64_t> output_list_this = op_desc->GetOutputOffset(); | |||
if (output_list_this.empty()) { | |||
REPORT_INNER_ERROR("E19999", "No output offset in node :%s, not expected when assign continuous input memory", | |||
REPORT_INNER_ERROR("E19999", "No output offset in node :%s, not expected", | |||
node->GetName().c_str()); | |||
GELOGE(FAILED, "[Get][OutputOffset] empty is invalid, node:%s", node->GetName().c_str()); | |||
return FAILED; | |||
@@ -619,29 +617,26 @@ Status GraphMemoryAssigner::AssignContinuousInputMemory(const ge::NodePtr &node, | |||
Status GetFirstInputPeerOutOutputOffset(const ge::NodePtr &node, int64_t &mem_offset) { | |||
auto in_data_anchor_list = node->GetAllInDataAnchors(); | |||
if (in_data_anchor_list.empty()) { | |||
REPORT_INNER_ERROR("E19999", "InAnchor list empty in node:%s, not expect when GetFirstInputPeerOutOutputOffset", | |||
REPORT_INNER_ERROR("E19999", "InAnchor list empty in node:%s, not expect", | |||
node->GetName().c_str()); | |||
GELOGE(FAILED, "[Get][InAnchor]empty is invalid, node:%s", node->GetName().c_str()); | |||
return FAILED; | |||
} | |||
auto peer_out_data_anchor = in_data_anchor_list.at(0)->GetPeerOutAnchor(); | |||
GE_IF_BOOL_EXEC(peer_out_data_anchor == nullptr, | |||
REPORT_INNER_ERROR("E19999", "PeerAcnhor is null, " | |||
"not expect when GetFirstInputPeerOutOutputOffset for node:%s", | |||
REPORT_INNER_ERROR("E19999", "PeerAcnhor is null, not expect for node:%s", | |||
node->GetName().c_str()); | |||
GELOGE(ge::FAILED, "[Check][PeerAnchor]null is invalid, node:%s", node->GetName().c_str()); | |||
return ge::FAILED); | |||
auto peer_op_desc = peer_out_data_anchor->GetOwnerNode()->GetOpDesc(); | |||
GE_IF_BOOL_EXEC(peer_op_desc == nullptr, | |||
REPORT_INNER_ERROR("E19999", "PeerOpDesc is null, " | |||
"not expect when GetFirstInputPeerOutOutputOffset for node:%s", | |||
REPORT_INNER_ERROR("E19999", "PeerOpDesc is null, not expect for node:%s", | |||
node->GetName().c_str()); | |||
GELOGE(ge::FAILED, "[Check][PeerOpDesc]null is invalid, node:%s", node->GetName().c_str()); | |||
return ge::FAILED); | |||
vector<int64_t> in_node_output_offsets = peer_op_desc->GetOutputOffset(); | |||
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, " | |||
"judge invalid when GetFirstInputPeerOutOutputOffset for node:%s", | |||
REPORT_INNER_ERROR("E19999", "PeerAnchorIndex:%d bigger than in_offset size:%lu, judge invalid for node:%s", | |||
peer_out_data_anchor->GetIdx(), in_node_output_offsets.size(), node->GetName().c_str()); | |||
GELOGE(FAILED, "[Check][Index:PeerOutDataAnchor]PeerIndex:%d bigger than in_offset size:%lu, node:%s", | |||
peer_out_data_anchor->GetIdx(), in_node_output_offsets.size(), node->GetName().c_str()); | |||
@@ -656,14 +651,12 @@ Status GraphMemoryAssigner::AssignContinuousOutputMemory(const ge::NodePtr &node | |||
GELOGI("Current node %s needs continuous output.", node->GetName().c_str()); | |||
auto out_op_desc = node->GetOpDesc(); | |||
GE_IF_BOOL_EXEC(out_op_desc == nullptr, | |||
REPORT_INNER_ERROR("E19999", "OpDesc is null, " | |||
"not expect when AssignContinuousOutputMemory for node:%s", | |||
REPORT_INNER_ERROR("E19999", "OpDesc is null, not expect for node:%s", | |||
node->GetName().c_str()); | |||
GELOGE(ge::FAILED, "[Check][OpDesc]null is invalid, node:%s", node->GetName().c_str())); | |||
vector<int64_t> output_list = out_op_desc->GetOutputOffset(); | |||
if ((out_op_desc->GetOutputsSize() > output_list.size()) || (output_list.size() == 0)) { | |||
REPORT_INNER_ERROR("E19999", "Output size:%zu more than output offset size:%zu, invalid in node:%s, " | |||
"when AssignContinuousOutputMemory", | |||
REPORT_INNER_ERROR("E19999", "Output size:%zu more than output offset size:%zu, invalid in node:%s", | |||
out_op_desc->GetOutputsSize(), output_list.size(), node->GetName().c_str()); | |||
GELOGE(ge::FAILED, "[Check][InnerData]Output size:%zu more than output offset size:%zu, invalid in node:%s", | |||
out_op_desc->GetOutputsSize(), output_list.size(), node->GetName().c_str()); | |||
@@ -732,8 +725,7 @@ Status GraphMemoryAssigner::ReAssignAtomicMemory(bool is_loop_graph) { | |||
auto mem_iter = memory_offset_.find(RT_MEMORY_HBM); | |||
if (mem_iter == memory_offset_.end()) { | |||
REPORT_INNER_ERROR("E19999", "InnerData memory_offset_ does not have type[HBM], " | |||
"not expected when ReAssignAtomicMemory, " | |||
REPORT_INNER_ERROR("E19999", "InnerData memory_offset_ does not have type[HBM], not expected, " | |||
"graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); | |||
GELOGE(FAILED, "[Check][InnerData]memory_offset_ does not have memory type[HBM]" | |||
"graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); | |||
@@ -878,8 +870,7 @@ Status GraphMemoryAssigner::AssignAtomicOutputAndWorkspaceMemory(const ge::NodeP | |||
Status GraphMemoryAssigner::AssignConnectNetOutputAtomicMemory(vector<NodePtr> &connect_netoutput_nodes) { | |||
auto iter = memory_offset_.find(RT_MEMORY_HBM); | |||
if (iter == memory_offset_.end()) { | |||
REPORT_INNER_ERROR("E19999", "InnerData memory_offset_ does not have type[HBM], " | |||
"not expected when AssignConnectNetOutputAtomicMemory, " | |||
REPORT_INNER_ERROR("E19999", "InnerData memory_offset_ does not have type[HBM], not expected, " | |||
"graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); | |||
GELOGE(FAILED, "[Check][InnerData]memory_offset_ does not have memory type[HBM]" | |||
"graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); | |||
@@ -930,8 +921,7 @@ Status GraphMemoryAssigner::AssignReferenceMemory() { | |||
vector<int64_t> output_list = out_op_desc->GetOutputOffset(); | |||
if (out_op_desc->GetOutputsSize() > output_list.size()) { | |||
REPORT_INNER_ERROR("E19999", "Output size:%zu more than output offset size:%zu, judge invalid in node:%s " | |||
"when AssignReferenceMemory", | |||
REPORT_INNER_ERROR("E19999", "Output size:%zu more than output offset size:%zu, judge invalid in node:%s", | |||
out_op_desc->GetOutputsSize(), output_list.size(), node->GetName().c_str()); | |||
GELOGE(ge::FAILED, "[Check][InnerData]Output size:%zu more than output offset size:%zu, invalid in node:%s", | |||
out_op_desc->GetOutputsSize(), output_list.size(), node->GetName().c_str()); | |||
@@ -1021,8 +1011,7 @@ Status GraphMemoryAssigner::AssignAtomicOutputMemory(const ge::NodePtr &node, ve | |||
auto output_list_size = static_cast<int64_t>(output_list.size()); | |||
auto iter = memory_offset_.find(RT_MEMORY_HBM); | |||
if (iter == memory_offset_.end()) { | |||
REPORT_INNER_ERROR("E19999", "InnerData memory_offset_ does not have type[HBM], " | |||
"not expected when AssignAtomicOutputMemory, " | |||
REPORT_INNER_ERROR("E19999", "InnerData memory_offset_ does not have type[HBM], not expected, " | |||
"graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); | |||
GELOGE(FAILED, "[Check][InnerData]memory_offset_ does not have memory type[HBM]" | |||
"graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); | |||
@@ -1111,8 +1100,7 @@ Status GraphMemoryAssigner::AssignOrdinaryAtomicWorkspaceMemory(const ge::OpDesc | |||
GELOGI("Begin to reassign normal atomic memory, node = %s.", op_desc->GetName().c_str()); | |||
auto mem_type_iter = memory_offset_.find(RT_MEMORY_HBM); | |||
if (mem_type_iter == memory_offset_.end()) { | |||
REPORT_INNER_ERROR("E19999", "InnerData memory_offset_ does not have type[HBM], " | |||
"not expected when AssignOrdinaryAtomicWorkspaceMemory, " | |||
REPORT_INNER_ERROR("E19999", "InnerData memory_offset_ does not have type[HBM], not expected, " | |||
"graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); | |||
GELOGE(FAILED, "[Check][InnerData]memory_offset_ does not have memory type[HBM]" | |||
"graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); | |||
@@ -1168,8 +1156,7 @@ Status GraphMemoryAssigner::AssignFusionAtomicWorkspaceMemory(const ge::OpDescPt | |||
GELOGI("Begin to reassign fusion atomic memory, node = %s.", op_desc->GetName().c_str()); | |||
auto mem_type_iter = memory_offset_.find(RT_MEMORY_HBM); | |||
if (mem_type_iter == memory_offset_.end()) { | |||
REPORT_INNER_ERROR("E19999", "InnerData memory_offset_ does not have type[HBM], " | |||
"not expected when AssignFusionAtomicWorkspaceMemory, " | |||
REPORT_INNER_ERROR("E19999", "InnerData memory_offset_ does not have type[HBM], not expected, " | |||
"graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); | |||
GELOGE(FAILED, "[Check][InnerData]memory_offset_ does not have memory type[HBM]" | |||
"graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); | |||
@@ -1203,7 +1190,7 @@ Status GraphMemoryAssigner::AssignFusionAtomicWorkspaceMemory(const ge::OpDescPt | |||
sub_node_workspace_offset.insert(std::make_pair(iter.first, index_offset)); | |||
} | |||
if (!(op_desc->SetExtAttr(EXT_ATTR_ATOMIC_WORKSPACE_OFFSET, sub_node_workspace_offset))) { | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for node:%s when AssignFusionAtomicWorkspaceMemory", | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for node:%s", | |||
EXT_ATTR_ATOMIC_WORKSPACE_OFFSET.c_str(), op_desc->GetName().c_str()); | |||
GELOGE(FAILED, "[Set][Attr:%s]fail for node:%s.", | |||
EXT_ATTR_ATOMIC_WORKSPACE_OFFSET.c_str(), op_desc->GetName().c_str()); | |||
@@ -1269,8 +1256,8 @@ Status GraphMemoryAssigner::CheckOffset() { | |||
ge::Status GraphMemoryAssigner::SetInputOffset() { | |||
if (memory_offset_.empty()) { | |||
REPORT_INNER_ERROR("E19999", "InnerData memory_offset_ empty, not expected when SetInputOffset, " | |||
"graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); | |||
REPORT_INNER_ERROR("E19999", "InnerData memory_offset_ empty, not expected, graph_id:%u, graph_name:%s", | |||
compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); | |||
GELOGE(FAILED, "[Check][InnerData:memory_offset_]empty is not expected, " | |||
"graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); | |||
} | |||
@@ -1500,7 +1487,7 @@ ge::Status GraphMemoryAssigner::SetAtomicCleanAttr(const NodePtr &node, const ve | |||
(void) ge::AttrUtils::GetListInt(node_op_desc, ATTR_NAME_AUTOMIC_ADD_START, mem_start_vector); | |||
mem_start_vector.insert(mem_start_vector.end(), atomic_mem_start.begin(), atomic_mem_start.end()); | |||
GE_CHK_BOOL_EXEC(ge::AttrUtils::SetListInt(node_op_desc, ATTR_NAME_AUTOMIC_ADD_START, mem_start_vector), | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s failed when SetAtomicCleanAttr, op_name:%s", | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s failed, op_name:%s", | |||
ATTR_NAME_AUTOMIC_ADD_START.c_str(), node_op_desc->GetName().c_str()); | |||
GELOGE(FAILED, "[Set][Attr:%s]fail for op_name:%s", | |||
ATTR_NAME_AUTOMIC_ADD_START.c_str(), node_op_desc->GetName().c_str()); | |||
@@ -1511,7 +1498,7 @@ ge::Status GraphMemoryAssigner::SetAtomicCleanAttr(const NodePtr &node, const ve | |||
(void) ge::AttrUtils::GetListInt(node_op_desc, ATTR_NAME_AUTOMIC_ADD_MEM_SIZE, mem_size_vector); | |||
mem_size_vector.insert(mem_size_vector.end(), atomic_mem_size.begin(), atomic_mem_size.end()); | |||
GE_CHK_BOOL_EXEC(ge::AttrUtils::SetListInt(node_op_desc, ATTR_NAME_AUTOMIC_ADD_MEM_SIZE, mem_size_vector), | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s failed when SetAtomicCleanAttr, op_name:%s", | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s failed, op_name:%s", | |||
ATTR_NAME_AUTOMIC_ADD_MEM_SIZE.c_str(), node_op_desc->GetName().c_str()); | |||
GELOGE(FAILED, "[Set][Attr:%s]fail for op_name:%s", | |||
ATTR_NAME_AUTOMIC_ADD_MEM_SIZE.c_str(), node_op_desc->GetName().c_str()); | |||
@@ -53,7 +53,7 @@ Status VarMemAssignUtil::AssignStaticMemory2Node(ge::ComputeGraphPtr &compute_gr | |||
GE_IF_BOOL_EXEC(ge::AttrUtils::GetStr(n->GetOpDesc(), REF_VAR_SRC_VAR_NAME, ref_var_src_var_name), continue); | |||
string node_name = n->GetName(); | |||
GE_IF_BOOL_EXEC(n->GetOpDesc()->GetAllOutputsDesc().empty(), | |||
REPORT_INNER_ERROR("E19999", "check node:%s has no OutputDesc when AssignStaticMemory2Node", | |||
REPORT_INNER_ERROR("E19999", "check node:%s has no OutputDesc", | |||
n->GetName().c_str()); | |||
GELOGE(FAILED, "node:%s has no OutputDesc.", n->GetName().c_str()); | |||
return FAILED); | |||
@@ -118,7 +118,7 @@ Status VarMemAssignUtil::SetOutVariableAttr(const ge::NodePtr &node, const ge::N | |||
GE_CHECK_NOTNULL(node->GetOpDesc()); | |||
output_list = node->GetOpDesc()->GetOutputOffset(); | |||
if (output_list.empty()) { | |||
REPORT_INNER_ERROR("E19999", "check node:%s output_offset_list is empty when SetOutVariableAttr", | |||
REPORT_INNER_ERROR("E19999", "check node:%s output_offset_list is empty", | |||
node->GetName().c_str()); | |||
GELOGE(PARAM_INVALID, "Output_list is empty"); | |||
return PARAM_INVALID; | |||
@@ -131,8 +131,8 @@ Status VarMemAssignUtil::SetOutVariableAttr(const ge::NodePtr &node, const ge::N | |||
int out_list_size = static_cast<int>(output_list.size()); | |||
if (index >= out_list_size) { | |||
REPORT_INNER_ERROR("E19999", "param index:%d >= output_list.size() %d in node %s, " | |||
"check invalid when SetOutVariableAttr", index, out_list_size, node->GetName().c_str()); | |||
REPORT_INNER_ERROR("E19999", "param index:%d >= output_list.size() %d in node %s, check invalid", | |||
index, out_list_size, node->GetName().c_str()); | |||
GELOGE(FAILED, "index %d >= output_list.size() %d", index, out_list_size); | |||
return FAILED; | |||
} | |||
@@ -116,14 +116,14 @@ Status ModelBuilder::CalcOutputSize(const ge::NodePtr &n) { | |||
int64_t size_temp = 0; | |||
graphStatus graph_status = TensorUtils::GetTensorMemorySizeInBytes(desc_temp, size_temp); | |||
if (graph_status != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Get tensor size in bytes failed for op:%s(%s) index:%u when CalcOutputSize", | |||
REPORT_CALL_ERROR("E19999", "Get tensor size in bytes failed for op:%s(%s) index:%u", | |||
node_op_desc->GetName().c_str(), node_op_desc->GetType().c_str(), index); | |||
GELOGE(graph_status, "GetTensorMemorySizeInBytes failed!"); | |||
return FAILED; | |||
} | |||
TensorUtils::SetSize(desc_temp, size_temp); | |||
if (node_op_desc->UpdateOutputDesc(index, desc_temp) != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Update Output desc size failed for op:%s(%s) index:%u when CalcOutputSize", | |||
REPORT_CALL_ERROR("E19999", "Update Output desc size failed for op:%s(%s) index:%u", | |||
node_op_desc->GetName().c_str(), node_op_desc->GetType().c_str(), index); | |||
GELOGE(FAILED, "UpdateOutputDesc failed."); | |||
return FAILED; | |||
@@ -210,14 +210,14 @@ Status ModelBuilder::AdjustConstWeightSize(const ge::NodePtr &node, size_t &mem_ | |||
if (node->GetType() == CONSTANT) { | |||
vector<GeTensorPtr> weights = OpDescUtils::MutableWeights(node); | |||
if (weights.empty()) { | |||
REPORT_INNER_ERROR("E19999", "Check weights size of node %s(%s) is empty when AdjustConstWeightSize", | |||
REPORT_INNER_ERROR("E19999", "Check weights size of node %s(%s) is empty", | |||
node->GetName().c_str(), node->GetType().c_str()); | |||
GELOGE(FAILED, "weights size of node %s is empty", node->GetName().c_str()); | |||
return FAILED; | |||
} | |||
GeTensorPtr weight = weights[0]; | |||
if (weight == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Check weight of node %s(%s) is nullptr when AdjustConstWeightSize", | |||
REPORT_INNER_ERROR("E19999", "Check weight of node %s(%s) is nullptr", | |||
node->GetName().c_str(), node->GetType().c_str()); | |||
GELOGE(FAILED, "weights[0] is null."); | |||
return FAILED; | |||
@@ -360,9 +360,9 @@ Status ModelBuilder::AdjustInputTensorFlag() { | |||
auto input_desc = owner_node_op_desc->GetInputDesc(in_anchors->GetIdx()); | |||
ge::TensorUtils::SetInputTensor(input_desc, true); | |||
if (owner_node_op_desc->UpdateInputDesc(in_anchors->GetIdx(), input_desc) != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Update Input desc size failed for op:%s(%s) index:%u when %s", | |||
REPORT_CALL_ERROR("E19999", "Update Input desc size failed for op:%s(%s) index:%u", | |||
owner_node_op_desc->GetName().c_str(), owner_node_op_desc->GetType().c_str(), | |||
in_anchors->GetIdx(), __FUNCTION__); | |||
in_anchors->GetIdx()); | |||
GELOGE(FAILED, "UpdateOutputDesc failed."); | |||
return FAILED; | |||
} | |||
@@ -391,51 +391,51 @@ Status ModelBuilder::BuildModelDef(ge::Model &model) { | |||
max_mem_offset_ = mem_type_to_mem_offset_[RT_MEMORY_HBM]; | |||
GE_CHK_BOOL_EXEC(ge::AttrUtils::SetInt(&model, ATTR_MODEL_MEMORY_SIZE, max_mem_offset_), | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s in model failed when %s", | |||
ATTR_MODEL_MEMORY_SIZE.c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s in model failed", | |||
ATTR_MODEL_MEMORY_SIZE.c_str()); | |||
GELOGE(FAILED, "SetInt of ATTR_MODEL_MEMORY_SIZE failed."); | |||
return FAILED); | |||
if (mem_type_to_mem_offset_.find(RT_MEMORY_P2P_DDR) != mem_type_to_mem_offset_.end()) { | |||
p2p_mem_offset_ = mem_type_to_mem_offset_[RT_MEMORY_P2P_DDR]; | |||
} | |||
GE_CHK_BOOL_EXEC(ge::AttrUtils::SetInt(&model, ATTR_MODEL_P2P_MEMORY_SIZE, p2p_mem_offset_), | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s in model failed when %s", | |||
ATTR_MODEL_P2P_MEMORY_SIZE.c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s in model failed", | |||
ATTR_MODEL_P2P_MEMORY_SIZE.c_str()); | |||
GELOGE(FAILED, "SetInt of ATTR_MODEL_P2P_MEMORY_SIZE failed."); | |||
return FAILED); | |||
GE_CHK_BOOL_EXEC(ge::AttrUtils::SetInt(&model, ATTR_MODEL_WEIGHT_SIZE, weight_offset_), | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s in model failed when %s", | |||
ATTR_MODEL_WEIGHT_SIZE.c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s in model failed", | |||
ATTR_MODEL_WEIGHT_SIZE.c_str()); | |||
GELOGE(FAILED, "SetInt of ATTR_MODEL_WEIGHT_SIZE failed."); | |||
return FAILED); | |||
GE_CHK_BOOL_EXEC(ge::AttrUtils::SetInt(&model, ATTR_MODEL_STREAM_NUM, stream_num_), | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s in model failed when %s", | |||
ATTR_MODEL_STREAM_NUM.c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s in model failed", | |||
ATTR_MODEL_STREAM_NUM.c_str()); | |||
GELOGE(FAILED, "SetInt of ATTR_MODEL_STREAM_NUM failed."); | |||
return FAILED); | |||
GE_CHK_BOOL_EXEC(ge::AttrUtils::SetInt(&model, ATTR_MODEL_EVENT_NUM, event_num_), | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s in model failed when %s", | |||
ATTR_MODEL_EVENT_NUM.c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s in model failed", | |||
ATTR_MODEL_EVENT_NUM.c_str()); | |||
GELOGE(FAILED, "SetInt of ATTR_MODEL_EVENT_NUM failed."); | |||
return FAILED); | |||
GE_CHK_BOOL_EXEC(ge::AttrUtils::SetListInt(&model, ATTR_MODEL_HUGE_STREAM_LIST, huge_streams_), | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s in model failed when %s", | |||
ATTR_MODEL_HUGE_STREAM_LIST.c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s in model failed", | |||
ATTR_MODEL_HUGE_STREAM_LIST.c_str()); | |||
GELOGE(FAILED, "SetInt of ATTR_MODEL_HUGE_STREAM_LIST failed."); | |||
return FAILED); | |||
GE_CHK_BOOL_EXEC(ge::AttrUtils::SetInt(&model, ATTR_MODEL_LABEL_NUM, label_num_), | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s in model failed when %s", | |||
ATTR_MODEL_LABEL_NUM.c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s in model failed", | |||
ATTR_MODEL_LABEL_NUM.c_str()); | |||
GELOGE(FAILED, "SetInt of ATTR_MODEL_LABEL_NUM failed."); | |||
return FAILED); | |||
GE_CHK_BOOL_EXEC(ge::AttrUtils::SetInt(&model, ATTR_MODEL_ZERO_COPY_MEMORY_SIZE, zero_copy_mem_size_), | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s in model failed when %s", | |||
ATTR_MODEL_ZERO_COPY_MEMORY_SIZE.c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s in model failed", | |||
ATTR_MODEL_ZERO_COPY_MEMORY_SIZE.c_str()); | |||
GELOGE(FAILED, "SetInt of ATTR_MODEL_ZERO_COPY_MEMORY_SIZE failed."); | |||
return FAILED); | |||
GE_CHK_BOOL_EXEC(ge::AttrUtils::SetListStr(&model, ATTR_MODEL_OUT_NODES_NAME, GetLocalOmgContext().net_out_nodes), | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s in model failed when %s", | |||
ATTR_MODEL_OUT_NODES_NAME.c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s in model failed", | |||
ATTR_MODEL_OUT_NODES_NAME.c_str()); | |||
GELOGE(FAILED, "SetListStr of ATTR_MODEL_OUT_NODES_NAME failed."); | |||
return FAILED); | |||
GELOGI("For model, max_mem_offset_: %zu, p2p_mem_size: %zu, zero_copy_mem_size_: %zu", max_mem_offset_, | |||
@@ -443,8 +443,8 @@ Status ModelBuilder::BuildModelDef(ge::Model &model) { | |||
string fp_ceiling_mode; | |||
if (ge::GetContext().GetOption("ge.fpCeilingMode", fp_ceiling_mode) == SUCCESS) { | |||
if (!ge::AttrUtils::SetStr(&model, ATTR_FP_CEILING_MODE, fp_ceiling_mode)) { | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s in model failed when %s", | |||
ATTR_FP_CEILING_MODE.c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s in model failed", | |||
ATTR_FP_CEILING_MODE.c_str()); | |||
GELOGE(FAILED, "Failed to set attr ATTR_FP_CEILING_MODE"); | |||
return FAILED; | |||
} | |||
@@ -459,30 +459,30 @@ Status ModelBuilder::BuildModelDef(ge::Model &model) { | |||
int64_t core_type = (ge_core_type == kVectorCore) ? 1 : 0; | |||
GELOGI("core_type: %ld", core_type); | |||
if (!ge::AttrUtils::SetInt(&model, ATTR_MODEL_CORE_TYPE, core_type)) { | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s in model failed when %s", | |||
ATTR_MODEL_CORE_TYPE.c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s in model failed", | |||
ATTR_MODEL_CORE_TYPE.c_str()); | |||
GELOGE(FAILED, "SetInt of ATTR_CORE_TYPE failed."); | |||
} | |||
InitL1FusionOption(); | |||
GE_CHK_BOOL_EXEC(ge::AttrUtils::SetBool(&model, ATTR_NAME_SWITCH_FOR_L1_FUSION, is_l1_fusion_enable_), | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s in model failed when %s", | |||
ATTR_NAME_SWITCH_FOR_L1_FUSION.c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s in model failed", | |||
ATTR_NAME_SWITCH_FOR_L1_FUSION.c_str()); | |||
GELOGE(FAILED, "SetBool of ATTR_NAME_SWITCH_FOR_L1_FUSION failed."); | |||
return FAILED); | |||
const DumpProperties &dump_properties = DumpManager::GetInstance().GetDumpProperties(session_id_); | |||
bool is_op_debug = dump_properties.IsOpDebugOpen(); | |||
if (is_op_debug) { | |||
if (!ge::AttrUtils::SetBool(&model, ATTR_OP_DEBUG_FLAG, is_op_debug)) { | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s in model failed when %s", | |||
ATTR_OP_DEBUG_FLAG.c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s in model failed", | |||
ATTR_OP_DEBUG_FLAG.c_str()); | |||
GELOGE(FAILED, "SetBool of ATTR_OP_DEBUG_FLAG failed."); | |||
return FAILED; | |||
} | |||
uint32_t op_debug_mode = dump_properties.GetOpDebugMode(); | |||
GELOGI("Get op debug mode:%d", op_debug_mode); | |||
if (!ge::AttrUtils::SetInt(&model, ATTR_OP_DEBUG_MODE, op_debug_mode)) { | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s in model failed when %s", | |||
ATTR_OP_DEBUG_MODE.c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s in model failed", | |||
ATTR_OP_DEBUG_MODE.c_str()); | |||
GELOGE(FAILED, "SetBool of ATTR_OP_DEBUG_MODE failed."); | |||
return FAILED; | |||
} | |||
@@ -554,8 +554,8 @@ Status ModelBuilder::MergeWeights() { | |||
// If MutableTensor failed, weight is nullptr. | |||
(void)ge::AttrUtils::MutableTensor(op_desc, ATTR_NAME_WEIGHTS, weight); | |||
if (weight == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Can't get const weight in op:%s(%s) when %s", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Can't get const weight in op:%s(%s)", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(FAILED, "Can't get const op weight, name: %s", node->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -579,14 +579,14 @@ Status ModelBuilder::MergeWeights() { | |||
} | |||
if (weight_data.data() != nullptr) { | |||
GE_IF_BOOL_EXEC(base_addr == nullptr, | |||
REPORT_INNER_ERROR("E19999", "Check weight in op:%s(%s) is nullptr when %s", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Check weight in op:%s(%s) is nullptr", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(FAILED, "Base addr is nullptr."); | |||
return FAILED); | |||
if (weight_offset_ - offset < weight_data.size()) { | |||
REPORT_INNER_ERROR("E19999", "left weight size not enough for op:%s(%s) left_size:%zu, weight_size:%zu when %s", | |||
REPORT_INNER_ERROR("E19999", "left weight size not enough for op:%s(%s) left_size:%zu, weight_size:%zu", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), | |||
weight_offset_ - offset, weight_data.size(), __FUNCTION__); | |||
weight_offset_ - offset, weight_data.size()); | |||
GELOGE(FAILED, "left weight size not enough. left_size:%lu, weight_size:%lu", | |||
weight_offset_ - offset, weight_data.size()); | |||
return FAILED; | |||
@@ -599,8 +599,8 @@ Status ModelBuilder::MergeWeights() { | |||
SECUREC_MEM_MAX_LEN); | |||
if (err != EOK) { | |||
REPORT_CALL_ERROR("E19999", "mem copy failed. errret:%u, " | |||
"dst_ptr:%lx, dst_size:%lu, src_ptr:%lx, src_size:%lu, when %s", | |||
err, dst_ptr, SECUREC_MEM_MAX_LEN, src_ptr, SECUREC_MEM_MAX_LEN, __FUNCTION__); | |||
"dst_ptr:%lx, dst_size:%lu, src_ptr:%lx, src_size:%lu,", | |||
err, dst_ptr, SECUREC_MEM_MAX_LEN, src_ptr, SECUREC_MEM_MAX_LEN); | |||
GELOGE(FAILED, "mem copy failed. errret:%u, " | |||
"dst_ptr:%lx, dst_size:%lu, src_ptr:%lx, src_size:%lu", | |||
err, dst_ptr, SECUREC_MEM_MAX_LEN, src_ptr, SECUREC_MEM_MAX_LEN); | |||
@@ -613,8 +613,8 @@ Status ModelBuilder::MergeWeights() { | |||
auto err = memcpy_s(reinterpret_cast<void *>(dst_ptr), left_size, reinterpret_cast<void *>(src_ptr), left_size); | |||
if (err != EOK) { | |||
REPORT_CALL_ERROR("E19999", "mem copy failed. errret:%u, " | |||
"dst_ptr:%lx, dst_size:%lu, src_ptr:%lx, src_size:%lu, when %s", | |||
err, dst_ptr, SECUREC_MEM_MAX_LEN, src_ptr, SECUREC_MEM_MAX_LEN, __FUNCTION__); | |||
"dst_ptr:%lx, dst_size:%lu, src_ptr:%lx, src_size:%lu,", | |||
err, dst_ptr, SECUREC_MEM_MAX_LEN, src_ptr, SECUREC_MEM_MAX_LEN); | |||
GELOGE(FAILED, "mem copy failed. errret:%u, " | |||
"dst_ptr:%lx, dst_size:%lu, src_ptr:%lx, src_size:%lu", | |||
err, dst_ptr, SECUREC_MEM_MAX_LEN, src_ptr, SECUREC_MEM_MAX_LEN); | |||
@@ -699,8 +699,8 @@ Status ModelBuilder::SaveDataToModel(ge::Model &model, ge::GeModel &ge_model) { | |||
} | |||
GE_IF_BOOL_EXEC(tbe_kernel == nullptr, continue); | |||
if (tbe_name_set.count(tbe_kernel->GetName()) > 0) { | |||
REPORT_INNER_ERROR("E19999", "tbe_kernel name %s can't be the same, judge for op:%s(%s), when %s", | |||
tbe_kernel->GetName().c_str(), n->GetName().c_str(), n->GetType().c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "tbe_kernel name %s can't be the same, judge for op:%s(%s),", | |||
tbe_kernel->GetName().c_str(), n->GetName().c_str(), n->GetType().c_str()); | |||
GELOGE(FAILED, "tbe_kernel name %s can't be the same", tbe_kernel->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -719,9 +719,8 @@ Status ModelBuilder::SaveDataToModel(ge::Model &model, ge::GeModel &ge_model) { | |||
node_op_desc->TryGetExtAttr(ge::OP_EXTATTR_CUSTAICPU_KERNEL, CustAICPUKernelPtr()); | |||
GE_IF_BOOL_EXEC(cust_aicpu_kernel == nullptr, continue); | |||
if (aicpu_name_set.count(cust_aicpu_kernel->GetName()) > 0) { | |||
REPORT_INNER_ERROR("E19999", "aicpu_kernel name %s can't be the same, judge for op:%s(%s), when %s", | |||
cust_aicpu_kernel->GetName().c_str(), n->GetName().c_str(), n->GetType().c_str(), | |||
__FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "aicpu_kernel name %s can't be the same, judge for op:%s(%s),", | |||
cust_aicpu_kernel->GetName().c_str(), n->GetName().c_str(), n->GetType().c_str()); | |||
GELOGE(FAILED, "aicpu_kernel name %s can't be the same", cust_aicpu_kernel->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -744,7 +743,7 @@ Status ModelBuilder::SaveDataToModel(ge::Model &model, ge::GeModel &ge_model) { | |||
// Add task | |||
GeAttrValue::BYTES task_def_bytes; | |||
if (!AttrUtils::GetZeroCopyBytes(model, MODEL_ATTR_TASKS, task_def_bytes)) { | |||
REPORT_CALL_ERROR("E19999", "Get attr:%s in model fail when %s", MODEL_ATTR_TASKS.c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Get attr:%s in model failed", MODEL_ATTR_TASKS.c_str()); | |||
GELOGE(INTERNAL_ERROR, "Get zero copy bytes fail."); | |||
return INTERNAL_ERROR; | |||
} | |||
@@ -780,7 +779,7 @@ void ModelBuilder::SetModelVersion(ge::Model &model) { | |||
Status ModelBuilder::PreBuildModel() { | |||
if ((compute_graph_ == nullptr) || !(compute_graph_->IsValid())) { | |||
REPORT_INNER_ERROR("E19999", "Check compute_graph no valid when %s", __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Check compute_graph no valid"); | |||
GELOGE(FAILED, "Graph_ is not valid."); | |||
return FAILED; | |||
} | |||
@@ -860,7 +859,7 @@ Status ModelBuilder::CompileSingleOp() { | |||
// Create ge instance | |||
std::shared_ptr<GELib> instance = ge::GELib::GetInstance(); | |||
if ((instance == nullptr) || !instance->InitFlag()) { | |||
REPORT_INNER_ERROR("E19999", "Check GELib instance not init before when %s", __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Check GELib instance not init before"); | |||
GELOGE(ge::GE_CLI_GE_NOT_INITIALIZED, "CompileSingleOp failed."); | |||
return ge::GE_CLI_GE_NOT_INITIALIZED; | |||
} | |||
@@ -882,8 +881,8 @@ Status ModelBuilder::CompileSingleOp() { | |||
(void)instance->DNNEngineManagerObj().GetDNNEngineName(node); | |||
kernel_lib_name = op_desc->GetOpKernelLibName(); | |||
if (kernel_lib_name.empty()) { | |||
REPORT_INNER_ERROR("E19999", "Check kernel lib name empty of op:%s(%s) when %s", | |||
node->GetName().c_str(), node->GetType().c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Check kernel lib name empty of op:%s(%s)", | |||
node->GetName().c_str(), node->GetType().c_str()); | |||
GELOGE(ge::INTERNAL_ERROR, "Get node:%s(%s) kernel lib failed.", node->GetName().c_str(), | |||
node->GetType().c_str()); | |||
return ge::INTERNAL_ERROR; | |||
@@ -894,8 +893,8 @@ Status ModelBuilder::CompileSingleOp() { | |||
if (kernel_info != nullptr) { | |||
node_vector_map[kernel_lib_name].emplace_back(node); | |||
} else { | |||
REPORT_INNER_ERROR("E19999", "Get ops kernel info store failed for op:%s(%s), op_kernel_name:%s, when %s", | |||
node->GetName().c_str(), node->GetType().c_str(), kernel_lib_name.c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Get ops kernel info store failed for op:%s(%s), op_kernel_name:%s,", | |||
node->GetName().c_str(), node->GetType().c_str(), kernel_lib_name.c_str()); | |||
GELOGE(ge::GE_GRAPH_PARAM_NULLPTR, "Get op %s ops kernel info store failed", node->GetName().c_str()); | |||
return ge::GE_GRAPH_PARAM_NULLPTR; | |||
} | |||
@@ -911,8 +910,8 @@ Status ModelBuilder::CompileSingleOp() { | |||
GELOGI("[GEPERFTRACE] The node size of compile op of %s is %zu", kernel_lib_name.c_str(), node_vector.size()); | |||
GE_TIMESTAMP_ADD(BatchCompileOp); | |||
if (ret != ge::SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Batch compile op failed, kernel lib name, node size:%zu, when %s", | |||
node_vector.size(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Batch compile op failed, kernel lib name, node size:%zu,", | |||
node_vector.size()); | |||
GELOGE(ret, "Compile op failed, kernel lib name is %s", kernel_lib_name.c_str()); | |||
return ret; | |||
} | |||
@@ -62,7 +62,7 @@ Status RunContextUtil::CreateRtModelResources(uint32_t stream_num, uint32_t even | |||
// Create rt model | |||
rtError_t rt_ret = rtModelCreate(&rt_model_, 0); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "call rtModelCreate fail, ret:%d, when %s", static_cast<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)); | |||
return RT_FAILED; | |||
} | |||
@@ -72,8 +72,8 @@ Status RunContextUtil::CreateRtModelResources(uint32_t stream_num, uint32_t even | |||
rtStream_t stream = nullptr; | |||
rt_ret = rtStreamCreate(&stream, 0); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "call rtStreamCreate fail, ret:%d, index:%u, when %s", | |||
static_cast<int>(rt_ret), i, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "call rtStreamCreate failed, 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; | |||
} | |||
@@ -81,8 +81,8 @@ Status RunContextUtil::CreateRtModelResources(uint32_t stream_num, uint32_t even | |||
rt_ret = rtModelBindStream(rt_model_, stream, 0); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "call rtModelBindStream fail, ret:%d, index:%u, when %s", | |||
static_cast<int>(rt_ret), i, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "call rtModelBindStream failed, 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; | |||
} | |||
@@ -95,8 +95,8 @@ Status RunContextUtil::CreateRtModelResources(uint32_t stream_num, uint32_t even | |||
rtEvent_t event = nullptr; | |||
rt_ret = rtEventCreateWithFlag(&event, create_flag); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "call rtEventCreate fail, ret:%d, index:%u, when %s", | |||
static_cast<int>(rt_ret), i, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "call rtEventCreate failed, 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; | |||
} | |||
@@ -108,8 +108,8 @@ Status RunContextUtil::CreateRtModelResources(uint32_t stream_num, uint32_t even | |||
rtLabel_t label = nullptr; | |||
rt_ret = rtLabelCreateV2(&label, rt_model_); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "call rtLabelCreateV2 fail, ret:%d, index:%u, when %s", | |||
static_cast<int>(rt_ret), i, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "call rtLabelCreateV2 failed, 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; | |||
} | |||
@@ -161,15 +161,15 @@ Status RunContextUtil::CreateRunContext(Model &model, const ComputeGraphPtr &gra | |||
GELOGD("Begin to Create RunContext, session_id = %lu", session_id); | |||
// check params | |||
if (graph == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Check param graph nullptr, session_id:%lu, when %s", session_id, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Check param graph nullptr, session_id:%lu,", session_id); | |||
GELOGE(PARAM_INVALID, "CreateRunContext param graph is null. session_id=%lu", session_id); | |||
return PARAM_INVALID; | |||
} | |||
uint32_t stream_num = 0; | |||
if (!AttrUtils::GetInt(&model, ATTR_MODEL_STREAM_NUM, stream_num)) { | |||
REPORT_INNER_ERROR("Get Attr:%s fail for model, session_id:%lu, when %s", | |||
ATTR_MODEL_STREAM_NUM.c_str(), session_id, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Get Attr:%s failed for model, session_id:%lu,", | |||
ATTR_MODEL_STREAM_NUM.c_str(), session_id); | |||
GELOGE(INTERNAL_ERROR, "Get stream_num attr from model_def failed. session_id=%lu", session_id); | |||
return INTERNAL_ERROR; | |||
} | |||
@@ -177,8 +177,8 @@ Status RunContextUtil::CreateRunContext(Model &model, const ComputeGraphPtr &gra | |||
uint32_t event_num = 0; | |||
if (!AttrUtils::GetInt(&model, ATTR_MODEL_EVENT_NUM, event_num)) { | |||
REPORT_INNER_ERROR("Get Attr:%s fail for model, session_id:%lu, when %s", | |||
ATTR_MODEL_EVENT_NUM.c_str(), session_id, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Get Attr:%s failed for model, session_id:%lu,", | |||
ATTR_MODEL_EVENT_NUM.c_str(), session_id); | |||
GELOGE(INTERNAL_ERROR, "Get event_num attr from model failed. session_id=%lu", session_id); | |||
return INTERNAL_ERROR; | |||
} | |||
@@ -186,8 +186,8 @@ Status RunContextUtil::CreateRunContext(Model &model, const ComputeGraphPtr &gra | |||
uint32_t label_num = 0; | |||
if (!AttrUtils::GetInt(&model, ATTR_MODEL_LABEL_NUM, label_num)) { | |||
REPORT_INNER_ERROR("Get Attr:%s fail for model, session_id:%lu, when %s", | |||
ATTR_MODEL_LABEL_NUM.c_str(), session_id, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Get Attr:%s failed for model, session_id:%lu,", | |||
ATTR_MODEL_LABEL_NUM.c_str(), session_id); | |||
GELOGE(INTERNAL_ERROR, "Get label_num attr from model failed. session_id=%lu", session_id); | |||
return INTERNAL_ERROR; | |||
} | |||
@@ -176,7 +176,7 @@ Status StreamAllocator::AssignLogicalStreams(const std::map<std::string, int> &m | |||
auto gelib = GELib::GetInstance(); | |||
if (gelib == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Check GELib instance nullptr when %s", __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Check GELib instance nullptr"); | |||
GELOGE(FAILED, "Get GELib instance failed."); | |||
return FAILED; | |||
} | |||
@@ -291,8 +291,8 @@ Status StreamAllocator::AssignSingleStream() { | |||
} | |||
if (stream_num_ > 1) { | |||
REPORT_INNER_ERROR("E19999", "The number of ts streams is %ld, only one is supported when %s", | |||
stream_num_, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "The number of ts streams is %ld, only one is supported", | |||
stream_num_); | |||
GELOGE(FAILED, "The number of ts streams is %ld, only one is supported.", stream_num_); | |||
return FAILED; | |||
} | |||
@@ -366,9 +366,9 @@ Status StreamAllocator::SetActiveStreamsByLabel() { | |||
} | |||
} | |||
GE_CHK_BOOL_EXEC(AttrUtils::SetListInt(node->GetOpDesc(), ATTR_NAME_ACTIVE_STREAM_LIST, activated_stream_list), | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s for op:%s(%s) failed when %s", | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s for op:%s(%s) failed", | |||
ATTR_NAME_ACTIVE_STREAM_LIST.c_str(), | |||
node->GetName().c_str(), node->GetType().c_str(), __FUNCTION__); | |||
node->GetName().c_str(), node->GetType().c_str()); | |||
GELOGE(FAILED, "SetListInt failed."); | |||
return FAILED); | |||
} | |||
@@ -419,9 +419,9 @@ Status StreamAllocator::SetActiveStreamsForSubgraphs() { | |||
} | |||
if (!AttrUtils::SetListInt(first_active_node->GetOpDesc(), ATTR_NAME_ACTIVE_STREAM_LIST, active_streams)) { | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s for op:%s(%s) failed when %s", | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s for op:%s(%s) failed", | |||
ATTR_NAME_ACTIVE_STREAM_LIST.c_str(), | |||
first_active_node->GetName().c_str(), first_active_node->GetType().c_str(), __FUNCTION__); | |||
first_active_node->GetName().c_str(), first_active_node->GetType().c_str()); | |||
GELOGE(FAILED, "Set active streams for node %s failed.", first_active_node->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -491,8 +491,8 @@ Status StreamAllocator::InsertOneEventInTwoNodes(const NodePtr &cur_node, const | |||
} | |||
if (next_stream_id == kInvalidStream) { | |||
REPORT_INNER_ERROR("E19999", "Stream id of next_node %s(%s) should not be %ld when %s", | |||
next_node->GetName().c_str(), next_node->GetType().c_str(), kInvalidStream, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Stream id of next_node %s(%s) should not be %ld", | |||
next_node->GetName().c_str(), next_node->GetType().c_str(), kInvalidStream); | |||
GELOGE(FAILED, "Stream id of next_node %s should not be %ld", next_node->GetName().c_str(), kInvalidStream); | |||
return FAILED; | |||
} | |||
@@ -707,11 +707,11 @@ Status StreamAllocator::OptimizeByStreamActivate() { | |||
// No need to insert an event between node in stream(normal) and node in stream(stream true or false) | |||
bool StreamAllocator::IsRecvNodeActivatedBySendNode(const NodePtr &send_node_ptr, const NodePtr &recv_node_ptr) const { | |||
GE_CHECK_NOTNULL_EXEC(send_node_ptr->GetOpDesc(), | |||
REPORT_INNER_ERROR("E19999", "Check param send_node_ptr nullptr when %s", __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Check param send_node_ptr nullptr"); | |||
GELOGE(FAILED, "op desc is nullptr"); | |||
return false); | |||
GE_CHECK_NOTNULL_EXEC(recv_node_ptr->GetOpDesc(), | |||
REPORT_INNER_ERROR("E19999", "Check param recv_node_ptr nullptr when %s", __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Check param recv_node_ptr nullptr"); | |||
GELOGE(FAILED, "op desc is nullptr"); | |||
return false); | |||
auto cur_stream_id = send_node_ptr->GetOpDesc()->GetStreamId(); | |||
@@ -837,8 +837,8 @@ Status StreamAllocator::SplitStreams(vector<set<int64_t>> &split_streams) { | |||
continue; | |||
} | |||
if (stream_id > last_stream_id) { | |||
REPORT_INNER_ERROR("E19999", "streamid(%ld) > last_stream_id(%ld), check invalid when %s", | |||
stream_id, last_stream_id, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "streamid(%ld) > last_stream_id(%ld), check invalid", | |||
stream_id, last_stream_id); | |||
GELOGE(FAILED, "SplitStreams:streamid(%ld) > last_stream_id(%ld)", stream_id, last_stream_id); | |||
return FAILED; | |||
} | |||
@@ -852,8 +852,8 @@ Status StreamAllocator::SplitStreams(vector<set<int64_t>> &split_streams) { | |||
stream_continuous_2_node_num_map[continuous_stream_label]++; | |||
// return error | |||
if (stream_continuous_2_node_num_map[continuous_stream_label] > max_node_num_one_stream) { | |||
REPORT_INNER_ERROR("E19999", "Check node[%s] stream_id[%ld] continuous stream label[%s] unsatisfied when %s", | |||
op_desc->GetName().c_str(), stream_id, continuous_stream_label.c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Check node[%s] stream_id[%ld] continuous stream label[%s] unsatisfied", | |||
op_desc->GetName().c_str(), stream_id, continuous_stream_label.c_str()); | |||
GELOGE(FAILED, "SplitStreams:node[%s] stream_id[%ld] continuous stream label[%s] unsatisfied ", | |||
op_desc->GetName().c_str(), stream_id, continuous_stream_label.c_str()); | |||
return FAILED; | |||
@@ -1008,8 +1008,8 @@ Status StreamAllocator::UpdateActiveStreamsForSwitchNode(NodePtr &switch_node) { | |||
GE_CHECK_NOTNULL(op_desc); | |||
if (!AttrUtils::SetListInt(op_desc, ATTR_NAME_ACTIVE_STREAM_LIST, stream_ids)) { | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s) when %s", ATTR_NAME_ACTIVE_STREAM_LIST.c_str(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s)", ATTR_NAME_ACTIVE_STREAM_LIST.c_str(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(FAILED, "SetListInt failed."); | |||
return FAILED; | |||
} | |||
@@ -1024,8 +1024,8 @@ Status StreamAllocator::InsertActiveNodesAfterSwitch(NodePtr &switch_node, vecto | |||
vector<string> ori_active_label_list; | |||
if (!AttrUtils::GetListStr(switch_desc, ATTR_NAME_ACTIVE_LABEL_LIST, ori_active_label_list) || | |||
ori_active_label_list.empty()) { | |||
REPORT_INNER_ERROR("E19999", "Get Attr:%s fail for op:%s(%s) when %s", ATTR_NAME_ACTIVE_LABEL_LIST.c_str(), | |||
switch_node->GetName().c_str(), switch_node->GetType().c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Get Attr:%s fail for op:%s(%s)", ATTR_NAME_ACTIVE_LABEL_LIST.c_str(), | |||
switch_node->GetName().c_str(), switch_node->GetType().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Get active label list of switch %s failed.", switch_node->GetName().c_str()); | |||
return INTERNAL_ERROR; | |||
} | |||
@@ -1049,8 +1049,8 @@ Status StreamAllocator::InsertActiveNodesAfterSwitch(NodePtr &switch_node, vecto | |||
for (auto &active_node : added_active_nodes) { | |||
GE_CHECK_NOTNULL(switch_node->GetOutControlAnchor()); | |||
if (switch_node->GetOutControlAnchor()->LinkTo(active_node->GetInControlAnchor()) != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Link from %s to %s failed when %s", | |||
switch_node->GetName().c_str(), active_node->GetName().c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Link from %s to %s failed", | |||
switch_node->GetName().c_str(), active_node->GetName().c_str()); | |||
GELOGE(FAILED, "Link %s to %s failed.", switch_node->GetName().c_str(), active_node->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -1066,8 +1066,8 @@ Status StreamAllocator::UpdateActiveStreamsForActiveNode(const vector<set<int64_ | |||
vector<uint32_t> new_active_streams = active_streams; | |||
for (uint32_t logical_stream : active_streams) { | |||
if (static_cast<size_t>(logical_stream) >= split_streams.size()) { | |||
REPORT_INNER_ERROR("E19999", "Check logical stream:%u is out of range:%zu when %s", | |||
logical_stream, split_streams.size(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Check logical stream:%u is out of range:%zu", | |||
logical_stream, split_streams.size()); | |||
GELOGE(FAILED, "logical stream is out of range."); | |||
return FAILED; | |||
} | |||
@@ -1086,8 +1086,8 @@ Status StreamAllocator::UpdateActiveStreamsForActiveNode(const vector<set<int64_ | |||
} | |||
} | |||
if (!AttrUtils::SetListInt(node->GetOpDesc(), ATTR_NAME_ACTIVE_STREAM_LIST, new_active_streams)) { | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s) when %s", ATTR_NAME_ACTIVE_STREAM_LIST.c_str(), | |||
node->GetName().c_str(), node->GetType().c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s)", ATTR_NAME_ACTIVE_STREAM_LIST.c_str(), | |||
node->GetName().c_str(), node->GetType().c_str()); | |||
GELOGE(FAILED, "Set active streams for node %s failed.", node->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -1128,8 +1128,8 @@ Status StreamAllocator::UpdateActiveStreamsForSubgraphs() const { | |||
new_active_streams.emplace(static_cast<uint32_t>(new_split_stream)); | |||
active_streams.assign(new_active_streams.begin(), new_active_streams.end()); | |||
if (!AttrUtils::SetListInt(active_op, ATTR_NAME_ACTIVE_STREAM_LIST, active_streams)) { | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s) when %s", ATTR_NAME_ACTIVE_STREAM_LIST.c_str(), | |||
active_op->GetName().c_str(), active_op->GetType().c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s)", ATTR_NAME_ACTIVE_STREAM_LIST.c_str(), | |||
active_op->GetName().c_str(), active_op->GetType().c_str()); | |||
GELOGE(FAILED, "Set active streams for node %s failed.", active_node->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -1198,8 +1198,8 @@ Status StreamAllocator::SetActiveStreamsForLoop() { | |||
NodePtr pre_switch_node = FindSwitchNodeBeforeLoopActiveNode(node); | |||
if (pre_switch_node == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Find switch node before loop active node %s fail when %s", | |||
node->GetName().c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Find switch node before loop active node %s fail", | |||
node->GetName().c_str()); | |||
GELOGE(FAILED, "find switch node before loop active node %s failed", node->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -1207,9 +1207,9 @@ Status StreamAllocator::SetActiveStreamsForLoop() { | |||
if (!AttrUtils::GetListStr(node->GetOpDesc(), ATTR_NAME_ACTIVE_LABEL_LIST, activated_label_list) || | |||
activated_label_list.empty()) { | |||
GE_CHK_BOOL_EXEC(AttrUtils::SetListInt(node->GetOpDesc(), ATTR_NAME_ACTIVE_STREAM_LIST, loop_active_streams), | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s) when %s", | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s)", | |||
ATTR_NAME_ACTIVE_STREAM_LIST.c_str(), | |||
node->GetName().c_str(), node->GetType().c_str(), __FUNCTION__); | |||
node->GetName().c_str(), node->GetType().c_str()); | |||
GELOGE(FAILED, "SetListInt failed."); | |||
return FAILED); | |||
for (const auto &stream_id : loop_active_streams) { | |||
@@ -1256,8 +1256,8 @@ Status StreamAllocator::CheckStreamActived() const { | |||
uint32_t stream_id = static_cast<uint32_t>(node->GetOpDesc()->GetStreamId()); | |||
auto iter = find(active_streams.begin(), active_streams.end(), stream_id); | |||
if (iter != active_streams.end()) { | |||
REPORT_INNER_ERROR("E19999", "Node:%s(%s) cannot active its own stream %u, check invalid when %s", | |||
node->GetName().c_str(), node->GetType().c_str(), stream_id, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Node:%s(%s) cannot active its own stream %u, check invalid ", | |||
node->GetName().c_str(), node->GetType().c_str(), stream_id); | |||
GELOGE(FAILED, "Node %s cannot active its own stream %u.", node->GetName().c_str(), stream_id); | |||
return FAILED; | |||
} | |||
@@ -1375,7 +1375,7 @@ Status StreamAllocator::RefreshContinuousEvents() { | |||
for (size_t i = 0; i < send_events.size(); i++) { | |||
auto find_it = old_to_new_events.find(send_events[i]); | |||
if (find_it == old_to_new_events.end()) { | |||
REPORT_INNER_ERROR("E19999", "Check invalid send event %u when %s", send_events[i], __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Check invalid send event %u", send_events[i]); | |||
GELOGE(FAILED, "RefreshContinuousEvents: invalid send event %u", send_events[i]); | |||
return FAILED; | |||
} | |||
@@ -1389,7 +1389,7 @@ Status StreamAllocator::RefreshContinuousEvents() { | |||
for (size_t i = 0; i < recv_events.size(); i++) { | |||
auto find_it = old_to_new_events.find(recv_events[i]); | |||
if (find_it == old_to_new_events.end()) { | |||
REPORT_INNER_ERROR("E19999", "Check invalid recv event %u when %s", recv_events[i], __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Check invalid recv event %u", recv_events[i]); | |||
GELOGE(FAILED, "RefreshContinuousEvents: invalid recv event %u", recv_events[i]); | |||
return FAILED; | |||
} | |||
@@ -1427,9 +1427,9 @@ Status StreamAllocator::InsertSyncEventNodes() { | |||
int64_t temp_stream_id = node->GetOpDesc()->GetStreamId(); | |||
op_desc_ptr->SetStreamId(temp_stream_id); | |||
GE_CHK_BOOL_EXEC(AttrUtils::SetInt(op_desc_ptr, RECV_ATTR_EVENT_ID, event_id), | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s for op:%s(%s) failed, event_id:%u, when %s", | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s for op:%s(%s) failed, event_id:%u,", | |||
RECV_ATTR_EVENT_ID.c_str(), | |||
node->GetName().c_str(), node->GetType().c_str(), event_id, __FUNCTION__); | |||
node->GetName().c_str(), node->GetType().c_str(), event_id); | |||
GELOGE(FAILED, "SetInt failed."); | |||
return FAILED); | |||
(void)AttrUtils::SetListStr(op_desc_ptr, ATTR_NAME_DATA_DUMP_ORIGIN_OP_NAMES, | |||
@@ -1439,8 +1439,8 @@ Status StreamAllocator::InsertSyncEventNodes() { | |||
GE_CHECK_NOTNULL(recv_node->GetOutControlAnchor()); | |||
Status status = GraphUtils::AddEdge(recv_node->GetOutControlAnchor(), node->GetInControlAnchor()); | |||
if (status != SUCCESS) { | |||
REPORT_INNER_ERROR("E19999", "Add edge from node %s to node %s failed when %s", | |||
recv_node->GetName().c_str(), node->GetName().c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Add edge from node %s to node %s failed", | |||
recv_node->GetName().c_str(), node->GetName().c_str()); | |||
GELOGE(status, "Add edge for node %s and node %s failed.", recv_node->GetName().c_str(), | |||
node->GetName().c_str()); | |||
return status; | |||
@@ -1476,8 +1476,8 @@ Status StreamAllocator::InsertSyncEventNodes() { | |||
GE_CHECK_NOTNULL(send_node->GetInControlAnchor()); | |||
Status status = GraphUtils::AddEdge(node->GetOutControlAnchor(), send_node->GetInControlAnchor()); | |||
if (status != SUCCESS) { | |||
REPORT_INNER_ERROR("E19999", "Add edge from node %s to node %s failed when %s", | |||
node->GetName().c_str(), send_node->GetName().c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Add edge from node %s to node %s failed", | |||
node->GetName().c_str(), send_node->GetName().c_str()); | |||
GELOGE(status, "Add edge for node %s and node %s failed.", node->GetName().c_str(), | |||
send_node->GetName().c_str()); | |||
return status; | |||
@@ -1489,8 +1489,8 @@ Status StreamAllocator::InsertSyncEventNodes() { | |||
Status status = whole_graph_->InsertGraphEvents(); | |||
if (status != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Insert Graph Events fail, graph:%s, when %s", | |||
whole_graph_->GetName().c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Insert Graph Events fail, graph:%s,", | |||
whole_graph_->GetName().c_str()); | |||
GELOGE(status, "Graph ReorderEventNodes failed"); | |||
return status; | |||
} | |||
@@ -1542,8 +1542,8 @@ Status StreamAllocator::GetMaxStreamAndTask(bool huge_stream, uint32_t &max_stre | |||
} | |||
rtError_t ret = rtGetMaxStreamAndTask(stream_type, &max_stream_count, &max_task_count); | |||
if (ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "call rtGetMaxStreamAndTask fail, ret:%d, stream_type:%u, when %s", | |||
static_cast<int>(ret), stream_type, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "call rtGetMaxStreamAndTask fail, ret:%d, stream_type:%u,", | |||
static_cast<int>(ret), stream_type); | |||
GELOGE(FAILED, "Get max stream and task count by rts failed."); | |||
return FAILED; | |||
} | |||
@@ -1686,7 +1686,7 @@ Status StreamAllocator::AddActiveNodes(NodePtr &switch_node, const vector<string | |||
for (size_t i = 0; i < label_num; i++) { | |||
const string &active_label = ori_active_label_list[i]; | |||
if (labeled_streams_.find(active_label) == labeled_streams_.end()) { | |||
REPORT_INNER_ERROR("E19999", "can not find stream label:%s when %s", active_label.c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "can not find stream label:%s", active_label.c_str()); | |||
GELOGE(FAILED, "can not find stream label %s", active_label.c_str()); | |||
return FAILED; | |||
} | |||
@@ -1713,15 +1713,15 @@ Status StreamAllocator::AddActiveNodes(NodePtr &switch_node, const vector<string | |||
} | |||
GE_CHECK_NOTNULL(switch_node->GetOutControlAnchor()); | |||
if (switch_node->GetOutControlAnchor()->Unlink(node->GetInControlAnchor()) != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("Unlink %s to %s failed when %s", | |||
switch_node->GetName().c_str(), node->GetName().c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Unlink %s to %s failed", | |||
switch_node->GetName().c_str(), node->GetName().c_str()); | |||
GELOGE(FAILED, "Unlink %s to %s failed.", switch_node->GetName().c_str(), node->GetName().c_str()); | |||
return FAILED; | |||
} | |||
GE_CHECK_NOTNULL(active_node->GetOutControlAnchor()); | |||
if (active_node->GetOutControlAnchor()->LinkTo(node->GetInControlAnchor()) != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("Link %s to %s failed when %s", | |||
active_node->GetName().c_str(), node->GetName().c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Link %s to %s failed", | |||
active_node->GetName().c_str(), node->GetName().c_str()); | |||
GELOGE(FAILED, "Link %s to %s failed.", active_node->GetName().c_str(), node->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -1752,15 +1752,15 @@ Status StreamAllocator::AddActiveNodes(NodePtr &switch_node, const vector<string | |||
Status StreamAllocator::SetActiveStreamList(NodePtr &active_node, const string &active_label) { | |||
if (labeled_streams_.find(active_label) == labeled_streams_.end()) { | |||
REPORT_INNER_ERROR("E19999", "Can not find stream label:%s when %s", active_label.c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Can not find stream label:%s", active_label.c_str()); | |||
GELOGE(FAILED, "Can not find stream label %s.", active_label.c_str()); | |||
return FAILED; | |||
} | |||
set<int64_t> &streams = labeled_streams_[active_label]; | |||
vector<int64_t> active_streams(streams.begin(), streams.end()); | |||
if (!AttrUtils::SetListInt(active_node->GetOpDesc(), ATTR_NAME_ACTIVE_STREAM_LIST, active_streams)) { | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s) when %s", ATTR_NAME_ACTIVE_STREAM_LIST.c_str(), | |||
active_node->GetName().c_str(), active_node->GetType().c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s)", ATTR_NAME_ACTIVE_STREAM_LIST.c_str(), | |||
active_node->GetName().c_str(), active_node->GetType().c_str()); | |||
GELOGE(FAILED, "SetListInt of %s failed.", ATTR_NAME_ACTIVE_STREAM_LIST.c_str()); | |||
return FAILED; | |||
} | |||
@@ -126,8 +126,8 @@ Status StreamGraphOptimizer::OptimizeStreamedSubGraph(const ComputeGraphPtr &com | |||
int64_t stream_id = op_desc->GetStreamId(); | |||
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 " | |||
"run_context.graphStreamList.size():%zu when %s", stream_id, op_desc->GetName().c_str(), | |||
op_desc->GetType().c_str(), run_context.graphStreamList.size(), __FUNCTION__); | |||
"run_context.graphStreamList.size():%zu", stream_id, op_desc->GetName().c_str(), | |||
op_desc->GetType().c_str(), run_context.graphStreamList.size()); | |||
GELOGE(FAILED, "stream_id %ld is bigger than run_context.graphStreamList.size() %zu", stream_id, | |||
run_context.graphStreamList.size()); | |||
return FAILED; | |||
@@ -71,7 +71,7 @@ Status TaskGenerator::GetTaskInfo(Model &model, ComputeGraphPtr &graph, uint64_t | |||
GELOGD("Begin to Get TaskInfo. session_id=%lu", session_id); | |||
// Check params | |||
if (graph == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Check param graph is null, session_id:%lu, when %s", session_id, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Check param graph is null, session_id:%lu", session_id); | |||
GELOGE(PARAM_INVALID, "GetTaskInfo param graph is null. session_id=%lu", session_id); | |||
return PARAM_INVALID; | |||
} | |||
@@ -96,8 +96,8 @@ Status TaskGenerator::GetTaskInfo(Model &model, ComputeGraphPtr &graph, uint64_t | |||
op_name.push_back(iter.second); | |||
} | |||
GE_CHK_BOOL_EXEC(ge::AttrUtils::SetListStr(model, ATTR_MODEL_TASK_INDEX_OP_NAME, op_name), | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for model:%s when %s", | |||
ATTR_MODEL_TASK_INDEX_OP_NAME.c_str(), model.GetName().c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for model:%s", | |||
ATTR_MODEL_TASK_INDEX_OP_NAME.c_str(), model.GetName().c_str()); | |||
GELOGE(FAILED, "SetListStr failed."); | |||
return FAILED); | |||
@@ -111,8 +111,8 @@ Status TaskGenerator::GetTaskInfo(Model &model, ComputeGraphPtr &graph, uint64_t | |||
for (const TaskDef &task_def_temp : task_def_list) { | |||
TaskDef *task_def = model_task_def.add_task(); | |||
if (task_def == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Add task_def in ModelTaskDef fail, session_id:%lu, graph:%s, model:%s, when %s", | |||
session_id, graph->GetName().c_str(), model.GetName().c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Add task_def in ModelTaskDef fail, session_id:%lu, graph:%s, model:%s", | |||
session_id, graph->GetName().c_str(), model.GetName().c_str()); | |||
GELOGE(FAILED, "task_def is nullptr."); | |||
return FAILED; | |||
} | |||
@@ -133,44 +133,44 @@ Status TaskGenerator::AddModelTaskToModel(const ModelTaskDef &model_task_def, ui | |||
RunContext &run_context) { | |||
GE_CHK_BOOL_EXEC( | |||
AttrUtils::SetInt(model, MODEL_ATTR_TASK_GEN_BASE_ADDR, reinterpret_cast<uintptr_t>(run_context.dataMemBase)), | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for model:%s when %s", | |||
MODEL_ATTR_TASK_GEN_BASE_ADDR.c_str(), model.GetName().c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for model:%s", | |||
MODEL_ATTR_TASK_GEN_BASE_ADDR.c_str(), model.GetName().c_str()); | |||
GELOGE(FAILED, "SetInt MODEL_ATTR_TASK_GEN_BASE_ADDR failed."); | |||
return FAILED); | |||
GE_CHK_BOOL_EXEC( | |||
AttrUtils::SetInt(model, MODEL_ATTR_TASK_GEN_WEIGHT_ADDR, reinterpret_cast<uintptr_t>(run_context.weightMemBase)), | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for model:%s when %s", | |||
MODEL_ATTR_TASK_GEN_WEIGHT_ADDR.c_str(), model.GetName().c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for model:%s", | |||
MODEL_ATTR_TASK_GEN_WEIGHT_ADDR.c_str(), model.GetName().c_str()); | |||
GELOGE(FAILED, "SetInt MODEL_ATTR_TASK_GEN_WEIGHT_ADDR failed."); | |||
return FAILED); | |||
GE_CHK_BOOL_EXEC(AttrUtils::SetInt(model, ATTR_MODEL_TASK_GEN_VAR_ADDR, reinterpret_cast<uintptr_t>(var_mem_base_)), | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for model:%s when %s", | |||
ATTR_MODEL_TASK_GEN_VAR_ADDR.c_str(), model.GetName().c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for model:%s", | |||
ATTR_MODEL_TASK_GEN_VAR_ADDR.c_str(), model.GetName().c_str()); | |||
GELOGE(FAILED, "SetInt ATTR_MODEL_TASK_GEN_VAR_ADDR failed."); | |||
return FAILED); | |||
GE_CHK_BOOL_EXEC(AttrUtils::SetInt(model, ATTR_MODEL_VAR_SIZE, var_mem_size_), | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for model:%s when %s", | |||
ATTR_MODEL_VAR_SIZE.c_str(), model.GetName().c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for model:%s", | |||
ATTR_MODEL_VAR_SIZE.c_str(), model.GetName().c_str()); | |||
GELOGE(FAILED, "SetInt ATTR_MODEL_VAR_SIZE failed."); | |||
return FAILED); | |||
GE_CHK_BOOL_EXEC(AttrUtils::SetInt(model, MODEL_ATTR_SESSION_ID, session_id), | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for mode:%s when %s", | |||
MODEL_ATTR_SESSION_ID.c_str(), model.GetName().c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for mode:%s", | |||
MODEL_ATTR_SESSION_ID.c_str(), model.GetName().c_str()); | |||
GELOGE(FAILED, "SetInt MODEL_ATTR_SESSION_ID failed."); | |||
return FAILED); | |||
size_t task_size = model_task_def.ByteSizeLong(); | |||
ge::Buffer serial_buff(task_size); | |||
if (!model_task_def.SerializePartialToArray(serial_buff.GetData(), static_cast<int>(task_size))) { | |||
REPORT_INNER_ERROR("E19999", "model_task_def's serialize failed, model name = %s, task_size=%zu when %s", | |||
model.GetName().c_str(), task_size, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "model_task_def's serialize failed, model name = %s, task_size=%zu", | |||
model.GetName().c_str(), task_size); | |||
GELOGE(FAILED, "model_task_def's serialize failed, model name = %s, task_size=%zu.", model.GetName().c_str(), | |||
task_size); | |||
return FAILED; | |||
} | |||
if (!AttrUtils::SetZeroCopyBytes(model, MODEL_ATTR_TASKS, std::move(serial_buff))) { | |||
REPORT_INNER_ERROR("E19999", "Set model task to model failed, model name = %s, task_size=%zu when %s", | |||
model.GetName().c_str(), task_size, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Set model task to model failed, model name = %s, task_size=%zu", | |||
model.GetName().c_str(), task_size); | |||
GELOGE(FAILED, "Set model task to model failed, model name = %s, task_size=%zu.", model.GetName().c_str(), | |||
task_size); | |||
return FAILED; | |||
@@ -189,8 +189,8 @@ Status TaskGenerator::UpdateOpIsVarAttr(const OpDescPtr &op_desc, uint64_t sessi | |||
input_var.push_back(VarManager::Instance(session_id)->IsVarAddr(input)); | |||
} | |||
GE_CHK_BOOL_EXEC(AttrUtils::SetListBool(op_desc, kIsInputVar, input_var), | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s) when %s", kIsInputVar, | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s)", kIsInputVar, | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(FAILED, "SetListBool failed."); | |||
return FAILED); | |||
} | |||
@@ -202,8 +202,8 @@ Status TaskGenerator::UpdateOpIsVarAttr(const OpDescPtr &op_desc, uint64_t sessi | |||
output_var.push_back(VarManager::Instance(session_id)->IsVarAddr(output)); | |||
} | |||
GE_CHK_BOOL_EXEC(AttrUtils::SetListBool(op_desc, kIsOutputVar, output_var), | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s) when %s", kIsOutputVar, | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s)", kIsOutputVar, | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(FAILED, "SetListBool failed."); | |||
return FAILED); | |||
} | |||
@@ -279,7 +279,7 @@ Status TaskGenerator::GenerateTask(RunContext &run_context, ComputeGraphPtr &gra | |||
GELOGD("Beign to generate task, graph name is %s.", graph->GetName().c_str()); | |||
std::shared_ptr<GELib> ge_lib = GELib::GetInstance(); | |||
if ((ge_lib == nullptr) || !ge_lib->InitFlag()) { | |||
REPORT_INNER_ERROR("E19999", "Check GELib instance not init before when %s", __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Check GELib instance not init before"); | |||
GELOGE(GE_CLI_GE_NOT_INITIALIZED, "GenerateTask failed."); | |||
return GE_CLI_GE_NOT_INITIALIZED; | |||
} | |||
@@ -347,8 +347,8 @@ Status TaskGenerator::GenerateTask(RunContext &run_context, ComputeGraphPtr &gra | |||
} | |||
auto kernel_info_store = ops_kernel_manager.GetOpsKernelInfoStore(op_kernel_lib_name); | |||
if (kernel_info_store == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Get ops kernel info store failed for op:%s(%s), op_kernel_name:%s when %s", | |||
node->GetName().c_str(), node->GetType().c_str(), op_kernel_lib_name.c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Get ops kernel info store failed for op:%s(%s), op_kernel_name:%s", | |||
node->GetName().c_str(), node->GetType().c_str(), op_kernel_lib_name.c_str()); | |||
GELOGE(INTERNAL_ERROR, | |||
"No ops kernel store or ops kernel builder found. node:%s(%s), op_kernel_lib_name=%s.", | |||
name.c_str(), | |||
@@ -374,8 +374,8 @@ Status TaskGenerator::GenerateTask(RunContext &run_context, ComputeGraphPtr &gra | |||
auto ret = OpsKernelBuilderManager::Instance().GenerateTask(*node, run_context, task_def_list); | |||
GE_TIMESTAMP_ADD(GenerateTask); | |||
if (ret != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Call OpsKernelBuilderManager GenerateTask fail for op:%s(%s) when %s", | |||
node->GetName().c_str(), node->GetType().c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call OpsKernelBuilderManager GenerateTask fail for op:%s(%s)", | |||
node->GetName().c_str(), node->GetType().c_str()); | |||
GELOGE(ret, "Call %s to generate node[name:%s(%s), id:%ld, stream_id:%ld] task failed.", | |||
op_kernel_lib_name.c_str(), name.c_str(), type.c_str(), op_id, stream_id); | |||
return ret; | |||
@@ -452,9 +452,9 @@ Status TaskGenerator::GenerateTaskForFusionNode(FusionTaskInfo &fusion_task_info | |||
size_t task_list_size_before = task_def_list.size(); | |||
OpsKernelInfoStorePtr kernel_info_store = ops_kernel_manager.GetOpsKernelInfoStore(op_kernel_lib_name); | |||
if (kernel_info_store == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Get ops kernel info store failed for op:%s(%s), op_kernel_name:%s when %s", | |||
REPORT_INNER_ERROR("E19999", "Get ops kernel info store failed for op:%s(%s), op_kernel_name:%s", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), | |||
op_kernel_lib_name.c_str(), __FUNCTION__); | |||
op_kernel_lib_name.c_str()); | |||
GELOGE(INTERNAL_ERROR, | |||
"Fusion: No ops kernel store or ops kernel builder found. fusion_node:%s(%s), op_kernel_lib_name=%s.", | |||
fusion_node_name.c_str(), fusion_node_type.c_str(), op_kernel_lib_name.c_str()); | |||
@@ -472,8 +472,8 @@ Status TaskGenerator::GenerateTaskForFusionNode(FusionTaskInfo &fusion_task_info | |||
int64_t stream_id = op_desc->GetStreamId(); | |||
if (stream_id < 0 || stream_id >= (int64_t)run_context.graphStreamList.size()) { | |||
REPORT_INNER_ERROR("E19999", "Fusion: fusion_node[name:%s(%s), id:%ld] stream id is invalid, " | |||
"stream list size=%zu, when %s", fusion_node_name.c_str(), fusion_node_type.c_str(), | |||
op_id, run_context.graphStreamList.size(), __FUNCTION__); | |||
"stream list size=%zu", fusion_node_name.c_str(), fusion_node_type.c_str(), | |||
op_id, run_context.graphStreamList.size()); | |||
GELOGE(INTERNAL_ERROR, "Fusion: fusion_node[name:%s(%s), id:%ld] stream id is invalid, stream list size=%zu", | |||
fusion_node_name.c_str(), fusion_node_type.c_str(), op_id, run_context.graphStreamList.size()); | |||
return INTERNAL_ERROR; | |||
@@ -486,8 +486,8 @@ Status TaskGenerator::GenerateTaskForFusionNode(FusionTaskInfo &fusion_task_info | |||
ret = OpsKernelBuilderManager::Instance().GenerateTask(*fusion_node, run_context, task_def_list); | |||
if (ret != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", " Call %s to generate fusion_node:[fusion_node_name:%s(%s), " | |||
"id:%ld, stream_id:%ld] task failed when %s", op_kernel_lib_name.c_str(), | |||
fusion_node_name.c_str(), fusion_node_type.c_str(), op_id, stream_id, __FUNCTION__); | |||
"id:%ld, stream_id:%ld] task failed", op_kernel_lib_name.c_str(), | |||
fusion_node_name.c_str(), fusion_node_type.c_str(), op_id, stream_id); | |||
GELOGE(ret, | |||
"Fusion: Call %s to generate fusion_node:[fusion_node_name:%s(%s), " | |||
"id:%ld, stream_id:%ld] task failed.", | |||
@@ -500,9 +500,9 @@ Status TaskGenerator::GenerateTaskForFusionNode(FusionTaskInfo &fusion_task_info | |||
// if tasks is reduced | |||
if (task_list_size_after < task_list_size_before) { | |||
REPORT_INNER_ERROR("E19999", "InsertProfilingTask for fusion_node:[fusion_node_name:%s(%s), kernel_name:%s" | |||
"id:%ld, stream_id:%ld] task, but task num from %zu to %zu, check invalid when %s", | |||
"id:%ld, stream_id:%ld] task, but task num from %zu to %zu, check invalid", | |||
fusion_node_name.c_str(), fusion_node_type.c_str(), op_kernel_lib_name.c_str(), | |||
op_id, stream_id, task_list_size_before, task_list_size_after, __FUNCTION__); | |||
op_id, stream_id, task_list_size_before, task_list_size_after); | |||
GELOGE(FAILED, | |||
"Fusion: Call %s to generate fusion_node:[fusion_node_name:%s(%s), " | |||
"id:%ld, stream_id:%ld] task. but task num from %zu to %zu.", | |||
@@ -537,8 +537,8 @@ Status TaskGenerator::GenerateTaskForFusionNode(FusionTaskInfo &fusion_task_info | |||
Status TaskGenerator::UpdateAnchorStatus(const NodePtr &node) { | |||
if (NodeUtils::SetAllAnchorStatus(node) != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "SetAllAnchorStatus fail for op:%s(%s) when %s", | |||
node->GetName().c_str(), node->GetType().c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "SetAllAnchorStatus fail for op:%s(%s)", | |||
node->GetName().c_str(), node->GetType().c_str()); | |||
GELOGE(INTERNAL_ERROR, "NodeUtils::SetAllAnchorStatus failed."); | |||
return INTERNAL_ERROR; | |||
} | |||
@@ -546,8 +546,8 @@ Status TaskGenerator::UpdateAnchorStatus(const NodePtr &node) { | |||
auto peer_anchor = anchor->GetPeerOutAnchor(); | |||
if (peer_anchor == nullptr) { | |||
if (AnchorUtils::SetStatus(anchor, ANCHOR_SUSPEND) != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Set in peer anchor status fail for op:%s(%s), anchor_index:%d, when %s", | |||
node->GetName().c_str(), node->GetType().c_str(), anchor->GetIdx(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Set in peer anchor status fail for op:%s(%s), anchor_index:%d,", | |||
node->GetName().c_str(), node->GetType().c_str(), anchor->GetIdx()); | |||
GELOGE(INTERNAL_ERROR, "AnchorUtils::SetStatus failed."); | |||
return INTERNAL_ERROR; | |||
} | |||
@@ -558,15 +558,15 @@ Status TaskGenerator::UpdateAnchorStatus(const NodePtr &node) { | |||
bool is_const = NodeUtils::GetConstOpType(peer_anchor->GetOwnerNode(), const_type); | |||
if (is_const && (const_type == CONSTANT)) { | |||
if (AnchorUtils::SetStatus(anchor, ANCHOR_CONST) != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Set in anchor CONST status fail for op:%s(%s), anchor_index:%d, when %s", | |||
node->GetName().c_str(), node->GetType().c_str(), anchor->GetIdx(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Set in anchor CONST status fail for op:%s(%s), anchor_index:%d,", | |||
node->GetName().c_str(), node->GetType().c_str(), anchor->GetIdx()); | |||
GELOGE(INTERNAL_ERROR, "AnchorUtils::SetStatus failed."); | |||
return INTERNAL_ERROR; | |||
} | |||
} else { | |||
if (AnchorUtils::SetStatus(anchor, ANCHOR_DATA) != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Set in anchor DATA status fail for op:%s(%s), anchor_index:%d, when %s", | |||
node->GetName().c_str(), node->GetType().c_str(), anchor->GetIdx(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Set in anchor DATA status fail for op:%s(%s), anchor_index:%d,", | |||
node->GetName().c_str(), node->GetType().c_str(), anchor->GetIdx()); | |||
GELOGE(INTERNAL_ERROR, "AnchorUtils::SetStatus failed."); | |||
return INTERNAL_ERROR; | |||
} | |||
@@ -579,15 +579,15 @@ Status TaskGenerator::UpdateAnchorStatus(const NodePtr &node) { | |||
Status TaskGenerator::MarkNodeAndSetIndex(ComputeGraphPtr &graph) { | |||
auto ge_lib = GELib::GetInstance(); | |||
if ((ge_lib == nullptr) || !ge_lib->InitFlag()) { | |||
REPORT_INNER_ERROR("E19999", "Check GELib instance not init before when %s", __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Check GELib instance not init before"); | |||
GELOGE(GE_CLI_GE_NOT_INITIALIZED, "GE is not initialized or is finalized."); | |||
return GE_CLI_GE_NOT_INITIALIZED; | |||
} | |||
const auto all_nodes = graph->GetNodes(graph->GetGraphUnknownFlag()); | |||
if (all_nodes.empty()) { | |||
REPORT_INNER_ERROR("E19999", "Check param all_nodes empty in graph:%s when %s", | |||
graph->GetName().c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Check param all_nodes empty in graph:%s", | |||
graph->GetName().c_str()); | |||
GELOGE(GE_GRAPH_GRAPH_NODE_NULL, "Graph's node is empty"); | |||
return GE_GRAPH_GRAPH_NODE_NULL; | |||
} | |||
@@ -643,9 +643,9 @@ Status TaskGenerator::MarkFirstAndLastOps(const vector<OpDescPtr> &ops, bool is_ | |||
for (auto &op_desc : continuous_ops) { | |||
string op_kernel_lib_name = op_desc->GetOpKernelLibName(); | |||
if (op_kernel_lib_name.empty()) { | |||
REPORT_INNER_ERROR("E19999", "Get ops kernel info store failed for op:%s(%s), op_kernel_name:%s when %s", | |||
REPORT_INNER_ERROR("E19999", "Get ops kernel info store failed for op:%s(%s), op_kernel_name:%s", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), | |||
op_kernel_lib_name.c_str(), __FUNCTION__); | |||
op_kernel_lib_name.c_str()); | |||
GELOGE(INTERNAL_ERROR, "node:%s(%s) get op kernel lib failed.", op_desc->GetName().c_str(), | |||
op_desc->GetType().c_str()); | |||
return INTERNAL_ERROR; | |||
@@ -662,15 +662,13 @@ Status TaskGenerator::MarkFirstAndLastOps(const vector<OpDescPtr> &ops, bool is_ | |||
for (auto &it : first_and_last_ops) { | |||
auto &op_pair = it.second; | |||
GE_CHK_BOOL_EXEC(ge::AttrUtils::SetBool(op_pair.first, kIsFirstNode, true), | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s) when %s", kIsFirstNode, | |||
op_pair.first->GetName().c_str(), op_pair.first->GetType().c_str(), | |||
__FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s)", kIsFirstNode, | |||
op_pair.first->GetName().c_str(), op_pair.first->GetType().c_str()); | |||
GELOGE(FAILED, "SetBool failed."); | |||
return FAILED); | |||
GE_CHK_BOOL_EXEC(ge::AttrUtils::SetBool(op_pair.second, kIsLastNode, true), | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s) when %s", kIsLastNode, | |||
op_pair.second->GetName().c_str(), op_pair.second->GetType().c_str(), | |||
__FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s)", kIsLastNode, | |||
op_pair.second->GetName().c_str(), op_pair.second->GetType().c_str()); | |||
GELOGE(FAILED, "SetBool failed."); | |||
return FAILED); | |||
} | |||
@@ -1185,7 +1183,7 @@ Status TaskGenerator::SetUnknownShapeStream(RunContext &run_context, rtStream_t | |||
run_context.stream = stream; | |||
rtError_t rt_ret = rtModelBindStream(run_context.model, stream, 0); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtModelBindStream failed, ret:0x%X when %s", rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtModelBindStream failed, ret:0x%X", rt_ret); | |||
GELOGE(FAILED, "Call rt api failed, ret: 0x%X", rt_ret); | |||
GE_CHK_RT_RET(rtStreamDestroy(stream)); | |||
return FAILED; | |||
@@ -111,14 +111,14 @@ class BCast { | |||
const std::function<OutT(InT const &, InT const &)> &func) { | |||
Status ret; | |||
if (func == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Check param func nullptr when %s", __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Check param func nullptr"); | |||
GELOGE(domi::PARAM_INVALID, "Param func is null"); | |||
return domi::PARAM_INVALID; | |||
} | |||
// Min input num is 2 | |||
if (input.size() < kMinDimNum) { | |||
REPORT_INNER_ERROR("E19999", "Param input.size():%zu < %zu, check invalid when %s", | |||
input.size(), kMinDimNum, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Param input.size():%zu < %zu, check invalid", | |||
input.size(), kMinDimNum); | |||
GELOGE(domi::PARAM_INVALID, "Input size is smaller than two."); | |||
return domi::PARAM_INVALID; | |||
} | |||
@@ -152,14 +152,14 @@ class BCast { | |||
Status BCastComputeCheck(const std::vector<ConstGeTensorPtr> &input, std::vector<OutT> &v_output, | |||
const std::function<OutT(InT const &, InT const &, DataType &type, Status &)> &func) { | |||
if (func == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Check param func nullptr when %s", __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Check param func nullptr"); | |||
GELOGE(PARAM_INVALID, "Param func is null"); | |||
return PARAM_INVALID; | |||
} | |||
// Min input num is 2 | |||
if (input.size() < kMinDimNum) { | |||
REPORT_INNER_ERROR("E19999", "Param input.size():%zu < %zu, check invalid when %s", | |||
input.size(), kMinDimNum, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Param input.size():%zu < %zu, check invalid", | |||
input.size(), kMinDimNum); | |||
GELOGE(PARAM_INVALID, "Input size is smaller than two."); | |||
return PARAM_INVALID; | |||
} | |||
@@ -38,8 +38,8 @@ Status GetOriginalType(const ge::NodePtr &node, string &type) { | |||
GE_CHECK_NOTNULL(node->GetOpDesc()); | |||
bool ret = ge::AttrUtils::GetStr(node->GetOpDesc(), ATTR_NAME_FRAMEWORK_ORIGINAL_TYPE, type); | |||
if (!ret) { | |||
REPORT_INNER_ERROR("E19999", "Get Attr:%s fail for op:%s(%s) when %s", ATTR_NAME_FRAMEWORK_ORIGINAL_TYPE.c_str(), | |||
node->GetName().c_str(), node->GetType().c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Get Attr:%s fail for op:%s(%s)", ATTR_NAME_FRAMEWORK_ORIGINAL_TYPE.c_str(), | |||
node->GetName().c_str(), node->GetType().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Get FrameWorkOp original type [%s]", type.c_str()); | |||
return INTERNAL_ERROR; | |||
} | |||
@@ -59,8 +59,8 @@ Status SetStreamLabel(const ge::NodePtr &node, const std::string &label) { | |||
GE_CHECK_NOTNULL(tmp_desc); | |||
if (!AttrUtils::SetStr(tmp_desc, ge::ATTR_NAME_STREAM_LABEL, label)) { | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s) when %s", ATTR_NAME_STREAM_LABEL.c_str(), | |||
node->GetName().c_str(), node->GetType().c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s)", ATTR_NAME_STREAM_LABEL.c_str(), | |||
node->GetName().c_str(), node->GetType().c_str()); | |||
GELOGE(FAILED, "Op: %s set ATTR_NAME_STREAM_LABEL failed", node->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -78,8 +78,8 @@ Status SetCycleEvent(const ge::NodePtr &node) { | |||
OpDescPtr tmp_desc = node->GetOpDesc(); | |||
GE_CHECK_NOTNULL(tmp_desc); | |||
if (!AttrUtils::SetBool(tmp_desc, ge::ATTR_NAME_STREAM_CYCLE_EVENT_FLAG, true)) { | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s) when %s", ATTR_NAME_STREAM_CYCLE_EVENT_FLAG.c_str(), | |||
node->GetName().c_str(), node->GetType().c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s)", ATTR_NAME_STREAM_CYCLE_EVENT_FLAG.c_str(), | |||
node->GetName().c_str(), node->GetType().c_str()); | |||
GELOGE(FAILED, "Op: %s set ATTR_NAME_STREAM_CYCLE_EVENT_FLAG failed", node->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -98,8 +98,8 @@ Status SetActiveLabelList(const ge::NodePtr &node, const std::vector<std::string | |||
OpDescPtr tmp_desc = node->GetOpDesc(); | |||
GE_CHECK_NOTNULL(tmp_desc); | |||
if (!AttrUtils::SetListStr(tmp_desc, ge::ATTR_NAME_ACTIVE_LABEL_LIST, active_label_list)) { | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s) when %s", ATTR_NAME_ACTIVE_LABEL_LIST.c_str(), | |||
node->GetName().c_str(), node->GetType().c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s)", ATTR_NAME_ACTIVE_LABEL_LIST.c_str(), | |||
node->GetName().c_str(), node->GetType().c_str()); | |||
GELOGE(FAILED, "Op: %s set ATTR_NAME_ACTIVE_LABEL_LIST failed", node->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -118,8 +118,8 @@ Status SetSwitchBranchNodeLabel(const ge::NodePtr &node, const std::string &bran | |||
OpDescPtr tmp_desc = node->GetOpDesc(); | |||
GE_CHECK_NOTNULL(tmp_desc); | |||
if (!AttrUtils::SetStr(tmp_desc, ge::ATTR_NAME_SWITCH_BRANCH_NODE_LABEL, branch_label)) { | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s) when %s", ATTR_NAME_SWITCH_BRANCH_NODE_LABEL.c_str(), | |||
node->GetName().c_str(), node->GetType().c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s)", ATTR_NAME_SWITCH_BRANCH_NODE_LABEL.c_str(), | |||
node->GetName().c_str(), node->GetType().c_str()); | |||
GELOGE(FAILED, "Op: %s set ATTR_NAME_SWITCH_BRANCH_NODE_LABEL failed", node->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -138,8 +138,8 @@ Status SetSwitchTrueBranchFlag(const ge::NodePtr &node, bool value) { | |||
OpDescPtr tmp_desc = node->GetOpDesc(); | |||
GE_CHECK_NOTNULL(tmp_desc); | |||
if (!AttrUtils::SetBool(tmp_desc, ge::ATTR_NAME_SWITCH_TRUE_BRANCH_FLAG, value)) { | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s) when %s", ATTR_NAME_SWITCH_TRUE_BRANCH_FLAG.c_str(), | |||
node->GetName().c_str(), node->GetType().c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s)", ATTR_NAME_SWITCH_TRUE_BRANCH_FLAG.c_str(), | |||
node->GetName().c_str(), node->GetType().c_str()); | |||
GELOGE(FAILED, "Op: %s set ATTR_NAME_SWITCH_TRUE_BRANCH_FLAG failed", node->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -158,8 +158,8 @@ Status SetOriginalNodeName(const ge::NodePtr &node, const std::string &orig_name | |||
OpDescPtr tmp_desc = node->GetOpDesc(); | |||
GE_CHECK_NOTNULL(tmp_desc); | |||
if (!AttrUtils::SetStr(tmp_desc, ge::ATTR_NAME_ORIG_NODE_NAME, orig_name)) { | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s) when %s", ATTR_NAME_ORIG_NODE_NAME.c_str(), | |||
node->GetName().c_str(), node->GetType().c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s)", ATTR_NAME_ORIG_NODE_NAME.c_str(), | |||
node->GetName().c_str(), node->GetType().c_str()); | |||
GELOGE(FAILED, "Op: %s set ATTR_NAME_ORIG_NODE_NAME failed", node->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -177,8 +177,8 @@ Status SetCyclicDependenceFlag(const ge::NodePtr &node) { | |||
OpDescPtr tmp_desc = node->GetOpDesc(); | |||
GE_CHECK_NOTNULL(tmp_desc); | |||
if (!AttrUtils::SetBool(tmp_desc, ge::ATTR_NAME_CYCLIC_DEPENDENCE_FLAG, true)) { | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s) when %s", ATTR_NAME_CYCLIC_DEPENDENCE_FLAG.c_str(), | |||
node->GetName().c_str(), node->GetType().c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s)", ATTR_NAME_CYCLIC_DEPENDENCE_FLAG.c_str(), | |||
node->GetName().c_str(), node->GetType().c_str()); | |||
GELOGE(FAILED, "Op: %s set ATTR_NAME_CYCLIC_DEPENDENCE_FLAG failed", node->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -198,8 +198,8 @@ Status SetNextIteration(const ge::NodePtr &node, const std::string &next) { | |||
GE_CHECK_NOTNULL(tmp_desc); | |||
if (!AttrUtils::SetStr(tmp_desc, ge::ATTR_NAME_NEXT_ITERATION, next)) { | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s) when %s", ATTR_NAME_NEXT_ITERATION.c_str(), | |||
node->GetName().c_str(), node->GetType().c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s)", ATTR_NAME_NEXT_ITERATION.c_str(), | |||
node->GetName().c_str(), node->GetType().c_str()); | |||
GELOGE(FAILED, "Op: %s set ATTR_NAME_NEXT_ITERATION failed", node->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -40,7 +40,7 @@ GraphExecutor::~GraphExecutor() { | |||
rtError_t rt_ret; | |||
rt_ret = rtFreeHost(buffer_addr); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtFreeHost failed, ret:0x%X when %s", rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtFreeHost failed, ret:0x%X", rt_ret); | |||
GELOGE(RT_FAILED, "[GraphManager] subgraph free buffer failed, ret: 0x%X", rt_ret); | |||
} | |||
} | |||
@@ -52,17 +52,17 @@ GraphExecutor::~GraphExecutor() { | |||
Status GraphExecutor::SetCondition(std::mutex *mutex, std::condition_variable *cond, | |||
std::shared_ptr<GraphModelListener> listener) { | |||
if (mutex == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Check param mutex nullptr when %s", __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Check param mutex nullptr"); | |||
GELOGE(GE_GRAPH_PARAM_NULLPTR, "[SetCondition] input param mutex is nullptr."); | |||
return GE_GRAPH_PARAM_NULLPTR; | |||
} | |||
if (cond == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Check param cond nullptr when %s", __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Check param cond nullptr"); | |||
GELOGE(GE_GRAPH_PARAM_NULLPTR, "[SetCondition] input param cond is nullptr."); | |||
return GE_GRAPH_PARAM_NULLPTR; | |||
} | |||
if (listener == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Check param listener nullptr when %s", __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Check param listener nullptr"); | |||
GELOGE(GE_GRAPH_PARAM_NULLPTR, "[SetCondition] input param listener is nullptr."); | |||
return GE_GRAPH_PARAM_NULLPTR; | |||
} | |||
@@ -79,7 +79,7 @@ Status GraphExecutor::SetCondition(std::mutex *mutex, std::condition_variable *c | |||
Status GraphExecutor::SetGraphContext(GraphContextPtr graph_context_ptr) { | |||
if (graph_context_ptr == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Check param graph_context_ptr nullptr when %s", __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Check param graph_context_ptr nullptr"); | |||
GELOGE(GE_GRAPH_PARAM_NULLPTR, "[SetGraphContext] input param graph_context_ptr is nullptr"); | |||
return GE_GRAPH_PARAM_NULLPTR; | |||
} | |||
@@ -106,7 +106,7 @@ Status GraphExecutor::FreeInOutBuffer() { | |||
rtError_t rt_ret; | |||
rt_ret = rtFreeHost(*iter); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtFreeHost failed, ret:0x%X when %s", rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtFreeHost failed, ret:0x%X", rt_ret); | |||
GELOGE(RT_FAILED, "[GraphManager] subgraph free buffer failed, ret: 0x%X", rt_ret); | |||
(void)buffer_addr_.erase(buffer_addr_.begin(), iter); | |||
return GE_GRAPH_FREE_FAILED; | |||
@@ -152,8 +152,8 @@ Status GraphExecutor::MallocInOutBuffer(const std::vector<uint64_t> &buffer_size | |||
void *tmp_buf = nullptr; | |||
rt_ret = rtMallocHost(&tmp_buf, buffer_size[i]); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMallocHost failed, size:%lu, ret:0x%X when %s", | |||
buffer_size[i], rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMallocHost failed, size:%lu, ret:0x%X", | |||
buffer_size[i], rt_ret); | |||
GELOGE(RT_FAILED, "[GraphManager] subgraph malloc buffer failed, ret: 0x%X", rt_ret); | |||
return GE_GRAPH_MALLOC_FAILED; | |||
} | |||
@@ -199,8 +199,8 @@ Status GraphExecutor::PrepareInputData(const std::vector<GeTensor> &input_tensor | |||
rtError_t rt_ret = rtMemcpy(addrVec[i], bufferSizeVec[i], in_tensor->GetData().data(), | |||
in_tensor->GetData().size(), RT_MEMCPY_HOST_TO_HOST); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, dst_size:%lu, src_size:%zu, ret:0x%X when %s", | |||
bufferSizeVec[i], in_tensor->GetData().size(), rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, dst_size:%lu, src_size:%zu, ret:0x%X", | |||
bufferSizeVec[i], in_tensor->GetData().size(), rt_ret); | |||
GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); | |||
return RT_FAILED; | |||
} | |||
@@ -260,8 +260,8 @@ Status GraphExecutor::SyncExecuteModel(uint32_t model_id, const std::vector<GeTe | |||
} | |||
if (graph_run_listener_->ResetResult() != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Call graph_run_listener_.ResetResult fail, model_id:%u, when %s", | |||
model_id, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call graph_run_listener_.ResetResult fail, model_id:%u", | |||
model_id); | |||
GELOGE(GE_GRAPH_EXECUTE_FAILED, "Reset result failed"); | |||
return GE_GRAPH_EXECUTE_FAILED; | |||
} | |||
@@ -285,8 +285,8 @@ Status GraphExecutor::SyncExecuteModel(uint32_t model_id, const std::vector<GeTe | |||
// Run graph return | |||
uint32_t result_code = graph_run_listener_->GetResultCode(); | |||
if (result_code != SUCCESS && result_code != END_OF_SEQUENCE) { | |||
REPORT_CALL_ERROR("E19999", "Graph_run_listener_ run fail, result:%u, model_id:%u, when %s", | |||
result_code, model_id, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Graph_run_listener_ run fail, result:%u, model_id:%u", | |||
result_code, model_id); | |||
GELOGE(GE_GRAPH_EXECUTE_FAILED, "[GraphExecutor] execute model failed, ret=%u, modelId=%u.", result_code, | |||
model_id); | |||
return GE_GRAPH_EXECUTE_FAILED; | |||
@@ -295,14 +295,14 @@ Status GraphExecutor::SyncExecuteModel(uint32_t model_id, const std::vector<GeTe | |||
for (size_t i = 0; i < output_data.blobs.size(); ++i) { | |||
DataBuffer outputDataTmp = output_data.blobs[i]; | |||
CHECK_FALSE_EXEC(outputDataTmp.length != 0, | |||
REPORT_INNER_ERROR("E19999", "Param output_data.length is 0 in model:%u, check invalid, when %s", | |||
model_id, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Param output_data.length is 0 in model:%u, check invalid", | |||
model_id); | |||
GELOGE(GE_GRAPH_EXECUTE_FAILED, "Failed to allocate memory, length is 0."); | |||
return GE_GRAPH_EXECUTE_FAILED); | |||
std::unique_ptr<uint8_t> outBufTmp(new (std::nothrow) uint8_t[outputDataTmp.length]); | |||
if (outBufTmp == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "New output buffer fail, length:%lu, model:%u, when %s", | |||
outputDataTmp.length, model_id, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "New output buffer fail, length:%lu, model:%u", | |||
outputDataTmp.length, model_id); | |||
GELOGE(FAILED, "Failed to allocate memory."); | |||
return FAILED; | |||
} | |||
@@ -310,8 +310,8 @@ Status GraphExecutor::SyncExecuteModel(uint32_t model_id, const std::vector<GeTe | |||
rtError_t ret_value = rtMemcpy(outBufTmp.get(), outputDataTmp.length, outputDataTmp.data, outputDataTmp.length, | |||
RT_MEMCPY_HOST_TO_HOST); | |||
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", | |||
outputDataTmp.length, outputDataTmp.length, ret_value, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, dst_size:%lu, src_size:%zu, ret:0x%X", | |||
outputDataTmp.length, outputDataTmp.length, ret_value); | |||
GELOGE(GE_GRAPH_EXECUTE_FAILED, "Call rt api rtMemcpy failed, ret: 0x%X", ret); | |||
return GE_GRAPH_EXECUTE_FAILED); | |||
GeTensor outTensor; | |||
@@ -364,8 +364,8 @@ Status GraphExecutor::ExecuteGraph(GraphId graph_id, const GeRootModelPtr &ge_ro | |||
last_graph_id_ = graph_id; | |||
if (!init_flag_) { | |||
REPORT_INNER_ERROR("E19999", "No SetCondition called before, graph:%u, check invalid when %s", | |||
graph_id, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "No SetCondition called before, graph:%u, check invalid", | |||
graph_id); | |||
GELOGE(GE_GRAPH_EXECUTE_NOT_INIT, "[GraphExecutor] AI Core Engine without calling SetCondition!"); | |||
return GE_GRAPH_EXECUTE_NOT_INIT; | |||
} | |||
@@ -414,12 +414,12 @@ Status GraphExecutor::AsyncExecuteModel(uint32_t model_id, const std::vector<Inp | |||
GELOGI("RunAsync success."); | |||
} 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 !"); | |||
CsaInteract::GetInstance().WriteErrorCode(FAILED, ERROR_MODULE_FMK, JOBSUBSTATE_GRAPH_EXEC); | |||
return MEMALLOC_FAILED; | |||
} 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 !"); | |||
CsaInteract::GetInstance().WriteErrorCode(FAILED, ERROR_MODULE_FMK, JOBSUBSTATE_GRAPH_EXEC); | |||
return FAILED; | |||
@@ -439,12 +439,12 @@ Status GraphExecutor::DataInput(const InputData &input_data, OutputData &output_ | |||
return ret; | |||
} | |||
} 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 !"); | |||
CsaInteract::GetInstance().WriteErrorCode(FAILED, ERROR_MODULE_FMK, JOBSUBSTATE_GRAPH_EXEC); | |||
return MEMALLOC_FAILED; | |||
} 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 !"); | |||
CsaInteract::GetInstance().WriteErrorCode(FAILED, ERROR_MODULE_FMK, JOBSUBSTATE_GRAPH_EXEC); | |||
return FAILED; | |||
@@ -465,12 +465,12 @@ Status GraphExecutor::GetInputOutputDescInfo(const uint32_t model_id, vector<Inp | |||
return ret; | |||
} | |||
} 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 !"); | |||
CsaInteract::GetInstance().WriteErrorCode(FAILED, ERROR_MODULE_FMK, JOBSUBSTATE_GRAPH_EXEC); | |||
return MEMALLOC_FAILED; | |||
} 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 !"); | |||
CsaInteract::GetInstance().WriteErrorCode(FAILED, ERROR_MODULE_FMK, JOBSUBSTATE_GRAPH_EXEC); | |||
return FAILED; | |||
@@ -494,12 +494,12 @@ Status GraphExecutor::GetInputOutputDescInfo(const uint32_t model_id, vector<Inp | |||
return ret; | |||
} | |||
} 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 !"); | |||
CsaInteract::GetInstance().WriteErrorCode(FAILED, ERROR_MODULE_FMK, JOBSUBSTATE_GRAPH_EXEC); | |||
return MEMALLOC_FAILED; | |||
} 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 !"); | |||
CsaInteract::GetInstance().WriteErrorCode(FAILED, ERROR_MODULE_FMK, JOBSUBSTATE_GRAPH_EXEC); | |||
return FAILED; | |||
@@ -42,8 +42,8 @@ Status CaseOpLabelMaker::Run(uint32_t &label_index) { | |||
const auto graph_names = case_desc->GetSubgraphInstanceNames(); | |||
if (graph_names.empty() || graph_names.size() > kMaxCaseBranch) { | |||
REPORT_INNER_ERROR("E19999", "Node:%s(%s) subgraph size: %zu, check invalid when %s", case_desc->GetName().c_str(), | |||
case_desc->GetType().c_str(), graph_names.size(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Node:%s(%s) subgraph size: %zu, check invalid", case_desc->GetName().c_str(), | |||
case_desc->GetType().c_str(), graph_names.size()); | |||
GELOGE(INTERNAL_ERROR, "Node: %s has invalid subgraph, graph size: %zu.", case_desc->GetName().c_str(), | |||
graph_names.size()); | |||
return FAILED; | |||
@@ -69,8 +69,8 @@ Status CaseOpLabelMaker::Run(uint32_t &label_index) { | |||
parent_node_->GetName() + "/StreamActive_" + std::to_string(index); // rtStreamActive | |||
NodePtr stream_active = AddStreamActive(graph, stream_active_name); | |||
if (stream_active == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "Add StreamActive node in graph:%s fail when %s", | |||
graph->GetName().c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Add StreamActive node in graph:%s fail", | |||
graph->GetName().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Subgraph: %s add stream active failed.", graph->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -79,8 +79,8 @@ Status CaseOpLabelMaker::Run(uint32_t &label_index) { | |||
std::string label_set_name = parent_node_->GetName() + "/LabelSet_" + std::to_string(index); // rtLabelSet | |||
NodePtr label = AddLabelSetEnter(graph, label_set_name, curr_label_index, stream_active); | |||
if (label == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "Add LabelSetEnter node in graph:%s fail when %s", | |||
graph->GetName().c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Add LabelSetEnter node in graph:%s fail", | |||
graph->GetName().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Subgraph: %s add label set failed.", graph->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -94,8 +94,8 @@ Status CaseOpLabelMaker::Run(uint32_t &label_index) { | |||
// middle node, add goto node to tail. | |||
std::string label_goto_name = parent_node_->GetName() + "/LabelGoto_" + std::to_string(index); // rtLabelGoto | |||
if (AddLabelGotoLeave(graph, label_goto_name, last_label_index) == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "Add LabelGotoLeave node in graph:%s fail when %s", | |||
graph->GetName().c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Add LabelGotoLeave node in graph:%s fail", | |||
graph->GetName().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Subgraph: %s add label goto failed.", graph->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -103,8 +103,8 @@ Status CaseOpLabelMaker::Run(uint32_t &label_index) { | |||
// last node, add label node to tail. | |||
std::string last_label_name = parent_node_->GetName() + "/LabelSet_Last"; // rtLabelSet | |||
if (AddLabelSetLeave(graph, last_label_name, last_label_index) == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "Add LabelSetLeave node in graph:%s fail when %s", | |||
graph->GetName().c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Add LabelSetLeave node in graph:%s fail", | |||
graph->GetName().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Subgraph: %s add label set failed.", graph->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -120,16 +120,16 @@ Status CaseOpLabelMaker::Run(uint32_t &label_index) { | |||
const GeTensorDesc &pred_desc = case_desc->GetInputDesc(kCasePredIndex); | |||
NodePtr switch_node = AddLabelSwitchEnter(first_graph, label_switch_name, pred_desc, switch_labels); | |||
if (switch_node == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "Add LabelSwitchEnter node in graph:%s fail when %s", | |||
first_graph->GetName().c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Add LabelSwitchEnter node in graph:%s fail", | |||
first_graph->GetName().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Subgraph: %s add label switch failed.", first_graph->GetName().c_str()); | |||
return FAILED; | |||
} | |||
// Link control edge to then branch head. | |||
if (GraphUtils::AddEdge(switch_node->GetOutControlAnchor(), first_label->GetInControlAnchor()) != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Add ctrl edge from %s to %s in graph:%s fail when %s", switch_node->GetName().c_str(), | |||
first_label->GetName().c_str(), first_graph->GetName().c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Add ctrl edge from %s to %s in graph:%s fail", switch_node->GetName().c_str(), | |||
first_label->GetName().c_str(), first_graph->GetName().c_str()); | |||
GELOGE(INTERNAL_ERROR, "LabelSwitchByIndex: Add ctrl edge to %s failed.", first_label->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -137,8 +137,8 @@ Status CaseOpLabelMaker::Run(uint32_t &label_index) { | |||
uint32_t parent_index = 0; // Case cond input is first. | |||
const std::string data_name = parent_node_->GetName() + "/SwitchIndexData"; | |||
if (AddLabelSwitchIndex(first_graph, data_name, pred_desc, switch_node, parent_index) == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "Add LabelSwitchIndex node in graph:%s fail when %s", | |||
first_graph->GetName().c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Add LabelSwitchIndex node in graph:%s fail", | |||
first_graph->GetName().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Subgraph: %s add switch input failed.", first_graph->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -44,9 +44,9 @@ Status IfOpLabelMaker::Run(uint32_t &label_index) { | |||
const std::string else_branch_name = if_desc->GetSubgraphInstanceName(kElseBranchIndex); | |||
if (then_branch_name.empty() || else_branch_name.empty()) { | |||
REPORT_INNER_ERROR("E19999", "Node:%s(%s), check subgraph invalid, " | |||
"then branch graph: %s, else branch graph: %s, when %s", | |||
"then branch graph: %s, else branch graph: %s", | |||
if_desc->GetName().c_str(), if_desc->GetType().c_str(), | |||
then_branch_name.c_str(), else_branch_name.c_str(), __FUNCTION__); | |||
then_branch_name.c_str(), else_branch_name.c_str()); | |||
GELOGE(INTERNAL_ERROR, "Node: %s has invalid subgraph, then branch: %s, else branch: %s.", | |||
if_desc->GetName().c_str(), then_branch_name.c_str(), else_branch_name.c_str()); | |||
return FAILED; | |||
@@ -70,44 +70,44 @@ Status IfOpLabelMaker::Run(uint32_t &label_index) { | |||
NodePtr then_stream_active = AddStreamActive(then_sub_graph, then_active_name); | |||
if (then_stream_active == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "Add StreamActive node in graph:%s fail when %s", | |||
then_sub_graph->GetName().c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Add StreamActive node in graph:%s fail", | |||
then_sub_graph->GetName().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Subgraph: %s add stream active failed.", then_sub_graph->GetName().c_str()); | |||
return FAILED; | |||
} | |||
NodePtr then_enter_label = AddLabelSetEnter(then_sub_graph, then_label_name, then_enter_index, then_stream_active); | |||
if (then_enter_label == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "Add LabelSetEnter node in graph:%s fail when %s", | |||
then_sub_graph->GetName().c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Add LabelSetEnter node in graph:%s fail", | |||
then_sub_graph->GetName().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Subgraph: %s add label set failed.", then_sub_graph->GetName().c_str()); | |||
return FAILED; | |||
} | |||
if (AddLabelGotoLeave(then_sub_graph, then_leave_name, else_leave_index) == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "Add LabelGotoLeave node in graph:%s fail when %s", | |||
then_sub_graph->GetName().c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Add LabelGotoLeave node in graph:%s fail", | |||
then_sub_graph->GetName().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Subgraph: %s add label goto failed.", then_sub_graph->GetName().c_str()); | |||
return FAILED; | |||
} | |||
NodePtr else_stream_active = AddStreamActive(else_sub_graph, else_active_name); | |||
if (else_stream_active == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "Add StreamActive node in graph:%s fail when %s", | |||
else_stream_active->GetName().c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Add StreamActive node in graph:%s fail", | |||
else_stream_active->GetName().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Subgraph: %s add stream active failed.", else_sub_graph->GetName().c_str()); | |||
return FAILED; | |||
} | |||
if (AddLabelSetEnter(else_sub_graph, else_enter_name, else_enter_index, else_stream_active) == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "Add LabelSetEnter node in graph:%s fail when %s", | |||
else_sub_graph->GetName().c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Add LabelSetEnter node in graph:%s fail", | |||
else_sub_graph->GetName().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Subgraph: %s add label set failed.", else_sub_graph->GetName().c_str()); | |||
return FAILED; | |||
} | |||
if (AddLabelSetLeave(else_sub_graph, else_leave_name, else_leave_index) == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "Add LabelSetLeave node in graph:%s fail when %s", | |||
else_sub_graph->GetName().c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Add LabelSetLeave node in graph:%s fail", | |||
else_sub_graph->GetName().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Subgraph: %s add label set failed.", else_sub_graph->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -119,16 +119,16 @@ Status IfOpLabelMaker::Run(uint32_t &label_index) { | |||
const GeTensorDesc &pred_desc = if_desc->GetInputDesc(kIfPredIndex); | |||
NodePtr switch_node = AddLabelSwitchEnter(then_sub_graph, then_enter_name, pred_desc, switch_labels); | |||
if (switch_node == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "Add LabelSwitchEnter node in graph:%s fail when %s", | |||
then_sub_graph->GetName().c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Add LabelSwitchEnter node in graph:%s fail", | |||
then_sub_graph->GetName().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Subgraph: %s add label switch failed.", then_sub_graph->GetName().c_str()); | |||
return FAILED; | |||
} | |||
// Link control edge to then branch head. | |||
if (GraphUtils::AddEdge(switch_node->GetOutControlAnchor(), then_enter_label->GetInControlAnchor()) != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Add ctrl edge from %s to %s in graph:%s fail when %s", switch_node->GetName().c_str(), | |||
then_enter_label->GetName().c_str(), then_sub_graph->GetName().c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Add ctrl edge from %s to %s in graph:%s fail", switch_node->GetName().c_str(), | |||
then_enter_label->GetName().c_str(), then_sub_graph->GetName().c_str()); | |||
GELOGE(INTERNAL_ERROR, "LabelSwitchByIndex: Add ctrl edge to %s failed.", then_enter_label->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -136,8 +136,8 @@ Status IfOpLabelMaker::Run(uint32_t &label_index) { | |||
uint32_t parent_index = 0; // If cond input is first. | |||
const std::string data_name = parent_node_->GetName() + "/SwitchIndexData"; | |||
if (AddLabelSwitchIndex(then_sub_graph, data_name, pred_desc, switch_node, parent_index) == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "Add LabelSwitchIndex node in graph:%s fail when %s", | |||
then_sub_graph->GetName().c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Add LabelSwitchIndex node in graph:%s fail", | |||
then_sub_graph->GetName().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Subgraph: %s add switch input failed.", then_sub_graph->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -56,8 +56,8 @@ void LabelMaker::LinkToGraphHead(const ComputeGraphPtr &graph, const NodePtr &no | |||
} | |||
if (GraphUtils::AddEdge(node->GetOutControlAnchor(), n->GetInControlAnchor()) != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Add ctrl edge from %s to %s in graph:%s fail when %s", node->GetName().c_str(), | |||
n->GetName().c_str(), graph->GetName().c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Add ctrl edge from %s to %s in graph:%s fail", node->GetName().c_str(), | |||
n->GetName().c_str(), graph->GetName().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Add ctrl edge from %s to %s failed.", node->GetName().c_str(), n->GetName().c_str()); | |||
} | |||
} | |||
@@ -80,8 +80,8 @@ void LabelMaker::LinkToGraphTail(const ComputeGraphPtr &graph, const NodePtr &no | |||
} | |||
if (GraphUtils::AddEdge(tail->GetOutControlAnchor(), node->GetInControlAnchor()) != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Add ctrl edge from %s to %s in graph:%s fail when %s", tail->GetName().c_str(), | |||
node->GetName().c_str(), graph->GetName().c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Add ctrl edge from %s to %s in graph:%s fail", tail->GetName().c_str(), | |||
node->GetName().c_str(), graph->GetName().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Add ctrl edge from %s to %s failed.", tail->GetName().c_str(), node->GetName().c_str()); | |||
} | |||
return; | |||
@@ -100,7 +100,7 @@ NodePtr LabelMaker::AddStreamActive(const ComputeGraphPtr &graph, const std::str | |||
const auto &node_list = graph->GetDirectNode(); | |||
if (node_list.empty()) { | |||
REPORT_INNER_ERROR("E19999", "Check param graph has no node when %s", graph->GetName().c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Check param graph:%s has no node", graph->GetName().c_str()); | |||
GELOGE(INTERNAL_ERROR, "LabelSet: Graph %s node is empty.", graph->GetName().c_str()); | |||
return nullptr; | |||
} | |||
@@ -136,7 +136,7 @@ NodePtr LabelMaker::AddLabelSetEnter(const ComputeGraphPtr &graph, const std::st | |||
const auto &node_list = graph->GetDirectNode(); | |||
if (node_list.empty()) { | |||
REPORT_INNER_ERROR("E19999", "Check param graph has no node when %s", graph->GetName().c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Check param graph:%s has no node", graph->GetName().c_str()); | |||
GELOGE(INTERNAL_ERROR, "LabelSet: Graph %s node is empty.", graph->GetName().c_str()); | |||
return nullptr; | |||
} | |||
@@ -151,8 +151,8 @@ NodePtr LabelMaker::AddLabelSetEnter(const ComputeGraphPtr &graph, const std::st | |||
GE_CHECK_NOTNULL_EXEC(label_set, return nullptr); | |||
if (GraphUtils::AddEdge(label_set->GetOutControlAnchor(), stream_active->GetInControlAnchor()) != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Add ctrl edge from %s to %s in graph:%s fail when %s", label_set->GetName().c_str(), | |||
stream_active->GetName().c_str(), graph->GetName().c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Add ctrl edge from %s to %s in graph:%s fail", label_set->GetName().c_str(), | |||
stream_active->GetName().c_str(), graph->GetName().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Add ctrl edge from %s to %s failed.", label_set->GetName().c_str(), | |||
stream_active->GetName().c_str()); | |||
return nullptr; | |||
@@ -201,7 +201,7 @@ NodePtr LabelMaker::AddLabelGotoEnter(const ComputeGraphPtr &graph, const std::s | |||
const auto &node_list = graph->GetDirectNode(); | |||
auto it = node_list.begin(); | |||
if (it == node_list.end()) { | |||
REPORT_INNER_ERROR("E19999", "Check param graph has no node when %s", graph->GetName().c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Check param graph:%s has no node", graph->GetName().c_str()); | |||
GELOGE(INTERNAL_ERROR, "LabelGoto: Graph %s node is empty.", graph->GetName().c_str()); | |||
return nullptr; | |||
} | |||
@@ -214,8 +214,8 @@ NodePtr LabelMaker::AddLabelGotoEnter(const ComputeGraphPtr &graph, const std::s | |||
(void)AttrUtils::SetInt(op_desc, ATTR_NAME_LABEL_SWITCH_INDEX, index); | |||
NodePtr label_goto = graph->AddNodeFront(op_desc); | |||
if (label_goto == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "Add node:%s(%s) to graph:%s fail when %s", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), graph->GetName().c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Add node:%s(%s) to graph:%s fail", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), graph->GetName().c_str()); | |||
GELOGE(INTERNAL_ERROR, "LabelGoto: Add to graph %s failed.", graph->GetName().c_str()); | |||
return nullptr; | |||
} | |||
@@ -264,7 +264,7 @@ NodePtr LabelMaker::AddLabelSwitchEnter(const ComputeGraphPtr &graph, const std: | |||
const auto &node_list = graph->GetDirectNode(); | |||
auto it = node_list.begin(); | |||
if (it == node_list.end()) { | |||
REPORT_INNER_ERROR("E19999", "Check param graph has no node when %s", graph->GetName().c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Check param graph:%s has no node", graph->GetName().c_str()); | |||
GELOGE(INTERNAL_ERROR, "LabelSwitchByIndex: Graph %s node is empty.", graph->GetName().c_str()); | |||
return nullptr; | |||
} | |||
@@ -275,23 +275,23 @@ NodePtr LabelMaker::AddLabelSwitchEnter(const ComputeGraphPtr &graph, const std: | |||
GELOGI("LabelSwitchByIndex: Create node %s.", op_desc->GetName().c_str()); | |||
if (op_desc->AddInputDesc(desc) != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Add input desc into node:%s(%s) in graph:%s fail when %s", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), graph->GetName().c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Add input desc into node:%s(%s) in graph:%s fail", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), graph->GetName().c_str()); | |||
GELOGE(INTERNAL_ERROR, "LabelSwitchByIndex: Add input desc failed."); | |||
return nullptr; | |||
} | |||
if (!AttrUtils::SetListInt(op_desc, ATTR_NAME_LABEL_SWITCH_LIST, labels)) { | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s) when %s", ATTR_NAME_LABEL_SWITCH_LIST.c_str(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s)", ATTR_NAME_LABEL_SWITCH_LIST.c_str(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(INTERNAL_ERROR, "LabelSwitchByIndex: Add %s failed.", ATTR_NAME_LABEL_SWITCH_INDEX.c_str()); | |||
return nullptr; | |||
} | |||
NodePtr label_switch = graph->AddNodeFront(op_desc); | |||
if (label_switch == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "Add node:%s(%s) to graph:%s ahead fail when %s", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), graph->GetName().c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Add node:%s(%s) to graph:%s ahead fail", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), graph->GetName().c_str()); | |||
GELOGE(INTERNAL_ERROR, "LabelSwitchByIndex: Add to graph %s failed.", graph->GetName().c_str()); | |||
return nullptr; | |||
} | |||
@@ -318,15 +318,15 @@ NodePtr LabelMaker::AddLabelSwitchLeave(const ComputeGraphPtr &graph, const std: | |||
GELOGI("LabelSwitchByIndex: Create node %s.", op_desc->GetName().c_str()); | |||
if (op_desc->AddInputDesc(desc) != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Add input desc into node:%s(%s) in graph:%s fail when %s", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), graph->GetName().c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Add input desc into node:%s(%s) in graph:%s fail", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), graph->GetName().c_str()); | |||
GELOGE(INTERNAL_ERROR, "LabelSwitchByIndex: Add input desc failed."); | |||
return nullptr; | |||
} | |||
if (!AttrUtils::SetListInt(op_desc, ATTR_NAME_LABEL_SWITCH_LIST, labels)) { | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s) when %s", ATTR_NAME_LABEL_SWITCH_LIST.c_str(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s)", ATTR_NAME_LABEL_SWITCH_LIST.c_str(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(INTERNAL_ERROR, "LabelSwitchByIndex: Add %s failed.", ATTR_NAME_LABEL_SWITCH_INDEX.c_str()); | |||
return nullptr; | |||
} | |||
@@ -358,21 +358,21 @@ NodePtr LabelMaker::AddLabelSwitchIndex(const ComputeGraphPtr &graph, const std: | |||
GELOGI("Data: Create node %s.", op_desc->GetName().c_str()); | |||
if (op_desc->AddInputDesc(desc) != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Add input desc into node:%s(%s) in graph:%s fail when %s", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), graph->GetName().c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Add input desc into node:%s(%s) in graph:%s fail", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), graph->GetName().c_str()); | |||
GELOGE(INTERNAL_ERROR, "LabelSwitchByIndex: Add data input desc failed."); | |||
return nullptr; | |||
} | |||
if (op_desc->AddOutputDesc(desc) != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Add output desc into node:%s(%s) in graph:%s fail when %s", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), graph->GetName().c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Add output desc into node:%s(%s) in graph:%s fail", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), graph->GetName().c_str()); | |||
GELOGE(INTERNAL_ERROR, "LabelSwitchByIndex: Add data output desc failed."); | |||
return nullptr; | |||
} | |||
if (!AttrUtils::SetInt(op_desc, ATTR_NAME_PARENT_NODE_INDEX, parent_index)) { | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s) when %s", ATTR_NAME_PARENT_NODE_INDEX.c_str(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s)", ATTR_NAME_PARENT_NODE_INDEX.c_str(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(INTERNAL_ERROR, "LabelSwitchByIndex: Add %s failed.", ATTR_NAME_PARENT_NODE_INDEX.c_str()); | |||
return nullptr; | |||
} | |||
@@ -382,8 +382,8 @@ NodePtr LabelMaker::AddLabelSwitchIndex(const ComputeGraphPtr &graph, const std: | |||
// Link control edge to graph head. | |||
if (GraphUtils::AddEdge(op_data->GetOutDataAnchor(0), sw_node->GetInDataAnchor(0)) != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Add ctrl edge from %s to %s in graph:%s fail when %s", op_data->GetName().c_str(), | |||
sw_node->GetName().c_str(), graph->GetName().c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Add ctrl edge from %s to %s in graph:%s fail", op_data->GetName().c_str(), | |||
sw_node->GetName().c_str(), graph->GetName().c_str()); | |||
GELOGE(INTERNAL_ERROR, "LabelSwitchByIndex: Add input edge to %s failed.", op_data->GetName().c_str()); | |||
return nullptr; | |||
} | |||
@@ -39,17 +39,17 @@ Status PartitionedCallLabelMaker::Run(uint32_t &label_index) { | |||
std::string sub_graph_name = call_desc->GetSubgraphInstanceName(kSubGraphIndex); | |||
if (sub_graph_name.empty()) { | |||
REPORT_INNER_ERROR("E19999", "Node:%s(%s) subgraph_index:%d name is empty, check invalid when %s", | |||
call_desc->GetName().c_str(), call_desc->GetType().c_str(), kSubGraphIndex, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Node:%s(%s) subgraph_index:%d name is empty, check invalid", | |||
call_desc->GetName().c_str(), call_desc->GetType().c_str(), kSubGraphIndex); | |||
GELOGE(INTERNAL_ERROR, "Node: %s has no subgraph name.", sub_graph_name.c_str()); | |||
return FAILED; | |||
} | |||
ComputeGraphPtr sub_graph = parent_graph_->GetSubgraph(sub_graph_name); | |||
if (sub_graph == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Node:%s(%s) subgraph_name:%s is not exist in parent_graph, check invalid when %s", | |||
REPORT_INNER_ERROR("E19999", "Node:%s(%s) subgraph_name:%s is not exist in parent_graph, check invalid", | |||
call_desc->GetName().c_str(), call_desc->GetType().c_str(), | |||
sub_graph_name.c_str(), __FUNCTION__); | |||
sub_graph_name.c_str()); | |||
GELOGE(INTERNAL_ERROR, "Node: %s has no subgraph.", sub_graph_name.c_str()); | |||
return FAILED; | |||
} | |||
@@ -57,8 +57,8 @@ Status PartitionedCallLabelMaker::Run(uint32_t &label_index) { | |||
const std::string stream_active_name = parent_node_->GetName() + "/StreamActive"; // rtStreamActive | |||
NodePtr stream_active = AddStreamActive(sub_graph, stream_active_name); | |||
if (stream_active == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "Add StreamActive node in graph:%s fail when %s", | |||
sub_graph->GetName().c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Add StreamActive node in graph:%s fail", | |||
sub_graph->GetName().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Subgraph: %s add stream active node failed.", sub_graph->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -45,8 +45,8 @@ Status WhileOpLabelMaker::Run(uint32_t &label_index) { | |||
std::string body_name = while_desc->GetSubgraphInstanceName(kBodyBranchIndex); | |||
if (cond_name.empty() || body_name.empty()) { | |||
REPORT_INNER_ERROR("E19999", "Node:%s(%s) cond subgraph index:%d or body subgraph index:%d name is empty, " | |||
"check invalid when %s", while_desc->GetName().c_str(), while_desc->GetType().c_str(), | |||
kCondBranchIndex, kBodyBranchIndex, __FUNCTION__); | |||
"check invalid", while_desc->GetName().c_str(), while_desc->GetType().c_str(), | |||
kCondBranchIndex, kBodyBranchIndex); | |||
GELOGE(INTERNAL_ERROR, "Node: %s has invalid subgraph, cond branch: %s, body branch: %s.", | |||
while_desc->GetName().c_str(), cond_name.c_str(), body_name.c_str()); | |||
return FAILED; | |||
@@ -70,44 +70,44 @@ Status WhileOpLabelMaker::Run(uint32_t &label_index) { | |||
NodePtr cond_stream_active = AddStreamActive(cond_graph, cond_active_name); | |||
if (cond_stream_active == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "Add StreamActive node in graph:%s fail when %s", | |||
cond_graph->GetName().c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Add StreamActive node in graph:%s fail", | |||
cond_graph->GetName().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Subgraph: %s add stream active failed.", cond_graph->GetName().c_str()); | |||
return FAILED; | |||
} | |||
if (AddLabelSetEnter(cond_graph, cond_enter_name, cond_enter_index, cond_stream_active) == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "Add LabelSetEnter node in graph:%s fail when %s", | |||
cond_graph->GetName().c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Add LabelSetEnter node in graph:%s fail", | |||
cond_graph->GetName().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Subgraph: %s add label set failed.", cond_graph->GetName().c_str()); | |||
return FAILED; | |||
} | |||
NodePtr body_stream_active = AddStreamActive(body_graph, body_active_name); | |||
if (body_stream_active == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "Add StreamActive node in graph:%s fail when %s", | |||
body_graph->GetName().c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Add StreamActive node in graph:%s fail", | |||
body_graph->GetName().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Subgraph: %s add stream active failed.", body_graph->GetName().c_str()); | |||
return FAILED; | |||
} | |||
if (AddLabelSetEnter(body_graph, body_enter_name, body_enter_index, body_stream_active) == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "Add LabelSetEnter node in graph:%s fail when %s", | |||
body_graph->GetName().c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Add LabelSetEnter node in graph:%s fail", | |||
body_graph->GetName().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Subgraph: %s add label set failed.", body_graph->GetName().c_str()); | |||
return FAILED; | |||
} | |||
if (AddLabelGotoLeave(body_graph, goto_leave_name, cond_enter_index) == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "Add LabelGotoLeave node in graph:%s fail when %s", | |||
body_graph->GetName().c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Add LabelGotoLeave node in graph:%s fail", | |||
body_graph->GetName().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Subgraph: %s add label goto failed.", body_graph->GetName().c_str()); | |||
return FAILED; | |||
} | |||
if (AddLabelSetLeave(body_graph, body_leave_name, body_leave_index) == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "Add LabelSetLeave node in graph:%s fail when %s", | |||
body_graph->GetName().c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Add LabelSetLeave node in graph:%s fail", | |||
body_graph->GetName().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Subgraph: %s add label set failed.", body_graph->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -124,8 +124,8 @@ Status WhileOpLabelMaker::Run(uint32_t &label_index) { | |||
const std::vector<uint32_t> switch_labels = {body_leave_index, body_enter_index}; | |||
NodePtr switch_node = AddLabelSwitchLeave(cond_graph, cond_leave_name, pred_desc, switch_labels); | |||
if (switch_node == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "Add LabelSwitchLeave node in graph:%s fail when %s", | |||
cond_graph->GetName().c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Add LabelSwitchLeave node in graph:%s fail", | |||
cond_graph->GetName().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Subgraph: %s add label switch failed.", cond_graph->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -141,9 +141,9 @@ Status WhileOpLabelMaker::Run(uint32_t &label_index) { | |||
InDataAnchorPtr in_anchor = all_in_data.at(kCondOutputIndex); | |||
GE_CHECK_NOTNULL(in_anchor); | |||
if (GraphUtils::AddEdge(in_anchor->GetPeerOutAnchor(), switch_node->GetInDataAnchor(kCondOutputIndex)) != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Add ctrl edge from %s to %s in graph:%s fail when %s", | |||
REPORT_CALL_ERROR("E19999", "Add ctrl edge from %s to %s in graph:%s fail", | |||
in_anchor->GetPeerOutAnchor()->GetOwnerNode()->GetName().c_str(), | |||
switch_node->GetName().c_str(), cond_graph->GetName().c_str(), __FUNCTION__); | |||
switch_node->GetName().c_str(), cond_graph->GetName().c_str()); | |||
GELOGE(FAILED, "Node: %s Add pred data input failed.", switch_node->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -52,15 +52,14 @@ Status GraphLoader::LoadModelOnline(uint32_t &model_id, const std::shared_ptr<ge | |||
GELOGI("Load model online begin."); | |||
rtError_t rt_ret = rtSetDevice(GetContext().DeviceId()); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtSetDevice failed, device_id:%u, ret:0x%X, when GraphLoader %s", | |||
GetContext().DeviceId(), rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtSetDevice failed, device_id:%u, ret:0x%X", | |||
GetContext().DeviceId(), 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); | |||
return RT_FAILED; | |||
} | |||
if (ge_root_model_ptr == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Check param ge_root_model_ptr nullptr, check invalid when GraphLoader %s", | |||
__FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Check param ge_root_model_ptr nullptr, check invalid"); | |||
GELOGE(GE_GRAPH_PARAM_NULLPTR, "[LoadGraph] GE load graph model_ptr is 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()); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtDeviceReset failed, device_id:%u, ret:0x%X, when GraphLoader %s", | |||
GetContext().DeviceId(), rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtDeviceReset failed, device_id:%u, ret:0x%X", | |||
GetContext().DeviceId(), rt_ret); | |||
GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); | |||
} | |||
return ret; | |||
@@ -90,8 +89,8 @@ Status GraphLoader::LoadModelOnline(uint32_t &model_id, const std::shared_ptr<ge | |||
rt_ret = rtDeviceReset(GetContext().DeviceId()); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtDeviceReset failed, device_id:%u, ret:0x%X, when GraphLoader %s", | |||
GetContext().DeviceId(), rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtDeviceReset failed, device_id:%u, ret:0x%X", | |||
GetContext().DeviceId(), 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()); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtDeviceReset failed, device_id:%u, ret:0x%X, when GraphLoader %s", | |||
GetContext().DeviceId(), rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtDeviceReset failed, device_id:%u, ret:0x%X", | |||
GetContext().DeviceId(), rt_ret); | |||
GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); | |||
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()); | |||
if (!key_path.empty() && !CheckInputPathValid(key_path)) { | |||
REPORT_INNER_ERROR("E19999", "Param key_path:%s empty or invalid, when GraphLoader %s", | |||
key_path.c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Param key_path:%s empty or invalid", | |||
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; | |||
} | |||
@@ -159,12 +158,12 @@ Status GraphLoader::CommandHandle(const Command &command) { | |||
return ret; | |||
} | |||
} 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 !"); | |||
return ACL_ERROR_GE_MEMORY_ALLOCATION; | |||
} 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 !"); | |||
return FAILED; | |||
@@ -246,8 +245,8 @@ Status GraphLoader::ExecuteModel(uint32_t model_id, rtStream_t stream, bool asyn | |||
Status GraphLoader::GetMemoryInfo(int64_t &free) { | |||
rtError_t rt_ret = rtSetDevice(GetContext().DeviceId()); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtSetDevice failed, device_id:%u, ret:0x%X, when GraphLoader %s", | |||
GetContext().DeviceId(), rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtSetDevice failed, device_id:%u, ret:0x%X", | |||
GetContext().DeviceId(), 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); | |||
return RT_FAILED; | |||
@@ -256,14 +255,14 @@ Status GraphLoader::GetMemoryInfo(int64_t &free) { | |||
size_t free_mem = 0; | |||
rt_ret = rtMemGetInfo(&free_mem, &total_mem); | |||
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); | |||
return RT_FAILED; | |||
} | |||
rt_ret = rtDeviceReset(GetContext().DeviceId()); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtDeviceReset failed, device_id:%u, ret:0x%X, when GraphLoader %s", | |||
GetContext().DeviceId(), rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtDeviceReset failed, device_id:%u, ret:0x%X", | |||
GetContext().DeviceId(), rt_ret); | |||
GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); | |||
return RT_FAILED; | |||
} | |||
@@ -52,7 +52,7 @@ CpuTaskInfo::~CpuTaskInfo() { | |||
Status CpuTaskModelDequeue::Init(uint32_t queue_id, uintptr_t &in_mbuf) { | |||
if ((args_ != nullptr) || (args_size_ > 0)) { | |||
REPORT_INNER_ERROR("E19999", "Param args_ is not nullptr or args_size_:%u > 0," | |||
"check invalid when CpuTaskModelDequeue %s", args_size_, __FUNCTION__); | |||
"check invalid", args_size_); | |||
GELOGE(FAILED, "Task already initialized, size: %u", args_size_); | |||
return FAILED; | |||
} | |||
@@ -60,8 +60,8 @@ Status CpuTaskModelDequeue::Init(uint32_t queue_id, uintptr_t &in_mbuf) { | |||
args_size_ = sizeof(MbufQueueInfo) + sizeof(uintptr_t); // sizeof(uintptr_t) for save in_mbuf. | |||
rtError_t status = rtMalloc(&args_, args_size_, RT_MEMORY_HBM); | |||
if (status != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%u, ret:0x%X, when CpuTaskModelDequeue %s", | |||
args_size_, status, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%u, ret:0x%X", | |||
args_size_, status); | |||
GELOGE(RT_FAILED, "Call rt malloc failed, status: 0x%x", status); | |||
return RT_ERROR_TO_GE_STATUS(status); | |||
} | |||
@@ -73,8 +73,8 @@ Status CpuTaskModelDequeue::Init(uint32_t queue_id, uintptr_t &in_mbuf) { | |||
queue_info.in_mbuf = in_mbuf; // Placeholder, input mbuf addr will save to this place. | |||
status = rtMemcpy(args_, args_size_, &queue_info, sizeof(MbufQueueInfo), RT_MEMCPY_HOST_TO_DEVICE); | |||
if (status != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%u, ret:0x%X, when CpuTaskModelDequeue %s", | |||
args_size_, status, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%u, ret:0x%X", | |||
args_size_, status); | |||
GELOGE(RT_FAILED, "Call rt memcpy failed, status: 0x%x", status); | |||
return RT_ERROR_TO_GE_STATUS(status); | |||
} | |||
@@ -85,15 +85,15 @@ Status CpuTaskModelDequeue::Init(uint32_t queue_id, uintptr_t &in_mbuf) { | |||
Status CpuTaskModelDequeue::Distribute() { | |||
if ((args_ == nullptr) || (args_size_ == 0) || (stream_ == nullptr)) { | |||
REPORT_INNER_ERROR("E19999", "Param args_ is nullptr or args_size_:%u is 0 or stream_ is nullptr," | |||
"check invalid when CpuTaskModelDequeue %s", args_size_, __FUNCTION__); | |||
"check invalid", args_size_); | |||
GELOGE(FAILED, "Task not initialized, distribute failed, size: %u", args_size_); | |||
return FAILED; | |||
} | |||
rtError_t status = rtCpuKernelLaunch(nullptr, kCpuTaskModelDequeue, kCoreDim, args_, args_size_, nullptr, stream_); | |||
if (status != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtCpuKernelLaunch failed, ret:0x%X, when CpuTaskModelDequeue %s", | |||
status, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtCpuKernelLaunch failed, ret:0x%X", | |||
status); | |||
GELOGE(RT_FAILED, "Call rt CpuKernelLaunch ModelDequeue failed, status: 0x%X", status); | |||
return RT_ERROR_TO_GE_STATUS(status); | |||
} | |||
@@ -112,7 +112,7 @@ Status CpuTaskModelDequeue::Distribute() { | |||
Status CpuTaskZeroCopy::Init(std::vector<uintptr_t> &mbuf_list, const map<uint32_t, ZeroCopyOffset> &outside_addrs) { | |||
if ((args_ != nullptr) || (args_size_ > 0)) { | |||
REPORT_INNER_ERROR("E19999", "Param args_ is not nullptr or args_size_:%u > 0," | |||
"check invalid when CpuTaskZeroCopy %s", args_size_, __FUNCTION__); | |||
"check invalid", args_size_); | |||
GELOGE(FAILED, "Task already initialized, size: %u", args_size_); | |||
return FAILED; | |||
} | |||
@@ -168,15 +168,15 @@ Status CpuTaskZeroCopy::Init(std::vector<uintptr_t> &mbuf_list, const map<uint32 | |||
Status CpuTaskZeroCopy::Distribute() { | |||
if ((args_ == nullptr) || (args_size_ == 0) || (stream_ == nullptr)) { | |||
REPORT_INNER_ERROR("E19999", "Param args_ is nullptr or args_size_:%u is 0 or stream_ is nullptr," | |||
"check invalid when CpuTaskZeroCopy %s", args_size_, __FUNCTION__); | |||
"check invalid", args_size_); | |||
GELOGE(FAILED, "Task not initialized, distribute failed, size: %u", args_size_); | |||
return FAILED; | |||
} | |||
rtError_t status = rtCpuKernelLaunch(nullptr, kCpuTaskZeroCopy, kCoreDim, args_, args_size_, nullptr, stream_); | |||
if (status != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtCpuKernelLaunch failed, ret:0x%X, when CpuTaskZeroCopy %s", | |||
status, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtCpuKernelLaunch failed, ret:0x%X", | |||
status); | |||
GELOGE(RT_FAILED, "Call rt CpuKernelLaunch ZeroCopy failed, status: 0x%X", status); | |||
return RT_ERROR_TO_GE_STATUS(status); | |||
} | |||
@@ -216,7 +216,7 @@ CpuTaskZeroCopy::~CpuTaskZeroCopy() { | |||
Status CpuTaskPrepareOutput::Init(uintptr_t addr, uint32_t size, uintptr_t in_mbuf, uintptr_t &out_mbuf) { | |||
if ((args_ != nullptr) || (args_size_ > 0)) { | |||
REPORT_INNER_ERROR("E19999", "Param args_ is not nullptr or args_size_:%u > 0," | |||
"check invalid when CpuTaskPrepareOutput %s", args_size_, __FUNCTION__); | |||
"check invalid", args_size_); | |||
GELOGE(FAILED, "Task already initialized, size: %u", args_size_); | |||
return FAILED; | |||
} | |||
@@ -224,8 +224,8 @@ Status CpuTaskPrepareOutput::Init(uintptr_t addr, uint32_t size, uintptr_t in_mb | |||
args_size_ = sizeof(PrepareOutputInfo) + sizeof(uintptr_t); // sizeof(uintptr_t) for save out_mbuf. | |||
rtError_t status = rtMalloc(&args_, args_size_, RT_MEMORY_HBM); | |||
if (status != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%u, ret:0x%X, when CpuTaskPrepareOutput %s", | |||
args_size_, status, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%u, ret:0x%X", | |||
args_size_, status); | |||
GELOGE(RT_FAILED, "Call rt malloc failed, status: 0x%x", status); | |||
return RT_ERROR_TO_GE_STATUS(status); | |||
} | |||
@@ -240,8 +240,8 @@ Status CpuTaskPrepareOutput::Init(uintptr_t addr, uint32_t size, uintptr_t in_mb | |||
prepare.out_mbuf = out_mbuf; // Placeholder, output mbuf addr will save to this place. | |||
status = rtMemcpy(args_, args_size_, &prepare, sizeof(PrepareOutputInfo), RT_MEMCPY_HOST_TO_DEVICE); | |||
if (status != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%u, ret:0x%X, when CpuTaskPrepareOutput %s", | |||
args_size_, status, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%u, ret:0x%X", | |||
args_size_, status); | |||
GELOGE(RT_FAILED, "Call rt memcpy failed, status: 0x%x", status); | |||
return RT_ERROR_TO_GE_STATUS(status); | |||
} | |||
@@ -252,15 +252,15 @@ Status CpuTaskPrepareOutput::Init(uintptr_t addr, uint32_t size, uintptr_t in_mb | |||
Status CpuTaskPrepareOutput::Distribute() { | |||
if ((args_ == nullptr) || (args_size_ == 0) || (stream_ == nullptr)) { | |||
REPORT_INNER_ERROR("E19999", "Param args_ is nullptr or args_size_:%u is 0 or stream_ is nullptr," | |||
"check invalid when CpuTaskPrepareOutput %s", args_size_, __FUNCTION__); | |||
"check invalid", args_size_); | |||
GELOGE(FAILED, "Task not initialized, distribute failed, size: %u", args_size_); | |||
return FAILED; | |||
} | |||
rtError_t status = rtCpuKernelLaunch(nullptr, kCpuTaskPrepareOutput, kCoreDim, args_, args_size_, nullptr, stream_); | |||
if (status != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtCpuKernelLaunch failed, ret:0x%X, when CpuTaskPrepareOutput %s", | |||
status, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtCpuKernelLaunch failed, ret:0x%X", | |||
status); | |||
GELOGE(RT_FAILED, "Call rt CpuKernelLaunch PrepareOutput failed, status: 0x%X", status); | |||
return RT_ERROR_TO_GE_STATUS(status); | |||
} | |||
@@ -279,7 +279,7 @@ Status CpuTaskPrepareOutput::Distribute() { | |||
Status CpuTaskModelEnqueue::Init(uint32_t queue_id, uintptr_t out_mbuf) { | |||
if ((args_ != nullptr) || (args_size_ > 0)) { | |||
REPORT_INNER_ERROR("E19999", "Param args_ is not nullptr or args_size_:%u > 0," | |||
"check invalid when CpuTaskModelEnqueue %s", args_size_, __FUNCTION__); | |||
"check invalid", args_size_); | |||
GELOGE(FAILED, "Task already initialized, size: %u", args_size_); | |||
return FAILED; | |||
} | |||
@@ -288,8 +288,8 @@ Status CpuTaskModelEnqueue::Init(uint32_t queue_id, uintptr_t out_mbuf) { | |||
args_size_ = sizeof(MbufQueueInfo); | |||
rtError_t status = rtMalloc(&args_, args_size_, RT_MEMORY_HBM); | |||
if (status != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%u, ret:0x%X, when CpuTaskModelEnqueue %s", | |||
args_size_, status, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%u, ret:0x%X", | |||
args_size_, status); | |||
GELOGE(RT_FAILED, "Call rt malloc failed, status: 0x%x", status); | |||
return RT_ERROR_TO_GE_STATUS(status); | |||
} | |||
@@ -300,8 +300,8 @@ Status CpuTaskModelEnqueue::Init(uint32_t queue_id, uintptr_t out_mbuf) { | |||
queue_info.in_mbuf = out_mbuf; | |||
status = rtMemcpy(args_, args_size_, &queue_info, args_size_, RT_MEMCPY_HOST_TO_DEVICE); | |||
if (status != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%u, ret:0x%X, when CpuTaskModelEnqueue %s", | |||
args_size_, status, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%u, ret:0x%X", | |||
args_size_, status); | |||
GELOGE(RT_FAILED, "Call rt memcpy failed, status: 0x%x", status); | |||
return RT_ERROR_TO_GE_STATUS(status); | |||
} | |||
@@ -312,15 +312,15 @@ Status CpuTaskModelEnqueue::Init(uint32_t queue_id, uintptr_t out_mbuf) { | |||
Status CpuTaskModelEnqueue::Distribute() { | |||
if ((args_ == nullptr) || (args_size_ == 0) || (stream_ == nullptr)) { | |||
REPORT_INNER_ERROR("E19999", "Param args_ is nullptr or args_size_ is 0 or stream_ is nullptr, arg_size:%u," | |||
"check invalid when CpuTaskModelEnqueue %s", args_size_, __FUNCTION__); | |||
"check invalid", args_size_); | |||
GELOGE(FAILED, "Task not initialized, distribute failed, size: %u", args_size_); | |||
return FAILED; | |||
} | |||
rtError_t status = rtCpuKernelLaunch(nullptr, kCpuTaskModelEnqueue, kCoreDim, args_, args_size_, nullptr, stream_); | |||
if (status != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtCpuKernelLaunch failed, ret:0x%X, when CpuTaskModelEnqueue %s", | |||
status, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtCpuKernelLaunch failed, ret:0x%X", | |||
status); | |||
GELOGE(RT_FAILED, "Call rt CpuKernelLaunch ModelEnqueue failed, status: 0x%X", status); | |||
return RT_ERROR_TO_GE_STATUS(status); | |||
} | |||
@@ -337,7 +337,7 @@ Status CpuTaskModelEnqueue::Distribute() { | |||
/// | |||
Status CpuTaskActiveEntry::Init(rtStream_t stream) { | |||
if (stream == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Param stream is nullptr, check invalid when CpuTaskActiveEntry %s", __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Param stream is nullptr, check invalid"); | |||
GELOGE(FAILED, "Task active stream not valid"); | |||
return FAILED; | |||
} | |||
@@ -349,15 +349,15 @@ Status CpuTaskActiveEntry::Init(rtStream_t stream) { | |||
Status CpuTaskActiveEntry::Distribute() { | |||
if ((active_stream_ == nullptr) || (stream_ == nullptr)) { | |||
REPORT_INNER_ERROR("E19999", "Param stream is nullptr or active_stream_ is nullptr, " | |||
"check invalid when CpuTaskActiveEntry %s", __FUNCTION__); | |||
"check invalid"); | |||
GELOGE(FAILED, "Task not initialized, distribute failed, size: %u", args_size_); | |||
return FAILED; | |||
} | |||
rtError_t ret = rtStreamActive(active_stream_, stream_); | |||
if (ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtStreamActive failed, ret:0x%X, when CpuTaskActiveEntry %s", | |||
ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtStreamActive failed, ret:0x%X", | |||
ret); | |||
GELOGE(RT_FAILED, "Call rt StreamActive failed, ret: 0x%X", ret); | |||
return RT_ERROR_TO_GE_STATUS(ret); | |||
} | |||
@@ -375,7 +375,7 @@ Status CpuTaskActiveEntry::Distribute() { | |||
Status CpuTaskWaitEndGraph::Init(uint32_t model_id) { | |||
if ((args_ != nullptr) || (args_size_ > 0)) { | |||
REPORT_INNER_ERROR("E19999", "Param args_ is not nullptr or args_size_:%u > 0," | |||
"check invalid when CpuTaskWaitEndGraph %s", args_size_, __FUNCTION__); | |||
"check invalid", args_size_); | |||
GELOGE(FAILED, "Task already initialized, size: %u", args_size_); | |||
return FAILED; | |||
} | |||
@@ -383,8 +383,8 @@ Status CpuTaskWaitEndGraph::Init(uint32_t model_id) { | |||
args_size_ = sizeof(model_id); | |||
rtError_t status = rtMalloc(&args_, args_size_, RT_MEMORY_HBM); | |||
if (status != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%u, ret:0x%X, when CpuTaskWaitEndGraph %s", | |||
args_size_, status, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%u, ret:0x%X", | |||
args_size_, status); | |||
GELOGE(RT_FAILED, "Call rt malloc failed, status: 0x%x", status); | |||
return RT_ERROR_TO_GE_STATUS(status); | |||
} | |||
@@ -392,8 +392,8 @@ Status CpuTaskWaitEndGraph::Init(uint32_t model_id) { | |||
status = rtMemcpy(args_, args_size_, &model_id, args_size_, RT_MEMCPY_HOST_TO_DEVICE); | |||
if (status != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%u, ret:0x%X, when CpuTaskWaitEndGraph %s", | |||
args_size_, status, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%u, ret:0x%X", | |||
args_size_, status); | |||
GELOGE(RT_FAILED, "Call rt memcpy failed, status: 0x%x", status); | |||
return RT_ERROR_TO_GE_STATUS(status); | |||
} | |||
@@ -404,15 +404,15 @@ Status CpuTaskWaitEndGraph::Init(uint32_t model_id) { | |||
Status CpuTaskWaitEndGraph::Distribute() { | |||
if ((args_ == nullptr) || (args_size_ == 0) || (stream_ == nullptr)) { | |||
REPORT_INNER_ERROR("E19999", "Param args_ is nullptr or args_size_:%u is 0 or stream_ is nullptr," | |||
"check invalid when CpuTaskWaitEndGraph %s", args_size_, __FUNCTION__); | |||
"check invalid", args_size_); | |||
GELOGE(FAILED, "Task not initialized, distribute failed, size: %u", args_size_); | |||
return FAILED; | |||
} | |||
rtError_t status = rtCpuKernelLaunch(nullptr, kCpuTaskWaitEndGraph, kCoreDim, args_, args_size_, nullptr, stream_); | |||
if (status != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtCpuKernelLaunch failed, ret:0x%X, when CpuTaskWaitEndGraph %s", | |||
status, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtCpuKernelLaunch failed, ret:0x%X", | |||
status); | |||
GELOGE(RT_FAILED, "Call rt CpuKernelLaunch WaitEndGraph failed, status: 0x%X", status); | |||
return RT_ERROR_TO_GE_STATUS(status); | |||
} | |||
@@ -430,7 +430,7 @@ Status CpuTaskWaitEndGraph::Distribute() { | |||
Status CpuTaskModelRepeat::Init(uint32_t model_id) { | |||
if ((args_ != nullptr) || (args_size_ > 0)) { | |||
REPORT_INNER_ERROR("E19999", "Param args_ is not nullptr or args_size_:%u > 0," | |||
"check invalid when CpuTaskModelRepeat %s", args_size_, __FUNCTION__); | |||
"check invalid", args_size_); | |||
GELOGE(FAILED, "Task already initialized, size: %u", args_size_); | |||
return FAILED; | |||
} | |||
@@ -438,8 +438,8 @@ Status CpuTaskModelRepeat::Init(uint32_t model_id) { | |||
args_size_ = sizeof(model_id); | |||
rtError_t status = rtMalloc(&args_, args_size_, RT_MEMORY_HBM); | |||
if (status != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%u, ret:0x%X, when CpuTaskModelRepeat %s", | |||
args_size_, status, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%u, ret:0x%X", | |||
args_size_, status); | |||
GELOGE(RT_FAILED, "Call rt malloc failed, status: 0x%x", status); | |||
return RT_ERROR_TO_GE_STATUS(status); | |||
} | |||
@@ -447,8 +447,8 @@ Status CpuTaskModelRepeat::Init(uint32_t model_id) { | |||
status = rtMemcpy(args_, args_size_, &model_id, args_size_, RT_MEMCPY_HOST_TO_DEVICE); | |||
if (status != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%u, ret:0x%X, when CpuTaskModelRepeat %s", | |||
args_size_, status, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%u, ret:0x%X", | |||
args_size_, status); | |||
GELOGE(RT_FAILED, "Call rt memcpy failed, status: 0x%x", status); | |||
return RT_ERROR_TO_GE_STATUS(status); | |||
} | |||
@@ -459,15 +459,15 @@ Status CpuTaskModelRepeat::Init(uint32_t model_id) { | |||
Status CpuTaskModelRepeat::Distribute() { | |||
if ((args_ == nullptr) || (args_size_ == 0) || (stream_ == nullptr)) { | |||
REPORT_INNER_ERROR("E19999", "Param args_ is nullptr or args_size_:%u is 0 or stream_ is nullptr," | |||
"check invalid when CpuTaskModelRepeat %s", args_size_, __FUNCTION__); | |||
"check invalid", args_size_); | |||
GELOGE(FAILED, "Task not initialized, distribute failed, size: %u", args_size_); | |||
return FAILED; | |||
} | |||
rtError_t status = rtCpuKernelLaunch(nullptr, kCpuTaskModelRepeat, kCoreDim, args_, args_size_, nullptr, stream_); | |||
if (status != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtCpuKernelLaunch failed, ret:0x%X, when CpuTaskModelRepeat %s", | |||
status, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtCpuKernelLaunch failed, ret:0x%X", | |||
status); | |||
GELOGE(RT_FAILED, "Call rt CpuKernelLaunch ModelRepeat failed, status: 0x%x", status); | |||
return RT_ERROR_TO_GE_STATUS(status); | |||
} | |||
@@ -325,7 +325,7 @@ Status DataDumper::GenerateOutput(aicpu::dump::Output &output, const OpDesc::Vis | |||
} | |||
int64_t output_size = 0; | |||
if (TensorUtils::GetTensorSizeInBytes(tensor_descs.at(index), output_size) != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Get tensor size fail when DataDumper %s", __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Get tensor size fail"); | |||
GELOGE(PARAM_INVALID, "Get output size filed"); | |||
return PARAM_INVALID; | |||
} | |||
@@ -388,9 +388,9 @@ Status DataDumper::DumpOutputWithTask(const InnerDumpInfo &inner_dump_info, aicp | |||
const auto &output_descs = inner_dump_info.op->GetAllOutputsDesc(); | |||
const std::vector<void *> output_addrs = ModelUtils::GetOutputDataAddrs(*runtime_param_, inner_dump_info.op); | |||
if (output_descs.size() != output_addrs.size()) { | |||
REPORT_INNER_ERROR("E19999", "output_desc size:%zu != output addr size:%zu in op:%s(%s) when DataDumper %s", | |||
REPORT_INNER_ERROR("E19999", "output_desc size:%zu != output addr size:%zu in op:%s(%s)", | |||
output_descs.size(), output_addrs.size(), | |||
inner_dump_info.op->GetName().c_str(), inner_dump_info.op->GetType().c_str(), __FUNCTION__); | |||
inner_dump_info.op->GetName().c_str(), inner_dump_info.op->GetType().c_str()); | |||
GELOGE(PARAM_INVALID, "Invalid output desc addrs size %zu, op %s has %zu output desc.", output_addrs.size(), | |||
inner_dump_info.op->GetName().c_str(), output_descs.size()); | |||
return PARAM_INVALID; | |||
@@ -415,9 +415,8 @@ Status DataDumper::DumpOutputWithTask(const InnerDumpInfo &inner_dump_info, aicp | |||
GELOGI("[L1Fusion] DumpOutputWithTask[%s] output[%zu] is l1 addr.", inner_dump_info.op->GetName().c_str(), i); | |||
int64_t output_size = 0; | |||
if (TensorUtils::GetTensorSizeInBytes(output_descs.at(i), output_size) != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Get output tensor size fail in op:%s(%s), index:%zu, when DataDumper %s", | |||
inner_dump_info.op->GetName().c_str(), inner_dump_info.op->GetType().c_str(), i, | |||
__FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Get output tensor size fail in op:%s(%s), index:%zu", | |||
inner_dump_info.op->GetName().c_str(), inner_dump_info.op->GetType().c_str(), i); | |||
GELOGE(PARAM_INVALID, "Get output size failed."); | |||
return PARAM_INVALID; | |||
} | |||
@@ -446,9 +445,9 @@ Status DataDumper::DumpOutput(const InnerDumpInfo &inner_dump_info, aicpu::dump: | |||
const std::vector<void *> output_addrs = ModelUtils::GetOutputDataAddrs(*runtime_param_, inner_dump_info.op); | |||
if (output_tensor == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "output_desc tensor is nullptr in op:%s(%s), index:%u, " | |||
"check invalid when DataDumper %s", | |||
"check invalid", | |||
inner_dump_info.op->GetName().c_str(), inner_dump_info.op->GetType().c_str(), | |||
inner_dump_info.output_anchor_index, __FUNCTION__); | |||
inner_dump_info.output_anchor_index); | |||
GELOGE(PARAM_INVALID, "output_tensor is null, index: %d, size: %zu.", inner_dump_info.output_anchor_index, | |||
inner_dump_info.op->GetOutputsSize()); | |||
return PARAM_INVALID; | |||
@@ -473,8 +472,8 @@ Status DataDumper::DumpOutput(const InnerDumpInfo &inner_dump_info, aicpu::dump: | |||
// due to lhisi virtual addr bug, cannot use args now | |||
if (inner_dump_info.output_anchor_index >= static_cast<int>(output_addrs.size())) { | |||
REPORT_INNER_ERROR("E19999", "output_anchor_index:%u >= output addr size:%zu in op:%s(%s), " | |||
"check invalid when DataDumper %s", inner_dump_info.output_anchor_index, output_addrs.size(), | |||
inner_dump_info.op->GetName().c_str(), inner_dump_info.op->GetType().c_str(), __FUNCTION__); | |||
"check invalid", inner_dump_info.output_anchor_index, output_addrs.size(), | |||
inner_dump_info.op->GetName().c_str(), inner_dump_info.op->GetType().c_str()); | |||
GELOGE(FAILED, "Index is out of range."); | |||
return FAILED; | |||
} | |||
@@ -501,7 +500,7 @@ Status DataDumper::GenerateInput(aicpu::dump::Input &input, const OpDesc::Vistor | |||
if (AttrUtils::GetInt(tensor_descs.at(index), ATTR_NAME_INPUT_ORIGIN_SIZE, input_size)) { | |||
GELOGI("Get aipp input size according to attr is %ld", input_size); | |||
} else if (TensorUtils::GetTensorSizeInBytes(tensor_descs.at(index), input_size) != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Get tensor size fail when DataDumper %s", __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Get tensor size fail"); | |||
GELOGE(PARAM_INVALID, "Get input size filed"); | |||
return PARAM_INVALID; | |||
} | |||
@@ -557,9 +556,9 @@ Status DataDumper::DumpInput(const InnerDumpInfo &inner_dump_info, aicpu::dump:: | |||
const auto &input_descs = inner_dump_info.op->GetAllInputsDesc(); | |||
const std::vector<void *> input_addrs = ModelUtils::GetInputDataAddrs(*runtime_param_, inner_dump_info.op); | |||
if (input_descs.size() != input_addrs.size()) { | |||
REPORT_INNER_ERROR("E19999", "input_desc size:%zu != input addr size:%zu in op:%s(%s) when DataDumper %s", | |||
REPORT_INNER_ERROR("E19999", "input_desc size:%zu != input addr size:%zu in op:%s(%s)", | |||
input_descs.size(), input_addrs.size(), | |||
inner_dump_info.op->GetName().c_str(), inner_dump_info.op->GetType().c_str(), __FUNCTION__); | |||
inner_dump_info.op->GetName().c_str(), inner_dump_info.op->GetType().c_str()); | |||
GELOGE(PARAM_INVALID, "Invalid input desc addrs size %zu, op %s has %zu input desc.", input_addrs.size(), | |||
inner_dump_info.op->GetName().c_str(), input_descs.size()); | |||
return PARAM_INVALID; | |||
@@ -585,9 +584,8 @@ Status DataDumper::DumpInput(const InnerDumpInfo &inner_dump_info, aicpu::dump:: | |||
if (AttrUtils::GetInt(input_descs.at(i), ATTR_NAME_INPUT_ORIGIN_SIZE, input_size)) { | |||
GELOGI("Get aipp input size according to attr is %ld", input_size); | |||
} else if (TensorUtils::GetTensorSizeInBytes(input_descs.at(i), input_size) != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Get input tensor size fail in op:%s(%s), index:%zu, when DataDumper %s", | |||
inner_dump_info.op->GetName().c_str(), inner_dump_info.op->GetType().c_str(), i, | |||
__FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Get input tensor size fail in op:%s(%s), index:%zu", | |||
inner_dump_info.op->GetName().c_str(), inner_dump_info.op->GetType().c_str(), i); | |||
GELOGE(PARAM_INVALID, "Get input size failed."); | |||
return PARAM_INVALID; | |||
} | |||
@@ -616,7 +614,7 @@ Status DataDumper::ExecuteLoadDumpInfo(aicpu::dump::OpMappingInfo &op_mapping_in | |||
size_t proto_size = op_mapping_info.ByteSizeLong(); | |||
bool ret = op_mapping_info.SerializeToString(&proto_str); | |||
if (!ret || proto_size == 0) { | |||
REPORT_INNER_ERROR("E19999", "Serialize proto to string fail when DataDumper %s", __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Serialize proto to string fail"); | |||
GELOGE(PARAM_INVALID, "Protobuf SerializeToString failed, proto size %zu.", proto_size); | |||
return PARAM_INVALID; | |||
} | |||
@@ -628,8 +626,8 @@ Status DataDumper::ExecuteLoadDumpInfo(aicpu::dump::OpMappingInfo &op_mapping_in | |||
rtError_t rt_ret = rtMalloc(&dev_mem_load_, proto_size, RT_MEMORY_HBM); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%zu, ret:0x%X, when DataDumper %s", | |||
proto_size, rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%zu, ret:0x%X", | |||
proto_size, rt_ret); | |||
GELOGE(RT_FAILED, "Call rtMalloc failed, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -637,15 +635,15 @@ Status DataDumper::ExecuteLoadDumpInfo(aicpu::dump::OpMappingInfo &op_mapping_in | |||
rt_ret = rtMemcpy(dev_mem_load_, proto_size, proto_str.c_str(), proto_size, RT_MEMCPY_HOST_TO_DEVICE); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret:0x%X, when DataDumper %s", | |||
proto_size, rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret:0x%X", | |||
proto_size, rt_ret); | |||
GELOGE(RT_FAILED, "Call rtMemcpy failed, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
rt_ret = rtDatadumpInfoLoad(dev_mem_load_, proto_size); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtDatadumpInfoLoad failed, ret:0x%X, when DataDumper %s", rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtDatadumpInfoLoad failed, ret:0x%X", rt_ret); | |||
GELOGE(RT_FAILED, "Call rtDatadumpInfoLoad failed, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -660,7 +658,7 @@ Status DataDumper::ExecuteUnLoadDumpInfo(aicpu::dump::OpMappingInfo &op_mapping_ | |||
size_t proto_size = op_mapping_info.ByteSizeLong(); | |||
bool ret = op_mapping_info.SerializeToString(&proto_str); | |||
if (!ret || proto_size == 0) { | |||
REPORT_INNER_ERROR("E19999", "Serialize proto to string fail when DataDumper %s", __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Serialize proto to string fail"); | |||
GELOGE(PARAM_INVALID, "Protobuf SerializeToString failed, proto size %zu.", proto_size); | |||
return PARAM_INVALID; | |||
} | |||
@@ -672,8 +670,8 @@ Status DataDumper::ExecuteUnLoadDumpInfo(aicpu::dump::OpMappingInfo &op_mapping_ | |||
rtError_t rt_ret = rtMalloc(&dev_mem_unload_, proto_size, RT_MEMORY_HBM); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%zu, ret:0x%X, when DataDumper %s", | |||
proto_size, rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%zu, ret:0x%X", | |||
proto_size, rt_ret); | |||
GELOGE(RT_FAILED, "Call rtMalloc failed, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -681,15 +679,15 @@ Status DataDumper::ExecuteUnLoadDumpInfo(aicpu::dump::OpMappingInfo &op_mapping_ | |||
rt_ret = rtMemcpy(dev_mem_unload_, proto_size, proto_str.c_str(), proto_size, RT_MEMCPY_HOST_TO_DEVICE); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret:0x%X, when DataDumper %s", | |||
proto_size, rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret:0x%X", | |||
proto_size, rt_ret); | |||
GELOGE(RT_FAILED, "Call rtMemcpy failed, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
rt_ret = rtDatadumpInfoLoad(dev_mem_unload_, proto_size); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtDatadumpInfoLoad failed, ret:0x%X, when DataDumper %s", rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtDatadumpInfoLoad failed, ret:0x%X", rt_ret); | |||
GELOGE(RT_FAILED, "Call rtDatadumpInfoLoad failed, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -974,7 +972,7 @@ Status DataDumper::DumpExceptionInfo(const std::vector<rtExceptionInfo> exceptio | |||
std::unique_ptr<char[]> proto_msg(new (std::nothrow) char[proto_size]); | |||
bool ret = dump_data.SerializeToArray(proto_msg.get(), proto_size); | |||
if (!ret || proto_size == 0) { | |||
REPORT_INNER_ERROR("E19999", "Serialize proto to string fail when DataDumper %s", __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Serialize proto to string fail"); | |||
GELOGE(PARAM_INVALID, "Dump data proto serialize failed"); | |||
return PARAM_INVALID; | |||
} | |||
@@ -68,8 +68,8 @@ | |||
try { \ | |||
thread_id = std::thread(func, args); \ | |||
} catch (const std::system_error &e) { \ | |||
REPORT_CALL_ERROR("E19999", "Create thread fail, ecode:%d, emsg:%s, when DavinciModel %s", \ | |||
e.code().value(), e.what(), __FUNCTION__); \ | |||
REPORT_CALL_ERROR("E19999", "Create thread fail, ecode:%d, emsg:%s", \ | |||
e.code().value(), e.what()); \ | |||
GELOGE(FAILED, "Caught system_error with code:%d, meaning:%s", e.code().value(), e.what()); \ | |||
GELOGE(FAILED, "Thread creat FAIL, Please check the left resource!"); \ | |||
return FAILED; \ | |||
@@ -332,8 +332,8 @@ void DavinciModel::Shrink() { | |||
Status DavinciModel::InitWeightMem(void *dev_ptr, void *weight_ptr, size_t weight_size) { | |||
if (is_weight_mem_has_inited_) { | |||
REPORT_INNER_ERROR("E19999", "Call InitWeightMem more than once, model_id:%u, check invalid when %s", | |||
model_id_, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Call InitWeightMem more than once, model_id:%u, check invalid", | |||
model_id_); | |||
GELOGE(FAILED, "call InitWeightMem more than once."); | |||
return FAILED; | |||
} | |||
@@ -345,7 +345,7 @@ Status DavinciModel::InitWeightMem(void *dev_ptr, void *weight_ptr, size_t weigh | |||
if ((weight_ptr != nullptr) && (weight_size < weights_size)) { | |||
REPORT_INNER_ERROR("E19999", "Param weight_ptr is nullptr or ge_model.weight.size:%zu < param weights_size:%zu, " | |||
"model_id:%u, check invalid when %s", weight_size, weights_size, model_id_, __FUNCTION__); | |||
"model_id:%u, check invalid", weight_size, weights_size, model_id_); | |||
GELOGE(FAILED, "Invalid mem param: weight_size=%zu totalsize=%zu.", weight_size, weights_size); | |||
return FAILED; | |||
} | |||
@@ -359,8 +359,8 @@ Status DavinciModel::InitWeightMem(void *dev_ptr, void *weight_ptr, size_t weigh | |||
if (weight_ptr == nullptr) { | |||
weights_mem_base_ = MallocWeightsMem(weights_size); | |||
if (weights_mem_base_ == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "MallocWeightsMem fail, weights_size:%zu, model_id:%u, check invalid when %s", | |||
weights_size, model_id_, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "MallocWeightsMem fail, weights_size:%zu, model_id:%u, check invalid", | |||
weights_size, model_id_); | |||
GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "Alloc weight memory failed. size: %zu", weights_size); | |||
return ACL_ERROR_GE_MEMORY_ALLOCATION; | |||
} | |||
@@ -379,8 +379,8 @@ Status DavinciModel::InitWeightMem(void *dev_ptr, void *weight_ptr, size_t weigh | |||
Status DavinciModel::InitFeatureMapAndP2PMem(void *dev_ptr, size_t mem_size) { | |||
if (is_feature_map_mem_has_inited_) { | |||
REPORT_INNER_ERROR("E19999", "Call InitFeatureMapMem more than once, model_id:%u, check invalid when %s", | |||
model_id_, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Call InitFeatureMapMem more than once, model_id:%u, check invalid", | |||
model_id_); | |||
GELOGE(PARAM_INVALID, "call InitFeatureMapMem more than once"); | |||
return PARAM_INVALID; | |||
} | |||
@@ -391,7 +391,7 @@ Status DavinciModel::InitFeatureMapAndP2PMem(void *dev_ptr, size_t mem_size) { | |||
if ((dev_ptr != nullptr) && (mem_size < TotalMemSize())) { | |||
REPORT_INNER_ERROR("E19999", "Param dev_ptr is nullptr or mem_size:%zu < ge_model.mem_size:%zu, " | |||
"model_id:%u, check invalid when %s", mem_size, TotalMemSize(), model_id_, __FUNCTION__); | |||
"model_id:%u, check invalid", mem_size, TotalMemSize(), model_id_); | |||
GELOGE(PARAM_INVALID, "Invalid mem param: mem_size=%zu totalsize=%zu.", mem_size, TotalMemSize()); | |||
return PARAM_INVALID; | |||
} | |||
@@ -403,8 +403,8 @@ Status DavinciModel::InitFeatureMapAndP2PMem(void *dev_ptr, size_t mem_size) { | |||
if (TotalMemSize() && mem_base_ == nullptr) { | |||
mem_base_ = MallocFeatureMapMem(data_size); | |||
if (mem_base_ == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "MallocFeatureMapMem fail, data_size:%zu, model_id:%u, check invalid when %s", | |||
data_size, model_id_, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "MallocFeatureMapMem fail, data_size:%zu, model_id:%u, check invalid", | |||
data_size, model_id_); | |||
GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "Alloc feature map memory failed. size: %zu", data_size); | |||
return ACL_ERROR_GE_MEMORY_ALLOCATION; | |||
} | |||
@@ -421,8 +421,8 @@ Status DavinciModel::InitFeatureMapAndP2PMem(void *dev_ptr, size_t mem_size) { | |||
if (p2p_data_size != 0) { | |||
p2p_mem_base_ = MallocP2PMem(p2p_data_size); | |||
if (p2p_mem_base_ == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "MallocFeatureMapMem fail, p2p_data_size:%zu, model_id:%u, check invalid when %s", | |||
p2p_data_size, model_id_, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "MallocFeatureMapMem fail, p2p_data_size:%zu, model_id:%u, check invalid", | |||
p2p_data_size, model_id_); | |||
GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "Alloc p2p memory failed,size: %zu", p2p_data_size); | |||
return ACL_ERROR_GE_MEMORY_ALLOCATION; | |||
} | |||
@@ -444,8 +444,8 @@ Status DavinciModel::InitVariableMem() { | |||
if (TotalVarMemSize() && (var_mem_base_ == nullptr)) { | |||
Status ret = VarManager::Instance(session_id_)->MallocVarMemory(TotalVarMemSize()); | |||
if (ret != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "MallocVarMemory fail, var_size:%zu, model_id:%u, check invalid when %s", | |||
TotalVarMemSize(), model_id_, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "MallocVarMemory fail, var_size:%zu, model_id:%u, check invalid", | |||
TotalVarMemSize(), model_id_); | |||
GELOGE(ret, "Malloc variable memory failed."); | |||
return ret; | |||
} | |||
@@ -586,8 +586,8 @@ Status DavinciModel::SetTSDevice() { | |||
GELOGD("SetTSDevice: %u.", core_type); | |||
rtError_t rt_ret = rtSetTSDevice(core_type); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtSetTSDevice failed, core_type:%u, model_id:%u, when DavinciModel %s", | |||
core_type, model_id_, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtSetTSDevice failed, core_type:%u, model_id:%u", | |||
core_type, model_id_); | |||
GELOGE(RT_FAILED, "SetTSDevice failed, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -910,8 +910,8 @@ Status DavinciModel::InitNodes(const ComputeGraphPtr &compute_graph) { | |||
rtError_t rt_ret = rtMemcpy(addr, size, tensor_device_addrs.data(), size, RT_MEMCPY_HOST_TO_DEVICE); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret: 0x%X when DavinciModel %s", | |||
size, rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret: 0x%X", | |||
size, rt_ret); | |||
GELOGE(RT_FAILED, "rtMemcpy error, ret: 0x%X", rt_ret); | |||
GE_CHK_RT(rtFree(addr)); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
@@ -989,9 +989,9 @@ Status DavinciModel::InitDataOp(const ComputeGraphPtr &graph, const NodePtr &nod | |||
(output_offset_list.size() != virtual_addr_list.size())) { | |||
REPORT_INNER_ERROR( | |||
"E19999", "Check data fail in op:%s(%s), output_desc size:%zu output addr size:%zu output offset size:%zu " | |||
"not equal or has empty, model_id:%u, when DavinciModel %s", | |||
"not equal or has empty, model_id:%u", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), | |||
output_size_list.size(), virtual_addr_list.size(), output_offset_list.size(), model_id_, __FUNCTION__); | |||
output_size_list.size(), virtual_addr_list.size(), output_offset_list.size(), model_id_); | |||
GELOGE(PARAM_INVALID, "Data[%s] init failed: output size is %zu, virtual_addr size is %zu, offset size is %zu.", | |||
op_desc->GetName().c_str(), output_size_list.size(), virtual_addr_list.size(), output_offset_list.size()); | |||
return PARAM_INVALID; | |||
@@ -1111,9 +1111,9 @@ Status DavinciModel::InitNetOutput(const ComputeGraphPtr &graph, const NodePtr & | |||
GE_IF_BOOL_EXEC(input_offset_list.size() != virtual_addr_list.size(), | |||
REPORT_INNER_ERROR( | |||
"E19999", "Check data fail in op:%s(%s), input addr size:%zu input offset size:%zu " | |||
"not equal, model_id:%u, when DavinciModel %s", | |||
"not equal, model_id:%u", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), | |||
virtual_addr_list.size(), input_offset_list.size(), model_id_, __FUNCTION__); | |||
virtual_addr_list.size(), input_offset_list.size(), model_id_); | |||
GELOGE(PARAM_INVALID, "virtual_addr size should be equal to offset size."); | |||
return PARAM_INVALID;); | |||
if (input_size_list.empty() && virtual_addr_list.empty()) { | |||
@@ -1123,8 +1123,8 @@ Status DavinciModel::InitNetOutput(const ComputeGraphPtr &graph, const NodePtr & | |||
if (input_size_list.empty() || input_size_list.size() != virtual_addr_list.size()) { | |||
REPORT_INNER_ERROR( | |||
"E19999", "Check data fail in op:%s(%s), input_desc size:%zu input addr size:%zu not equal or has empty, " | |||
"model_id:%u, when DavinciModel %s", op_desc->GetName().c_str(), op_desc->GetType().c_str(), | |||
input_size_list.size(), virtual_addr_list.size(), model_id_, __FUNCTION__); | |||
"model_id:%u", op_desc->GetName().c_str(), op_desc->GetType().c_str(), | |||
input_size_list.size(), virtual_addr_list.size(), model_id_); | |||
GELOGE(PARAM_INVALID, "NetOutput[%s] init failed: Input size is %zu, Input addr is %zu", op_desc->GetName().c_str(), | |||
input_size_list.size(), virtual_addr_list.size()); | |||
return PARAM_INVALID; | |||
@@ -1222,9 +1222,9 @@ Status DavinciModel::GetGetDynamicDimsNodeInfo(const NodePtr &node) { | |||
auto in_anchor = node->GetAllInDataAnchors().at(get_dynamic_dims_index); | |||
auto peer_out_anchor = in_anchor->GetPeerOutAnchor(); | |||
if (peer_out_anchor == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "In anchor index:%zu in op:%s(%s) peer anchor is nullptr, model_id:%u, check invalid " | |||
"when DavinciModel %s", get_dynamic_dims_index, | |||
node->GetName().c_str(), node->GetType().c_str(), model_id_, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "In anchor index:%zu in op:%s(%s) peer anchor is nullptr, model_id:%u, check invalid", | |||
get_dynamic_dims_index, | |||
node->GetName().c_str(), node->GetType().c_str(), model_id_); | |||
GELOGE(PARAM_INVALID, "Out anchor of getdynmaicdims node should not be nullptr."); | |||
return PARAM_INVALID; | |||
} | |||
@@ -1237,17 +1237,17 @@ Status DavinciModel::GetGetDynamicDimsNodeInfo(const NodePtr &node) { | |||
auto input_size = ModelUtils::GetInputSize(node->GetOpDesc()); | |||
if (input_addr.empty() || input_size.empty()) { | |||
REPORT_INNER_ERROR("E19999", "input_addr size:%zu or input_length size:%zu in op:%s(%s) has empty, model_id:%u " | |||
"check invalid when DavinciModel %s", input_addr.size(), input_size.size(), | |||
node->GetName().c_str(), node->GetType().c_str(), model_id_, __FUNCTION__); | |||
"check invalid", input_addr.size(), input_size.size(), | |||
node->GetName().c_str(), node->GetType().c_str(), model_id_); | |||
GELOGE(PARAM_INVALID, "Not set output of %s", op_desc->GetName().c_str()); | |||
return PARAM_INVALID; | |||
} | |||
auto input_desc = node->GetOpDesc()->GetInputDescPtr(get_dynamic_dims_index); | |||
GE_CHECK_NOTNULL(input_desc); | |||
if (input_desc->GetShape().GetDims().empty()) { | |||
REPORT_INNER_ERROR("E19999", "input_desc_index:%zu in op:%s(%s) shape dim is empty, model_id:%u, check invalid " | |||
"when DavinciModel %s", get_dynamic_dims_index, | |||
node->GetName().c_str(), node->GetType().c_str(), model_id_, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "input_desc_index:%zu in op:%s(%s) shape dim is empty, model_id:%u, check invalid", | |||
get_dynamic_dims_index, | |||
node->GetName().c_str(), node->GetType().c_str(), model_id_); | |||
GELOGE(PARAM_INVALID, "Not set output desc shape of %s.", op_desc->GetName().c_str()); | |||
return PARAM_INVALID; | |||
} | |||
@@ -1292,8 +1292,8 @@ Status DavinciModel::GetRealOutputSizeOfCase(const ComputeGraphPtr &graph, size_ | |||
for (const auto &name : func_desc->GetSubgraphInstanceNames()) { | |||
const auto &subgraph = graph->GetSubgraph(name); | |||
if (subgraph == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Get name:%s subgraph in graph:%s fail, model_id:%u, check invalid " | |||
"when DavinciModel %s", name.c_str(), graph->GetName().c_str(), model_id_, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Get name:%s subgraph in graph:%s fail, model_id:%u, check invalid", | |||
name.c_str(), graph->GetName().c_str(), model_id_); | |||
GELOGE(GE_GRAPH_EMPTY_SUBGRAPH, "Subgraph not found, name: %s.", name.c_str()); | |||
return GE_GRAPH_EMPTY_SUBGRAPH; | |||
} | |||
@@ -1307,9 +1307,9 @@ Status DavinciModel::GetRealOutputSizeOfCase(const ComputeGraphPtr &graph, size_ | |||
GELOGD("Batch index of %s is %zu.", op_desc->GetName().c_str(), batch_index); | |||
if (batch_index > all_gears_info_.size()) { | |||
REPORT_INNER_ERROR("E19999", "Batch_index:%zu in op:%s(%s) > all_gears_info.size:%zu, model_id:%u, " | |||
"check invalid when DavinciModel %s", batch_index, | |||
"check invalid", batch_index, | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), | |||
all_gears_info_.size(), model_id_, __FUNCTION__); | |||
all_gears_info_.size(), model_id_); | |||
GELOGE(PARAM_INVALID, "The value of ATTR_NAME_BATCH_LABEL is invalid."); | |||
return PARAM_INVALID; | |||
} | |||
@@ -1319,9 +1319,9 @@ Status DavinciModel::GetRealOutputSizeOfCase(const ComputeGraphPtr &graph, size_ | |||
GE_CHECK_NOTNULL(tensor_desc); | |||
int64_t data_size = 0; | |||
if (TensorUtils::GetTensorSizeInBytes(*tensor_desc, data_size) != GRAPH_SUCCESS) { | |||
REPORT_INNER_ERROR("E19999", "Get input TensorSize in op:%s(%s) failed, input_index:%zu, model_id:%u" | |||
"when DavinciModel %s", op_desc->GetName().c_str(), op_desc->GetType().c_str(), | |||
input_index, model_id_, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Get input TensorSize in op:%s(%s) failed, input_index:%zu, model_id:%u", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), | |||
input_index, model_id_); | |||
GELOGE(FAILED, "Get tensor size in bytes failed."); | |||
return FAILED; | |||
} | |||
@@ -1363,9 +1363,9 @@ Status DavinciModel::GetGearAndRealOutShapeInfo(const ComputeGraphPtr &graph, co | |||
for (auto &it : dynamic_output_shape) { | |||
auto gear_index = static_cast<size_t>(it[0]); | |||
if (gear_index > all_gears_info_.size()) { | |||
REPORT_INNER_ERROR("E19999", "gear index:%zu in op:%s(%s) > all_gears_info.size:%zu in model:%u check invalid" | |||
"when DavinciModel %s", gear_index, op_desc->GetName().c_str(), op_desc->GetType().c_str(), | |||
all_gears_info_.size(), model_id_, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "gear index:%zu in op:%s(%s) > all_gears_info.size:%zu in model:%u " | |||
"check invalid", gear_index, op_desc->GetName().c_str(), op_desc->GetType().c_str(), | |||
all_gears_info_.size(), model_id_); | |||
GELOGE(PARAM_INVALID, "The value of cur index: %zu is invalid.", static_cast<size_t>(it[0])); | |||
return PARAM_INVALID; | |||
} | |||
@@ -1414,8 +1414,8 @@ Status DavinciModel::GetLabelGotoAddr(uint32_t label_index, rtMemType_t mem_type | |||
} | |||
if (label_index >= label_list_.size()) { | |||
REPORT_INNER_ERROR("E19999", "Param label index:%u >= label_list_.size:%zu in model:%u, check invalid" | |||
"when DavinciModel %s", label_index, label_list_.size(), model_id_, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Param label index:%u >= label_list_.size:%zu in model:%u, check invalid", | |||
label_index, label_list_.size(), model_id_); | |||
GELOGE(INTERNAL_ERROR, "Invalid label id:%u, label size:%zu", label_index, label_list_.size()); | |||
return INTERNAL_ERROR; | |||
} | |||
@@ -1425,8 +1425,8 @@ Status DavinciModel::GetLabelGotoAddr(uint32_t label_index, rtMemType_t mem_type | |||
arg_size = label_used.size() * sizeof(rtLabelDevInfo); | |||
rtError_t rt_ret = rtMalloc(&arg_addr, arg_size, mem_type); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%u, ret: 0x%X when DavinciModel %s", | |||
arg_size, rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%u, ret: 0x%X", | |||
arg_size, rt_ret); | |||
GELOGE(RT_FAILED, "Call rtMalloc failed, error: %#x", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -1434,7 +1434,7 @@ Status DavinciModel::GetLabelGotoAddr(uint32_t label_index, rtMemType_t mem_type | |||
label_goto_args_[label_index] = { arg_addr, arg_size }; | |||
rt_ret = rtLabelListCpy(label_used.data(), label_used.size(), arg_addr, arg_size); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtLabelListCpy failed, ret: 0x%X when DavinciModel %s", rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtLabelListCpy failed, ret: 0x%X", rt_ret); | |||
GELOGE(RT_FAILED, "Call rtLabelListCpy failed, error: %#x", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -1449,24 +1449,24 @@ Status DavinciModel::GetLabelGotoAddr(uint32_t label_index, rtMemType_t mem_type | |||
Status DavinciModel::InitLabelSet(const OpDescPtr &op_desc) { | |||
uint32_t label_index = 0; | |||
if (!AttrUtils::GetInt(op_desc, ATTR_NAME_LABEL_SWITCH_INDEX, label_index)) { | |||
REPORT_INNER_ERROR("E19999", "Get Attr:%s in op:%s(%s) fail, model_id:%u, check invalid" | |||
"when DavinciModel %s", ATTR_NAME_LABEL_SWITCH_INDEX.c_str(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), model_id_, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Get Attr:%s in op:%s(%s) fail, model_id:%u, check invalid", | |||
ATTR_NAME_LABEL_SWITCH_INDEX.c_str(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), model_id_); | |||
GELOGE(INTERNAL_ERROR, "InitLabelSet: %s attr [%s] not exist.", op_desc->GetName().c_str(), | |||
ATTR_NAME_LABEL_SWITCH_INDEX.c_str()); | |||
return INTERNAL_ERROR; | |||
} | |||
if (label_index >= LabelNum()) { | |||
REPORT_INNER_ERROR("E19999", "label_switch_index:%u in op:%s(%s) >= label_num:%u in model:%u, check invalid" | |||
"when DavinciModel %s", label_index, op_desc->GetName().c_str(), op_desc->GetType().c_str(), | |||
LabelNum(), model_id_, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "label_switch_index:%u in op:%s(%s) >= label_num:%u in model:%u, check invalid", | |||
label_index, op_desc->GetName().c_str(), op_desc->GetType().c_str(), | |||
LabelNum(), model_id_); | |||
GELOGE(INTERNAL_ERROR, "InitLabelSet: label index: %u >= label size: %u.", label_index, LabelNum()); | |||
return INTERNAL_ERROR; | |||
} | |||
if (label_id_indication_.count(label_index) > 0) { | |||
REPORT_INNER_ERROR("E19999", "label_switch_index:%u in op:%s(%s) is already used in model:%u, check invalid" | |||
"when DavinciModel %s", label_index, op_desc->GetName().c_str(), op_desc->GetType().c_str(), | |||
model_id_, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "label_switch_index:%u in op:%s(%s) is already used in model:%u, check invalid", | |||
label_index, op_desc->GetName().c_str(), op_desc->GetType().c_str(), | |||
model_id_); | |||
GELOGE(INTERNAL_ERROR, "InitLabelSet: %s label index: %u already used.", op_desc->GetName().c_str(), label_index); | |||
return INTERNAL_ERROR; | |||
} | |||
@@ -1478,9 +1478,9 @@ Status DavinciModel::InitLabelSet(const OpDescPtr &op_desc) { | |||
} else if (stream_list_.size() > stream_id) { | |||
stream = stream_list_[stream_id]; | |||
} else { | |||
REPORT_INNER_ERROR("E19999", "stream_id:%u in op:%s(%s) >= stream size:%zu in model:%u, check invalid" | |||
"when DavinciModel %s", stream_id, op_desc->GetName().c_str(), op_desc->GetType().c_str(), | |||
stream_list_.size(), model_id_, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "stream_id:%u in op:%s(%s) >= stream size:%zu in model:%u, check invalid", | |||
stream_id, op_desc->GetName().c_str(), op_desc->GetType().c_str(), | |||
stream_list_.size(), model_id_); | |||
GELOGE(INTERNAL_ERROR, "InitLabelSet: stream index: %u >= stream size: %zu.", stream_id, stream_list_.size()); | |||
return INTERNAL_ERROR; | |||
} | |||
@@ -1488,8 +1488,8 @@ Status DavinciModel::InitLabelSet(const OpDescPtr &op_desc) { | |||
rtLabel_t rt_label = nullptr; | |||
rtError_t rt_error = rtLabelCreateExV2(&rt_label, rt_model_handle_, stream); | |||
if (rt_error != RT_ERROR_NONE || rt_label == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "Call rtLabelCreateExV2 failed, ret: 0x%X when DavinciModel %s", | |||
rt_error, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtLabelCreateExV2 failed, ret: 0x%X", | |||
rt_error); | |||
GELOGE(INTERNAL_ERROR, "InitLabelSet: %s create label failed, error=0x%x.", op_desc->GetName().c_str(), rt_error); | |||
return INTERNAL_ERROR; | |||
} | |||
@@ -1529,8 +1529,8 @@ Status DavinciModel::SetQueIds(const std::vector<uint32_t> &input_queue_ids, | |||
const std::vector<uint32_t> &output_queue_ids) { | |||
if (input_queue_ids.empty() && output_queue_ids.empty()) { | |||
REPORT_INNER_ERROR("E19999", "Param input_queue_ids.size:%zu or output_queue_ids.size:%zu is empty, model_id:%u," | |||
"check invalid when DavinciModel %s", input_queue_ids.size(), output_queue_ids.size(), | |||
model_id_, __FUNCTION__); | |||
"check invalid", input_queue_ids.size(), output_queue_ids.size(), | |||
model_id_); | |||
GELOGE(ACL_ERROR_GE_EXEC_MODEL_QUEUE_ID_INVALID, "Param is empty"); | |||
return ACL_ERROR_GE_EXEC_MODEL_QUEUE_ID_INVALID; | |||
} | |||
@@ -1554,8 +1554,8 @@ Status DavinciModel::LoadWithQueue() { | |||
if (input_queue_ids_.size() != input_data_info_.size()) { | |||
REPORT_INNER_ERROR("E19999", "Param input_queue_ids_.size:%zu != input_data_info_.size:%zu, model_id:%u," | |||
"check invalid when DavinciModel %s", input_queue_ids_.size(), input_data_info_.size(), | |||
model_id_, __FUNCTION__); | |||
"check invalid", input_queue_ids_.size(), input_data_info_.size(), | |||
model_id_); | |||
GELOGE(ACL_ERROR_GE_EXEC_MODEL_QUEUE_ID_INVALID, "Input queue ids not match model: input_queue=%zu input_data=%zu", | |||
input_queue_ids_.size(), input_data_info_.size()); | |||
return ACL_ERROR_GE_EXEC_MODEL_QUEUE_ID_INVALID; | |||
@@ -1563,8 +1563,8 @@ Status DavinciModel::LoadWithQueue() { | |||
if (output_queue_ids_.size() != output_data_info_.size()) { | |||
REPORT_INNER_ERROR("E19999", "Param output_queue_ids_.size:%zu != output_data_info_.size:%zu, model_id:%u," | |||
"check invalid when DavinciModel %s", output_queue_ids_.size(), output_data_info_.size(), | |||
model_id_, __FUNCTION__); | |||
"check invalid", output_queue_ids_.size(), output_data_info_.size(), | |||
model_id_); | |||
GELOGE(ACL_ERROR_GE_EXEC_MODEL_QUEUE_ID_INVALID, | |||
"Output queue ids not match model: output_queue=%zu output_data=%zu", | |||
output_queue_ids_.size(), output_data_info_.size()); | |||
@@ -1613,7 +1613,7 @@ Status DavinciModel::BindInputQueue() { | |||
rtError_t rt_ret = rtModelBindQueue(rt_model_handle_, queue_id, RT_MODEL_INPUT_QUEUE); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtModelBindQueue failed, ret: 0x%X when DavinciModel %s", rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtModelBindQueue failed, ret: 0x%X", rt_ret); | |||
GELOGE(RT_FAILED, "Call rtModelBindQueue failed, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -1634,8 +1634,8 @@ Status DavinciModel::CpuModelDequeue(uint32_t queue_id) { | |||
GELOGI("Set CpuKernel model dequeue task enter."); | |||
std::shared_ptr<CpuTaskModelDequeue> dequeue_task = MakeShared<CpuTaskModelDequeue>(rt_entry_stream_); | |||
if (dequeue_task == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "New CpuTaskModelDequeue failed, model_id:%u, when DavinciModel %s", | |||
model_id_, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "New CpuTaskModelDequeue failed, model_id:%u", | |||
model_id_); | |||
GELOGE(MEMALLOC_FAILED, "Make CpuTaskModelDequeue task failed."); | |||
return MEMALLOC_FAILED; | |||
} | |||
@@ -1658,8 +1658,8 @@ Status DavinciModel::CpuTaskModelZeroCopy(std::vector<uintptr_t> &mbuf_list, | |||
GELOGI("Set CpuKernel model zero_copy task enter."); | |||
std::shared_ptr<CpuTaskZeroCopy> zero_copy = MakeShared<CpuTaskZeroCopy>(rt_entry_stream_); | |||
if (zero_copy == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "New CpuTaskZeroCopy failed, model_id:%u, when DavinciModel %s", | |||
model_id_, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "New CpuTaskZeroCopy failed, model_id:%u", | |||
model_id_); | |||
GELOGE(MEMALLOC_FAILED, "Make CpuTaskZeroCopy task failed."); | |||
return MEMALLOC_FAILED; | |||
} | |||
@@ -1682,16 +1682,16 @@ Status DavinciModel::BindOutputQueue() { | |||
for (size_t i = 0; i < output_queue_ids_.size(); ++i) { | |||
auto it = output_data_info_.find(i); | |||
if (it == output_data_info_.end()) { | |||
REPORT_INNER_ERROR("E19999", "Index:%zu can't find in output_data_info_ size:%zu in model_id:%u, check invalid " | |||
"when DavinciModel %s", i, output_data_info_.size(), model_id_, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Index:%zu can't find in output_data_info_ size:%zu in model_id:%u, check invalid", | |||
i, output_data_info_.size(), model_id_); | |||
GELOGE(FAILED, "Output not match: tensor num=%zu, Queue id index=%zu", output_data_info_.size(), i); | |||
return FAILED; | |||
} | |||
uint32_t queue_id = output_queue_ids_[i]; | |||
if (it->second.GetDataInfo().empty()) { | |||
REPORT_INNER_ERROR("E19999", "Index:%zu out_data_info in model:%u is empty, check invalid " | |||
"when DavinciModel %s", i, model_id_, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Index:%zu out_data_info in model:%u is empty, check invalid", | |||
i, model_id_); | |||
GELOGE(INTERNAL_ERROR, "the %zu output_queue not set data_info.", i); | |||
return INTERNAL_ERROR; | |||
} | |||
@@ -1702,8 +1702,8 @@ Status DavinciModel::BindOutputQueue() { | |||
rtError_t rt_ret = rtModelBindQueue(rt_model_handle_, queue_id, RT_MODEL_OUTPUT_QUEUE); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtModelBindQueue failed, queue_id:%u, ret: 0x%X when DavinciModel %s", | |||
queue_id, rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtModelBindQueue failed, queue_id:%u, ret: 0x%X", | |||
queue_id, rt_ret); | |||
GELOGE(RT_FAILED, "Call rtModelBindQueue failed, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -1725,16 +1725,16 @@ Status DavinciModel::BindOutputQueue() { | |||
Status DavinciModel::CpuModelPrepareOutput(uintptr_t addr, uint32_t size) { | |||
GELOGI("Set CpuKernel model enqueue task enter."); | |||
if (input_mbuf_list_.empty()) { | |||
REPORT_INNER_ERROR("E19999", "input_mbuf_list_ is empty, model_id:%u, check invalid when %s", | |||
model_id_, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "input_mbuf_list_ is empty, model_id:%u, check invalid", | |||
model_id_); | |||
GELOGE(FAILED, "Need input mbuf for fill output mbuf head info."); | |||
return FAILED; | |||
} | |||
std::shared_ptr<CpuTaskPrepareOutput> prepare_output = MakeShared<CpuTaskPrepareOutput>(rt_entry_stream_); | |||
if (prepare_output == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "New CpuTaskPrepareOutput failed, model_id:%u, when DavinciModel %s", | |||
model_id_, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "New CpuTaskPrepareOutput failed, model_id:%u", | |||
model_id_); | |||
GELOGE(MEMALLOC_FAILED, "Make CpuTaskPrepareOutput task failed."); | |||
return MEMALLOC_FAILED; | |||
} | |||
@@ -1759,8 +1759,8 @@ Status DavinciModel::CpuActiveStream() { | |||
GELOGI("Set CpuKernel active stream task enter."); | |||
std::shared_ptr<CpuTaskActiveEntry> active_entry = MakeShared<CpuTaskActiveEntry>(rt_entry_stream_); | |||
if (active_entry == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "New CpuTaskActiveEntry failed, model_id:%u, when DavinciModel %s", | |||
model_id_, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "New CpuTaskActiveEntry failed, model_id:%u", | |||
model_id_); | |||
GELOGE(MEMALLOC_FAILED, "Make CpuTaskActiveEntry task failed."); | |||
return MEMALLOC_FAILED; | |||
} | |||
@@ -1782,8 +1782,8 @@ Status DavinciModel::CpuWaitEndGraph() { | |||
GELOGI("Set CpuKernel wait end graph task enter."); | |||
std::shared_ptr<CpuTaskWaitEndGraph> wait_endgraph = MakeShared<CpuTaskWaitEndGraph>(rt_entry_stream_); | |||
if (wait_endgraph == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "New CpuTaskWaitEndGraph failed, model_id:%u, when DavinciModel %s", | |||
model_id_, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "New CpuTaskWaitEndGraph failed, model_id:%u", | |||
model_id_); | |||
GELOGE(MEMALLOC_FAILED, "Make CpuTaskWaitEndGraph task failed."); | |||
return MEMALLOC_FAILED; | |||
} | |||
@@ -1802,8 +1802,8 @@ Status DavinciModel::BindEnqueue() { | |||
for (size_t i = 0; i < output_queue_ids_.size(); ++i) { | |||
auto it = output_data_info_.find(i); | |||
if (it == output_data_info_.end()) { | |||
REPORT_INNER_ERROR("E19999", "Index:%zu can't find in output_data_info_ size:%zu in model_id:%u, check invalid " | |||
"when DavinciModel %s", i, output_data_info_.size(), model_id_, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Index:%zu can't find in output_data_info_ size:%zu in model_id:%u, check invalid", | |||
i, output_data_info_.size(), model_id_); | |||
GELOGE(FAILED, "Output not match: tensor num=%zu, Queue id index=%zu", output_data_info_.size(), i); | |||
return FAILED; | |||
} | |||
@@ -1820,8 +1820,8 @@ Status DavinciModel::CpuModelEnqueue(uint32_t queue_id, uintptr_t out_mbuf) { | |||
GELOGI("Set CpuKernel model enqueue task enter."); | |||
std::shared_ptr<CpuTaskModelEnqueue> model_enqueue = MakeShared<CpuTaskModelEnqueue>(rt_entry_stream_); | |||
if (model_enqueue == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "New CpuTaskModelEnqueue failed, model_id:%u, when DavinciModel %s", | |||
model_id_, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "New CpuTaskModelEnqueue failed, model_id:%u", | |||
model_id_); | |||
GELOGE(MEMALLOC_FAILED, "Make CpuTaskModelEnqueue task failed."); | |||
return MEMALLOC_FAILED; | |||
} | |||
@@ -1842,8 +1842,8 @@ Status DavinciModel::CpuModelRepeat() { | |||
GELOGI("Set CpuKernel repeat task enter."); | |||
std::shared_ptr<CpuTaskModelRepeat> model_repeat = MakeShared<CpuTaskModelRepeat>(rt_entry_stream_); | |||
if (model_repeat == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "New CpuTaskModelRepeat failed, model_id:%u, when DavinciModel %s", | |||
model_id_, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "New CpuTaskModelRepeat failed, model_id:%u", | |||
model_id_); | |||
GELOGE(MEMALLOC_FAILED, "Make CpuTaskModelRepeat task failed."); | |||
return MEMALLOC_FAILED; | |||
} | |||
@@ -1878,7 +1878,7 @@ Status DavinciModel::GetInputOutputDescInfo(vector<InputOutputDescInfo> &input_d | |||
vector<uint32_t> &output_formats, bool by_dims) { | |||
if (input_addrs_list_.empty() || input_addrs_list_[0].size() != 1) { | |||
REPORT_INNER_ERROR("E19999", "input_addrs_list_ is empty or first member size != 1, model_id:%u, " | |||
"check invalid when DavinciModel %s", model_id_, __FUNCTION__); | |||
"check invalid", model_id_); | |||
GELOGE(FAILED, "OP List Pointer is null or input_desc size is not 1!"); | |||
return FAILED; | |||
} | |||
@@ -1989,9 +1989,9 @@ Status DavinciModel::InitAippType(uint32_t index, const OpDescPtr &op_desc, cons | |||
} else if (data_mode == "dynamic_aipp_conf") { | |||
aipp_type = DYNAMIC_AIPP_NODE; | |||
} else { | |||
REPORT_INNER_ERROR("E19999", "Attr:%s data_mode:%s in op:%s(%s), model_id:%u, check invalid when DavinciModel %s", | |||
REPORT_INNER_ERROR("E19999", "Attr:%s data_mode:%s in op:%s(%s), model_id:%u, check invalid", | |||
ATTR_DATA_RELATED_AIPP_MODE.c_str(), data_mode.c_str(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), model_id_, __FUNCTION__); | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), model_id_); | |||
GELOGE(ACL_ERROR_GE_AIPP_MODE_INVALID, | |||
"The info of aipp releated info %s is invalid with index %u.", data_mode.c_str(), index); | |||
return ACL_ERROR_GE_AIPP_MODE_INVALID; | |||
@@ -2143,8 +2143,8 @@ void DavinciModel::CreateOutput(uint32_t index, const OpDescPtr &op_desc, InputO | |||
/// netoutput input tensor desc | |||
GE_IF_BOOL_EXEC(op_desc->GetInputDescPtr(index) == nullptr, | |||
REPORT_INNER_ERROR("E19999", "input_desc index:%u in op:%s(%s) not exist, model_id:%u, " | |||
"check invalid when DavinciModel %s", index, | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), model_id_, __FUNCTION__); | |||
"check invalid", index, | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), model_id_); | |||
GELOGE(FAILED, "OpDesc GetInputDescPtr is nullptr"); | |||
return); | |||
Format format = op_desc->GetInputDescPtr(index)->GetFormat(); | |||
@@ -2236,7 +2236,7 @@ Status DavinciModel::CopyInputData(const InputData &input_data, bool device_data | |||
for (const auto &data : input_data_info_) { | |||
if (data.first >= blobs.size()) { | |||
REPORT_INNER_ERROR("E19999", "index:%u in input_data_info_ >= input_data.blobs.size:%zu, model_id:%u, " | |||
"check invalid when DavinciModel %s", data.first, blobs.size(), model_id_, __FUNCTION__); | |||
"check invalid", data.first, blobs.size(), model_id_); | |||
GELOGE(FAILED, "Blobs not match: blobs=%zu, tensor=%zu, index=%u, size=%ld, op_name(%s)", blobs.size(), | |||
input_data_info_.size(), data.first, data.second.GetDataInfo().at(0).first, | |||
data.second.GetOpName().c_str()); | |||
@@ -2386,12 +2386,12 @@ Status DavinciModel::SinkModelProfile() { | |||
try { | |||
reported_data = model_load_info.dump(kInteval, ' ', false, Json::error_handler_t::ignore); | |||
} catch (std::exception &e) { | |||
REPORT_INNER_ERROR("E19999", "Convert model_load_info JSON to string failed, model_id:%u, reason:%s, " | |||
"when DavinciModel %s", model_id_, e.what(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Convert model_load_info JSON to string failed, model_id:%u, reason:%s", | |||
model_id_, e.what()); | |||
GELOGE(FAILED, "Failed to convert JSON to string, reason: %s.", e.what()); | |||
} catch (...) { | |||
REPORT_INNER_ERROR("E19999", "Convert model_load_info JSON to string failed, model_id:%u, when DavinciModel %s", | |||
model_id_, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Convert model_load_info JSON to string failed, model_id:%u", | |||
model_id_); | |||
GELOGE(FAILED, "Failed to convert JSON to string."); | |||
} | |||
reported_data.append(",") | |||
@@ -2426,12 +2426,12 @@ Status DavinciModel::SinkTimeProfile(const InputData ¤t_data) { | |||
try { | |||
reported_data = model_time_info.dump(kInteval, ' ', false, Json::error_handler_t::ignore); | |||
} catch (std::exception &e) { | |||
REPORT_INNER_ERROR("E19999", "Convert model_time_info JSON to string failed, model_id:%u, reason:%s, " | |||
"when DavinciModel %s", model_id_, e.what(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Convert model_time_info JSON to string failed, model_id:%u, reason:%s", | |||
model_id_, e.what()); | |||
GELOGE(FAILED, "Failed to convert JSON to string, reason: %s.", e.what()); | |||
} catch (...) { | |||
REPORT_INNER_ERROR("E19999", "Convert model_time_info JSON to string failed, model_id:%u, when DavinciModel %s", | |||
model_id_, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Convert model_time_info JSON to string failed, model_id:%u", | |||
model_id_); | |||
GELOGE(FAILED, "Failed to convert JSON to string."); | |||
} | |||
reported_data.append(",") | |||
@@ -2499,8 +2499,8 @@ Status DavinciModel::CopyOutputData(uint32_t data_id, OutputData &output_data, r | |||
output_data.model_id = model_id_; | |||
if (output_data.blobs.size() != output_data_info_.size()) { | |||
REPORT_INNER_ERROR("E19999", "output_data.blobs.size:%zu != output_data_info.size:%zu, model_id:%u, " | |||
"check invalid when DavinciModel %s", | |||
output_data.blobs.size(), output_data_info_.size(), model_id_, __FUNCTION__); | |||
"check invalid", | |||
output_data.blobs.size(), output_data_info_.size(), model_id_); | |||
GELOGE(FAILED, "Output data buffer num=%zu not equal model data num=%zu", output_data.blobs.size(), | |||
output_data_info_.size()); | |||
return FAILED; | |||
@@ -2511,7 +2511,7 @@ Status DavinciModel::CopyOutputData(uint32_t data_id, OutputData &output_data, r | |||
for (const auto &output : output_data_info_) { | |||
if (output.first >= blobs.size()) { | |||
REPORT_INNER_ERROR("E19999", "index:%u in output_data_info_ >= output_data.blobs.size:%zu, model_id:%u, " | |||
"check invalid when DavinciModel %s", output.first, blobs.size(), model_id_, __FUNCTION__); | |||
"check invalid", output.first, blobs.size(), model_id_); | |||
GELOGE(FAILED, "Blobs not match: blobs=%zu, tensor=%zu, index=%u, size=%ld", blobs.size(), | |||
input_data_info_.size(), output.first, output.second.GetDataInfo().at(0).first); | |||
return FAILED; | |||
@@ -2531,8 +2531,8 @@ Status DavinciModel::CopyOutputData(uint32_t data_id, OutputData &output_data, r | |||
GELOGI("No need to check output data size."); | |||
} else if (buffer.length < mem_size) { | |||
REPORT_INNER_ERROR("E19999", "Buffer.length:%lu in output blob < mem_size:%lu in output_data_info, index:%u, " | |||
"model_id:%u, check invalid when DavinciModel %s", buffer.length, mem_size, output.first, | |||
model_id_, __FUNCTION__); | |||
"model_id:%u, check invalid", buffer.length, mem_size, output.first, | |||
model_id_); | |||
GELOGE(FAILED, "Tensor data size=%lu, buffer size=%lu", mem_size, buffer.length); | |||
return FAILED; | |||
} else if (buffer.length > mem_size) { | |||
@@ -2570,9 +2570,9 @@ Status DavinciModel::InitOutputTensorInfo(const OpDescPtr &op_desc) { | |||
auto ret = TensorUtils::GetTensorSizeInBytes(*input_desc, size); | |||
GE_IF_BOOL_EXEC(ret != GRAPH_SUCCESS, | |||
REPORT_INNER_ERROR("E19999", "Get input TensorSize in op:%s(%s) failed, input_index:%zu, " | |||
"model_id:%u when DavinciModel %s", | |||
"model_id:%u", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), i, | |||
model_id_, __FUNCTION__); | |||
model_id_); | |||
GELOGE(ret, "Get size from TensorDesc failed, op:%s, input id:%zu", op_desc->GetName().c_str(), i); | |||
return ret); | |||
const GeShape &shape = input_desc->GetShape(); | |||
@@ -2615,8 +2615,8 @@ Status DavinciModel::GenOutputTensorInfo(OutputData *output_data, vector<OutputT | |||
for (size_t i = 0; i < output_buffer_size.size(); ++i) { | |||
std::unique_ptr<uint8_t[]> data_buf(new (std::nothrow) uint8_t[output_buffer_size[i]]); | |||
if (data_buf == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "New buffer failed, size:%ld, model_id:%u when DavinciModel %s", | |||
output_buffer_size[i], model_id_, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "New buffer failed, size:%ld, model_id:%u", | |||
output_buffer_size[i], model_id_); | |||
GELOGE(GE_GRAPH_MALLOC_FAILED, "Malloc buffer failed."); | |||
return GE_GRAPH_MALLOC_FAILED; | |||
} | |||
@@ -3109,8 +3109,8 @@ Status DavinciModel::MallocKnownArgs() { | |||
if (total_args_size_ != 0) { | |||
rt_ret = rtMalloc(&args_, total_args_size_, mem_type); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%u, ret: 0x%X when DavinciModel %s", | |||
total_args_size_, rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%u, ret: 0x%X", | |||
total_args_size_, rt_ret); | |||
GELOGE(RT_FAILED, "Call rtMalloc failed, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -3119,8 +3119,8 @@ Status DavinciModel::MallocKnownArgs() { | |||
if (total_hybrid_args_size_ != 0) { | |||
rt_ret = rtMalloc(&hybrid_addrs_, total_hybrid_args_size_, mem_type); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%u, ret: 0x%X when DavinciModel %s", | |||
total_hybrid_args_size_, rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%u, ret: 0x%X", | |||
total_hybrid_args_size_, rt_ret); | |||
GELOGE(RT_FAILED, "Call rtMalloc failed, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -3130,8 +3130,8 @@ Status DavinciModel::MallocKnownArgs() { | |||
GELOGI("Begin to allocate fixed addr."); | |||
rt_ret = rtMalloc(&fixed_addrs_, total_fixed_addr_size_, mem_type); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%u, ret: 0x%X when DavinciModel %s", | |||
total_hybrid_args_size_, rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%u, ret: 0x%X", | |||
total_hybrid_args_size_, rt_ret); | |||
GELOGE(RT_FAILED, "Call rtMalloc failed, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -3380,8 +3380,8 @@ bool DavinciModel::CheckInputAndModelSize(const int64_t &input_size, const int64 | |||
// The input and model input size can not be exactly equal because user input is not definite. | |||
if ((input_size + kDataMemAlignSizeCompare) < op_size) { | |||
REPORT_INNER_ERROR("E19999", "input size:%ld from user add align:%u > input_op_size:%ld in model, model_id:%u, " | |||
"check invalid when DavinciModel %s", | |||
input_size, kDataMemAlignSizeCompare, op_size, model_id_, __FUNCTION__); | |||
"check invalid", | |||
input_size, kDataMemAlignSizeCompare, op_size, model_id_); | |||
GELOGE(ACL_ERROR_GE_PARAM_INVALID, | |||
"Input size [%ld] can not be smaller than op size [%ld] after 64-byte alignment", input_size, op_size); | |||
return false; | |||
@@ -3432,8 +3432,8 @@ Status DavinciModel::UpdateIoTaskArgs(const std::map<uint32_t, ZeroCopyOffset> & | |||
const vector<DataBuffer> &blobs, bool is_dynamic, const string &batch_label) { | |||
if (blobs.size() != data_info.size()) { | |||
REPORT_INNER_ERROR("E19999", "is_input:%d blob size:%ld from user != op_size:%ld in model, mode_id:%u" | |||
"check invalid when DavinciModel %s", is_input, | |||
blobs.size(), data_info.size(), model_id_, __FUNCTION__); | |||
"check invalid", is_input, | |||
blobs.size(), data_info.size(), model_id_); | |||
GELOGE(ACL_ERROR_GE_PARAM_INVALID, "Verify %s data num failed: model requires %zu, but user actually feeds %zu", | |||
is_input ? "input" : "output", data_info.size(), blobs.size()); | |||
return ACL_ERROR_GE_PARAM_INVALID; | |||
@@ -3442,8 +3442,8 @@ Status DavinciModel::UpdateIoTaskArgs(const std::map<uint32_t, ZeroCopyOffset> & | |||
for (const auto &data : data_info) { | |||
if (data.first >= blobs.size()) { // check data index. | |||
REPORT_INNER_ERROR("E19999", "is_input:%d, data index:%u from model >= blobs.size:%zu from user, mode_id:%u" | |||
"check invalid when DavinciModel %s", is_input, | |||
data.first, blobs.size(), model_id_, __FUNCTION__); | |||
"check invalid", is_input, | |||
data.first, blobs.size(), model_id_); | |||
GELOGE(ACL_ERROR_GE_PARAM_INVALID, | |||
"Verify %s data num failed: can not find No.%u data, because user only feeds %zu", | |||
is_input ? "input" : "output", data.first, blobs.size()); | |||
@@ -3453,8 +3453,8 @@ Status DavinciModel::UpdateIoTaskArgs(const std::map<uint32_t, ZeroCopyOffset> & | |||
const DataBuffer &buffer = blobs[data.first]; // index of data. | |||
if (buffer.data == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "is_input:%d buffer from user is nullptr, index:%u, mode_id:%u" | |||
"check invalid when DavinciModel %s", is_input, | |||
data.first, model_id_, __FUNCTION__); | |||
"check invalid", is_input, | |||
data.first, model_id_); | |||
GELOGE(ACL_ERROR_GE_PARAM_INVALID, "data_buf.data is nullptr, index=%u", data.first); | |||
return ACL_ERROR_GE_PARAM_INVALID; | |||
} | |||
@@ -3472,8 +3472,8 @@ Status DavinciModel::UpdateIoTaskArgs(const std::map<uint32_t, ZeroCopyOffset> & | |||
GELOGI("[IMAS] Find addr %p need direct copy from user malloc input %p", basic_addr, buffer.data); | |||
rtError_t rt_ret = rtMemcpy(basic_addr, data_size, buffer.data, buffer.length, RT_MEMCPY_DEVICE_TO_DEVICE); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%lu, model_id:%u, when DavinciModel %s", | |||
data_size, model_id_, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%lu, model_id:%u", | |||
data_size, model_id_); | |||
GELOGE(rt_ret, "Non-zero copy data node copy failed"); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -3556,17 +3556,17 @@ Status DavinciModel::InitConstant(const OpDescPtr &op_desc) { | |||
auto v_output_addr = ModelUtils::GetOutputDataAddrs(runtime_param_, op_desc); | |||
GE_IF_BOOL_EXEC(v_weights.empty() || v_output_size.empty() || v_output_addr.empty(), | |||
REPORT_INNER_ERROR("E19999", "weight.size:%zu output_length.size:%zu output_addr.size:%zu in " | |||
"op:%s(%s) has empty, model_id:%u, check invalid when DavinciModel %s", | |||
"op:%s(%s) has empty, model_id:%u, check invalid", | |||
v_weights.size(),v_output_size.size(), v_output_addr.size(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str() ,model_id_, __FUNCTION__); | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str() ,model_id_); | |||
GELOGE(PARAM_INVALID, "const op:%s not set output", op_desc->GetName().c_str()); | |||
return PARAM_INVALID;); | |||
GeTensor *tensor = const_cast<GeTensor *>(v_weights[0].get()); | |||
GE_IF_BOOL_EXEC(static_cast<size_t>(v_output_size[0]) < tensor->GetData().size(), | |||
REPORT_INNER_ERROR("E19999", "Output size:%zu < weight size:%zu in op:%s(%s) model_id:%u, " | |||
"check invalid when DavinciModel %s", v_output_size[0], tensor->GetData().size(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str() ,model_id_, __FUNCTION__); | |||
"check invalid", v_output_size[0], tensor->GetData().size(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str() ,model_id_); | |||
GELOGE(PARAM_INVALID, "output size:%ld less than weight data size:%zu", v_output_size[0], | |||
tensor->GetData().size()); | |||
return PARAM_INVALID;); | |||
@@ -3616,8 +3616,8 @@ Status DavinciModel::InitTbeHandle(const OpDescPtr &op_desc) { | |||
auto kernel = ge_model_->GetTBEKernelStore().FindKernel(op_desc->GetName()); | |||
auto tbe_kernel = (kernel != nullptr) ? kernel : op_desc->TryGetExtAttr(OP_EXTATTR_NAME_TBE_KERNEL, TBEKernelPtr()); | |||
if (tbe_kernel == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Get tbe_kernel for op:%s(%s) fail, model_id:%u, when DavinciModel %s", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str() ,model_id_, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Get tbe_kernel for op:%s(%s) fail, model_id:%u", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str() ,model_id_); | |||
GELOGE(INTERNAL_ERROR, "TBE: %s can't find tvm bin file!", op_desc->GetName().c_str()); | |||
return INTERNAL_ERROR; | |||
} | |||
@@ -3644,9 +3644,9 @@ Status DavinciModel::InitTbeHandle(const OpDescPtr &op_desc) { | |||
} else if (json_string == "RT_DEV_BINARY_MAGIC_ELF_AIVEC") { | |||
binary.magic = RT_DEV_BINARY_MAGIC_ELF_AIVEC; | |||
} else { | |||
REPORT_INNER_ERROR("E19999", "Attr:%s value:%s in op:%s(%s), model_id:%u, check invalid when DavinciModel %s", | |||
REPORT_INNER_ERROR("E19999", "Attr:%s value:%s in op:%s(%s), model_id:%u, check invalid", | |||
TVM_ATTR_NAME_MAGIC.c_str(), json_string.c_str(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str() ,model_id_, __FUNCTION__); | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str() ,model_id_); | |||
GELOGE(PARAM_INVALID, "TBE: Invalid parameter magic number! json: %s", json_string.c_str()); | |||
return PARAM_INVALID; | |||
} | |||
@@ -3737,10 +3737,10 @@ Status DavinciModel::InitStreamSwitch(const OpDescPtr &op_desc) { | |||
"GetInt ACTIVE_STREAM_LIST failed."); | |||
if (active_stream_list.size() != kTrueBranchStreamNum) { | |||
REPORT_INNER_ERROR("E19999", "Attr:%s active_stream_list.size:%zu in op:%s(%s) != kTrueBranchStreamNum:%u, " | |||
"model_id:%u, check invalid when DavinciModel %s", | |||
"model_id:%u, check invalid", | |||
ATTR_NAME_ACTIVE_STREAM_LIST.c_str(), active_stream_list.size(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), | |||
kTrueBranchStreamNum, model_id_, __FUNCTION__); | |||
kTrueBranchStreamNum, model_id_); | |||
GELOGE(INTERNAL_ERROR, "Stream num of switch true branch must be %u.", kTrueBranchStreamNum); | |||
return INTERNAL_ERROR; | |||
} | |||
@@ -3755,9 +3755,9 @@ Status DavinciModel::InitStreamSwitch(const OpDescPtr &op_desc) { | |||
Status DavinciModel::InitStreamSwitchN(const OpDescPtr &op_desc) { | |||
std::vector<uint32_t> active_stream_list; | |||
if (!AttrUtils::GetListInt(op_desc, ATTR_NAME_ACTIVE_STREAM_LIST, active_stream_list)) { | |||
REPORT_INNER_ERROR("E19999", "Get Attr:%s from op:%s(%s) fail, model_id:%u, when DavinciModel %s", | |||
REPORT_INNER_ERROR("E19999", "Get Attr:%s from op:%s(%s) fail, model_id:%u", | |||
ATTR_NAME_ACTIVE_STREAM_LIST.c_str(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), model_id_, __FUNCTION__); | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), model_id_); | |||
GELOGE(INTERNAL_ERROR, "StreamSwitchNOp get attr ACTIVE_STREAM failed."); | |||
return INTERNAL_ERROR; | |||
} | |||
@@ -3769,9 +3769,9 @@ Status DavinciModel::InitStreamSwitchN(const OpDescPtr &op_desc) { | |||
uint32_t batch_num = 0; | |||
if (!AttrUtils::GetInt(op_desc, ATTR_NAME_BATCH_NUM, batch_num)) { | |||
REPORT_INNER_ERROR("E19999", "Get Attr:%s from op:%s(%s) fail, model_id:%u, when DavinciModel %s", | |||
REPORT_INNER_ERROR("E19999", "Get Attr:%s from op:%s(%s) fail, model_id:%u", | |||
ATTR_NAME_BATCH_NUM.c_str(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), model_id_, __FUNCTION__); | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), model_id_); | |||
GELOGE(FAILED, "Failed to get attr ATTR_NAME_BATCH_NUM, StreamSwitchN: %s.", op_desc->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -3789,9 +3789,9 @@ Status DavinciModel::SetDynamicBatchInfo(const OpDescPtr &op_desc, uint32_t batc | |||
std::vector<int64_t> batch_shape; | |||
const std::string attr_name = ATTR_NAME_PRED_VALUE + "_" + std::to_string(i); | |||
if (!AttrUtils::GetListInt(op_desc, attr_name, batch_shape)) { | |||
REPORT_INNER_ERROR("E19999", "Get Attr:%s from op:%s(%s) fail, model_id:%u, when DavinciModel %s", | |||
REPORT_INNER_ERROR("E19999", "Get Attr:%s from op:%s(%s) fail, model_id:%u", | |||
attr_name.c_str(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), model_id_, __FUNCTION__); | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), model_id_); | |||
GELOGE(FAILED, "Get attr ATTR_NAME_PRED_VALUE failed, Node: %s", op_desc->GetName().c_str()); | |||
batch_info_.clear(); | |||
return FAILED; | |||
@@ -3936,8 +3936,8 @@ Status DavinciModel::NnExecute(rtStream_t stream, bool async_mode, const InputDa | |||
// Add active entry stream for special env. | |||
Status DavinciModel::AddHeadStream() { | |||
if (active_stream_list_.empty()) { | |||
REPORT_INNER_ERROR("E19999", "active_stream_list is empty in model:%u, check invalid when DavinciModel %s", | |||
model_id_, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "active_stream_list is empty in model:%u, check invalid", | |||
model_id_); | |||
GELOGE(INTERNAL_ERROR, "Active stream is empty, stream list size: %zu, stream indication size: %zu.", | |||
stream_list_.size(), active_stream_indication_.size()); | |||
return INTERNAL_ERROR; | |||
@@ -3957,8 +3957,8 @@ Status DavinciModel::AddHeadStream() { | |||
for (auto s : active_stream_list_) { | |||
std::shared_ptr<CpuTaskActiveEntry> active_entry = MakeShared<CpuTaskActiveEntry>(rt_head_stream_); | |||
if (active_entry == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "New CpuTaskActiveEntry failed, model_id:%u, when DavinciModel %s", | |||
model_id_, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "New CpuTaskActiveEntry failed, model_id:%u", | |||
model_id_); | |||
GELOGE(MEMALLOC_FAILED, "Make CpuTaskActiveEntry task failed."); | |||
return MEMALLOC_FAILED; | |||
} | |||
@@ -4090,8 +4090,8 @@ Status DavinciModel::TransAllVarData(ComputeGraphPtr &graph, uint32_t graph_id) | |||
rtContext_t ctx = nullptr; | |||
rtError_t rt_ret = rtCtxGetCurrent(&ctx); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtCtxGetCurrent failed, model_id:%u, when DavinciModel %s", | |||
model_id_, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtCtxGetCurrent failed, model_id:%u", | |||
model_id_); | |||
GELOGE(RT_FAILED, "Failed to get current context, error_code is: 0x%X.", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -4125,7 +4125,7 @@ void DavinciModel::SetDataDumperArgs(const ComputeGraphPtr &graph, const map<str | |||
int32_t device_id = 0; | |||
rtError_t rt_ret = rtGetDevice(&device_id); | |||
if (rt_ret != RT_ERROR_NONE || device_id < 0) { | |||
REPORT_CALL_ERROR("E19999", "Call rtGetDevice failed, model_id:%u, when DavinciModel %s", model_id_, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtGetDevice failed, model_id:%u", model_id_); | |||
GELOGE(RT_FAILED, "Call rtGetDevice failed, ret = 0x%X, device_id = %d.", rt_ret, device_id); | |||
return; | |||
} | |||
@@ -4189,9 +4189,9 @@ Status DavinciModel::InitOrigInputInfo(uint32_t index, const OpDescPtr &op_desc) | |||
std::vector<std::string> infos = ge::StringUtils::Split(input, ':'); | |||
if (infos.size() != kAippInfoNum) { | |||
REPORT_INNER_ERROR("E19999", "Attr:%s in op:%s(%s), aipp input size:%zu != kAippInfoNum:%u, model_id:%u, " | |||
"check invalid when DavinciModel %s", ATTR_NAME_AIPP_INPUTS.c_str(), | |||
"check invalid", ATTR_NAME_AIPP_INPUTS.c_str(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), infos.size(), kAippInfoNum, | |||
model_id_, __FUNCTION__); | |||
model_id_); | |||
GELOGE(ACL_ERROR_GE_AIPP_MODE_INVALID, "origin input str is invalid[%zu, %u].", infos.size(), kAippInfoNum); | |||
return ACL_ERROR_GE_AIPP_MODE_INVALID; | |||
} | |||
@@ -4212,8 +4212,8 @@ Status DavinciModel::InitOrigInputInfo(uint32_t index, const OpDescPtr &op_desc) | |||
Status DavinciModel::GetOrigInputInfo(uint32_t index, OriginInputInfo &orig_input_info) const { | |||
const auto it = orig_input_info_.find(index); | |||
if (it == orig_input_info_.end()) { | |||
REPORT_INNER_ERROR("E19999", "Get index:%u from orig_input_info_ fail, model_id:%u, when DavinciModel %s", | |||
index, model_id_, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Get index:%u from orig_input_info_ fail, model_id:%u", | |||
index, model_id_); | |||
GELOGE(ACL_ERROR_GE_AIPP_NOT_EXIST, "there is not AIPP related with index %u.", index); | |||
return ACL_ERROR_GE_AIPP_NOT_EXIST; | |||
} | |||
@@ -4231,8 +4231,8 @@ void DavinciModel::ParseAIPPInfo(std::string in_out_info, InputOutputDims &dims_ | |||
std::vector<std::string> infos = ge::StringUtils::Split(in_out_info, ':'); | |||
if (infos.size() != kAippInfoNum) { | |||
REPORT_INNER_ERROR("E19999", "in_out_info:%s size:%zu != kAippInfoNum:%u, model_id:%u, " | |||
"check invalid when DavinciModel %s", in_out_info.c_str(), infos.size(), kAippInfoNum, | |||
model_id_, __FUNCTION__); | |||
"check invalid", in_out_info.c_str(), infos.size(), kAippInfoNum, | |||
model_id_); | |||
GELOGE(ACL_ERROR_GE_AIPP_MODE_INVALID, "origin input str is invalid[%zu, %u].", infos.size(), kAippInfoNum); | |||
return; | |||
} | |||
@@ -4295,8 +4295,8 @@ Status DavinciModel::GetAllAippInputOutputDims(uint32_t index, vector<InputOutpu | |||
vector<InputOutputDims> &output_dims) const { | |||
const auto it = aipp_dims_info_.find(index); | |||
if (it == aipp_dims_info_.end()) { | |||
REPORT_INNER_ERROR("E19999", "Get index:%u from aipp_dims_info_ fail, model_id:%u, when DavinciModel %s", | |||
index, model_id_, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Get index:%u from aipp_dims_info_ fail, model_id:%u", | |||
index, model_id_); | |||
GELOGE(ACL_ERROR_GE_AIPP_NOT_EXIST, "there is not AIPP related with index %u.", index); | |||
return ACL_ERROR_GE_AIPP_NOT_EXIST; | |||
} | |||
@@ -4328,8 +4328,8 @@ Status DavinciModel::InitL1DataDumperArgs() { | |||
if (rtDumpAddrSet(rt_model_handle_, l1_fusion_addr_, kDumpL1FusionOpMByteSize, kDumpFlagOfL1Fusion) != | |||
RT_ERROR_NONE) { | |||
// l1_fusion_addr_ will be free when DavinciModel destruct | |||
REPORT_CALL_ERROR("E19999", "Call rtDumpAddrSet failed, model_id:%u, when DavinciModel %s", | |||
model_id_, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtDumpAddrSet failed, model_id:%u", | |||
model_id_); | |||
GELOGE(FAILED, "Call rtDumpAddrSet failed"); | |||
return FAILED; | |||
} | |||
@@ -100,15 +100,15 @@ Status ModelManager::KernelLaunchEx(aicpu::FWKAdapter::FWKOperateType op_type, u | |||
auto kernel_size = sizeof(uint64_t) * (v_aicpu_kernel.size()); | |||
rtError_t rt_ret = rtMalloc(&aicpu_kernel_addr, kernel_size, RT_MEMORY_HBM); | |||
GE_IF_BOOL_EXEC(rt_ret != RT_ERROR_NONE, | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%zu, ret: 0x%X when ModelManager %s", | |||
kernel_size, rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%zu, ret: 0x%X", | |||
kernel_size, rt_ret); | |||
GELOGE(RT_FAILED, "rtMalloc error, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret);) | |||
rt_ret = rtMemcpy(aicpu_kernel_addr, kernel_size, v_aicpu_kernel.data(), kernel_size, RT_MEMCPY_HOST_TO_DEVICE); | |||
GE_IF_BOOL_EXEC(rt_ret != RT_ERROR_NONE, | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret: 0x%X when ModelManager %s", | |||
kernel_size, rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret: 0x%X", | |||
kernel_size, rt_ret); | |||
GELOGE(RT_FAILED, "rtMemcpy to input_output_addr_ error: 0x%X", rt_ret); | |||
GE_CHK_RT(rtFree(aicpu_kernel_addr)); return RT_ERROR_TO_GE_STATUS(rt_ret);) | |||
uint64_t kernel_id_addr = static_cast<uint64_t>(reinterpret_cast<uintptr_t>(aicpu_kernel_addr)); | |||
@@ -120,8 +120,8 @@ Status ModelManager::KernelLaunchEx(aicpu::FWKAdapter::FWKOperateType op_type, u | |||
rtError_t rt_ret = rtMalloc(&(devicebase), sizeof(STR_FWK_OP_KERNEL), RT_MEMORY_HBM); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%zu, ret: 0x%X when ModelManager %s", | |||
sizeof(STR_FWK_OP_KERNEL), rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%zu, ret: 0x%X", | |||
sizeof(STR_FWK_OP_KERNEL), rt_ret); | |||
GELOGE(RT_FAILED, "malloc device memory failed. ret: 0x%X", rt_ret); | |||
GE_IF_BOOL_EXEC(aicpu_kernel_addr != nullptr, GE_CHK_RT(rtFree(aicpu_kernel_addr))); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
@@ -130,8 +130,8 @@ Status ModelManager::KernelLaunchEx(aicpu::FWKAdapter::FWKOperateType op_type, u | |||
rt_ret = | |||
rtMemcpy(devicebase, sizeof(STR_FWK_OP_KERNEL), ¶m_base, sizeof(STR_FWK_OP_KERNEL), RT_MEMCPY_HOST_TO_DEVICE); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret: 0x%X when ModelManager %s", | |||
sizeof(STR_FWK_OP_KERNEL), rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret: 0x%X", | |||
sizeof(STR_FWK_OP_KERNEL), rt_ret); | |||
GELOGE(RT_FAILED, "memory copy to device failed. ret: 0x%X", rt_ret); | |||
GE_IF_BOOL_EXEC(aicpu_kernel_addr != nullptr, GE_CHK_RT(rtFree(aicpu_kernel_addr))); | |||
GE_CHK_RT(rtFree(devicebase)); | |||
@@ -141,7 +141,7 @@ Status ModelManager::KernelLaunchEx(aicpu::FWKAdapter::FWKOperateType op_type, u | |||
rtStream_t stream = nullptr; | |||
rt_ret = rtStreamCreate(&stream, 0); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtStreamCreate failed, ret: 0x%X when ModelManager %s", rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtStreamCreate failed, ret: 0x%X", rt_ret); | |||
GELOGE(RT_FAILED, "create stream failed. ret: 0x%X", rt_ret); | |||
GE_IF_BOOL_EXEC(aicpu_kernel_addr != nullptr, GE_CHK_RT(rtFree(aicpu_kernel_addr))); | |||
GE_CHK_RT(rtFree(devicebase)); | |||
@@ -150,7 +150,7 @@ Status ModelManager::KernelLaunchEx(aicpu::FWKAdapter::FWKOperateType op_type, u | |||
rt_ret = rtKernelLaunchEx(devicebase, sizeof(STR_FWK_OP_KERNEL), 0, stream); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtKernelLaunchEx failed, ret: 0x%X when ModelManager %s", rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtKernelLaunchEx failed, ret: 0x%X", rt_ret); | |||
GELOGE(RT_FAILED, "rtKernelLaunchEx failed. ret: 0x%X", rt_ret); | |||
GE_IF_BOOL_EXEC(aicpu_kernel_addr != nullptr, GE_CHK_RT(rtFree(aicpu_kernel_addr))); | |||
GE_CHK_RT(rtFree(devicebase)); | |||
@@ -159,8 +159,8 @@ Status ModelManager::KernelLaunchEx(aicpu::FWKAdapter::FWKOperateType op_type, u | |||
} | |||
rt_ret = rtStreamSynchronize(stream); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtStreamSynchronize failed, ret: 0x%X when ModelManager %s", | |||
rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtStreamSynchronize failed, ret: 0x%X", | |||
rt_ret); | |||
GELOGE(RT_FAILED, "rtStreamSynchronize failed. ret: 0x%X", rt_ret); | |||
GE_IF_BOOL_EXEC(aicpu_kernel_addr != nullptr, GE_CHK_RT(rtFree(aicpu_kernel_addr))); | |||
GE_CHK_RT(rtFree(devicebase)); | |||
@@ -170,7 +170,7 @@ Status ModelManager::KernelLaunchEx(aicpu::FWKAdapter::FWKOperateType op_type, u | |||
if (aicpu_kernel_addr != nullptr) { | |||
rt_ret = rtFree(aicpu_kernel_addr); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtFree failed, ret: 0x%X when ModelManager %s", rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtFree failed, ret: 0x%X", rt_ret); | |||
GELOGE(RT_FAILED, "free memory failed. ret: 0x%X", rt_ret); | |||
GE_CHK_RT(rtFree(devicebase)); | |||
GE_CHK_RT(rtStreamDestroy(stream)); | |||
@@ -179,14 +179,14 @@ Status ModelManager::KernelLaunchEx(aicpu::FWKAdapter::FWKOperateType op_type, u | |||
} | |||
rt_ret = rtFree(devicebase); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtFree failed, ret: 0x%X when ModelManager %s", rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtFree failed, ret: 0x%X", rt_ret); | |||
GELOGE(RT_FAILED, "free memory failed. ret: 0x%X", rt_ret); | |||
GE_CHK_RT(rtStreamDestroy(stream)); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
rt_ret = rtStreamDestroy(stream); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtStreamDestroy failed, ret: 0x%X when ModelManager %s", rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtStreamDestroy failed, ret: 0x%X", rt_ret); | |||
GELOGE(RT_FAILED, "rtStreamDestroy failed. ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -233,8 +233,8 @@ ge::Status ModelManager::DestroyAicpuSessionForInfer(uint32_t model_id) { | |||
auto it = model_map_.find(model_id); | |||
if (it == model_map_.end()) { | |||
REPORT_INNER_ERROR("E19999", "Param model_id:%u can't find in model_map, check invalid when ModelManager %s", | |||
model_id, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Param model_id:%u can't find in model_map, check invalid", | |||
model_id); | |||
GELOGE(ACL_ERROR_GE_EXEC_MODEL_ID_INVALID, "model id %u does not exists.", model_id); | |||
return ACL_ERROR_GE_EXEC_MODEL_ID_INVALID; | |||
} | |||
@@ -252,8 +252,8 @@ ge::Status ModelManager::DestroyAicpuKernel(uint64_t session_id, uint32_t model_ | |||
Status ret = KernelLaunchEx(aicpu::FWKAdapter::FWKOperateType::FWK_ADPT_KERNEL_DESTROY, session_id, model_id, | |||
sub_model_id); | |||
if (ret != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Call KernelLaunchEx fail, model_id:%u, sub_model_id:%u, session_id:%lu, " | |||
"when ModelManager %s", model_id, sub_model_id, session_id, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call KernelLaunchEx fail, model_id:%u, sub_model_id:%u, session_id:%lu", | |||
model_id, sub_model_id, session_id); | |||
GELOGE(FAILED, "Destroy aicpu kernel failed."); | |||
return FAILED; | |||
} | |||
@@ -311,7 +311,7 @@ bool ModelManager::IsNeedHybridLoad(ge::GeRootModel &ge_root_model) { | |||
auto root_graph = ge_root_model.GetRootGraph(); | |||
if (root_graph == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "root graph in param ge_root_model is nullptr, model_id:%u, " | |||
"check invalid when ModelManager %s", ge_root_model.GetModelId(), __FUNCTION__); | |||
"check invalid", ge_root_model.GetModelId()); | |||
GELOGE(FAILED, "no model on root model"); | |||
return false; | |||
} | |||
@@ -340,7 +340,7 @@ Status ModelManager::LoadModelOnline(uint32_t &model_id, const shared_ptr<ge::Ge | |||
mmTimespec timespec = mmGetTickCount(); | |||
std::shared_ptr<DavinciModel> davinci_model = MakeShared<DavinciModel>(0, listener); | |||
if (davinci_model == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "New DavinciModel fail, model_id:%u, when ModelManager %s", model_id, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "New DavinciModel fail, model_id:%u", model_id); | |||
GELOGE(FAILED, "davinci_model is nullptr"); | |||
return FAILED; | |||
} | |||
@@ -405,8 +405,8 @@ Status ModelManager::DeleteModel(uint32_t id) { | |||
} else if (hybrid_model_it != hybrid_model_map_.end()) { | |||
(void)hybrid_model_map_.erase(hybrid_model_it); | |||
} else { | |||
REPORT_INNER_ERROR("E19999", "model_id:%u not exist in model_map, check invalid when ModelManager %s", | |||
id, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "model_id:%u not exist in model_map, check invalid", | |||
id); | |||
GELOGE(ACL_ERROR_GE_EXEC_MODEL_ID_INVALID, "model id %u does not exists.", id); | |||
return ACL_ERROR_GE_EXEC_MODEL_ID_INVALID; | |||
} | |||
@@ -453,8 +453,7 @@ Status ModelManager::DataInput(const InputData &input_data, OutputData &output_d | |||
Status status = data_wrap->Init(input_data, output_data); | |||
if (status != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Init InputDataWrapper failed, input data index: %u, when ModelManager %s", | |||
input_data.index, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Init InputDataWrapper failed, input data index: %u", input_data.index); | |||
GELOGE(domi::PUSH_DATA_FAILED, "Init InputDataWrapper failed, input data index: %u.", input_data.index); | |||
return domi::PUSH_DATA_FAILED; | |||
} | |||
@@ -471,8 +470,7 @@ Status ModelManager::DataInput(const InputData &input_data, OutputData &output_d | |||
DataInputer *inputer = model->GetDataInputer(); | |||
GE_CHECK_NOTNULL(inputer); | |||
if (inputer->Push(data_wrap) != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "DataInputer queue is full, please call again later, model_id %u, when ModelManager %s", | |||
model_id, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "DataInputer queue is full, please call again later, model_id %u", model_id); | |||
GELOGE(domi::DATA_QUEUE_ISFULL, "Data queue is full, please call again later, model_id %u ", model_id); | |||
return domi::DATA_QUEUE_ISFULL; | |||
} | |||
@@ -487,8 +485,8 @@ Status ModelManager::GetCurDynamicDims(const vector<vector<int64_t>> &user_real_ | |||
GELOGD("Start get cur dynamic dims."); | |||
if (user_real_input_dims.size() != user_input_dims.size()) { | |||
REPORT_INNER_ERROR("E19999", "Param user_real_input_dims.size:%zu != user_input_dims.size:%zu, " | |||
"check invalid when ModelManager %s", | |||
user_real_input_dims.size(), user_input_dims.size(), __FUNCTION__); | |||
"check invalid", | |||
user_real_input_dims.size(), user_input_dims.size()); | |||
GELOGE(INTERNAL_ERROR, | |||
"The input count of user: %zu should be equal to the data count of graph: %zu", | |||
user_real_input_dims.size(), user_input_dims.size()); | |||
@@ -498,8 +496,8 @@ Status ModelManager::GetCurDynamicDims(const vector<vector<int64_t>> &user_real_ | |||
for (size_t i = 0; i < user_input_dims.size(); ++i) { | |||
if (user_real_input_dims[i].size() != user_input_dims[i].second.size()) { | |||
REPORT_INNER_ERROR("E19999", "Param user_real_input_dims[%zu].size:%zu != user_input_dims[%zu].size:%zu, " | |||
"check invalid when ModelManager %s", i, user_real_input_dims[i].size(), | |||
i, user_input_dims[i].second.size(), __FUNCTION__); | |||
"check invalid", i, user_real_input_dims[i].size(), | |||
i, user_input_dims[i].second.size()); | |||
GELOGE(INTERNAL_ERROR, | |||
"The shape size: %zu of dynamic input: %s should be equal to the shape size of input shape: %zu.", | |||
user_real_input_dims[i].size(), user_input_dims[i].first.c_str(), user_input_dims[i].second.size()); | |||
@@ -521,8 +519,8 @@ Status ModelManager::GetCurDynamicDims(const vector<vector<int64_t>> &user_real_ | |||
} | |||
} | |||
if (!cur_dynamic_dims_valid) { | |||
REPORT_INNER_ERROR("E19999", "cur dynamic dims is %s, not exist in options, check invalid " | |||
"when ModelManager %s", formats::JoinToString(cur_dynamic_dims).c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "cur dynamic dims is %s, not exist in options, check invalid", | |||
formats::JoinToString(cur_dynamic_dims).c_str()); | |||
GELOGE(INTERNAL_ERROR, "Cur dynamic dims is %s, not exist in options.", | |||
formats::JoinToString(cur_dynamic_dims).c_str()); | |||
return INTERNAL_ERROR; | |||
@@ -674,8 +672,8 @@ Status ModelManager::HandleCommand(const Command &command) { | |||
auto iter = cmds.find(command.cmd_type); | |||
if (iter == cmds.end()) { | |||
REPORT_INNER_ERROR("E19999", "Unsupported command:%s check when ModelManager %s", | |||
command.cmd_type.c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Unsupported command:%s check", | |||
command.cmd_type.c_str()); | |||
GELOGE(PARAM_INVALID, "Unsupported command: %s", command.cmd_type.c_str()); | |||
return PARAM_INVALID; | |||
} else { | |||
@@ -687,8 +685,8 @@ Status ModelManager::GetModelByCmd(const Command &command, | |||
std::shared_ptr<DavinciModel> &davinci_model) { | |||
if (command.cmd_params.size() < kCmdParSize) { | |||
REPORT_INNER_ERROR("E19999", "command.cmd_params.size:%zu < kCmdParSize:%u, command_type:%s, " | |||
"check invalid when ModelManager %s", command.cmd_params.size(), kCmdParSize, | |||
command.cmd_type.c_str(), __FUNCTION__); | |||
"check invalid", command.cmd_params.size(), kCmdParSize, | |||
command.cmd_type.c_str()); | |||
GELOGE(PARAM_INVALID, "When the cmd_type is '%s', the size of cmd_params must larger than 2.", | |||
command.cmd_type.c_str()); | |||
return PARAM_INVALID; | |||
@@ -701,18 +699,18 @@ Status ModelManager::GetModelByCmd(const Command &command, | |||
try { | |||
model_id = std::stoi(value); | |||
} catch (std::invalid_argument &) { | |||
REPORT_INNER_ERROR("E19999", "%s param:%s, check invalid when ModelManager %s", PROFILE_MODEL_ID.c_str(), | |||
value.c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "%s param:%s, check invalid", PROFILE_MODEL_ID.c_str(), | |||
value.c_str()); | |||
GELOGE(PARAM_INVALID, "Model id: %s is invalid.", value.c_str()); | |||
return PARAM_INVALID; | |||
} catch (std::out_of_range &) { | |||
REPORT_INNER_ERROR("E19999", "%s param:%s, check out of range when ModelManager %s", PROFILE_MODEL_ID.c_str(), | |||
value.c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "%s param:%s, check out of range", PROFILE_MODEL_ID.c_str(), | |||
value.c_str()); | |||
GELOGE(PARAM_INVALID, "Model id: %s is out of range.", value.c_str()); | |||
return PARAM_INVALID; | |||
} catch (...) { | |||
REPORT_INNER_ERROR("E19999", "%s param:%s, check cannot change to int when ModelManager %s", | |||
PROFILE_MODEL_ID.c_str(), value.c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "%s param:%s, check cannot change to int", | |||
PROFILE_MODEL_ID.c_str(), value.c_str()); | |||
GELOGE(FAILED, "Model id: %s cannot change to int.", value.c_str()); | |||
return FAILED; | |||
} | |||
@@ -721,14 +719,14 @@ Status ModelManager::GetModelByCmd(const Command &command, | |||
GE_CHECK_NOTNULL(model_manager); | |||
davinci_model = model_manager->GetModel(static_cast<uint32_t>(model_id)); | |||
if (davinci_model == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "GetModel from model_manager fail, model_id:%u, when ModelManager %s", | |||
model_id, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "GetModel from model_manager fail, model_id:%u", | |||
model_id); | |||
GELOGE(FAILED, "Model id: %d is invaild or model is not loaded.", model_id); | |||
return FAILED; | |||
} | |||
} else { | |||
REPORT_INNER_ERROR("E19999", "Fisrt cmd_param not %s, check invalid when ModelManager %s", | |||
PROFILE_MODEL_ID.c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Fisrt cmd_param not %s, check invalid", | |||
PROFILE_MODEL_ID.c_str()); | |||
GELOGE(FAILED, "The model_id parameter is not found in the command."); | |||
return FAILED; | |||
} | |||
@@ -792,14 +790,14 @@ Status ModelManager::HandleProfFinalizeCommand(const Command &command) { | |||
*/ | |||
Status ModelManager::HandleProfStartCommand(const Command &command) { | |||
if (command.cmd_params.size() < kProfStartCmdParaSize) { | |||
REPORT_INNER_ERROR("E19999", "command.cmd_params.size:%zu < %zu, check invalid when ModelManager %s", | |||
command.cmd_params.size(), kProfStartCmdParaSize, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "command.cmd_params.size:%zu < %zu, check invalid", | |||
command.cmd_params.size(), kProfStartCmdParaSize); | |||
GELOGE(PARAM_INVALID, "When the cmd_type is 'profile start', the size of cmd_params must larger than 2."); | |||
return PARAM_INVALID; | |||
} | |||
if (command.cmd_params.size() > kProfCmdParaMaxSize) { | |||
REPORT_INNER_ERROR("E19999", "command.cmd_params.size:%zu > %zu, check invalid when ModelManager %s", | |||
command.cmd_params.size(), kProfCmdParaMaxSize, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "command.cmd_params.size:%zu > %zu, check invalid", | |||
command.cmd_params.size(), kProfCmdParaMaxSize); | |||
GELOGE(PARAM_INVALID, "Command para size[%zu] larger than max[1000].", command.cmd_params.size()); | |||
return PARAM_INVALID; | |||
} | |||
@@ -822,14 +820,14 @@ Status ModelManager::HandleProfStartCommand(const Command &command) { | |||
Status ModelManager::HandleProfStopCommand(const Command &command) { | |||
if (command.cmd_params.size() < kProfStartCmdParaSize) { | |||
REPORT_INNER_ERROR("E19999", "command.cmd_params.size:%zu < %zu, check invalid when ModelManager %s", | |||
command.cmd_params.size(), kProfStartCmdParaSize, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "command.cmd_params.size:%zu < %zu, check invalid", | |||
command.cmd_params.size(), kProfStartCmdParaSize); | |||
GELOGE(PARAM_INVALID, "When the cmd_type is 'profile stop', the size of cmd_params must larger than 2."); | |||
return PARAM_INVALID; | |||
} | |||
if (command.cmd_params.size() > kProfCmdParaMaxSize) { | |||
REPORT_INNER_ERROR("E19999", "command.cmd_params.size:%zu > %zu, check invalid when ModelManager %s", | |||
command.cmd_params.size(), kProfCmdParaMaxSize, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "command.cmd_params.size:%zu > %zu, check invalid", | |||
command.cmd_params.size(), kProfCmdParaMaxSize); | |||
GELOGE(PARAM_INVALID, "Command para size[%zu] larger than max[1000].", command.cmd_params.size()); | |||
return PARAM_INVALID; | |||
} | |||
@@ -855,8 +853,8 @@ static Status ParserPara(const Command &command, const string &dump_key, string | |||
if (iter != command.cmd_params.end()) { | |||
++iter; | |||
if (iter == command.cmd_params.end()) { | |||
REPORT_INNER_ERROR("E19999", "dump_key:%s can't find in command.param, check invalid when ModelManager %s", | |||
dump_key.c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "dump_key:%s can't find in command.param, check invalid", | |||
dump_key.c_str()); | |||
GELOGE(PARAM_INVALID, "Invalid access."); | |||
return PARAM_INVALID; | |||
} | |||
@@ -867,8 +865,8 @@ static Status ParserPara(const Command &command, const string &dump_key, string | |||
Status ModelManager::HandleDumpCommand(const Command &command) { | |||
if (command.cmd_params.size() % kDumpCmdPairSize != 0) { | |||
REPORT_INNER_ERROR("E19999", "command.cmd_params.size:%zu MOD 2 != 0, check invalid when ModelManager %s", | |||
command.cmd_params.size(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "command.cmd_params.size:%zu MOD 2 != 0, check invalid", | |||
command.cmd_params.size()); | |||
GELOGE(PARAM_INVALID, "When the cmd_type is 'dump', the size of cmd_params must be a even number."); | |||
return PARAM_INVALID; | |||
} | |||
@@ -1085,7 +1083,7 @@ Status ModelManager::GenSessionId(uint64_t &session_id) { | |||
mmTimeval tv; | |||
if (mmGetTimeOfDay(&tv, nullptr) != 0) { | |||
REPORT_CALL_ERROR("E19999", "Call mmGetTimeOfDay fail when ModelManager %s", __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call mmGetTimeOfDay fail"); | |||
GELOGE(INTERNAL_ERROR, "Failed to get current time."); | |||
return INTERNAL_ERROR; | |||
} | |||
@@ -1130,7 +1128,7 @@ Status ModelManager::LoadModelOffline(uint32_t &model_id, const ModelData &model | |||
GeModelPtr ge_model = model_helper.GetGeModel(); | |||
shared_ptr<DavinciModel> davinci_model = MakeShared<DavinciModel>(model.priority, listener); | |||
if (davinci_model == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "New DavinciModel fail when ModelManager %s", __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "New DavinciModel fail"); | |||
GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "Make shared failed"); | |||
return ACL_ERROR_GE_MEMORY_ALLOCATION; | |||
} | |||
@@ -1146,7 +1144,7 @@ Status ModelManager::LoadModelOffline(uint32_t &model_id, const ModelData &model | |||
int32_t device_id = 0; | |||
rtError_t rt_ret = rtGetDevice(&device_id); | |||
if (rt_ret != RT_ERROR_NONE || device_id < 0) { | |||
REPORT_CALL_ERROR("E19999", "Call rtGetDevice failed, ret = 0x%X, when ModelManager %s", rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtGetDevice failed, ret = 0x%X", rt_ret); | |||
GELOGE(rt_ret, "Call rtGetDevice failed, ret = 0x%X, device_id = %d.", rt_ret, device_id); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -1205,7 +1203,7 @@ Status ModelManager::LoadModelWithQ(uint32_t &model_id, const ModelData &model_d | |||
shared_ptr<DavinciModel> davinci_model = MakeShared<DavinciModel>(model_data.priority, nullptr); | |||
if (davinci_model == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "New DavinciModel fail when ModelManager %s", __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "New DavinciModel fail"); | |||
GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "create model failed."); | |||
return ACL_ERROR_GE_MEMORY_ALLOCATION; | |||
} | |||
@@ -1326,8 +1324,8 @@ Status ModelManager::LoadCustAicpuSo(const OpDescPtr &op_desc, const string &so_ | |||
rtContext_t rt_cur_ctx = nullptr; | |||
auto rt_error = rtCtxGetCurrent(&rt_cur_ctx); | |||
if (rt_error != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtCtxGetCurrent failed, ret = 0x%X, when ModelManager %s", | |||
rt_error, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtCtxGetCurrent failed, ret = 0x%X", | |||
rt_error); | |||
GELOGE(RT_FAILED, "get current context failed, runtime result is %d", static_cast<int>(rt_error)); | |||
return RT_FAILED; | |||
} | |||
@@ -1363,8 +1361,8 @@ Status ModelManager::LaunchKernelCustAicpuSo(const string &kernel_name) { | |||
rtContext_t rt_cur_ctx = nullptr; | |||
auto rt_error = rtCtxGetCurrent(&rt_cur_ctx); | |||
if (rt_error != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtCtxGetCurrent failed, ret = 0x%X, when ModelManager %s", | |||
rt_error, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtCtxGetCurrent failed, ret = 0x%X", | |||
rt_error); | |||
GELOGE(RT_FAILED, "get current context failed, runtime result is %d", static_cast<int>(rt_error)); | |||
return RT_FAILED; | |||
} | |||
@@ -1390,16 +1388,16 @@ Status ModelManager::LaunchKernelCustAicpuSo(const string &kernel_name) { | |||
status = rtMalloc(&d_aicpu_data, aicpu_data_length, RT_MEMORY_HBM); | |||
if (status != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%u, ret = 0x%X, when ModelManager %s", | |||
aicpu_data_length, status, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%u, ret = 0x%X", | |||
aicpu_data_length, status); | |||
GELOGE(RT_FAILED, "Call rt failed, status: 0x%x", status); | |||
return RT_ERROR_TO_GE_STATUS(status); | |||
} | |||
allocated_mem.push_back(d_aicpu_data); | |||
status = rtMalloc(&d_so_name, so_name.size(), RT_MEMORY_HBM); | |||
if (status != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc fail, size:%zu, ret = 0x%X, when ModelManager %s", | |||
so_name.size(), status, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc fail, size:%zu, ret = 0x%X", | |||
so_name.size(), status); | |||
GELOGE(RT_FAILED, "Call rt failed, status: 0x%x", status); | |||
return RT_ERROR_TO_GE_STATUS(status); | |||
} | |||
@@ -1422,8 +1420,8 @@ Status ModelManager::LaunchKernelCustAicpuSo(const string &kernel_name) { | |||
uint32_t args_size = sizeof(CustAicpuSoBuf) * v_cust_so.size(); | |||
status = rtMalloc(&args, args_size, RT_MEMORY_HBM); | |||
if (status != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc fail, size:%u, ret = 0x%X, when ModelManager %s", | |||
args_size, status, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc fail, size:%u, ret = 0x%X", | |||
args_size, status); | |||
GELOGE(RT_FAILED, "Call rt failed, status: 0x%x", status); | |||
return RT_ERROR_TO_GE_STATUS(status); | |||
} | |||
@@ -1438,8 +1436,8 @@ Status ModelManager::LaunchKernelCustAicpuSo(const string &kernel_name) { | |||
uint32_t batch_args_size = sizeof(BatchLoadOpFromBufArgs); | |||
status = rtMalloc(&batch_args, batch_args_size, RT_MEMORY_HBM); | |||
if (status != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc fail, size:%u, ret = 0x%X, when ModelManager %s", | |||
batch_args_size, status, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc fail, size:%u, ret = 0x%X", | |||
batch_args_size, status); | |||
GELOGE(RT_FAILED, "Call rt failed, status: 0x%x", status); | |||
return RT_ERROR_TO_GE_STATUS(status); | |||
} | |||
@@ -1452,8 +1450,8 @@ Status ModelManager::LaunchKernelCustAicpuSo(const string &kernel_name) { | |||
status = rtStreamSynchronize(stream); | |||
if (status != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtStreamSynchronize fail, ret = 0x%X, when ModelManager %s", | |||
status, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtStreamSynchronize fail, ret = 0x%X", | |||
status); | |||
GELOGE(RT_FAILED, "Call rt stream sync failed, status: 0x%x", status); | |||
return RT_ERROR_TO_GE_STATUS(status); | |||
} | |||
@@ -1498,8 +1496,7 @@ Status ModelManager::GetModelMemAndWeightSize(const ModelData &model, size_t &me | |||
auto partition_table = reinterpret_cast<ModelPartitionTable *>(model_data); | |||
if (partition_table->num == 1) { | |||
REPORT_INNER_ERROR("E19999", "partition_table num in model_data is 1, check invalid when ModelManager %s", | |||
__FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "partition_table num in model_data is 1, check invalid"); | |||
GELOGE(ACL_ERROR_GE_PARAM_INVALID, "om model is error,please use executable om model"); | |||
return ACL_ERROR_GE_PARAM_INVALID; | |||
} | |||
@@ -1566,8 +1563,7 @@ ge::Status ModelManager::SyncExecuteModel(uint32_t model_id, const vector<GeTens | |||
vector<GeTensor> &outputs) { | |||
auto model = GetHybridModel(model_id); | |||
if (model == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "partition_table num in model_data is 1, check invalid when ModelManager %s", | |||
__FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "partition_table num in model_data is 1, check invalid"); | |||
GELOGE(FAILED, "Hybrid model not found. model id = %u.", model_id); | |||
return FAILED; | |||
} | |||
@@ -1596,8 +1592,8 @@ Status ModelManager::EnableExceptionDump(const std::map<string, string> &options | |||
if (iter->second == "1") { | |||
rtError_t rt_ret = rtSetTaskFailCallback(reinterpret_cast<rtTaskFailCallback>(ExceptionCallback)); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtSetTaskFailCallback fail, ret = 0x%X, when ModelManager %s", | |||
rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtSetTaskFailCallback fail, ret = 0x%X", | |||
rt_ret); | |||
GELOGE(RT_FAILED, "rtSetTaskFailCallback failed"); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -1645,8 +1641,8 @@ Status ModelManager::LaunchKernelCheckAicpuOp(std::vector<std::string> &aicpu_op | |||
// malloc sysOpInfoList in SysOpCheckInfo | |||
status = rtMalloc(&d_req_op_list, op_nums * sizeof(SysOpInfo), RT_MEMORY_HBM); | |||
if (status != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc fail, size:%zu, ret = 0x%X, when ModelManager %s", | |||
op_nums * sizeof(SysOpInfo), status, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc fail, size:%zu, ret = 0x%X", | |||
op_nums * sizeof(SysOpInfo), status); | |||
GELOGE(RT_FAILED, "Call rt failed, status: 0x%x", status); | |||
return RT_ERROR_TO_GE_STATUS(status); | |||
} | |||
@@ -1655,8 +1651,8 @@ Status ModelManager::LaunchKernelCheckAicpuOp(std::vector<std::string> &aicpu_op | |||
// malloc sysOpInfoList in SysOpCheckResp | |||
status = rtMalloc(&d_res_op_list, op_nums * sizeof(SysOpInfo), RT_MEMORY_HBM); | |||
if (status != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc fail, size:%zu, ret = 0x%X, when ModelManager %s", | |||
op_nums * sizeof(SysOpInfo), status, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc fail, size:%zu, ret = 0x%X", | |||
op_nums * sizeof(SysOpInfo), status); | |||
GELOGE(RT_FAILED, "Call rt failed, status: 0x%x", status); | |||
return RT_ERROR_TO_GE_STATUS(status); | |||
} | |||
@@ -1665,8 +1661,8 @@ Status ModelManager::LaunchKernelCheckAicpuOp(std::vector<std::string> &aicpu_op | |||
// malloc returnCodeList in SysOpCheckResp | |||
status = rtMalloc(&d_ret_code_list, op_nums * sizeof(ReturnCode), RT_MEMORY_HBM); | |||
if (status != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc fail, size:%zu, ret = 0x%X, when ModelManager %s", | |||
op_nums * sizeof(ReturnCode), status, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc fail, size:%zu, ret = 0x%X", | |||
op_nums * sizeof(ReturnCode), status); | |||
GELOGE(RT_FAILED, "Call rt failed, status: 0x%x", status); | |||
return RT_ERROR_TO_GE_STATUS(status); | |||
} | |||
@@ -1678,8 +1674,8 @@ Status ModelManager::LaunchKernelCheckAicpuOp(std::vector<std::string> &aicpu_op | |||
void *d_op_type_name = nullptr; | |||
status = rtMalloc(&d_op_type_name, op_type.length(), RT_MEMORY_HBM); | |||
if (status != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc fail, size:%lu, ret = 0x%X, when ModelManager %s", | |||
op_type.length(), status, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc fail, size:%lu, ret = 0x%X", | |||
op_type.length(), status); | |||
GELOGE(RT_FAILED, "Call rt failed, status: 0x%x", status); | |||
return RT_ERROR_TO_GE_STATUS(status); | |||
} | |||
@@ -1697,8 +1693,8 @@ Status ModelManager::LaunchKernelCheckAicpuOp(std::vector<std::string> &aicpu_op | |||
void *d_op_type_name = nullptr; | |||
status = rtMalloc(&d_op_type_name, op_type.size(), RT_MEMORY_HBM); | |||
if (status != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc fail, size:%lu, ret = 0x%X, when ModelManager %s", | |||
op_type.length(), status, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc fail, size:%lu, ret = 0x%X", | |||
op_type.length(), status); | |||
GELOGE(RT_FAILED, "Call rt failed, status: 0x%x", status); | |||
return RT_ERROR_TO_GE_STATUS(status); | |||
} | |||
@@ -1727,8 +1723,8 @@ Status ModelManager::LaunchKernelCheckAicpuOp(std::vector<std::string> &aicpu_op | |||
uint32_t args_size = sizeof(SysOpCheckInfo) + sizeof(SysOpCheckResp); | |||
status = rtMalloc(&args, args_size, RT_MEMORY_HBM); | |||
if (status != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc fail, size:%u, ret = 0x%X, when ModelManager %s", | |||
args_size, status, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc fail, size:%u, ret = 0x%X", | |||
args_size, status); | |||
GELOGE(RT_FAILED, "Call rt failed, status: 0x%x", status); | |||
return RT_ERROR_TO_GE_STATUS(status); | |||
} | |||
@@ -1744,8 +1740,8 @@ Status ModelManager::LaunchKernelCheckAicpuOp(std::vector<std::string> &aicpu_op | |||
status = rtStreamSynchronize(stream); | |||
if (status != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtStreamSynchronize fail, ret = 0x%X, when ModelManager %s", | |||
status, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtStreamSynchronize fail, ret = 0x%X", | |||
status); | |||
GELOGE(RT_FAILED, "Call rt stream sync failed, status: 0x%x", status); | |||
GE_CHK_RT(rtStreamDestroy(stream)); | |||
return RT_ERROR_TO_GE_STATUS(status); | |||
@@ -1779,8 +1775,8 @@ Status ModelManager::LaunchKernelCheckAicpuOp(std::vector<std::string> &aicpu_op | |||
sizeof(SysOpInfo) * res_op_nums, RT_MEMCPY_DEVICE_TO_HOST)); | |||
if (res_ret_code_list.size() != res_aicpu_op_info_list.size() || res_ret_code_list.size() != res_op_nums) { | |||
REPORT_INNER_ERROR("E19999", "res_ret_code_list.size:%zu res_aicpu_op_info_list.size:%zu res_op_nums:%lu " | |||
"not equal, check invalid when ModelManager %s", | |||
res_ret_code_list.size(), res_aicpu_op_info_list.size(), res_op_nums, __FUNCTION__); | |||
"not equal, check invalid", | |||
res_ret_code_list.size(), res_aicpu_op_info_list.size(), res_op_nums); | |||
GELOGE(FAILED, "Number of retcode is not equal to number of op type."); | |||
GE_CHK_RT(rtStreamDestroy(stream)); | |||
return FAILED; | |||
@@ -1804,8 +1800,8 @@ Status ModelManager::LaunchKernelCheckAicpuOp(std::vector<std::string> &aicpu_op | |||
"<0: op_type, 1: format, 2: datatype> \n"; | |||
} | |||
fail_reason += "not support."; | |||
REPORT_INNER_ERROR("E19999", "Check aicpu op_type failed, details:%s when ModelManager %s", | |||
fail_reason.c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Check aicpu op_type failed, details:%s", | |||
fail_reason.c_str()); | |||
GELOGE(FAILED, "Check aicpu op_type failed. details: %s", fail_reason.c_str()); | |||
GE_CHK_RT(rtStreamDestroy(stream)); | |||
return FAILED; | |||
@@ -26,8 +26,8 @@ | |||
do { \ | |||
if (SIZE <= static_cast<uint64_t>(OFFSET)) { \ | |||
REPORT_INNER_ERROR("E19999", \ | |||
"Node:%s(%s) offset:%ld out of range size:%lu, check invalid when ModelUtils %s", \ | |||
OP->GetName().c_str(), OP->GetType().c_str(), OFFSET, SIZE, __FUNCTION__); \ | |||
"Node:%s(%s) offset:%ld out of range size:%lu, check invalid", \ | |||
OP->GetName().c_str(), OP->GetType().c_str(), OFFSET, SIZE); \ | |||
GELOGE(OUT_OF_MEMORY, "Node: %s, memory out of range[%lu: %ld]", OP->GetName().c_str(), SIZE, OFFSET); \ | |||
return {}; \ | |||
} \ | |||
@@ -308,9 +308,9 @@ vector<void *> ModelUtils::GetInputDataAddrs(const RuntimeParam &model_param, Co | |||
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); | |||
if (has_mem_type_attr && (v_memory_type.size() != inputs_size)) { | |||
REPORT_INNER_ERROR("E19999", "Attr:%s, memory_type.size:%zu != input_desc.size:%zu, op:%s(%s), check invalid " | |||
"when ModelUtils %s", ATTR_NAME_INPUT_MEM_TYPE_LIST.c_str(), v_memory_type.size(), inputs_size, | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Attr:%s, memory_type.size:%zu != input_desc.size:%zu, op:%s(%s), check invalid", | |||
ATTR_NAME_INPUT_MEM_TYPE_LIST.c_str(), v_memory_type.size(), inputs_size, | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(PARAM_INVALID, "Fusion: check input size failed, op: %s, input v_memory_type size: %zu input numbers: %zu", | |||
op_desc->GetName().c_str(), v_memory_type.size(), inputs_size); | |||
return v_input_data_addr; | |||
@@ -390,7 +390,7 @@ Status ModelUtils::GetVarAddr(const RuntimeParam &model_param, const ConstOpDesc | |||
switch (mem_type) { | |||
case RT_MEMORY_RDMA_HBM: | |||
if (offset < 0) { | |||
REPORT_INNER_ERROR("E19999", "Param offset:%ld < 0, check invalid when ModelUtils %s", offset, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Param offset:%ld < 0, check invalid", offset); | |||
GELOGE(PARAM_INVALID, "rdma var addr is invalid, addr=%p", | |||
reinterpret_cast<uint8_t *>(static_cast<uintptr_t>(offset))); | |||
return PARAM_INVALID; | |||
@@ -402,8 +402,8 @@ Status ModelUtils::GetVarAddr(const RuntimeParam &model_param, const ConstOpDesc | |||
var_addr = model_param.var_base + offset - model_param.logic_var_base; | |||
break; | |||
default: | |||
REPORT_INNER_ERROR("E19999", "Get mem_type:%d for offset:%ld is unsupported, check invalid when ModelUtils %s", | |||
mem_type, offset, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Get mem_type:%d for offset:%ld is unsupported, check invalid", | |||
mem_type, offset); | |||
GELOGE(PARAM_INVALID, "unsupported memory type %u", mem_type); | |||
return PARAM_INVALID; | |||
} | |||
@@ -429,9 +429,9 @@ vector<void *> ModelUtils::GetOutputDataAddrs(const RuntimeParam &model_param, C | |||
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); | |||
if (has_mem_type_attr && (v_memory_type.size() != outputs_size)) { | |||
REPORT_INNER_ERROR("E19999", "Attr:%s, memory_type.size:%zu != output_desc.size:%zu, op:%s(%s), check invalid " | |||
"when ModelUtils %s", ATTR_NAME_OUTPUT_MEM_TYPE_LIST.c_str(), v_memory_type.size(), outputs_size, | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Attr:%s, memory_type.size:%zu != output_desc.size:%zu, op:%s(%s), check invalid", | |||
ATTR_NAME_OUTPUT_MEM_TYPE_LIST.c_str(), v_memory_type.size(), outputs_size, | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(PARAM_INVALID, | |||
"Fusion: check output size failed, op: %s, output v_memory_type size: %lu output numbers: %zu", | |||
op_desc->GetName().c_str(), v_memory_type.size(), outputs_size); | |||
@@ -580,7 +580,7 @@ Status ModelUtils::GetRtAddress(const RuntimeParam ¶m, uintptr_t logic_addr, | |||
param.var_size); | |||
} else if (logic_addr != 0) { | |||
mem_addr = nullptr; | |||
REPORT_INNER_ERROR("E19999", "Check param logic addr:0x%lx abnormal when ModelUtils %s", logic_addr, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Check param logic addr:0x%lx abnormal", logic_addr); | |||
GELOGE(PARAM_INVALID, "The logic addr:0x%lx is abnormal", logic_addr); | |||
return PARAM_INVALID; | |||
} | |||
@@ -27,7 +27,7 @@ namespace ge { | |||
Status EndGraphTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *davinci_model) { | |||
GELOGI("InitEndGraphTaskInfo Init Start."); | |||
if (davinci_model == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Check param davinci_model nullptr when EndGraphTaskInfo %s", __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Check param davinci_model nullptr"); | |||
GELOGE(PARAM_INVALID, "davinci_model is null!"); | |||
return PARAM_INVALID; | |||
} | |||
@@ -50,7 +50,7 @@ Status EndGraphTaskInfo::Distribute() { | |||
GELOGI("Start to call rtEndGraphEx"); | |||
rtError_t rt_ret = rtEndGraphEx(model_, stream_, kDumpFlag); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtEndGraphEx failed, ret:0x%X, when EndGraphTaskInfo %s", rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtEndGraphEx failed, ret:0x%X", rt_ret); | |||
GELOGE(RT_FAILED, "Call rtEndGraphEx failed, ret: 0x%x", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -58,7 +58,7 @@ Status EndGraphTaskInfo::Distribute() { | |||
GELOGI("Start to call rtEndGraph"); | |||
rtError_t rt_ret = rtEndGraph(model_, stream_); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtEndGraph failed, ret:0x%X, when EndGraphTaskInfo %s", rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtEndGraph failed, ret:0x%X", rt_ret); | |||
GELOGE(RT_FAILED, "Call rtEndGraph failed, ret: 0x%x", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -68,8 +68,8 @@ Status EndGraphTaskInfo::Distribute() { | |||
uint32_t stream_id = 0; | |||
rtError_t rt_ret = rtModelGetTaskId(davinci_model_->GetRtModelHandle(), &task_id, &stream_id); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtModelGetTaskId failed, ret:0x%X, when EndGraphTaskInfo %s", | |||
rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtModelGetTaskId failed, ret:0x%X", | |||
rt_ret); | |||
GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -23,7 +23,7 @@ namespace ge { | |||
Status EventRecordTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *davinci_model) { | |||
GELOGI("EventRecordTaskInfo Init Start."); | |||
if (davinci_model == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Check param davinci_model nullptr when EventRecordTaskInfo %s", __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Check param davinci_model nullptr"); | |||
GELOGE(PARAM_INVALID, "davinci_model is null!"); | |||
return PARAM_INVALID; | |||
} | |||
@@ -35,8 +35,8 @@ Status EventRecordTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *da | |||
const auto &eventList = davinci_model->GetEventList(); | |||
if (task_def.event_id() >= eventList.size()) { | |||
REPORT_INNER_ERROR("E19999", "Task event_id:%u > model event size:%zu, check invalid when EventRecordTaskInfo %s", | |||
task_def.event_id(), eventList.size(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Task event_id:%u > model event size:%zu, check invalid", | |||
task_def.event_id(), eventList.size()); | |||
GELOGE(INTERNAL_ERROR, "event list size:%zu, cur:%u!", eventList.size(), task_def.event_id()); | |||
return INTERNAL_ERROR; | |||
} | |||
@@ -50,8 +50,8 @@ Status EventRecordTaskInfo::Distribute() { | |||
GELOGI("EventRecordTaskInfo Distribute Start."); | |||
rtError_t rt_ret = rtEventRecord(event_, stream_); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtEventRecord failed, ret:0x%X, when EventRecordTaskInfo %s", | |||
rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtEventRecord failed, ret:0x%X", | |||
rt_ret); | |||
GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -23,7 +23,7 @@ namespace ge { | |||
Status EventWaitTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *davinci_model) { | |||
GELOGI("EventWaitTaskInfo Init Start."); | |||
if (davinci_model == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Check param davinci_model nullptr when EventWaitTaskInfo %s", __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Check param davinci_model nullptr"); | |||
GELOGE(PARAM_INVALID, "davinci_model is null!"); | |||
return PARAM_INVALID; | |||
} | |||
@@ -35,8 +35,8 @@ Status EventWaitTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *davi | |||
const auto &eventList = davinci_model->GetEventList(); | |||
if (task_def.event_id() >= eventList.size()) { | |||
REPORT_INNER_ERROR("E19999", "Task event_id:%u > model event size:%zu, check invalid when EventWaitTaskInfo %s", | |||
task_def.event_id(), eventList.size(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Task event_id:%u > model event size:%zu, check invalid", | |||
task_def.event_id(), eventList.size()); | |||
GELOGE(INTERNAL_ERROR, "event list size:%zu, cur:%u!", eventList.size(), task_def.event_id()); | |||
return INTERNAL_ERROR; | |||
} | |||
@@ -51,16 +51,16 @@ Status EventWaitTaskInfo::Distribute() { | |||
GELOGI("EventWaitTaskInfo Distribute Start."); | |||
rtError_t rt_ret = rtStreamWaitEvent(stream_, event_); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtStreamWaitEvent failed, ret:0x%X, when EventWaitTaskInfo %s", | |||
rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtStreamWaitEvent failed, ret:0x%X", | |||
rt_ret); | |||
GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
rt_ret = rtEventReset(event_, stream_); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtEventReset failed, ret:0x%X, when EventWaitTaskInfo %s", | |||
rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtEventReset failed, ret:0x%X", | |||
rt_ret); | |||
GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -23,7 +23,7 @@ namespace ge { | |||
Status FusionStartTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *davinci_model) { | |||
GELOGI("FusionStartTaskInfo Init Start."); | |||
if (davinci_model == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Check param davinci_model nullptr when FusionStartTaskInfo %s", __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Check param davinci_model nullptr"); | |||
GELOGE(PARAM_INVALID, "davinci_model is null!"); | |||
return PARAM_INVALID; | |||
} | |||
@@ -40,8 +40,8 @@ Status FusionStartTaskInfo::Distribute() { | |||
GELOGI("FusionStartTaskInfo Distribute Start."); | |||
rtError_t rt_ret = rtKernelFusionStart(stream_); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtKernelFusionStart failed, ret:0x%X, when FusionStartTaskInfo %s", | |||
rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtKernelFusionStart failed, ret:0x%X", | |||
rt_ret); | |||
GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -23,7 +23,7 @@ namespace ge { | |||
Status FusionStopTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *davinci_model) { | |||
GELOGI("FusionStopTaskInfo Init Start."); | |||
if (davinci_model == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Check param davinci_model nullptr when FusionStopTaskInfo %s", __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Check param davinci_model nullptr"); | |||
GELOGE(PARAM_INVALID, "davinci_model is null!"); | |||
return PARAM_INVALID; | |||
} | |||
@@ -40,8 +40,7 @@ Status FusionStopTaskInfo::Distribute() { | |||
GELOGI("FusionStopTaskInfo Distribute Start."); | |||
rtError_t rt_ret = rtKernelFusionEnd(stream_); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtKernelFusionEnd failed, ret:0x%X, when FusionStopTaskInfo %s", | |||
rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtKernelFusionEnd failed, ret:0x%X", rt_ret); | |||
GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -30,7 +30,7 @@ HcclTaskInfo::~HcclTaskInfo() { | |||
if (private_def_ != nullptr) { | |||
rtError_t ret = rtFreeHost(private_def_); | |||
if (ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtFreeHost failed, ret:0x%X, when HcclTaskInfo %s", ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtFreeHost failed, ret:0x%X", ret); | |||
GELOGE(RT_FAILED, "Call rtFree Fail, ret = 0x%X.", ret); | |||
} | |||
private_def_ = nullptr; | |||
@@ -42,7 +42,7 @@ HcclTaskInfo::~HcclTaskInfo() { | |||
Status HcclTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *davinci_model) { | |||
GELOGI("HcclTaskInfo Init Start."); | |||
if (davinci_model == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Check param davinci_model nullptr when HcclTaskInfo %s", __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Check param davinci_model nullptr"); | |||
GELOGE(PARAM_INVALID, "davinci_model is null!"); | |||
return PARAM_INVALID; | |||
} | |||
@@ -69,30 +69,30 @@ Status HcclTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *davinci_m | |||
// Only in Horovod scenario should get the inputName and GeShape | |||
ret = HcomOmeUtil::GetHorovodInputs(op_desc, kernel_hccl_infos_); | |||
if (ret != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Call GetHorovodInputs fail for op:%s(%s), when HcclTaskInfo %s", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call GetHorovodInputs fail for op:%s(%s)", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(ret, "davinci_model: GetHorovodInputs fail! domi error: %u", ret); | |||
return ret; | |||
} | |||
Status dmrt = HcomOmeUtil::GetHcclDataType(op_desc, kernel_hccl_infos_); | |||
if (dmrt != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Call GetHcclDataType fail for op:%s(%s), when HcclTaskInfo %s", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call GetHcclDataType fail for op:%s(%s)", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(dmrt, "davinci_model: GetHcomDataType fail! domi error: %u", dmrt); | |||
return dmrt; | |||
} | |||
dmrt = HcomOmeUtil::GetHcclCount(op_desc, kernel_hccl_infos_); | |||
if (dmrt != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Call GetHcclCount fail for op:%s(%s), when HcclTaskInfo %s", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call GetHcclCount fail for op:%s(%s)", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(dmrt, "davinci_model: GetHcomCount fail! domi error: %u", dmrt); | |||
return dmrt; | |||
} | |||
// Only HCOMBROADCAST and HVDCALLBACKBROADCAST need to get the rootId | |||
dmrt = HcomOmeUtil::GetAllRootId(op_desc, kernel_hccl_infos_); | |||
if (dmrt != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Call GetAllRootId fail for op:%s(%s), when HcclTaskInfo %s", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call GetAllRootId fail for op:%s(%s)", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(dmrt, "davinci_model: Get rootId fail! domi error: %u", dmrt); | |||
return dmrt; | |||
} | |||
@@ -179,16 +179,16 @@ Status HcclTaskInfo::CreateStream(int64_t stream_num, DavinciModel *davinci_mode | |||
rtError_t rt_ret = | |||
rtStreamCreateWithFlags(&stream, davinci_model->Priority(), RT_STREAM_PERSISTENT | RT_STREAM_FORCE_COPY); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtStreamCreateWithFlags failed, ret:0x%X, stream_idx:%ld, stream_num:%ld, " | |||
"when HcclTaskInfo %s", rt_ret, i, stream_num, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtStreamCreateWithFlags failed, ret:0x%X, stream_idx:%ld, stream_num:%ld", | |||
rt_ret, i, stream_num); | |||
GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
// Create slave stream, inactive by default, activated by hccl | |||
rt_ret = rtModelBindStream(davinci_model->GetRtModelHandle(), stream, RT_MODEL_WAIT_ACTIVE_STREAM); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtModelBindStream failed, ret:0x%X, stream_idx:%ld, stream_num:%ld, " | |||
"when HcclTaskInfo %s", rt_ret, i, stream_num, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtModelBindStream failed, ret:0x%X, stream_idx:%ld, stream_num:%ld", | |||
rt_ret, i, stream_num); | |||
GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); | |||
(void)rtStreamDestroy(stream); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
@@ -206,7 +206,7 @@ Status HcclTaskInfo::CreateStream(int64_t stream_num, DavinciModel *davinci_mode | |||
Status HcclTaskInfo::Distribute() { | |||
GELOGI("HcclTaskInfo Distribute Start. begin to call function LoadTask in hccl."); | |||
if (ops_kernel_store_ == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Check param ops_kernel_store_ nullptr when HcclTaskInfo %s", __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Check param ops_kernel_store_ nullptr"); | |||
GELOGE(INTERNAL_ERROR, "ops kernel store is null."); | |||
return INTERNAL_ERROR; | |||
} | |||
@@ -216,7 +216,7 @@ Status HcclTaskInfo::Distribute() { | |||
TransToGETaskInfo(ge_task); | |||
auto result = ops_kernel_info_store->LoadTask(ge_task); | |||
if (result != HCCL_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Call ops_kernel_info_store LoadTask fail when HcclTaskInfo %s", __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call ops_kernel_info_store LoadTask fail"); | |||
GELOGE(INTERNAL_ERROR, "davinci_model : load task fail, return ret: %u", result); | |||
return INTERNAL_ERROR; | |||
} | |||
@@ -332,8 +332,8 @@ void HcclTaskInfo::GetPrivateDefByTaskDef(const domi::TaskDef &task) { | |||
private_def_len_ = private_def_temp.size(); | |||
rtError_t ret = rtMallocHost(&private_def_, private_def_len_); | |||
if (ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMallocHost failed, ret:0x%X, size:%u, when HcclTaskInfo %s", | |||
ret, private_def_len_, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMallocHost failed, ret:0x%X, size:%u", | |||
ret, private_def_len_); | |||
GELOGE(RT_FAILED, "Call rtMallocHost Fail, ret = 0x%X.", ret); | |||
return; | |||
} | |||
@@ -341,8 +341,8 @@ void HcclTaskInfo::GetPrivateDefByTaskDef(const domi::TaskDef &task) { | |||
ret = rtMemcpy(private_def_, private_def_len_, task.private_def().c_str(), private_def_len_, | |||
RT_MEMCPY_HOST_TO_HOST); | |||
if (ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, ret:0x%X, size:%u, when HcclTaskInfo %s", | |||
ret, private_def_len_, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, ret:0x%X, size:%u", | |||
ret, private_def_len_); | |||
GELOGE(RT_FAILED, "Call rtMemcpy Fail, ret = 0x%X.", ret); | |||
return; | |||
} | |||
@@ -75,15 +75,15 @@ Status KernelExTaskInfo::InitTaskExtInfo(const std::string &ext_info, const OpDe | |||
} | |||
auto rt_ret = rtMalloc(&ext_info_addr_, ext_handle->GetExtInfoLen(), RT_MEMORY_HBM); | |||
GE_IF_BOOL_EXEC(rt_ret != RT_ERROR_NONE, | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%zu, ret:0x%X, when KernelExTaskInfo %s", | |||
ext_info.size(), rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%zu, ret:0x%X", | |||
ext_info.size(), rt_ret); | |||
GELOGE(RT_FAILED, "rtMalloc ext_info error: 0x%X, size=%zu", rt_ret, ext_info.size()); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret);) | |||
rt_ret = rtMemcpy(ext_info_addr_, ext_handle->GetExtInfoLen(), ext_handle->GetExtInfo(), | |||
ext_handle->GetExtInfoLen(), RT_MEMCPY_HOST_TO_DEVICE); | |||
GE_IF_BOOL_EXEC(rt_ret != RT_ERROR_NONE, | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret:0x%X, when KernelExTaskInfo %s", | |||
ext_handle->GetExtInfoLen(), rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret:0x%X", | |||
ext_handle->GetExtInfoLen(), rt_ret); | |||
GELOGE(RT_FAILED, "rtMemcpy ext_info error: 0x%X, size=%zu", rt_ret, ext_info.size()); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret);) | |||
return SUCCESS; | |||
@@ -105,8 +105,8 @@ Status KernelExTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *davin | |||
uint32_t op_index = kernel_ex_def.op_index(); | |||
OpDescPtr op_desc = davinci_model_->GetOpByIndex(op_index); | |||
if (op_desc == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Can't get op_desc from davinci_model by index:%u when KernelExTaskInfo %s", | |||
op_index, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Can't get op_desc from davinci_model by index:%u", | |||
op_index); | |||
GELOGE(INTERNAL_ERROR, "Init aicpu task info error, index is out of range!"); | |||
return INTERNAL_ERROR; | |||
} | |||
@@ -115,8 +115,7 @@ Status KernelExTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *davin | |||
STR_FWK_OP_KERNEL fwk_op_kernel = {0}; | |||
if (sizeof(STR_FWK_OP_KERNEL) < kernel_ex_def.args_size()) { | |||
REPORT_INNER_ERROR("E19999", "Param kernel_ex_def.args_size():%u > sizeof(STR_FWK_OP_KERNEL):%zu, " | |||
"check invalid when KernelExTaskInfo %s", kernel_ex_def.args_size(), sizeof(STR_FWK_OP_KERNEL), | |||
__FUNCTION__); | |||
"check invalid", kernel_ex_def.args_size(), sizeof(STR_FWK_OP_KERNEL)); | |||
GELOGE(FAILED, "sizeof STR_FWK_OP_KERNEL is: %zu, but args_size is: %u", sizeof(STR_FWK_OP_KERNEL), | |||
kernel_ex_def.args_size()); | |||
return FAILED; | |||
@@ -124,8 +123,8 @@ Status KernelExTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *davin | |||
errno_t sec_ret = | |||
memcpy_s(&fwk_op_kernel, sizeof(STR_FWK_OP_KERNEL), kernel_ex_def.args().data(), kernel_ex_def.args_size()); | |||
if (sec_ret != EOK) { | |||
REPORT_CALL_ERROR("E19999", "Call memcpy_s fail, size:%zu, ret:0x%X, when KernelExTaskInfo %s", | |||
sizeof(STR_FWK_OP_KERNEL), sec_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call memcpy_s fail, size:%zu, ret:0x%X", | |||
sizeof(STR_FWK_OP_KERNEL), sec_ret); | |||
GELOGE(FAILED, "memcpy failed, ret: %d", sec_ret); | |||
return FAILED; | |||
} | |||
@@ -147,17 +146,16 @@ Status KernelExTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *davin | |||
uint64_t kernel_id = fwk_op_kernel.fwkKernelBase.fwk_kernel.kernelID; | |||
GE_IF_BOOL_EXEC(ModelManager::GetInstance()->CreateAicpuKernel(session_id, davinci_model->Id(), | |||
davinci_model->SubModelId(), kernel_id) != SUCCESS, | |||
REPORT_CALL_ERROR("E19999", "CreateAicpuKernel fail, session_id:%lu, model_id:%u, kernel_id:%lu " | |||
"when KernelExTaskInfo %s", | |||
session_id, davinci_model->Id(), kernel_id, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "CreateAicpuKernel fail, session_id:%lu, model_id:%u, kernel_id:%lu", | |||
session_id, davinci_model->Id(), kernel_id); | |||
GELOGE(FAILED, "CreateAicpuKernel error."); | |||
return FAILED;) | |||
// 2.3 Create session | |||
GE_CHECK_NOTNULL(ModelManager::GetInstance()); | |||
ret = ModelManager::GetInstance()->CreateAicpuSession(session_id); | |||
GE_IF_BOOL_EXEC(ret != SUCCESS, | |||
REPORT_CALL_ERROR("E19999", "CreateAicpuSession fail, session_id:%lu when KernelExTaskInfo %s", | |||
session_id, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "CreateAicpuSession fail, session_id:%lu", | |||
session_id); | |||
GELOGE(ret, "CreateAicpuSession error. session id: %lu", session_id); | |||
return ret;) | |||
@@ -169,8 +167,8 @@ Status KernelExTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *davin | |||
void *workspace_base_addr = nullptr; | |||
rtError_t rt_ret = rtMalloc(&workspace_base_addr, kernel_ex_def.task_info_size(), RT_MEMORY_HBM); | |||
GE_IF_BOOL_EXEC(rt_ret != RT_ERROR_NONE, | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%u, ret:0x%X, when KernelExTaskInfo %s", | |||
kernel_ex_def.task_info_size(), rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%u, ret:0x%X", | |||
kernel_ex_def.task_info_size(), rt_ret); | |||
GELOGE(RT_FAILED, "rtMalloc error, ret: Ox%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret);); | |||
rt_ret = rtMemcpy(workspace_base_addr, kernel_ex_def.task_info_size(), kernel_ex_def.task_info().data(), | |||
@@ -183,16 +181,16 @@ Status KernelExTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *davin | |||
rt_ret = rtMalloc(&kernel_buf_, kernel_buf_size_, RT_MEMORY_HBM); | |||
GE_IF_BOOL_EXEC(rt_ret != RT_ERROR_NONE, | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, ret:0x%X, size:%u, when KernelExTaskInfo %s", | |||
rt_ret, kernel_buf_size_, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, ret:0x%X, size:%u", | |||
rt_ret, kernel_buf_size_); | |||
GELOGE(RT_FAILED, "rtMalloc error: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret);) | |||
rt_ret = rtMemcpy(kernel_buf_, kernel_buf_size_, static_cast<void *>(&fwk_op_kernel), kernel_buf_size_, | |||
RT_MEMCPY_HOST_TO_DEVICE); | |||
GE_IF_BOOL_EXEC(rt_ret != RT_ERROR_NONE, | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, ret:0x%X, size:%u, when KernelExTaskInfo %s", | |||
rt_ret, kernel_buf_size_, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, ret:0x%X, size:%u", | |||
rt_ret, kernel_buf_size_); | |||
GELOGE(RT_FAILED, "rtMemcpy error, ret: Ox%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret);) | |||
@@ -211,8 +209,8 @@ Status KernelExTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *davin | |||
const vector<void *> workspace_data_addrs = ModelUtils::GetWorkspaceDataAddrs(rts_param, op_desc); | |||
if (workspace_data_addrs.empty()) { | |||
REPORT_CALL_ERROR("E19999", "workspace_data_addrs is empty in op:%s(%s), check invalid when KernelExTaskInfo %s", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "workspace_data_addrs is empty in op:%s(%s), check invalid", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(FAILED, "workspace_data_addrs is empty."); | |||
return FAILED; | |||
} | |||
@@ -228,15 +226,15 @@ Status KernelExTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *davin | |||
if (addrs_size > 0) { | |||
rtError_t rt_ret = rtMalloc(&input_output_addr_, addrs_size, RT_MEMORY_HBM); | |||
GE_IF_BOOL_EXEC(rt_ret != RT_ERROR_NONE, | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, ret:0x%X, size:%lu, when KernelExTaskInfo %s", | |||
rt_ret, addrs_size, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, ret:0x%X, size:%lu", | |||
rt_ret, addrs_size); | |||
GELOGE(RT_FAILED, "rtMalloc error, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret);) | |||
rt_ret = rtMemcpy(input_output_addr_, addrs_size, io_addrs.data(), addrs_size, RT_MEMCPY_HOST_TO_DEVICE); | |||
GE_IF_BOOL_EXEC(rt_ret != RT_ERROR_NONE, | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, ret:0x%X, size:%lu, when KernelExTaskInfo %s", | |||
rt_ret, addrs_size, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, ret:0x%X, size:%lu", | |||
rt_ret, addrs_size); | |||
GELOGE(RT_FAILED, "rtMemcpy to input_output_addr_ error: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret);) | |||
@@ -257,16 +255,16 @@ Status KernelExTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *davin | |||
// 4. Return result | |||
rtError_t rt_ret = rtMalloc(&kernel_buf_, sizeof(STR_FWK_OP_KERNEL), RT_MEMORY_HBM); | |||
GE_IF_BOOL_EXEC(rt_ret != RT_ERROR_NONE, | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, ret:0x%X, size:%zu, when KernelExTaskInfo %s", | |||
rt_ret, sizeof(STR_FWK_OP_KERNEL), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, ret:0x%X, size:%zu", | |||
rt_ret, sizeof(STR_FWK_OP_KERNEL)); | |||
GELOGE(RT_FAILED, "rtMalloc error: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret);) | |||
rt_ret = rtMemcpy(kernel_buf_, sizeof(STR_FWK_OP_KERNEL), static_cast<void *>(&fwk_op_kernel), | |||
sizeof(STR_FWK_OP_KERNEL), RT_MEMCPY_HOST_TO_DEVICE); | |||
GE_IF_BOOL_EXEC(rt_ret != RT_ERROR_NONE, | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, ret:0x%X, size:%zu, when KernelExTaskInfo %s", | |||
rt_ret, sizeof(STR_FWK_OP_KERNEL), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, ret:0x%X, size:%zu", | |||
rt_ret, sizeof(STR_FWK_OP_KERNEL)); | |||
GELOGE(RT_FAILED, "rtMemcpy error, ret: Ox%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret);) | |||
@@ -288,8 +286,8 @@ Status KernelExTaskInfo::CalculateArgs(const domi::TaskDef &task_def, DavinciMod | |||
uint32_t op_index = kernel_ex_def.op_index(); | |||
OpDescPtr op_desc = davinci_model->GetOpByIndex(op_index); | |||
if (op_desc == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Can't get op_desc from davinci_model by index:%u when KernelExTaskInfo %s", | |||
op_index, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Can't get op_desc from davinci_model by index:%u", | |||
op_index); | |||
GELOGE(INTERNAL_ERROR, "Init aicpu task info error, index is out of range!"); | |||
return INTERNAL_ERROR; | |||
} | |||
@@ -308,8 +306,8 @@ Status KernelExTaskInfo::CalculateArgs(const domi::TaskDef &task_def, DavinciMod | |||
uint32_t output_index = davinci_model->GetFixedAddrOutputIndex(peer_input_name); | |||
if (output_index > outputs_size) { | |||
REPORT_INNER_ERROR("E19999", "The output size[%zu] and output index[%u] in op:%s(%s) are inconsistent, " | |||
"check invalid when KernelExTaskInfo %s", outputs_size, output_index, | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); | |||
"check invalid", outputs_size, output_index, | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(FAILED, "The output size[%zu] and output index[%u] are inconsistent.", outputs_size, output_index); | |||
return FAILED; | |||
} | |||
@@ -337,8 +335,8 @@ void KernelExTaskInfo::SetIoAddrs(const OpDescPtr &op_desc) { | |||
uint32_t output_index = davinci_model_->GetFixedAddrOutputIndex(peer_input_name); | |||
if (output_index > output_data_addrs.size()) { | |||
REPORT_INNER_ERROR("E19999", "The output data addr size[%zu] and output index[%u] in op:%s(%s) are inconsistent" | |||
", check invalid when KernelExTaskInfo %s", output_data_addrs.size(), output_index, | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); | |||
", check invalid", output_data_addrs.size(), output_index, | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(FAILED, "The output data addr size[%zu] and output index[%u] are inconsistent.", | |||
output_data_addrs.size(), output_index); | |||
return; | |||
@@ -369,25 +367,25 @@ Status KernelExTaskInfo::CopyTaskInfo(const domi::KernelExDef &kernel_def, const | |||
const vector<int64_t> workspace_data_sizes = ModelUtils::GetWorkspaceSize(op_desc); | |||
const vector<void *> workspace_data_addrs = ModelUtils::GetWorkspaceDataAddrs(rts_param, op_desc); | |||
if (workspace_data_addrs.empty() || workspace_data_sizes.empty()) { | |||
REPORT_INNER_ERROR("E19999", "Node:%s(%s) workspace addr:%zu or size:%zu empty, check invalid " | |||
"when KernelExTaskInfo %s", op_desc->GetName().c_str(), op_desc->GetType().c_str(), | |||
workspace_data_addrs.size(), workspace_data_sizes.size(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Node:%s(%s) workspace addr:%zu or size:%zu empty, check invalid", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), | |||
workspace_data_addrs.size(), workspace_data_sizes.size()); | |||
GELOGE(FAILED, "Node:%s invalid workspace, addrs is %zu, size is %zu.", op_desc->GetName().c_str(), | |||
workspace_data_addrs.size(), workspace_data_sizes.size()); | |||
return FAILED; | |||
} | |||
if (workspace_data_addrs[0] == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Node:%s(%s) workspace addr is nullptr, check invalid when KernelExTaskInfo %s", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Node:%s(%s) workspace addr is nullptr, check invalid", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(FAILED, "Node:%s workspace addrs is null.", op_desc->GetName().c_str()); | |||
return FAILED; | |||
} | |||
if (workspace_data_sizes[0] < static_cast<int64_t>(kernel_def.task_info_size())) { | |||
REPORT_INNER_ERROR("E19999", "Node:%s(%s) workspace size:%ld < task info size:%d, check invalid " | |||
"when KernelExTaskInfo %s", op_desc->GetName().c_str(), op_desc->GetType().c_str(), | |||
workspace_data_sizes[0], kernel_def.task_info_size(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Node:%s(%s) workspace size:%ld < task info size:%d, check invalid", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), | |||
workspace_data_sizes[0], kernel_def.task_info_size()); | |||
GELOGE(FAILED, "Node:%s workspace size is %ld, task info size is %d.", op_desc->GetName().c_str(), | |||
workspace_data_sizes[0], kernel_def.task_info_size()); | |||
return FAILED; | |||
@@ -396,8 +394,8 @@ Status KernelExTaskInfo::CopyTaskInfo(const domi::KernelExDef &kernel_def, const | |||
rtError_t rt_ret = rtMemcpy(workspace_data_addrs[0], kernel_def.task_info_size(), kernel_def.task_info().data(), | |||
kernel_def.task_info_size(), RT_MEMCPY_HOST_TO_DEVICE); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, ret:0x%X, size:%d, when KernelExTaskInfo %s", | |||
rt_ret, kernel_def.task_info_size(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, ret:0x%X, size:%d", | |||
rt_ret, kernel_def.task_info_size()); | |||
GELOGE(RT_FAILED, "rtMemcpy error: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -409,14 +407,14 @@ Status KernelExTaskInfo::Distribute() { | |||
GELOGI("KernelExTaskInfo Distribute Start."); | |||
rtError_t rt_ret = rtKernelLaunchEx(kernel_buf_, kernel_buf_size_, dump_flag_, stream_); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtKernelLaunchEx failed, ret:0x%X when KernelExTaskInfo %s", | |||
rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtKernelLaunchEx failed, ret:0x%X", | |||
rt_ret); | |||
GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
if (davinci_model_ == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Check param davinci_model nullptr when KernelExTaskInfo %s", __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Check param davinci_model nullptr"); | |||
GELOGE(PARAM_INVALID, "davinci_model_ is null."); | |||
return PARAM_INVALID; | |||
} | |||
@@ -425,8 +423,8 @@ Status KernelExTaskInfo::Distribute() { | |||
uint32_t stream_id = 0; // for profiling | |||
rt_ret = rtModelGetTaskId(davinci_model_->GetRtModelHandle(), &task_id, &stream_id); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtModelGetTaskId failed, ret:0x%X when KernelExTaskInfo %s", | |||
rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtModelGetTaskId failed, ret:0x%X", | |||
rt_ret); | |||
GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -95,9 +95,9 @@ Status KernelTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *davinci | |||
rtError_t rt_ret = rtGetFunctionByName(const_cast<char *>(kernel_def.stub_func().c_str()), &stub_func_); | |||
GE_IF_BOOL_EXEC(rt_ret != RT_ERROR_NONE, | |||
REPORT_CALL_ERROR("E19999", "Call rtGetFunctionByName failed for op:%s(%s), " | |||
"bin_file_key:%s, ret:0x%X, when KernelTaskInfo %s", | |||
"bin_file_key:%s, ret:0x%X", | |||
op_desc_->GetName().c_str(), op_desc_->GetType().c_str(), | |||
kernel_def.stub_func().c_str(), rt_ret, __FUNCTION__); | |||
kernel_def.stub_func().c_str(), rt_ret); | |||
GELOGE(RT_FAILED, "execute rtGetFunctionByName failed. stub_func: %s", | |||
kernel_def.stub_func().c_str()); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret);); | |||
@@ -109,17 +109,17 @@ Status KernelTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *davinci | |||
rtError_t rt_ret = rtGetFunctionByName(bin_file_key, &stub_func_); | |||
GE_IF_BOOL_EXEC(rt_ret != RT_ERROR_NONE, | |||
REPORT_CALL_ERROR("E19999", "Call rtGetFunctionByName failed for op:%s(%s), " | |||
"bin_file_key:%s, ret:0x%X, when KernelTaskInfo %s", | |||
"bin_file_key:%s, ret:0x%X", | |||
op_desc_->GetName().c_str(), op_desc_->GetType().c_str(), | |||
bin_file_key, rt_ret, __FUNCTION__); | |||
bin_file_key, rt_ret); | |||
GELOGE(RT_FAILED, "execute rtGetFunctionByName failed. bin_file_key: %s", bin_file_key); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret);); | |||
} | |||
if (context.origin_op_index_size() > CC_FUSION_OP_MAX) { | |||
REPORT_INNER_ERROR("E19999", "context.origin_op_index_size():%d is more than CC_FUSION_OP_MAX(%d), op:%s(%s) ," | |||
"check invalid when KernelTaskInfo %s", context.origin_op_index_size(), CC_FUSION_OP_MAX, | |||
op_desc_->GetName().c_str(), op_desc_->GetType().c_str(), __FUNCTION__); | |||
"check invalid", context.origin_op_index_size(), CC_FUSION_OP_MAX, | |||
op_desc_->GetName().c_str(), op_desc_->GetType().c_str()); | |||
GELOGE(PARAM_INVALID, "context.origin_op_index_size() is more than CC_FUSION_OP_MAX(%d)", CC_FUSION_OP_MAX); | |||
return PARAM_INVALID; | |||
} | |||
@@ -133,8 +133,8 @@ Status KernelTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *davinci | |||
uint16_t *args_offset_tmp = reinterpret_cast<uint16_t *>(const_cast<char *>(context.args_offset().data())); | |||
if (context.args_offset().size() / sizeof(uint16_t) < 1) { | |||
REPORT_INNER_ERROR("E19999", "context.args_offset().size():%zu / sizeof(uint16_t) less than 1, op:%s(%s) ," | |||
"check invalid when KernelTaskInfo %s", context.args_offset().size(), | |||
op_desc_->GetName().c_str(), op_desc_->GetType().c_str(), __FUNCTION__); | |||
"check invalid", context.args_offset().size(), | |||
op_desc_->GetName().c_str(), op_desc_->GetType().c_str()); | |||
GELOGE(FAILED, "context.args_offset().size() / sizeof(uint16_t) less than 1"); | |||
return FAILED; | |||
} | |||
@@ -147,8 +147,8 @@ Status KernelTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *davinci | |||
ret = InitAicpuTask(context.op_index(), kernel_def); | |||
} else { | |||
if (kernel_def.args().empty() || args_size_ == 0) { | |||
REPORT_INNER_ERROR("E19999", "kernel_def.args() is empty, op:%s(%s), check invalid when KernelTaskInfo %s", | |||
op_desc_->GetName().c_str(), op_desc_->GetType().c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "kernel_def.args() is empty, op:%s(%s), check invalid", | |||
op_desc_->GetName().c_str(), op_desc_->GetType().c_str()); | |||
GELOGE(FAILED, "args is null."); | |||
return FAILED; | |||
} | |||
@@ -181,8 +181,8 @@ void KernelTaskInfo::UpdateSKTTaskId() { | |||
if (davinci_model_ != nullptr) { | |||
rtError_t rt_ret = rtModelGetTaskId(davinci_model_->GetRtModelHandle(), &task_id, &stream_id); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtModelGetTaskId failed, ret:0x%X, when KernelTaskInfo %s", | |||
rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtModelGetTaskId failed, ret:0x%X", | |||
rt_ret); | |||
GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); | |||
return; | |||
} | |||
@@ -201,8 +201,8 @@ void KernelTaskInfo::UpdateTaskId() { | |||
if (davinci_model_ != nullptr) { | |||
rtError_t rt_ret = rtModelGetTaskId(davinci_model_->GetRtModelHandle(), &task_id, &stream_id); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtModelGetTaskId failed, ret:0x%X, when KernelTaskInfo %s", | |||
rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtModelGetTaskId failed, ret:0x%X", | |||
rt_ret); | |||
GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); | |||
return; | |||
} | |||
@@ -258,8 +258,8 @@ Status KernelTaskInfo::SuperKernelLaunch() { | |||
static_cast<rtSmDesc_t *>(skt_info.last_sm_desc), skt_info.last_stream, | |||
skt_info.last_dump_flag); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtKernelLaunchWithFlag failed, ret:0x%X, when KernelTaskInfo %s", | |||
rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtKernelLaunchWithFlag failed, ret:0x%X", | |||
rt_ret); | |||
GELOGE(RT_FAILED, "SuperKernelLaunch: Call rt api failed, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -272,8 +272,8 @@ Status KernelTaskInfo::SuperKernelLaunch() { | |||
// Init super kernel factory | |||
Status ge_ret = factory->Init(); | |||
if (ge_ret != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Call SuperKernelFactory init fail, ret:0x%X, when KernelTaskInfo %s", | |||
ge_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call SuperKernelFactory init fail, ret:0x%X", | |||
ge_ret); | |||
GELOGE(ge_ret, "SuperKernelLaunch: SuperKernelFactory init failed"); | |||
return ge_ret; | |||
} | |||
@@ -281,8 +281,8 @@ Status KernelTaskInfo::SuperKernelLaunch() { | |||
std::unique_ptr<skt::SuperKernel> superKernel = nullptr; | |||
ge_ret = factory->FuseKernels(skt_kernel_list, skt_arg_list, skt_info.last_block_dim, superKernel); | |||
if (ge_ret != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Call SuperKernelFactory FuseKernels fail, ret:0x%X, when KernelTaskInfo %s", | |||
ge_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call SuperKernelFactory FuseKernels fail, ret:0x%X", | |||
ge_ret); | |||
GELOGE(ge_ret, "SuperKernelLaunch: fuse call failed"); | |||
return ge_ret; | |||
} | |||
@@ -290,8 +290,8 @@ Status KernelTaskInfo::SuperKernelLaunch() { | |||
skt_dump_flag_ = GetDumpFlag(); | |||
ge_ret = superKernel->Launch(skt_info.last_stream, skt_dump_flag_); | |||
if (ge_ret != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Call SuperKernelFactory Launch fail, ret:0x%X, when KernelTaskInfo %s", | |||
ge_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call SuperKernelFactory Launch fail, ret:0x%X", | |||
ge_ret); | |||
GELOGE(ge_ret, "SuperKernelLaunch: launch failed"); | |||
return ge_ret; | |||
} | |||
@@ -330,14 +330,14 @@ Status KernelTaskInfo::SaveSuperKernelInfo() { | |||
bool KernelTaskInfo::IsMarkedLastNode() { | |||
if (davinci_model_ == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Check param davinci_model nullptr when KernelTaskInfo %s", __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Check param davinci_model nullptr"); | |||
GELOGE(PARAM_INVALID, "davinci_model is null!"); | |||
return false; | |||
} | |||
OpDescPtr op_desc = davinci_model_->GetOpByIndex(ctx_.opIndex); | |||
if (op_desc == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Can't get op_desc from davinci_model by index:%u when KernelTaskInfo %s", | |||
ctx_.opIndex, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Can't get op_desc from davinci_model by index:%u", | |||
ctx_.opIndex); | |||
GELOGE(INTERNAL_ERROR, "InitTVMTaskInfo error, index is out of range!"); | |||
return false; | |||
} | |||
@@ -348,14 +348,14 @@ bool KernelTaskInfo::IsMarkedLastNode() { | |||
bool KernelTaskInfo::IsMarkedFirstNode() { | |||
if (davinci_model_ == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Check param davinci_model nullptr when KernelTaskInfo %s", __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Check param davinci_model nullptr"); | |||
GELOGE(PARAM_INVALID, "davinci_model is null!"); | |||
return false; | |||
} | |||
OpDescPtr op_desc = davinci_model_->GetOpByIndex(ctx_.opIndex); | |||
if (op_desc == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Can't get op_desc from davinci_model by index:%u when KernelTaskInfo %s", | |||
ctx_.opIndex, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Can't get op_desc from davinci_model by index:%u", | |||
ctx_.opIndex); | |||
GELOGE(INTERNAL_ERROR, "InitTVMTaskInfo error, index is out of range!"); | |||
return false; | |||
} | |||
@@ -396,8 +396,8 @@ Status KernelTaskInfo::SuperKernelDistribute() { | |||
rtError_t rt_ret = rtKernelLaunchWithFlag(stub_func_, block_dim_, args_, args_size_, | |||
static_cast<rtSmDesc_t *>(sm_desc_), stream_, dump_flag_); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtKernelLaunchWithFlag failed, ret:0x%X, when KernelTaskInfo %s", | |||
rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtKernelLaunchWithFlag failed, ret:0x%X", | |||
rt_ret); | |||
GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); | |||
return rt_ret; | |||
} | |||
@@ -460,7 +460,7 @@ Status KernelTaskInfo::Distribute() { | |||
} | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtKernelLaunchWithFlag or rtCpuKernelLaunchWithFlag failed, " | |||
"ret:0x%X, when KernelTaskInfo %s", rt_ret, __FUNCTION__); | |||
"ret:0x%X", rt_ret); | |||
GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -497,8 +497,8 @@ Status KernelTaskInfo::CopyNoncontinuousArgs(uint16_t offset) { | |||
// copy io addr | |||
errno_t sec_ret = memcpy_s(args_addr.get() + offset, addr_size, io_addrs.data(), addr_size); | |||
if (sec_ret != EOK) { | |||
REPORT_CALL_ERROR("E19999", "Call memcpy_s fail, size:%zu, ret:0x%X, when KernelTaskInfo %s", | |||
addr_size, sec_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call memcpy_s fail, size:%zu, ret:0x%X", | |||
addr_size, sec_ret); | |||
GELOGE(FAILED, "memcpy failed, ret: %d", sec_ret); | |||
return FAILED; | |||
} | |||
@@ -506,8 +506,8 @@ Status KernelTaskInfo::CopyNoncontinuousArgs(uint16_t offset) { | |||
// copy args to device | |||
rtError_t rt_ret = rtMemcpy(args_, args_size_, args_addr.get(), args_size_, RT_MEMCPY_HOST_TO_DEVICE); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%u, ret:0x%X, when KernelTaskInfo %s", | |||
args_size_, rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%u, ret:0x%X", | |||
args_size_, rt_ret); | |||
GELOGE(RT_FAILED, "Call rt api(rtMemcpy) failed, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -556,7 +556,7 @@ Status KernelTaskInfo::Release() { | |||
ret = (sm_desc_ != nullptr) ? rtMemFreeManaged(sm_desc_) : RT_ERROR_NONE; | |||
if (ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMemFreeManaged failed, ret:0x%X, when KernelTaskInfo %s", ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMemFreeManaged failed, ret:0x%X", ret); | |||
GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", static_cast<int>(ret)); | |||
return RT_ERROR_TO_GE_STATUS(ret); | |||
} | |||
@@ -587,16 +587,16 @@ Status KernelTaskInfo::UpdateL2Data(const domi::KernelDef &kernel_def) { | |||
rtError_t rt_ret = rtMemAllocManaged(&sm_desc_, sm_desc.size(), RT_MEMORY_SPM); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMemAllocManaged failed, ret:0x%X, when KernelTaskInfo %s", | |||
rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMemAllocManaged failed, ret:0x%X", | |||
rt_ret); | |||
GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
rt_ret = rtMemcpy(sm_desc_, sm_desc.size(), sm_desc.data(), sm_desc.size(), RT_MEMCPY_HOST_TO_DEVICE); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret:0x%X, when KernelTaskInfo %s", | |||
sm_desc.size(), rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret:0x%X", | |||
sm_desc.size(), rt_ret); | |||
GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -643,8 +643,8 @@ Status KernelTaskInfo::InitTVMTask(uint16_t offset, const domi::KernelDef &kerne | |||
args_addr = std::unique_ptr<uint8_t[]>(new (std::nothrow) uint8_t[args_size_]); | |||
errno_t sec_ret = memcpy_s(args_addr.get(), args_size_, kernel_def.args().data(), args_size_); | |||
if (sec_ret != EOK) { | |||
REPORT_CALL_ERROR("E19999", "Call memcpy_s fail, size:%u, ret:0x%X, when KernelTaskInfo %s", | |||
args_size_, sec_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call memcpy_s fail, size:%u, ret:0x%X", | |||
args_size_, sec_ret); | |||
GELOGE(FAILED, "memcpy failed, ret: %d", sec_ret); | |||
return FAILED; | |||
} | |||
@@ -687,8 +687,8 @@ Status KernelTaskInfo::InitTVMTask(uint16_t offset, const domi::KernelDef &kerne | |||
// malloc args memory | |||
rt_ret = rtMalloc(&args_, args_size_, RT_MEMORY_HBM); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%u, ret:0x%X, when KernelTaskInfo %s", | |||
args_size_, rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%u, ret:0x%X", | |||
args_size_, rt_ret); | |||
GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -696,17 +696,16 @@ Status KernelTaskInfo::InitTVMTask(uint16_t offset, const domi::KernelDef &kerne | |||
// copy orign args | |||
rt_ret = rtMemcpy(args_, args_size_, kernel_def.args().data(), args_size_, RT_MEMCPY_HOST_TO_DEVICE); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%u, ret:0x%X, when KernelTaskInfo %s", | |||
args_size_, rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%u, ret:0x%X", | |||
args_size_, rt_ret); | |||
GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
if ((args_size_ <= offset) || (args_size_ - offset < kAddrLen * tensor_device_addrs.size())) { | |||
REPORT_INNER_ERROR("E19999", "offset:%u >= kernelInfo.argsSize:%u or copy content:%zu beyond applied memory:%u, " | |||
"check invalid, when KernelTaskInfo %s", | |||
offset, args_size_, kAddrLen * tensor_device_addrs.size(), args_size_ - offset, | |||
__FUNCTION__); | |||
"check invalid", | |||
offset, args_size_, kAddrLen * tensor_device_addrs.size(), args_size_ - offset); | |||
GELOGE(FAILED, "offset >= kernelInfo.argsSize or copy content beyond applied memory."); | |||
return FAILED; | |||
} | |||
@@ -715,16 +714,16 @@ Status KernelTaskInfo::InitTVMTask(uint16_t offset, const domi::KernelDef &kerne | |||
rt_ret = rtMemcpy(static_cast<char *>(args_) + offset, args_size_ - offset, tensor_device_addrs.data(), | |||
kAddrLen * tensor_device_addrs.size(), RT_MEMCPY_HOST_TO_DEVICE); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%u, ret:0x%X, when KernelTaskInfo %s", | |||
args_size_ - offset, rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%u, ret:0x%X", | |||
args_size_ - offset, rt_ret); | |||
GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
sec_ret = memcpy_s(args_addr.get() + offset, args_size_ - offset, tensor_device_addrs.data(), | |||
kAddrLen * tensor_device_addrs.size()); | |||
if (sec_ret != EOK) { | |||
REPORT_CALL_ERROR("E19999", "Call memcpy_s failed, size:%u, ret:0x%X, when KernelTaskInfo %s", | |||
args_size_ - offset, sec_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call memcpy_s failed, size:%u, ret:0x%X", | |||
args_size_ - offset, sec_ret); | |||
GELOGE(FAILED, "memcpy failed, ret: %d", sec_ret); | |||
return FAILED; | |||
} | |||
@@ -769,8 +768,8 @@ Status KernelTaskInfo::InitAICPUCustomTask(uint32_t op_index, const domi::Kernel | |||
GELOGI("Do InitAICPUCustomTask"); | |||
OpDescPtr op_desc = davinci_model_->GetOpByIndex(op_index); | |||
if (op_desc == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Can't get op_desc from davinci_model by index:%u when KernelTaskInfo %s", | |||
op_index, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Can't get op_desc from davinci_model by index:%u", | |||
op_index); | |||
GELOGE(INTERNAL_ERROR, "index is out of range, index: %u", op_index); | |||
return INTERNAL_ERROR; | |||
} | |||
@@ -781,17 +780,17 @@ Status KernelTaskInfo::InitAICPUCustomTask(uint32_t op_index, const domi::Kernel | |||
const uint32_t kCustomAicpuArgsLen = 5; | |||
ctx_.argsOffset = new (std::nothrow) uint16_t[kCustomAicpuArgsLen](); | |||
if (ctx_.argsOffset == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "New ctx_.argsOffset fail, size:%u, op:%s(%s), when KernelTaskInfo %s", | |||
kCustomAicpuArgsLen, op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "New ctx_.argsOffset fail, size:%u, op:%s(%s)", | |||
kCustomAicpuArgsLen, op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(PARAM_INVALID, "ctx_.argsOffset is null!"); | |||
return PARAM_INVALID; | |||
} | |||
if (context.args_offset().size() / sizeof(uint16_t) < kCustomAicpuArgsLen) { | |||
REPORT_INNER_ERROR("E19999", "context.args_offset().size():%zu / sizeof(uint16_t) is less than " | |||
"kCustomAicpuArgsLen:%u, op:%s(%s), check invalid when KernelTaskInfo %s", | |||
"kCustomAicpuArgsLen:%u, op:%s(%s), check invalid", | |||
context.args_offset().size(), kCustomAicpuArgsLen, | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(PARAM_INVALID, "context.args_offset().size() / sizeof(uint16_t) is less than kCustomAicpuArgsLen"); | |||
return PARAM_INVALID; | |||
} | |||
@@ -812,32 +811,32 @@ Status KernelTaskInfo::InitAICPUCustomTask(uint32_t op_index, const domi::Kernel | |||
// attrHandle | |||
Buffer buffer; | |||
if (!AttrUtils::GetBytes(op_desc, ATTR_NAME_OPATTR, buffer)) { | |||
REPORT_INNER_ERROR("E19999", "Get Attr:%s in op:%s(%s) fail when KernelTaskInfo %s", ATTR_NAME_OPATTR.c_str(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Get Attr:%s in op:%s(%s) fail", ATTR_NAME_OPATTR.c_str(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(FAILED, "can't find opattr bytes!."); | |||
return FAILED; | |||
} | |||
uint32_t op_attr_size = buffer.GetSize(); | |||
if (op_attr_size == 0) { | |||
REPORT_INNER_ERROR("E19999", "Attr:%s in op:%s(%s) size is 0, check invalid when KernelTaskInfo %s", | |||
ATTR_NAME_OPATTR.c_str(), op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Attr:%s in op:%s(%s) size is 0, check invalid", | |||
ATTR_NAME_OPATTR.c_str(), op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(PARAM_INVALID, "param op_attr_size is out of range"); | |||
return PARAM_INVALID; | |||
} | |||
rtError_t rt_ret = rtMalloc(&custom_info_.attr_handle, op_attr_size, RT_MEMORY_HBM); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed for op:%s(%s), size:%u, ret:0x%X, when KernelTaskInfo %s", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), op_attr_size, rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed for op:%s(%s), size:%u, ret:0x%X", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), op_attr_size, rt_ret); | |||
GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
rt_ret = rtMemcpy(custom_info_.attr_handle, op_attr_size, buffer.GetData(), op_attr_size, RT_MEMCPY_HOST_TO_DEVICE); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed for op:%s(%s), size:%u, ret:0x%X, when KernelTaskInfo %s", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), op_attr_size, rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed for op:%s(%s), size:%u, ret:0x%X", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), op_attr_size, rt_ret); | |||
GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -848,9 +847,9 @@ Status KernelTaskInfo::InitAICPUCustomTask(uint32_t op_index, const domi::Kernel | |||
for (uint32_t i = 0; i < kCustomAicpuArgsLen; ++i) { | |||
if (kernel_def.args().size() < ((size_t)ctx_.argsOffset[i] + sizeof(uint64_t))) { | |||
REPORT_INNER_ERROR("E19999", "ctx.argsOffset[%u]: %u + sizeof(uint64_t): %zu >= kernelDef.args().size():%zu, " | |||
"op:%s(%s) check invalid when KernelTaskInfo %s", i, (uint32_t)ctx_.argsOffset[i], | |||
"op:%s(%s) check invalid", i, (uint32_t)ctx_.argsOffset[i], | |||
sizeof(uint64_t), kernel_def.args().size(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(FAILED, "ctx.argsOffset[%u]: %u + sizeof(uint64_t): %zu >= kernelDef.args().size():%zu", i, | |||
(uint32_t)ctx_.argsOffset[i], sizeof(uint64_t), kernel_def.args().size()); | |||
return FAILED; | |||
@@ -869,8 +868,8 @@ Status KernelTaskInfo::InitAICPUCustomTask(uint32_t op_index, const domi::Kernel | |||
rt_ret = rtMalloc(&args_, args_size_, RT_MEMORY_HBM); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed for op:%s(%s), size:%u, ret:0x%X, when KernelTaskInfo %s", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), args_size_, rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed for op:%s(%s), size:%u, ret:0x%X", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), args_size_, rt_ret); | |||
GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -878,9 +877,9 @@ Status KernelTaskInfo::InitAICPUCustomTask(uint32_t op_index, const domi::Kernel | |||
rt_ret = rtMemcpy(args_, kernel_def.args_size(), kernel_def.args().data(), kernel_def.args_size(), | |||
RT_MEMCPY_HOST_TO_DEVICE); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed for op:%s(%s), size:%u, ret:0x%X, when KernelTaskInfo %s", | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed for op:%s(%s), size:%u, ret:0x%X", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), | |||
kernel_def.args_size(), rt_ret, __FUNCTION__); | |||
kernel_def.args_size(), rt_ret); | |||
GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -895,7 +894,7 @@ Status KernelTaskInfo::InitAICPUCustomTask(uint32_t op_index, const domi::Kernel | |||
Status KernelTaskInfo::InitCceTask(const domi::KernelDef &kernel_def) { | |||
GELOGI("Do InitCCETask"); | |||
if (davinci_model_ == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Check param davinci_model nullptr when KernelTaskInfo %s", __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Check param davinci_model nullptr"); | |||
GELOGE(PARAM_INVALID, "davinci_model is null!"); | |||
return PARAM_INVALID; | |||
} | |||
@@ -910,8 +909,7 @@ Status KernelTaskInfo::InitCceTask(const domi::KernelDef &kernel_def) { | |||
if (context.is_flowtable()) { | |||
if (flowtable.empty()) { | |||
REPORT_INNER_ERROR("E19999", "kernel_def.flowtable is empty, check invalid when KernelTaskInfo %s", | |||
__FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "kernel_def.flowtable is empty, check invalid"); | |||
GELOGE(FAILED, "flowtable is null."); | |||
return FAILED; | |||
} | |||
@@ -946,8 +944,8 @@ Status KernelTaskInfo::InitCceTask(const domi::KernelDef &kernel_def) { | |||
// args | |||
rtError_t rt_ret = rtMalloc(&args_, kernel_def.args_size(), RT_MEMORY_HBM); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%u, ret:0x%X, when KernelTaskInfo %s", | |||
kernel_def.args_size(), rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%u, ret:0x%X", | |||
kernel_def.args_size(), rt_ret); | |||
GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -956,8 +954,8 @@ Status KernelTaskInfo::InitCceTask(const domi::KernelDef &kernel_def) { | |||
rt_ret = rtMemcpy(args_, kernel_def.args_size(), kernel_def.args().data(), kernel_def.args_size(), | |||
RT_MEMCPY_HOST_TO_DEVICE); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%u, ret:0x%X, when KernelTaskInfo %s", | |||
kernel_def.args_size(), rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%u, ret:0x%X", | |||
kernel_def.args_size(), rt_ret); | |||
GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -966,16 +964,16 @@ Status KernelTaskInfo::InitCceTask(const domi::KernelDef &kernel_def) { | |||
if (!sm_desc.empty()) { | |||
rt_ret = rtMemAllocManaged(&sm_desc_, sm_desc.size(), RT_MEMORY_SPM); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMemAllocManaged failed, ret:0x%X, when KernelTaskInfo %s", | |||
rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMemAllocManaged failed, ret:0x%X", | |||
rt_ret); | |||
GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
rt_ret = rtMemcpy(sm_desc_, sm_desc.size(), sm_desc.data(), sm_desc.size(), RT_MEMCPY_HOST_TO_DEVICE); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret:0x%X, when KernelTaskInfo %s", | |||
sm_desc.size(), rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret:0x%X", | |||
sm_desc.size(), rt_ret); | |||
GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -990,8 +988,8 @@ Status KernelTaskInfo::InitAicpuTask(uint32_t op_index, const domi::KernelDef &k | |||
OpDescPtr op_desc = davinci_model_->GetOpByIndex(op_index); | |||
if (op_desc == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Can't get op_desc from davinci_model by index:%u when KernelTaskInfo %s", | |||
op_index, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Can't get op_desc from davinci_model by index:%u", | |||
op_index); | |||
GELOGE(INTERNAL_ERROR, "index is out of range, index: %u", op_index); | |||
return INTERNAL_ERROR; | |||
} | |||
@@ -1009,8 +1007,8 @@ Status KernelTaskInfo::InitAicpuTask(uint32_t op_index, const domi::KernelDef &k | |||
GE_PRINT_DYNAMIC_MEMORY(new, "cce task physical memory.", sizeof(uint8_t) * args_size_) | |||
errno_t sec_ret = memcpy_s(args_addr.get(), args_size_, kernel_def.args().data(), args_size_); | |||
if (sec_ret != EOK) { | |||
REPORT_CALL_ERROR("E19999", "Call memcpy_s fail, size:%u, ret:0x%X, when KernelTaskInfo %s", | |||
args_size_, sec_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call memcpy_s fail, size:%u, ret:0x%X", | |||
args_size_, sec_ret); | |||
GELOGE(FAILED, "memcpy failed, ret: %d", sec_ret); | |||
return FAILED; | |||
} | |||
@@ -1045,8 +1043,8 @@ Status KernelTaskInfo::InitAicpuTask(uint32_t op_index, const domi::KernelDef &k | |||
auto addrs_size = sizeof(uint64_t) * io_addrs.size(); | |||
sec_ret = memcpy_s(reinterpret_cast<void *>(io_addr), addrs_size, io_addrs.data(), addrs_size); | |||
if (sec_ret != EOK) { | |||
REPORT_CALL_ERROR("E19999", "Call memcpy_s fail, size:%lu, ret:0x%X, when KernelTaskInfo %s", | |||
addrs_size, sec_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call memcpy_s fail, size:%lu, ret:0x%X", | |||
addrs_size, sec_ret); | |||
GELOGE(FAILED, "memcpy failed, ret: %d", sec_ret); | |||
return FAILED; | |||
} | |||
@@ -1055,8 +1053,8 @@ Status KernelTaskInfo::InitAicpuTask(uint32_t op_index, const domi::KernelDef &k | |||
// malloc device memory for args | |||
rtError_t rt_ret = rtMalloc(static_cast<void **>(&args_), args_size_, RT_MEMORY_HBM); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed for op:%s(%s), size:%u, ret:0x%X, when KernelTaskInfo %s", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), args_size_, rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed for op:%s(%s), size:%u, ret:0x%X", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), args_size_, rt_ret); | |||
GELOGE(RT_FAILED, "Call rt api(rtMalloc) failed, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -1065,8 +1063,8 @@ Status KernelTaskInfo::InitAicpuTask(uint32_t op_index, const domi::KernelDef &k | |||
// copy args to device | |||
rt_ret = rtMemcpy(args_, args_size_, args_addr.get(), args_size_, RT_MEMCPY_HOST_TO_DEVICE); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed for op:%s(%s), size:%u, ret:0x%X, when KernelTaskInfo %s", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), args_size_, rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed for op:%s(%s), size:%u, ret:0x%X", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), args_size_, rt_ret); | |||
GELOGE(RT_FAILED, "Call rt api(rtMemcpy) failed, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -1138,18 +1136,18 @@ Status KernelTaskInfo::InitAicpuTaskExtInfo(const std::string &ext_info) { | |||
} | |||
auto rt_ret = rtMalloc(&aicpu_ext_info_addr_, ext_handle->GetExtInfoLen(), RT_MEMORY_HBM); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed for op:%s(%s), size:%zu, ret:0x%X, when KernelTaskInfo %s", | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed for op:%s(%s), size:%zu, ret:0x%X", | |||
op_desc_->GetName().c_str(), op_desc_->GetType().c_str(), | |||
ext_handle->GetExtInfoLen(), rt_ret, __FUNCTION__); | |||
ext_handle->GetExtInfoLen(), rt_ret); | |||
GELOGE(RT_FAILED, "rtMalloc ext_info error: 0x%X, size=%zu", rt_ret, ext_info.size()); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
rt_ret = rtMemcpy(aicpu_ext_info_addr_, ext_handle->GetExtInfoLen(), ext_handle->GetExtInfo(), | |||
ext_handle->GetExtInfoLen(), RT_MEMCPY_HOST_TO_DEVICE); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed for op:%s(%s), size:%zu, ret:0x%X, when KernelTaskInfo %s", | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed for op:%s(%s), size:%zu, ret:0x%X", | |||
op_desc_->GetName().c_str(), op_desc_->GetType().c_str(), | |||
ext_handle->GetExtInfoLen(), rt_ret, __FUNCTION__); | |||
ext_handle->GetExtInfoLen(), rt_ret); | |||
GELOGE(RT_FAILED, "rtMemcpy ext_info error: 0x%X, size=%zu", rt_ret, ext_info.size()); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -1167,8 +1165,8 @@ Status KernelTaskInfo::StoreInputOutputTensor(const std::vector<void *> &input_d | |||
// inputDescs | |||
rtError_t rt_ret = rtMalloc(&custom_info_.input_descs, sizeof(opTensor_t) * input_size, RT_MEMORY_HBM); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%zu, ret:0x%X, when KernelTaskInfo %s", | |||
sizeof(opTensor_t) * input_size, rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%zu, ret:0x%X", | |||
sizeof(opTensor_t) * input_size, rt_ret); | |||
GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -1177,8 +1175,8 @@ Status KernelTaskInfo::StoreInputOutputTensor(const std::vector<void *> &input_d | |||
rt_ret = rtMemcpy(static_cast<opTensor_t *>(custom_info_.input_descs) + i, sizeof(opTensor_t), | |||
const_cast<tagOpTensor *>(&input_descs[i]), sizeof(opTensor_t), RT_MEMCPY_HOST_TO_DEVICE); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret:0x%X, when KernelTaskInfo %s", | |||
sizeof(opTensor_t), rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret:0x%X", | |||
sizeof(opTensor_t), rt_ret); | |||
GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -1187,8 +1185,8 @@ Status KernelTaskInfo::StoreInputOutputTensor(const std::vector<void *> &input_d | |||
// inputAddrs | |||
rt_ret = rtMalloc(&custom_info_.input_addrs, sizeof(opTensor_t) * input_size, RT_MEMORY_HBM); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%zu, ret:0x%X, when KernelTaskInfo %s", | |||
sizeof(opTensor_t) * input_size, rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%zu, ret:0x%X", | |||
sizeof(opTensor_t) * input_size, rt_ret); | |||
GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -1197,8 +1195,8 @@ Status KernelTaskInfo::StoreInputOutputTensor(const std::vector<void *> &input_d | |||
rt_ret = rtMemcpy(custom_info_.input_addrs, kAddrLen * input_size, &input_data_addrs[0], kAddrLen * input_size, | |||
RT_MEMCPY_HOST_TO_DEVICE); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret:0x%X, when KernelTaskInfo %s", | |||
kAddrLen * input_size, rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret:0x%X", | |||
kAddrLen * input_size, rt_ret); | |||
GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -1207,8 +1205,8 @@ Status KernelTaskInfo::StoreInputOutputTensor(const std::vector<void *> &input_d | |||
// outputDescs | |||
rt_ret = rtMalloc(&custom_info_.output_descs, sizeof(opTensor_t) * output_size, RT_MEMORY_HBM); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%zu, ret:0x%X, when KernelTaskInfo %s", | |||
sizeof(opTensor_t) * output_size, rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%zu, ret:0x%X", | |||
sizeof(opTensor_t) * output_size, rt_ret); | |||
GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -1216,8 +1214,8 @@ Status KernelTaskInfo::StoreInputOutputTensor(const std::vector<void *> &input_d | |||
rt_ret = rtMemcpy(static_cast<opTensor_t *>(custom_info_.output_descs) + i, sizeof(opTensor_t), | |||
const_cast<tagOpTensor *>(&input_descs[i]), sizeof(opTensor_t), RT_MEMCPY_HOST_TO_DEVICE); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret:0x%X, when KernelTaskInfo %s", | |||
sizeof(opTensor_t), rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret:0x%X", | |||
sizeof(opTensor_t), rt_ret); | |||
GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -1226,8 +1224,8 @@ Status KernelTaskInfo::StoreInputOutputTensor(const std::vector<void *> &input_d | |||
// outputAddrs | |||
rt_ret = rtMalloc(&custom_info_.output_addrs, sizeof(opTensor_t) * output_size, RT_MEMORY_HBM); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%zu, ret:0x%X, when KernelTaskInfo %s", | |||
sizeof(opTensor_t) * output_size, rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%zu, ret:0x%X", | |||
sizeof(opTensor_t) * output_size, rt_ret); | |||
GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -1236,8 +1234,8 @@ Status KernelTaskInfo::StoreInputOutputTensor(const std::vector<void *> &input_d | |||
rt_ret = rtMemcpy(custom_info_.output_addrs, kAddrLen * output_size, &output_data_addrs[0], kAddrLen * output_size, | |||
RT_MEMCPY_HOST_TO_DEVICE); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret:0x%X, when KernelTaskInfo %s", | |||
kAddrLen * output_size, rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret:0x%X", | |||
kAddrLen * output_size, rt_ret); | |||
GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -1254,16 +1252,15 @@ Status KernelTaskInfo::SetContext(const domi::KernelDef &kernel_def) { | |||
ctx_.isFlowtable = context.is_flowtable(); | |||
ctx_.argsCount = context.args_count(); | |||
if (ctx_.argsCount == 0) { | |||
REPORT_INNER_ERROR("E19999", "kernel_def.context.args_count is 0, check invalid when KernelTaskInfo %s", | |||
__FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "kernel_def.context.args_count is 0, check invalid"); | |||
GELOGE(INTERNAL_ERROR, "check argsCount fail:%u.", ctx_.argsCount); | |||
return INTERNAL_ERROR; | |||
} | |||
if (context.args_offset().size() / sizeof(uint16_t) < ctx_.argsCount) { | |||
REPORT_INNER_ERROR("E19999", "param [context.args_offset().size():%zu / sizeof(uint16_t)] " | |||
"is less than [ctx_.argsCount:%u], check invalid when KernelTaskInfo %s", | |||
context.args_offset().size(), ctx_.argsCount, __FUNCTION__); | |||
"is less than [ctx_.argsCount:%u], check invalid", | |||
context.args_offset().size(), ctx_.argsCount); | |||
GELOGE(PARAM_INVALID, "param [context.args_offset().size() / sizeof(uint16_t)] is less than [ctx_.argsCount]"); | |||
return PARAM_INVALID; | |||
} | |||
@@ -1271,8 +1268,8 @@ Status KernelTaskInfo::SetContext(const domi::KernelDef &kernel_def) { | |||
// ctx_.argsOffset stores the offset of the internal information of agrs_, equal to the ctx_.argsCount | |||
ctx_.argsOffset = new (std::nothrow) uint16_t[ctx_.argsCount](); | |||
if (ctx_.argsOffset == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "New ctx_.argsOffset fail, size:%u, when KernelTaskInfo %s", | |||
ctx_.argsCount, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "New ctx_.argsOffset fail, size:%u", | |||
ctx_.argsCount); | |||
GELOGE(PARAM_INVALID, "(param [ctx_.argsOffset] must not be null."); | |||
return PARAM_INVALID; | |||
} | |||
@@ -1290,7 +1287,7 @@ void KernelTaskInfo::FreeRtMem(void **ptr) { | |||
} | |||
rtError_t ret = rtFree(*ptr); | |||
if (ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtFree failed, ret:0x%X, when KernelTaskInfo %s", ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtFree failed, ret:0x%X", ret); | |||
GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", ret); | |||
} | |||
@@ -1338,8 +1335,8 @@ Status KernelTaskInfo::CceUpdateKernelArgs(const domi::KernelContext &context, u | |||
if (handle == nullptr) { | |||
error = mmDlerror(); | |||
GE_IF_BOOL_EXEC(error == nullptr, error = ""); | |||
REPORT_INNER_ERROR("E19999", "Failed in dlopen:%s, dlerror:%s, when KernelTaskInfo %s", | |||
canonicalPath.c_str(), error, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Failed in dlopen:%s, dlerror:%s", | |||
canonicalPath.c_str(), error); | |||
GELOGE(GE_PLGMGR_SO_NOT_EXIST, "Failed in dlopen %s! ", error); | |||
return FAILED; | |||
} | |||
@@ -1348,8 +1345,8 @@ Status KernelTaskInfo::CceUpdateKernelArgs(const domi::KernelContext &context, u | |||
auto cceUpdateKernelArgs = (ccStatus_t(*)(ccOpContext &, uint64_t, uint64_t, | |||
uint64_t, void *, uint64_t, void *))mmDlsym(handle, const_cast<char *>(update_kernel_args.c_str())); | |||
if (cceUpdateKernelArgs == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "No symbol:%s in %s, check invalid when KernelTaskInfo %s", | |||
update_kernel_args.c_str(), canonicalPath.c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "No symbol:%s in %s, check invalid", | |||
update_kernel_args.c_str(), canonicalPath.c_str()); | |||
GELOGE(FAILED, "Failed to invoke function ccUpdateKernelArgs"); | |||
if (mmDlclose(handle) != 0) { | |||
error = mmDlerror(); | |||
@@ -1374,8 +1371,8 @@ Status KernelTaskInfo::CceUpdateKernelArgs(const domi::KernelContext &context, u | |||
return FAILED; | |||
} | |||
if (cc_ret != CC_STATUS_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Call cceUpdateKernelArgs fail, ret:0x%X, when KernelTaskInfo %s", | |||
cc_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call cceUpdateKernelArgs fail, ret:0x%X", | |||
cc_ret); | |||
GELOGE(CCE_FAILED, "Call cce api failed, ret: 0x%X", cc_ret); | |||
return CCE_FAILED; | |||
} | |||
@@ -1389,8 +1386,8 @@ Status KernelTaskInfo::SetFlowtable(std::string &flowtable, const domi::KernelDe | |||
if (context.is_flowtable()) { | |||
rtError_t rt_ret = rtMalloc(&flowtable_, flowtable.size(), RT_MEMORY_HBM); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%zu, ret:0x%X, when KernelTaskInfo %s", | |||
flowtable.size(), rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%zu, ret:0x%X", | |||
flowtable.size(), rt_ret); | |||
GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -1398,8 +1395,8 @@ Status KernelTaskInfo::SetFlowtable(std::string &flowtable, const domi::KernelDe | |||
rt_ret = rtMemcpy(flowtable_, flowtable.size(), flowtable.data(), flowtable.size(), RT_MEMCPY_HOST_TO_DEVICE); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret:0x%X, when KernelTaskInfo %s", | |||
flowtable.size(), rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret:0x%X", | |||
flowtable.size(), rt_ret); | |||
GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -1411,9 +1408,9 @@ Status KernelTaskInfo::SetFlowtable(std::string &flowtable, const domi::KernelDe | |||
((reinterpret_cast<uint16_t *>(const_cast<char *>(context.args_offset().data())))[0] + sizeof(uint64_t))) { | |||
REPORT_INNER_ERROR( | |||
"E19999", "(context.args_offset().data()))[0]:%u + sizeof(uint64_t):%zu > " | |||
"kernelDef.args().size():%zu, check invalid when %s", | |||
"kernelDef.args().size():%zu, check invalid", | |||
(uint32_t)((reinterpret_cast<uint16_t *>(const_cast<char *>(context.args_offset().data())))[0]), | |||
sizeof(uint64_t), kernel_def.args().size(), __FUNCTION__); | |||
sizeof(uint64_t), kernel_def.args().size()); | |||
GELOGE(FAILED, "(context.args_offset().data()))[0]:%u + sizeof(uint64_t):%zu > kernelDef.args().size():%zu", | |||
(uint32_t)((reinterpret_cast<uint16_t *>(const_cast<char *>(context.args_offset().data())))[0]), | |||
sizeof(uint64_t), kernel_def.args().size()); | |||
@@ -38,17 +38,17 @@ Status LabelGotoExTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *da | |||
const domi::LabelGotoExDef &label_goto = task_def.label_goto_ex(); | |||
OpDescPtr op_desc = davinci_model->GetOpByIndex(label_goto.op_index()); | |||
if (op_desc == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Can't get op_desc from davinci_model by index:%u when LabelGotoExTaskInfo %s", | |||
label_goto.op_index(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Can't get op_desc from davinci_model by index:%u", | |||
label_goto.op_index()); | |||
GELOGE(INTERNAL_ERROR, "Task op index:%u out of range!", label_goto.op_index()); | |||
return INTERNAL_ERROR; | |||
} | |||
uint32_t label_index = 0; | |||
if (!AttrUtils::GetInt(op_desc, ATTR_NAME_LABEL_SWITCH_INDEX, label_index)) { | |||
REPORT_INNER_ERROR("E19999", "Get Attr:%s in op:%s(%s) fail when LabelGotoExTaskInfo %s", | |||
REPORT_INNER_ERROR("E19999", "Get Attr:%s in op:%s(%s) fail", | |||
ATTR_NAME_LABEL_SWITCH_INDEX.c_str(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(INTERNAL_ERROR, "LabelGotoExTaskInfo: %s attr [%s] not exist.", | |||
op_desc->GetName().c_str(), ATTR_NAME_LABEL_SWITCH_INDEX.c_str()); | |||
return INTERNAL_ERROR; | |||
@@ -61,8 +61,8 @@ Status LabelGotoExTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *da | |||
rtError_t rt_ret = rtMalloc(&index_value_, sizeof(uint64_t), memory_type); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed for op:%s(%s), size:%lu, ret:0x%X, when LabelGotoExTaskInfo %s", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), sizeof(uint64_t), rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed for op:%s(%s), size:%lu, ret:0x%X", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), sizeof(uint64_t), rt_ret); | |||
GELOGE(RT_FAILED, "Call rtMalloc failed, error: %#x", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -70,8 +70,8 @@ Status LabelGotoExTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *da | |||
uint64_t branch_index = 0; | |||
rt_ret = rtMemcpy(index_value_, sizeof(uint64_t), &branch_index, sizeof(uint64_t), RT_MEMCPY_HOST_TO_DEVICE); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed for op:%s(%s), size:%lu, ret:0x%X, when LabelGotoExTaskInfo %s", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), sizeof(uint64_t), rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed for op:%s(%s), size:%lu, ret:0x%X", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), sizeof(uint64_t), rt_ret); | |||
GELOGE(RT_FAILED, "Call rtMemcpy failed, error: %#x", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -85,15 +85,15 @@ Status LabelGotoExTaskInfo::Distribute() { | |||
GE_CHECK_NOTNULL(args_); | |||
GE_CHECK_NOTNULL(index_value_); | |||
if (args_size_ == 0) { | |||
REPORT_INNER_ERROR("E19999", "Param args_size_ is 0, check fail when LabelGotoExTaskInfo %s", __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Param args_size_ is 0, check fail"); | |||
GELOGE(PARAM_INVALID, "branch max: %u, args size: %u invalid.", kGotoBranchMax, args_size_); | |||
return PARAM_INVALID; | |||
} | |||
rtError_t rt_ret = rtLabelSwitchByIndex(index_value_, kGotoBranchMax, args_, stream_); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtLabelSwitchByIndex failed, ret:0x%X, when LabelGotoExTaskInfo %s", | |||
rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtLabelSwitchByIndex failed, ret:0x%X", | |||
rt_ret); | |||
GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -32,17 +32,17 @@ Status LabelSetTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *davin | |||
const domi::LabelSetDef &label_set = task_def.label_set(); | |||
OpDescPtr op_desc = davinci_model->GetOpByIndex(label_set.op_index()); | |||
if (op_desc == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Can't get op_desc from davinci_model by index:%u when LabelSetTaskInfo %s", | |||
label_set.op_index(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Can't get op_desc from davinci_model by index:%u", | |||
label_set.op_index()); | |||
GELOGE(INTERNAL_ERROR, "Task op index:%u out of range!", label_set.op_index()); | |||
return INTERNAL_ERROR; | |||
} | |||
uint32_t label_index = 0; | |||
if (!AttrUtils::GetInt(op_desc, ATTR_NAME_LABEL_SWITCH_INDEX, label_index)) { | |||
REPORT_INNER_ERROR("E19999", "Get Attr:%s in op:%s(%s) fail when LabelSetTaskInfo %s", | |||
REPORT_INNER_ERROR("E19999", "Get Attr:%s in op:%s(%s) fail", | |||
ATTR_NAME_LABEL_SWITCH_INDEX.c_str(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(INTERNAL_ERROR, "LabelSetTaskInfo: %s attr [%s] not exist.", | |||
op_desc->GetName().c_str(), ATTR_NAME_LABEL_SWITCH_INDEX.c_str()); | |||
return INTERNAL_ERROR; | |||
@@ -51,8 +51,8 @@ Status LabelSetTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *davin | |||
const vector<rtLabel_t> &label_list = davinci_model->GetLabelList(); | |||
if (label_index >= label_list.size()) { | |||
REPORT_INNER_ERROR("E19999", "lable_index:%u >= label_list.size():%zu in model, op:%s(%s), " | |||
"check invalid when LabelSetTaskInfo %s", label_index, label_list.size(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); | |||
"check invalid", label_index, label_list.size(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(INTERNAL_ERROR, "LabelSetTaskInfo: Invalid label id:%u, label size:%zu", label_index, label_list.size()); | |||
return INTERNAL_ERROR; | |||
} | |||
@@ -66,8 +66,8 @@ Status LabelSetTaskInfo::Distribute() { | |||
GELOGI("LabelSetTaskInfo Distribute Start."); | |||
rtError_t rt_ret = rtLabelSet(label_, stream_); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtLabelSet failed, ret:0x%X, when LabelSetTaskInfo %s", | |||
rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtLabelSet failed, ret:0x%X", | |||
rt_ret); | |||
GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -39,8 +39,8 @@ Status LabelSwitchByIndexTaskInfo::Init(const domi::TaskDef &task_def, DavinciMo | |||
const domi::LabelSwitchByIndexDef &label_switch = task_def.label_switch_by_index(); | |||
OpDescPtr op_desc = davinci_model->GetOpByIndex(label_switch.op_index()); | |||
if (op_desc == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Can't get op_desc from davinci_model by index:%u when LabelSwitchByIndexTaskInfo %s", | |||
label_switch.op_index(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Can't get op_desc from davinci_model by index:%u", | |||
label_switch.op_index()); | |||
GELOGE(INTERNAL_ERROR, "Task op index:%u out of range!", label_switch.op_index()); | |||
return INTERNAL_ERROR; | |||
} | |||
@@ -50,8 +50,8 @@ Status LabelSwitchByIndexTaskInfo::Init(const domi::TaskDef &task_def, DavinciMo | |||
auto input_data_addr = ModelUtils::GetInputDataAddrs(davinci_model->GetRuntimeParam(), op_desc); | |||
if (input_data_addr.size() != kLabelSwitchIndexNum) { | |||
REPORT_INNER_ERROR("E19999", "input_data_addr size:%zu != kLabelSwitchIndexNum:%u, op:%s(%s), " | |||
"check invalid when LabelSwitchByIndexTaskInfo %s", input_data_addr.size(), kLabelSwitchIndexNum, | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); | |||
"check invalid", input_data_addr.size(), kLabelSwitchIndexNum, | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(INTERNAL_ERROR, "LabelSwitchByIndexTaskInfo: %s invalid addr size: %zu, num: %u!", | |||
op_desc->GetName().c_str(), input_data_addr.size(), kLabelSwitchIndexNum); | |||
return INTERNAL_ERROR; | |||
@@ -67,9 +67,9 @@ Status LabelSwitchByIndexTaskInfo::Init(const domi::TaskDef &task_def, DavinciMo | |||
vector<uint32_t> label_idx_list; | |||
if (!AttrUtils::GetListInt(op_desc, ATTR_NAME_LABEL_SWITCH_LIST, label_idx_list)) { | |||
REPORT_INNER_ERROR("E19999", "Get Attr:%s in op:%s(%s) fail when LabelSwitchByIndexTaskInfo %s", | |||
REPORT_INNER_ERROR("E19999", "Get Attr:%s in op:%s(%s) fail", | |||
ATTR_NAME_LABEL_SWITCH_LIST.c_str(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(INTERNAL_ERROR, "LabelSwitchByIndexTaskInfo: %s Get attr %s failed.", op_desc->GetName().c_str(), | |||
ATTR_NAME_LABEL_SWITCH_LIST.c_str()); | |||
return INTERNAL_ERROR; | |||
@@ -77,9 +77,9 @@ Status LabelSwitchByIndexTaskInfo::Init(const domi::TaskDef &task_def, DavinciMo | |||
if (label_idx_list.empty() || label_idx_list.size() != branch_max_) { | |||
REPORT_INNER_ERROR("E19999", "label_idx_list in op:%s(%s) is empty, or size:%zu != branch_max_:%u" | |||
"check invalid when LabelSwitchByIndexTaskInfo %s", | |||
"check invalid", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), | |||
label_idx_list.size(), branch_max_, __FUNCTION__); | |||
label_idx_list.size(), branch_max_); | |||
GELOGE(INTERNAL_ERROR, "LabelSwitchByIndexTaskInfo: %s label index size: %zu, task branch max: %u.", | |||
op_desc->GetName().c_str(), label_idx_list.size(), branch_max_); | |||
return INTERNAL_ERROR; | |||
@@ -91,8 +91,8 @@ Status LabelSwitchByIndexTaskInfo::Init(const domi::TaskDef &task_def, DavinciMo | |||
uint32_t label_id = label_idx_list[idx]; | |||
if (label_id >= label_list.size()) { | |||
REPORT_INNER_ERROR("E19999", "label_id:%u in op:%s(%s) >= label_list.size():%zu in model" | |||
"check invalid when LabelSwitchByIndexTaskInfo %s", label_id, | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), label_list.size(), __FUNCTION__); | |||
"check invalid", label_id, | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), label_list.size()); | |||
GELOGE(INTERNAL_ERROR, "LabelSwitchByIndexTaskInfo: %s index: %zu, label index: %u, model label size: %zu.", | |||
op_desc->GetName().c_str(), idx, label_id, label_list.size()); | |||
return INTERNAL_ERROR; | |||
@@ -106,17 +106,16 @@ Status LabelSwitchByIndexTaskInfo::Init(const domi::TaskDef &task_def, DavinciMo | |||
args_size_ = branch_max_ * sizeof(rtLabelDevInfo); | |||
rtError_t rt_ret = rtMalloc(&args_, args_size_, memory_type); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed for op:%s(%s), size:%u, ret:0x%X, " | |||
"when LabelSwitchByIndexTaskInfo %s", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), args_size_, rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed for op:%s(%s), size:%u, ret:0x%X", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), args_size_, rt_ret); | |||
GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
rt_ret = rtLabelListCpy(label_used.data(), label_used.size(), args_, args_size_); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtLabelListCpy failed, ret:0x%X, when LabelSwitchByIndexTaskInfo %s", | |||
rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtLabelListCpy failed, ret:0x%X", | |||
rt_ret); | |||
GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -131,15 +130,15 @@ Status LabelSwitchByIndexTaskInfo::Distribute() { | |||
GE_CHECK_NOTNULL(index_value_); | |||
if (branch_max_ == 0 || args_size_ == 0) { | |||
REPORT_INNER_ERROR("E19999", "branch_max_:%u or args_size_:%u is 0" | |||
"check invalid when LabelSwitchByIndexTaskInfo %s", branch_max_, args_size_, __FUNCTION__); | |||
"check invalid", branch_max_, args_size_); | |||
GELOGE(PARAM_INVALID, "branch max: %u, args size: %u invalid.", branch_max_, args_size_); | |||
return PARAM_INVALID; | |||
} | |||
rtError_t rt_ret = rtLabelSwitchByIndex(index_value_, branch_max_, args_, stream_); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtLabelSwitchByIndex failed, ret:0x%X, when LabelSwitchByIndexTaskInfo %s", | |||
rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtLabelSwitchByIndex failed, ret:0x%X", | |||
rt_ret); | |||
GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -158,8 +157,8 @@ Status LabelSwitchByIndexTaskInfo::CalculateArgs(const domi::TaskDef &task_def, | |||
GELOGI("Calc opType[%s] args size. Node name is [%s]", op_desc->GetType().c_str(), op_desc->GetName().c_str()); | |||
if (op_desc->GetInputsSize() != kLabelSwitchIndexNum) { | |||
REPORT_INNER_ERROR("E19999", "input size:%zu in op:%s(%s) != kLabelSwitchIndexNum" | |||
"check invalid when LabelSwitchByIndexTaskInfo %s", op_desc->GetInputsSize(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); | |||
"check invalid", op_desc->GetInputsSize(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(FAILED, "Label switch op only have one data input. Now input size is %zu", op_desc->GetInputsSize()); | |||
return FAILED; | |||
} | |||
@@ -36,8 +36,8 @@ Status MemcpyAddrAsyncTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel | |||
const auto &memcpy_async = task_def.memcpy_async(); | |||
OpDescPtr op_desc = davinci_model->GetOpByIndex(memcpy_async.op_index()); | |||
if (op_desc == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Can't get op_desc from davinci_model by index:%u when MemcpyAddrAsyncTaskInfo %s", | |||
memcpy_async.op_index(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Can't get op_desc from davinci_model by index:%u", | |||
memcpy_async.op_index()); | |||
GELOGE(INTERNAL_ERROR, "Task op index:%u out of range", memcpy_async.op_index()); | |||
return INTERNAL_ERROR; | |||
} | |||
@@ -63,9 +63,9 @@ Status MemcpyAddrAsyncTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel | |||
GELOGI("memory_type: %u", memory_type); | |||
rtError_t rt_ret = rtMalloc(&args_, args_size + kAlignBytes, memory_type); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed for op:%s(%s), size:%lu, ret:0x%X, " | |||
"when MemcpyAddrAsyncTaskInfo %s", op_desc->GetName().c_str(), op_desc->GetType().c_str(), | |||
args_size + kAlignBytes, rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed for op:%s(%s), size:%lu, ret:0x%X", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), | |||
args_size + kAlignBytes, rt_ret); | |||
GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -76,9 +76,8 @@ Status MemcpyAddrAsyncTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel | |||
static_cast<uint8_t *>(args_align_) + args_size, dst_, io_addrs.size()); | |||
rt_ret = rtMemcpy(args_align_, args_size, io_addrs.data(), args_size, RT_MEMCPY_HOST_TO_DEVICE); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed for op:%s(%s), size:%zu, ret:0x%X, " | |||
"when MemcpyAddrAsyncTaskInfo %s", op_desc->GetName().c_str(), op_desc->GetType().c_str(), | |||
args_size, rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed for op:%s(%s), size:%zu, ret:0x%X", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), args_size, rt_ret); | |||
GELOGE(RT_FAILED, "Call rt api for src failed, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -99,8 +98,8 @@ Status MemcpyAddrAsyncTaskInfo::Distribute() { | |||
rtError_t rt_ret = rtMemcpyAsync(reinterpret_cast<void *>(reinterpret_cast<uintptr_t>(args_align_) + sizeof(void *)), | |||
dst_max_, args_align_, count_, static_cast<rtMemcpyKind_t>(kind_), stream_); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpyAsync failed, size:%lu, ret:0x%X, when MemcpyAddrAsyncTaskInfo %s", | |||
dst_max_, rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpyAsync failed, size:%lu, ret:0x%X", | |||
dst_max_, rt_ret); | |||
GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -36,8 +36,8 @@ Status MemcpyAsyncTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *da | |||
dst_max_ = memcpy_async.dst_max(); | |||
OpDescPtr op_desc = davinci_model_->GetOpByIndex(memcpy_async.op_index()); | |||
if (op_desc == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Can't get op_desc from davinci_model by index:%u when MemcpyAsyncTaskInfo %s", | |||
memcpy_async.op_index(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Can't get op_desc from davinci_model by index:%u", | |||
memcpy_async.op_index()); | |||
GELOGE(INTERNAL_ERROR, "Task op index:%u out of range", memcpy_async.op_index()); | |||
return INTERNAL_ERROR; | |||
} | |||
@@ -88,8 +88,8 @@ Status MemcpyAsyncTaskInfo::Distribute() { | |||
rtError_t rt_ret = rtMemcpyAsync(dst_, dst_max_, src_, count_, static_cast<rtMemcpyKind_t>(kind_), stream_); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpyAsync failed, size:%lu, ret:0x%X, when MemcpyAsyncTaskInfo %s", | |||
dst_max_, rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpyAsync failed, size:%lu, ret:0x%X", | |||
dst_max_, rt_ret); | |||
GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -24,7 +24,7 @@ namespace ge { | |||
Status ModelExitTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *davinci_model) { | |||
GELOGI("InitModelExitTaskInfo Init Start."); | |||
if (davinci_model == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Check param davinci_model nullptr when ModelExitTaskInfo %s", __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Check param davinci_model nullptr"); | |||
GELOGE(PARAM_INVALID, "davinci_model is null!"); | |||
return PARAM_INVALID; | |||
} | |||
@@ -44,8 +44,8 @@ Status ModelExitTaskInfo::Distribute() { | |||
GELOGI("ModelExitTaskInfo Distribute Start."); | |||
rtError_t rt_ret = rtModelExit(model_, stream_); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtModelExit failed, ret:0x%X, when ModelExitTaskInfo %s", | |||
rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtModelExit failed, ret:0x%X", | |||
rt_ret); | |||
GELOGE(RT_FAILED, "Call rtModelExit failed, ret: 0x%x", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -23,7 +23,7 @@ namespace ge { | |||
Status ProfilerTraceTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *davinci_model) { | |||
GELOGI("ProfilerTraceTaskInfo Init Start."); | |||
if (davinci_model == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Check param davinci_model nullptr when ProfilerTraceTaskInfo %s", __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Check param davinci_model nullptr"); | |||
GELOGE(PARAM_INVALID, "davinci_model is null!"); | |||
return PARAM_INVALID; | |||
} | |||
@@ -47,8 +47,8 @@ Status ProfilerTraceTaskInfo::Distribute() { | |||
rtError_t rt_ret = rtProfilerTrace(log_id_, notify_, flat_, stream_); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtProfilerTrace failed, ret:0x%X, when ProfilerTraceTaskInfo %s", | |||
rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtProfilerTrace failed, ret:0x%X", | |||
rt_ret); | |||
GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -26,7 +26,7 @@ namespace ge { | |||
Status StreamActiveTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *davinci_model) { | |||
GELOGI("StreamActiveTaskInfo Init Start."); | |||
if (davinci_model == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Check param davinci_model nullptr when StreamActiveTaskInfo %s", __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Check param davinci_model nullptr"); | |||
GELOGE(PARAM_INVALID, "davinci_model is null!"); | |||
return PARAM_INVALID; | |||
} | |||
@@ -46,17 +46,17 @@ Status StreamActiveTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *d | |||
GE_CHECK_NOTNULL(op_desc); | |||
std::vector<uint32_t> active_stream_index_list; | |||
if (!AttrUtils::GetListInt(op_desc, ATTR_NAME_ACTIVE_STREAM_LIST, active_stream_index_list)) { | |||
REPORT_INNER_ERROR("E19999", "Get Attr:%s in op:%s(%s) fail when StreamActiveTaskInfo %s", | |||
REPORT_INNER_ERROR("E19999", "Get Attr:%s in op:%s(%s) fail", | |||
ATTR_NAME_ACTIVE_STREAM_LIST.c_str(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(INTERNAL_ERROR, "StreamActiveOp get attr ACTIVE_STREAM fail, node name:%s.", op_desc->GetName().c_str()); | |||
return INTERNAL_ERROR; | |||
} | |||
if (internal_index >= active_stream_index_list.size()) { | |||
REPORT_INNER_ERROR("E19999", "flowctrl index:%u >= active_stream_list size:%zu in op:%s(%s), " | |||
"check invalid when StreamActiveTaskInfo %s", internal_index, active_stream_index_list.size(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); | |||
"check invalid", internal_index, active_stream_index_list.size(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(INTERNAL_ERROR, "InitStreamSwitchTaskInfo stream id index invalid. index:%u, list size:%zu.", internal_index, | |||
active_stream_index_list.size()); | |||
return INTERNAL_ERROR; | |||
@@ -64,9 +64,8 @@ Status StreamActiveTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *d | |||
if (active_stream_index_list[internal_index] >= davinci_model->GetStreamList().size()) { | |||
REPORT_INNER_ERROR("E19999", "active_stream_index:%u in op:%s(%s) >= stream size:%zu in model, " | |||
"check invalid when StreamActiveTaskInfo %s", active_stream_index_list[internal_index], | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), davinci_model->GetStreamList().size(), | |||
__FUNCTION__); | |||
"check invalid", active_stream_index_list[internal_index], | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), davinci_model->GetStreamList().size()); | |||
GELOGE(INTERNAL_ERROR, "InitStreamSwitchTaskInfo stream index invalid. index:%u, stream list size:%zu.", | |||
active_stream_index_list[internal_index], davinci_model->GetStreamList().size()); | |||
return INTERNAL_ERROR; | |||
@@ -84,8 +83,8 @@ Status StreamActiveTaskInfo::Distribute() { | |||
GELOGI("StreamActiveTaskInfo Distribute Start."); | |||
rtError_t rt_ret = rtStreamActive(active_stream_, stream_); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtStreamActive failed, ret:0x%X, when StreamActiveTaskInfo %s", | |||
rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtStreamActive failed, ret:0x%X", | |||
rt_ret); | |||
GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -31,7 +31,7 @@ const uint32_t kTrueBranchStreamNum = 1; | |||
Status StreamSwitchTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *davinci_model) { | |||
GELOGI("StreamSwitchTaskInfo Init Start."); | |||
if (davinci_model == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Check param davinci_model nullptr when StreamSwitchTaskInfo %s", __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Check param davinci_model nullptr"); | |||
GELOGE(PARAM_INVALID, "davinci_model is null!"); | |||
return PARAM_INVALID; | |||
} | |||
@@ -50,9 +50,9 @@ Status StreamSwitchTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *d | |||
SetInputAndValuePtr(davinci_model, input_data_addr); | |||
uint32_t cond = 0; | |||
if (!AttrUtils::GetInt(op_desc, ATTR_NAME_STREAM_SWITCH_COND, cond)) { | |||
REPORT_INNER_ERROR("E19999", "Get Attr:%s in op:%s(%s) fail when StreamSwitchTaskInfo %s", | |||
REPORT_INNER_ERROR("E19999", "Get Attr:%s in op:%s(%s) fail", | |||
ATTR_NAME_STREAM_SWITCH_COND.c_str(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(INTERNAL_ERROR, "StreamSwitchOp get attr STREAM_SWITCH_COND fail."); | |||
return INTERNAL_ERROR; | |||
} | |||
@@ -61,8 +61,8 @@ Status StreamSwitchTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *d | |||
size_t input_size = op_desc->GetInputsSize(); | |||
if (input_data_addr.size() != STREAM_SWITCH_INPUT_NUM || input_size != STREAM_SWITCH_INPUT_NUM) { | |||
REPORT_INNER_ERROR("E19999", "input_data_addr.size():%zu or input size:%zu != STREAM_SWITCH_INPUT_NUM:%u " | |||
"in op:%s(%s), check invalid when StreamSwitchTaskInfo %s", input_data_addr.size(), input_size, | |||
STREAM_SWITCH_INPUT_NUM, op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); | |||
"in op:%s(%s), check invalid", input_data_addr.size(), input_size, | |||
STREAM_SWITCH_INPUT_NUM, op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Input num should be %u. inputAddr size:%zu, inputDesc size:%zu.", | |||
STREAM_SWITCH_INPUT_NUM, input_data_addr.size(), input_size); | |||
return INTERNAL_ERROR; | |||
@@ -70,17 +70,17 @@ Status StreamSwitchTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *d | |||
vector<uint32_t> active_stream_list; | |||
if (!AttrUtils::GetListInt(op_desc, ATTR_NAME_ACTIVE_STREAM_LIST, active_stream_list)) { | |||
REPORT_INNER_ERROR("E19999", "Get Attr:%s in op:%s(%s) fail when StreamSwitchTaskInfo %s", | |||
REPORT_INNER_ERROR("E19999", "Get Attr:%s in op:%s(%s) fail", | |||
ATTR_NAME_ACTIVE_STREAM_LIST.c_str(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(INTERNAL_ERROR, "StreamSwitchOp get attr ACTIVE_STREAM_LIST fail."); | |||
return INTERNAL_ERROR; | |||
} | |||
if (active_stream_list.size() != kTrueBranchStreamNum) { | |||
REPORT_INNER_ERROR("E19999", "active_stream_list.size():%zu in op:%s(%s) != kTrueBranchStreamNum:%u, " | |||
"check invalid when StreamSwitchTaskInfo %s", active_stream_list.size(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), kTrueBranchStreamNum, __FUNCTION__); | |||
"check invalid", active_stream_list.size(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), kTrueBranchStreamNum); | |||
GELOGE(FAILED, "Stream num of switch true branch must be %u.", kTrueBranchStreamNum); | |||
return FAILED; | |||
} | |||
@@ -88,9 +88,8 @@ Status StreamSwitchTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *d | |||
size_t true_stream_index = active_stream_list.front(); | |||
if (true_stream_index >= davinci_model->GetStreamList().size()) { | |||
REPORT_INNER_ERROR("E19999", "active_stream_index:%zu in op:%s(%s) >= stream list size:%zu in model," | |||
"check invalid when StreamSwitchTaskInfo %s", true_stream_index, | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), davinci_model->GetStreamList().size(), | |||
__FUNCTION__); | |||
"check invalid", true_stream_index, | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), davinci_model->GetStreamList().size()); | |||
GELOGE(INTERNAL_ERROR, "InitStreamSwitchTaskInfo stream index invalid. index:%zu, stream list size:%zu.", | |||
true_stream_index, davinci_model->GetStreamList().size()); | |||
return INTERNAL_ERROR; | |||
@@ -104,9 +103,9 @@ Status StreamSwitchTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *d | |||
if (op_desc->HasAttr(ATTR_NAME_SWITCH_DATA_TYPE)) { | |||
int64_t data_type = 0; | |||
if (!AttrUtils::GetInt(op_desc, ATTR_NAME_SWITCH_DATA_TYPE, data_type)) { | |||
REPORT_INNER_ERROR("E19999", "Get Attr:%s in op:%s(%s) fail when StreamSwitchTaskInfo %s", | |||
REPORT_INNER_ERROR("E19999", "Get Attr:%s in op:%s(%s) fail", | |||
ATTR_NAME_SWITCH_DATA_TYPE.c_str(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(FAILED, "StreamSwitchOp[node:%s] get attr SWITCH_DATA_TYPE fail.", op_desc->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -123,8 +122,8 @@ Status StreamSwitchTaskInfo::Distribute() { | |||
GELOGI("StreamSwitchTaskInfo Distribute Start."); | |||
rtError_t rt_ret = rtStreamSwitchEx(input_ptr_, cond_, value_ptr_, true_stream_, stream_, data_type_); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtStreamSwitchEx fail, ret:0x%X, when StreamSwitchTaskInfo %s", | |||
rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtStreamSwitchEx fail, ret:0x%X", | |||
rt_ret); | |||
GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -142,8 +141,8 @@ Status StreamSwitchTaskInfo::CalculateArgs(const domi::TaskDef &task_def, Davinc | |||
GELOGI("Calc opType[%s] args size. Node name is [%s]", op_desc->GetType().c_str(), op_desc->GetName().c_str()); | |||
if (op_desc->GetInputsSize() != STREAM_SWITCH_INPUT_NUM) { | |||
REPORT_INNER_ERROR("E19999", "input size:%zu in op:%s(%s) != STREAM_SWITCH_INPUT_NUM:%u," | |||
"check invalid when StreamSwitchTaskInfo %s", op_desc->GetInputsSize(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), STREAM_SWITCH_INPUT_NUM, __FUNCTION__); | |||
"check invalid", op_desc->GetInputsSize(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), STREAM_SWITCH_INPUT_NUM); | |||
GELOGE(FAILED, "Stream switch op only have one data input. Now input size is %zu", op_desc->GetInputsSize()); | |||
return FAILED; | |||
} | |||
@@ -36,8 +36,8 @@ Status StreamSwitchNTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel * | |||
auto stream_switchn_def = task_def.stream_switch_n(); | |||
OpDescPtr op_desc = davinci_model->GetOpByIndex(stream_switchn_def.op_index()); | |||
if (op_desc == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Can't get op_desc from davinci_model by index:%u when StreamSwitchNTaskInfo %s", | |||
stream_switchn_def.op_index(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Can't get op_desc from davinci_model by index:%u", | |||
stream_switchn_def.op_index()); | |||
GELOGE(FAILED, "Index is out of range, index: %u", stream_switchn_def.op_index()); | |||
return FAILED; | |||
} | |||
@@ -49,8 +49,8 @@ Status StreamSwitchNTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel * | |||
auto value = stream_switchn_def.target_value(); | |||
if (value.size() == 0) { | |||
REPORT_INNER_ERROR("E19999", "task_Def.stream_switch_n.target_value:%d in op:%s(%s) is 0," | |||
"check invalid when StreamSwitchNTaskInfo %s", value.size(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); | |||
"check invalid", value.size(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(FAILED, "The number of gears in dynamic batch scenario can not be 0."); | |||
return FAILED; | |||
} | |||
@@ -62,9 +62,9 @@ Status StreamSwitchNTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel * | |||
// set element_size_ | |||
if (!AttrUtils::GetInt(op_desc, ATTR_NAME_BATCH_NUM, element_size_)) { | |||
REPORT_INNER_ERROR("E19999", "Get Attr:%s in op:%s(%s) fail when StreamSwitchNTaskInfo %s", | |||
REPORT_INNER_ERROR("E19999", "Get Attr:%s in op:%s(%s) fail", | |||
ATTR_NAME_BATCH_NUM.c_str(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(FAILED, "Get ATTR_NAME_BATCH_NUM of switchN op failed."); | |||
return FAILED; | |||
} | |||
@@ -92,8 +92,8 @@ Status StreamSwitchNTaskInfo::Distribute() { | |||
rtError_t rt_ret = | |||
rtStreamSwitchN(input_ptr_, input_size_, value_ptr_, true_stream_ptr_, element_size_, stream_, data_type_); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtStreamSwitchN failed, ret:0x%X, when InitStreamSwitchNTaskInfo %s", | |||
rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtStreamSwitchN failed, ret:0x%X", | |||
rt_ret); | |||
GELOGE(RT_FAILED, "Call rt api failed, ret: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
@@ -106,18 +106,17 @@ Status StreamSwitchNTaskInfo::Distribute() { | |||
Status StreamSwitchNTaskInfo::GetTrueStreamPtr(const OpDescPtr &op_desc, DavinciModel *davinci_model) { | |||
vector<uint32_t> true_stream_id_list; | |||
if (!AttrUtils::GetListInt(op_desc, ATTR_NAME_ACTIVE_STREAM_LIST, true_stream_id_list)) { | |||
REPORT_INNER_ERROR("E19999", "Get Attr:%s in op:%s(%s) fail when StreamSwitchNTaskInfo %s", | |||
REPORT_INNER_ERROR("E19999", "Get Attr:%s in op:%s(%s) fail", | |||
ATTR_NAME_ACTIVE_STREAM_LIST.c_str(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(FAILED, "StreamSwitchNOp get attr ACTIVE_STREAM_LIST fail."); | |||
return FAILED; | |||
} | |||
if (true_stream_id_list.size() > davinci_model->GetStreamList().size()) { | |||
REPORT_INNER_ERROR("E19999", "active_stream_list.size:%zu in op:%s(%s) >= stream list size:%zu in model," | |||
"check invalid when StreamSwitchNTaskInfo %s", true_stream_id_list.size(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), davinci_model->GetStreamList().size(), | |||
__FUNCTION__); | |||
"check invalid", true_stream_id_list.size(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), davinci_model->GetStreamList().size()); | |||
GELOGE(FAILED, | |||
"InitStreamSwitchNTaskInfo get true stream id list failed. true stream size:%zu, " | |||
"stream list size:%zu.", | |||
@@ -130,9 +129,8 @@ Status StreamSwitchNTaskInfo::GetTrueStreamPtr(const OpDescPtr &op_desc, Davinci | |||
uint32_t true_stream_id = true_stream_id_list[i]; | |||
if (true_stream_id >= davinci_model->GetStreamList().size()) { | |||
REPORT_INNER_ERROR("E19999", "active_stream_id:%u in op:%s(%s) >= stream list size:%zu in model," | |||
"check invalid when StreamSwitchNTaskInfo %s", true_stream_id, | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), davinci_model->GetStreamList().size(), | |||
__FUNCTION__); | |||
"check invalid", true_stream_id, | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), davinci_model->GetStreamList().size()); | |||
GELOGE(FAILED, "InitStreamSwitchNTaskInfo stream id invalid. id:%u, stream list size:%zu.", true_stream_id, | |||
davinci_model->GetStreamList().size()); | |||
return FAILED; | |||
@@ -144,8 +142,8 @@ Status StreamSwitchNTaskInfo::GetTrueStreamPtr(const OpDescPtr &op_desc, Davinci | |||
if (true_stream_list_.empty()) { | |||
REPORT_INNER_ERROR("E19999", "active_stream_list.size():%zu in op:%s(%s) is empty, " | |||
"check invalid when StreamSwitchNTaskInfo %s", true_stream_id_list.size(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); | |||
"check invalid", true_stream_id_list.size(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(FAILED, "true stream list is null."); | |||
return FAILED; | |||
} | |||
@@ -163,8 +161,8 @@ Status StreamSwitchNTaskInfo::CalculateArgs(const domi::TaskDef &task_def, Davin | |||
GELOGI("Calc opType[%s] args size. Node name is [%s]", op_desc->GetType().c_str(), op_desc->GetName().c_str()); | |||
if (op_desc->GetInputsSize() != kStreamSwitchnInputNum) { | |||
REPORT_INNER_ERROR("E19999", "input size:%zu in op:%s(%s) != kStreamSwitchnInputNum:%u ," | |||
"check invalid when StreamSwitchNTaskInfo %s", op_desc->GetInputsSize(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), kStreamSwitchnInputNum, __FUNCTION__); | |||
"check invalid", op_desc->GetInputsSize(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), kStreamSwitchnInputNum); | |||
GELOGE(FAILED, "Stream switchn op only have one data input. Now input size is %zu", op_desc->GetInputsSize()); | |||
return FAILED; | |||
} | |||
@@ -187,8 +185,8 @@ Status StreamSwitchNTaskInfo::InputPtrUpdate(const OpDescPtr &op_desc, DavinciMo | |||
const vector<int64_t> input_legnth = ModelUtils::GetInputSize(op_desc); | |||
if (input_offset.empty() || input_legnth.empty()) { | |||
REPORT_INNER_ERROR("E19999", "input_offset size:%zu or input_length.size:%zu in op:%s(%s) is empty," | |||
"check invalid when StreamSwitchNTaskInfo %s", input_offset.size(), input_legnth.size(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); | |||
"check invalid", input_offset.size(), input_legnth.size(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(FAILED, "input offset size %zu, input legnth size: %zu", input_offset.size(), input_legnth.size()); | |||
return FAILED; | |||
} | |||
@@ -201,8 +199,8 @@ Status StreamSwitchNTaskInfo::InputPtrUpdate(const OpDescPtr &op_desc, DavinciMo | |||
auto input_data_addr = ModelUtils::GetInputDataAddrs(davinci_model->GetRuntimeParam(), op_desc); | |||
if (input_data_addr.empty()) { | |||
REPORT_INNER_ERROR("E19999", "input_data_addr size:%zu in op:%s(%s) is empty," | |||
"check invalid when StreamSwitchNTaskInfo %s", input_data_addr.size(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); | |||
"check invalid", input_data_addr.size(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(FAILED, "input data addr is empty"); | |||
return FAILED; | |||
} | |||
@@ -27,22 +27,22 @@ Status SuperKernel::Launch(rtStream_t stream, uint32_t dump_flag) { | |||
rtError_t rt_ret = rtMalloc(reinterpret_cast<void **>(&device_args_addr_), sizeof(args), RT_MEMORY_HBM); | |||
GE_IF_BOOL_EXEC(rt_ret != RT_ERROR_NONE, | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%lu, ret:0x%X when %s", | |||
sizeof(args), rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%lu, ret:0x%X", | |||
sizeof(args), rt_ret); | |||
GELOGE(RT_FAILED, "rtMalloc failied. error: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret);) | |||
rt_ret = rtMemcpy(reinterpret_cast<void *>(device_args_addr_), sizeof(args), reinterpret_cast<void *>(args), | |||
sizeof(args), RT_MEMCPY_HOST_TO_DEVICE); | |||
GE_IF_BOOL_EXEC(rt_ret != RT_ERROR_NONE, | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%lu, ret:0x%X when %s", | |||
sizeof(args), rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%lu, ret:0x%X", | |||
sizeof(args), rt_ret); | |||
GELOGE(RT_FAILED, "rtMemcpy failied. error: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret);) | |||
rt_ret = rtKernelLaunchWithFlag((void *const)func_stub_, block_dim_, device_args_addr_, sizeof(args), NULL, stream, | |||
dump_flag); | |||
GE_IF_BOOL_EXEC(rt_ret != RT_ERROR_NONE, | |||
REPORT_CALL_ERROR("E19999", "Call rtKernelLaunchWithFlag failed, dump_flag:%u, ret:0x%X when %s", | |||
dump_flag, rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtKernelLaunchWithFlag failed, dump_flag:%u, ret:0x%X", | |||
dump_flag, rt_ret); | |||
GELOGE(RT_FAILED, "rtKernelLaunchWithFlag failied. error: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret);) | |||
return SUCCESS; | |||
@@ -36,14 +36,14 @@ Status SuperKernelFactory::Init() { | |||
rtError_t rt_ret; | |||
rt_ret = rtGetFunctionByName(this->sk_stub_name_.c_str(), &this->func_stub_); | |||
GE_IF_BOOL_EXEC(rt_ret != RT_ERROR_NONE, | |||
REPORT_CALL_ERROR("E19999", "Call rtGetFunctionByName failed, stub_func:%s, ret:0x%X, when %s", | |||
this->sk_stub_name_.c_str(), rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtGetFunctionByName failed, stub_func:%s, ret:0x%X", | |||
this->sk_stub_name_.c_str(), rt_ret); | |||
GELOGE(RT_FAILED, "rtGetFunctionByName failed. stub_func: %s, please export LD_LIBRARY_PATH for " | |||
"libcce_aicore.so", this->sk_stub_name_.c_str()); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret);) | |||
rt_ret = rtGetAddrByFun(this->func_stub_, &this->func_ptr_); | |||
GE_IF_BOOL_EXEC(rt_ret != RT_ERROR_NONE, | |||
REPORT_CALL_ERROR("E19999", "Call rtGetAddrByFun failed, ret:0x%X, when %s", rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtGetAddrByFun failed, ret:0x%X", rt_ret); | |||
GELOGE(RT_FAILED, "rtGetAddrByFun failed. error: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret);) | |||
GELOGD( | |||
@@ -101,7 +101,7 @@ Status SuperKernelFactory::FuseKernels(const std::vector<void *> &stub_func_list | |||
void *sub_device_func = nullptr; | |||
rt_ret = rtGetAddrByFun(stub_func_list[i], &sub_device_func); | |||
GE_IF_BOOL_EXEC(rt_ret != RT_ERROR_NONE, | |||
REPORT_CALL_ERROR("E19999", "Call rtGetAddrByFun failed, ret:0x%X, when %s", rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtGetAddrByFun failed, ret:0x%X", rt_ret); | |||
GELOGE(RT_FAILED, "rtGetAddrByFun failed. error: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret);) | |||
GELOGD("SKT: fuseKernels subFunc %p, device func address %p", stub_func_list[i], sub_device_func); | |||
@@ -114,15 +114,15 @@ Status SuperKernelFactory::FuseKernels(const std::vector<void *> &stub_func_list | |||
} | |||
rt_ret = rtMalloc(reinterpret_cast<void **>(&hbm_nav_table_addr), nav_table_size, RT_MEMORY_HBM); | |||
GE_IF_BOOL_EXEC(rt_ret != RT_ERROR_NONE, | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%lu, ret:0x%X, when %s", | |||
nav_table_size, rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%lu, ret:0x%X", | |||
nav_table_size, rt_ret); | |||
GELOGE(RT_FAILED, "rtMalloc failed. error: 0x%X", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret);) | |||
rt_ret = rtMemcpy(reinterpret_cast<void *>(hbm_nav_table_addr), nav_table_size, | |||
reinterpret_cast<void *>(nav_table.get()), nav_table_size, RT_MEMCPY_HOST_TO_DEVICE); | |||
GE_IF_BOOL_EXEC(rt_ret != RT_ERROR_NONE, | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%lu, ret:0x%X when %s", | |||
nav_table_size, rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%lu, ret:0x%X", | |||
nav_table_size, rt_ret); | |||
GELOGE(RT_FAILED, "rtMemcpy failed. error: 0x%X", rt_ret); | |||
GE_CHK_RT(rtFree(hbm_nav_table_addr)); return RT_ERROR_TO_GE_STATUS(rt_ret);) | |||
// Create the necessary metadata for the super kernel | |||
@@ -25,8 +25,8 @@ Status TaskInfo::SetStream(uint32_t stream_id, const std::vector<rtStream_t> &st | |||
} else if (stream_list.size() > stream_id) { | |||
stream_ = stream_list[stream_id]; | |||
} else { | |||
REPORT_INNER_ERROR("E19999", "stream_id:%u >= stream_list.size(): %zu, check invalid when TaskInfo %s", | |||
stream_id, stream_list.size(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "stream_id:%u >= stream_list.size(): %zu, check invalid", | |||
stream_id, stream_list.size()); | |||
GELOGE(FAILED, "index: %u >= stream_list.size(): %zu.", stream_id, stream_list.size()); | |||
return FAILED; | |||
} | |||
@@ -23,7 +23,7 @@ | |||
namespace ge { | |||
void TbeHandleInfo::used_inc(uint32_t num) { | |||
if (used_ > std::numeric_limits<uint32_t>::max() - num) { | |||
REPORT_INNER_ERROR("E19999", "Used:%u reach numeric max when TbeHandleInfo %s", used_, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Used:%u reach numeric max", used_); | |||
GELOGE(INTERNAL_ERROR, "Used[%u] reach numeric max.", used_); | |||
return; | |||
} | |||
@@ -33,7 +33,7 @@ void TbeHandleInfo::used_inc(uint32_t num) { | |||
void TbeHandleInfo::used_dec(uint32_t num) { | |||
if (used_ < std::numeric_limits<uint32_t>::min() + num) { | |||
REPORT_INNER_ERROR("E19999", "Used:%u reach numeric min when TbeHandleInfo %s", used_, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Used:%u reach numeric min", used_); | |||
GELOGE(INTERNAL_ERROR, "Used[%u] reach numeric min.", used_); | |||
return; | |||
} | |||
@@ -107,8 +107,8 @@ void TBEHandleStore::ReferTBEHandle(const std::string &name) { | |||
std::lock_guard<std::mutex> lock(mutex_); | |||
auto it = kernels_.find(name); | |||
if (it == kernels_.end()) { | |||
REPORT_INNER_ERROR("E19999", "Kernel:%s not found in stored check invalid when TbeHandleInfo %s", | |||
name.c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Kernel:%s not found in stored check invalid", | |||
name.c_str()); | |||
GELOGE(INTERNAL_ERROR, "Kernel[%s] not found in stored.", name.c_str()); | |||
return; | |||
} | |||
@@ -128,8 +128,8 @@ void TBEHandleStore::EraseTBEHandle(const std::map<std::string, uint32_t> &names | |||
for (auto &item : names) { | |||
auto it = kernels_.find(item.first); | |||
if (it == kernels_.end()) { | |||
REPORT_INNER_ERROR("E19999", "Kernel:%s not found in stored check invalid when TbeHandleInfo %s", | |||
item.first.c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Kernel:%s not found in stored check invalid", | |||
item.first.c_str()); | |||
GELOGE(INTERNAL_ERROR, "Kernel[%s] not found in stored.", item.first.c_str()); | |||
continue; | |||
} | |||
@@ -140,8 +140,8 @@ void TBEHandleStore::EraseTBEHandle(const std::map<std::string, uint32_t> &names | |||
} else { | |||
rtError_t rt_ret = rtDevBinaryUnRegister(info.handle()); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_INNER_ERROR("E19999", "Call rtDevBinaryUnRegister failed for Kernel:%s fail, ret:0x%X, " | |||
"when TbeHandleInfo %s", item.first.c_str(), rt_ret, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Call rtDevBinaryUnRegister failed for Kernel:%s fail, ret:0x%X", | |||
item.first.c_str(), rt_ret); | |||
GELOGE(INTERNAL_ERROR, "Kernel[%s] UnRegister handle fail:%u.", item.first.c_str(), rt_ret); | |||
} | |||
kernels_.erase(it); | |||
@@ -76,8 +76,8 @@ Status ZeroCopyOffset::InitOutputDataInfo(const vector<int64_t> &input_size_list | |||
auto tensor_desc = op_desc->GetInputDescPtr(idx); | |||
GE_CHECK_NOTNULL(tensor_desc); | |||
if (TensorUtils::GetTensorSizeInBytes(*tensor_desc, size) != GRAPH_SUCCESS) { | |||
REPORT_INNER_ERROR("E19999", "Get input TensorSize in op:%s(%s) failed, input_index:%zu, when ZeroCopyOffset %s", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), idx, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Get input TensorSize in op:%s(%s) failed, input_index:%zu", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), idx); | |||
GELOGE(FAILED, "GetTensorSizeInBytes failed!"); | |||
return FAILED; | |||
} | |||
@@ -36,8 +36,8 @@ ZeroCopyTask::~ZeroCopyTask() { args_addr_ = nullptr; } | |||
*/ | |||
Status ZeroCopyTask::SetTaskArgsOffset(uintptr_t addr, size_t offset) { | |||
if (offset + sizeof(uintptr_t) > args_size_) { | |||
REPORT_INNER_ERROR("E19999", "Param offset:%zu + 8 > args_size_:%zu, check invalid when ZeroCopyOffset %s", | |||
offset, args_size_, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Param offset:%zu + 8 > args_size_:%zu, check invalid", | |||
offset, args_size_); | |||
GELOGE(FAILED, "[ZCPY] %s set task args failed, args size: %zu, offset: %zu", name_.c_str(), args_size_, offset); | |||
return FAILED; // unexpected error, need fix. | |||
} | |||
@@ -118,8 +118,8 @@ Status ZeroCopyTask::DistributeParam(bool async_mode, rtStream_t stream) { | |||
} | |||
if (rt_err != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpyAsync or rtMemcpy failed, size:%zu, ret: 0x%X when ZeroCopyTask %s", | |||
args_size_, rt_err, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpyAsync or rtMemcpy failed, size:%zu, ret: 0x%X", | |||
args_size_, rt_err); | |||
GELOGE(RT_FAILED, "[ZCPY] %s distribute task param failed, error=0x%x", name_.c_str(), rt_err); | |||
return RT_ERROR_TO_GE_STATUS(rt_err); | |||
} | |||
@@ -111,7 +111,7 @@ Status CachingAllocator::Initialize(uint32_t device_id) { | |||
} | |||
auto bin_ptr = new (std::nothrow) BlockBin(BlockComparator); | |||
if (bin_ptr == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "New BlockBin fail, device_id:%u, when CachingAllocator %s", device_id, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "New BlockBin fail, device_id:%u", device_id); | |||
GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "Alloc BlockBin failed."); | |||
return ACL_ERROR_GE_MEMORY_ALLOCATION; | |||
} | |||
@@ -147,8 +147,8 @@ uint8_t *CachingAllocator::Malloc(size_t size, uint8_t *org_ptr, uint32_t device | |||
ptr = block->ptr; | |||
} | |||
if (ptr == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "FindFreeBlock fail, size:%zu, device_id:%u, when CachingAllocator %s", | |||
size, device_id, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "FindFreeBlock fail, size:%zu, device_id:%u", | |||
size, device_id); | |||
GELOGE(FAILED, "Malloc failed device id = %u, size= %zu", device_id, size); | |||
} | |||
return ptr; | |||
@@ -157,8 +157,8 @@ uint8_t *CachingAllocator::Malloc(size_t size, uint8_t *org_ptr, uint32_t device | |||
Status CachingAllocator::Free(uint8_t *ptr, uint32_t device_id) { | |||
GELOGI("Free device id = %u", device_id); | |||
if (ptr == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Param ptr is nullptr, device_id:%u, check invalid when CachingAllocator %s", | |||
device_id, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Param ptr is nullptr, device_id:%u, check invalid", | |||
device_id); | |||
GELOGE(PARAM_INVALID, "Invalid memory pointer"); | |||
return ge::PARAM_INVALID; | |||
} | |||
@@ -166,8 +166,8 @@ Status CachingAllocator::Free(uint8_t *ptr, uint32_t device_id) { | |||
std::lock_guard<std::recursive_mutex> lock(mutex_); | |||
auto it = allocated_blocks_.find(ptr); | |||
if (it == allocated_blocks_.end()) { | |||
REPORT_INNER_ERROR("E19999", "Param ptr not allocated before, device_id:%u, check invalid when CachingAllocator %s", | |||
device_id, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Param ptr not allocated before, device_id:%u, check invalid", | |||
device_id); | |||
GELOGE(PARAM_INVALID, "Invalid memory pointer"); | |||
return ge::PARAM_INVALID; | |||
} | |||
@@ -225,8 +225,8 @@ Block *CachingAllocator::FindFreeBlock(size_t size, uint8_t *org_ptr, uint32_t d | |||
Block key(device_id, size, org_ptr); | |||
BlockBin *bin = GetBlockBin(size); | |||
if (bin == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "GetBlockBin fail, size:%zu, device_id:%u, when CachingAllocator %s", | |||
size, device_id, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "GetBlockBin fail, size:%zu, device_id:%u", | |||
size, device_id); | |||
GELOGE(ge::FAILED, "Get block bin failed size = %zu", size); | |||
return nullptr; | |||
} | |||
@@ -258,8 +258,8 @@ Block *CachingAllocator::SplitBlock(Block *block, size_t size, BlockBin &bin, ui | |||
Block *remaining = block; | |||
Block *new_block = new (std::nothrow) Block(device_id, size, &bin, block->ptr); | |||
if (new_block == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "New Block fail, size:%zu, device_id:%u, when CachingAllocator %s", | |||
size, device_id, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "New Block fail, size:%zu, device_id:%u", | |||
size, device_id); | |||
GELOGE(ge::FAILED, "Alloc block failed size = %zu", size); | |||
return block; | |||
} | |||
@@ -304,15 +304,15 @@ Status CachingAllocator::TryExtendCache(size_t size, uint32_t device_id) { | |||
Status CachingAllocator::AddToBlockBin(uint8_t *ptr, size_t size, uint32_t device_id) { | |||
BlockBin *bin = GetBlockBin(size); | |||
if (bin == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "GetBlockBin fail, size:%zu, device_id:%u, when CachingAllocator %s", | |||
size, device_id, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "GetBlockBin fail, size:%zu, device_id:%u", | |||
size, device_id); | |||
GELOGE(ge::FAILED, "Get block bin failed size = %zu", size); | |||
return ge::FAILED; | |||
} | |||
Block *block = new (std::nothrow) Block(device_id, size, bin, nullptr); | |||
if (block == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "New Block fail, size:%zu, device_id:%u, when CachingAllocator %s", | |||
size, device_id, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "New Block fail, size:%zu, device_id:%u", | |||
size, device_id); | |||
GELOGE(ge::FAILED, "Alloc block failed size = %zu", size); | |||
return ge::FAILED; | |||
} | |||
@@ -44,7 +44,7 @@ GraphContext::GraphContext(const GraphNodePtr &graph_node) { | |||
Status GraphContext::SetComputeGraph(const GraphNodePtr &graph_node) { | |||
if (graph_node == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Param graph_node is nullptr, check invalid when GraphContext %s", __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Param graph_node is nullptr, check invalid"); | |||
GELOGE(GE_GRAPH_PARAM_NULLPTR, "graphNode is NULL!"); | |||
return GE_GRAPH_PARAM_NULLPTR; | |||
} | |||
@@ -55,8 +55,7 @@ Status GraphContext::SetComputeGraph(const GraphNodePtr &graph_node) { | |||
if (compute_graph_ == nullptr) { | |||
std::shared_ptr<const ge::Graph> graph = graph_node->GetGraph(); | |||
if (graph == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Param graph in graph_node is nullptr, check invalid when GraphContext %s", | |||
__FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Param graph in graph_node is nullptr, check invalid"); | |||
GELOGE(GE_GRAPH_OPTIMIZE_COMPUTE_GRAPH_NULL, "compute_graph by graphNode is NULL!"); | |||
return GE_GRAPH_OPTIMIZE_COMPUTE_GRAPH_NULL; | |||
} | |||
@@ -73,15 +72,14 @@ Status GraphContext::Finalize() const { return SUCCESS; } | |||
Status GraphContext::GetVariableTensor(const std::string &var_data_name, GeTensor &returned_tensor) { | |||
if (var_data_name.empty()) { | |||
REPORT_INNER_ERROR("E19999", "Param var_data_name is empty, check invalid when GraphContext %s", | |||
__FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Param var_data_name is empty, check invalid"); | |||
GELOGE(GE_GRAPH_EMPTY_STRING_NAME, "Variable data name is empty!"); | |||
return GE_GRAPH_EMPTY_STRING_NAME; | |||
} | |||
if (GetVarNodeTensorTable().empty()) { | |||
REPORT_INNER_ERROR("E19999", "VarNodeTensorTable is empty, var_data_name:%s, check invalid when GraphContext %s", | |||
var_data_name.c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "VarNodeTensorTable is empty, var_data_name:%s, check invalid", | |||
var_data_name.c_str()); | |||
GELOGE(GE_GRAPH_EMPTY_VARIABLE_TENSOR_TABLE, "VarNodeTensorTable is empty!"); | |||
return GE_GRAPH_EMPTY_VARIABLE_TENSOR_TABLE; | |||
} | |||
@@ -90,8 +88,8 @@ Status GraphContext::GetVariableTensor(const std::string &var_data_name, GeTenso | |||
returned_tensor.SetTensorDesc(var_record.second.GetTensorDesc()); | |||
auto ret = returned_tensor.SetData(var_record.second.GetData()); | |||
if (ret != SUCCESS) { | |||
REPORT_INNER_ERROR("E19999", "SetData to tensor fail, var_data_name:%s, when GraphContext %s", | |||
var_data_name.c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "SetData to tensor fail, var_data_name:%s", | |||
var_data_name.c_str()); | |||
GELOGE(ret, "Set Tensor data failed!"); | |||
return ret; | |||
} | |||
@@ -100,8 +98,8 @@ Status GraphContext::GetVariableTensor(const std::string &var_data_name, GeTenso | |||
} | |||
} | |||
REPORT_INNER_ERROR("E19999", "VarRecord with data_name:%s does not exist, check invalid when GraphContext %s", | |||
var_data_name.c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "VarRecord with data_name:%s does not exist, check invalid", | |||
var_data_name.c_str()); | |||
GELOGE(GE_GRAPH_VARIABLE_DOES_NOT_EXIST, "VarRecord with data_name %s does NOT exist!", var_data_name.c_str()); | |||
return GE_GRAPH_VARIABLE_DOES_NOT_EXIST; | |||
@@ -140,7 +140,7 @@ ge::Status CheckFpCeilingMode() { | |||
auto ret = ge::GetContext().GetOption("ge.fpCeilingMode", mode); | |||
if (ret == ge::GRAPH_SUCCESS) { | |||
if (kValidFpCeilingMode.count(mode) == 0) { | |||
REPORT_INNER_ERROR("E19999", "Option ge.fpCeilingMode is invalid, value:%s, when %s", mode.c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Option ge.fpCeilingMode is invalid, value:%s", mode.c_str()); | |||
GELOGE(ge::GE_GRAPH_OPTIONS_INVALID, "The fp_ceiling_mode %s is invalid, options are 0, 1, and 2.", mode.c_str()); | |||
return ge::GE_GRAPH_OPTIONS_INVALID; | |||
} | |||
@@ -169,14 +169,14 @@ Status GraphManager::Initialize(const std::map<string, string> &options) { | |||
// malloc | |||
graph_run_listener_ = MakeShared<GraphModelListener>(sync_run_mutex_, condition_); | |||
if (graph_run_listener_ == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "New GraphModelListener fail when GraphManager %s", __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "New GraphModelListener fail"); | |||
GELOGE(MEMALLOC_FAILED, "Make shared failed"); | |||
return MEMALLOC_FAILED; | |||
} | |||
// graph context | |||
graph_context_ = MakeShared<GraphContext>(); | |||
if (graph_context_ == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "New GraphModelListener fail when GraphManager %s", __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "New GraphModelListener fail"); | |||
GELOGE(MEMALLOC_FAILED, "Make shared failed."); | |||
return MEMALLOC_FAILED; | |||
} | |||
@@ -298,8 +298,8 @@ Status GraphManager::InitDynamicParams(ComputeGraphPtr &compute_graph) { | |||
std::string op_type; | |||
auto ret = GetOriginalType(node, op_type); | |||
if (ret != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "GetOriginalType from op:%s fail when GraphManager %s", | |||
node->GetName().c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "GetOriginalType from op:%s fail", | |||
node->GetName().c_str()); | |||
GELOGE(FAILED, "Failed to get node %s original type.", node->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -330,7 +330,7 @@ Status GraphManager::AddGraph(const GraphId &graph_id, const Graph &graph, | |||
const std::map<std::string, std::string> &options, | |||
const OmgContext &omg_context) { | |||
if (HasGraphNode(graph_id)) { | |||
REPORT_INNER_ERROR("E19999", "graph_id:%u is exist, check invalid when GraphManager %s", graph_id, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "graph_id:%u is exist, check invalid", graph_id); | |||
GELOGE(GE_GRAPH_GRAPH_ALREADY_EXIST, "[GraphManager] graph exists, graph_id = %u.", graph_id); | |||
return GE_GRAPH_GRAPH_ALREADY_EXIST; | |||
} | |||
@@ -341,8 +341,8 @@ Status GraphManager::AddGraph(const GraphId &graph_id, const Graph &graph, | |||
bool graph_has_been_added = false; | |||
if (AttrUtils::GetBool(*compute_graph, ATTR_NAME_GRAPH_HAS_BEEN_ADDED, graph_has_been_added) | |||
&& graph_has_been_added) { | |||
REPORT_INNER_ERROR("E19999", "Get Attr:%s from graph:%u fail when GraphManager %s", | |||
ATTR_NAME_GRAPH_HAS_BEEN_ADDED.c_str(), graph_id, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Get Attr:%s from graph:%u fail", | |||
ATTR_NAME_GRAPH_HAS_BEEN_ADDED.c_str(), graph_id); | |||
GELOGE(GE_GRAPH_GRAPH_ALREADY_EXIST, | |||
"[GraphManager] same graph object can not be added again, graph_id = %u.", graph_id); | |||
return GE_GRAPH_GRAPH_ALREADY_EXIST; | |||
@@ -350,8 +350,8 @@ Status GraphManager::AddGraph(const GraphId &graph_id, const Graph &graph, | |||
(void)AttrUtils::SetBool(*compute_graph, ATTR_NAME_GRAPH_HAS_BEEN_ADDED, true); | |||
compute_graph_ = compute_graph; | |||
} else { | |||
REPORT_INNER_ERROR("E19999", "compute_graph from graph:%u is nullptr, check invalid when GraphManager %s", | |||
graph_id, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "compute_graph from graph:%u is nullptr, check invalid", | |||
graph_id); | |||
GELOGE(FAILED, "compute graph is null"); | |||
return FAILED; | |||
} | |||
@@ -369,14 +369,14 @@ Status GraphManager::AddGraph(const GraphId &graph_id, const Graph &graph, | |||
GraphNodePtr graph_node = MakeShared<ge::GraphNode>(graph_id); | |||
GE_IF_BOOL_EXEC(graph_node == nullptr, | |||
REPORT_CALL_ERROR("E19999", "New GraphNode fail, graph_id:%u, when GraphManager %s", | |||
graph_id, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "New GraphNode fail, graph_id:%u", | |||
graph_id); | |||
GELOGE(FAILED, "GraphNode make shared failed"); | |||
return FAILED); | |||
std::shared_ptr<Graph> graph_ptr = MakeShared<ge::Graph>(graph); | |||
GE_IF_BOOL_EXEC(graph_ptr == nullptr, | |||
REPORT_CALL_ERROR("E19999", "New Graph fail, graph_id:%u, when GraphManager %s", | |||
graph_id, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "New Graph fail, graph_id:%u", | |||
graph_id); | |||
GELOGE(FAILED, "GraphPtr make shared failed"); | |||
return FAILED); | |||
// update option about tuning graph | |||
@@ -413,7 +413,7 @@ Status GraphManager::AddGraphWithCopy(const GraphId &graph_id, const Graph &grap | |||
const std::map<std::string, std::string> &options, | |||
const OmgContext &omg_context) { | |||
if (HasGraphNode(graph_id)) { | |||
REPORT_INNER_ERROR("E19999", "graph_id:%u is exist, check invalid when GraphManager %s", graph_id, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "graph_id:%u is exist, check invalid", graph_id); | |||
GELOGE(GE_GRAPH_GRAPH_ALREADY_EXIST, "[GraphManager] graph exists, graph_id = %u.", graph_id); | |||
return GE_GRAPH_GRAPH_ALREADY_EXIST; | |||
} | |||
@@ -423,15 +423,15 @@ Status GraphManager::AddGraphWithCopy(const GraphId &graph_id, const Graph &grap | |||
bool graph_has_been_added = false; | |||
if (AttrUtils::GetBool(*compute_graph, ATTR_NAME_GRAPH_HAS_BEEN_ADDED, graph_has_been_added) | |||
&& graph_has_been_added) { | |||
REPORT_INNER_ERROR("E19999", "Get Attr:%s from graph:%u fail when GraphManager %s", | |||
ATTR_NAME_GRAPH_HAS_BEEN_ADDED.c_str(), graph_id, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Get Attr:%s from graph:%u fail", | |||
ATTR_NAME_GRAPH_HAS_BEEN_ADDED.c_str(), graph_id); | |||
GELOGE(GE_GRAPH_GRAPH_ALREADY_EXIST, | |||
"[GraphManager] same graph object can not be added again, graph_id = %u.", graph_id); | |||
return GE_GRAPH_GRAPH_ALREADY_EXIST; | |||
} | |||
} else { | |||
REPORT_INNER_ERROR("E19999", "compute_graph from graph:%u is nullptr, check invalid when GraphManager %s", | |||
graph_id, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "compute_graph from graph:%u is nullptr, check invalid", | |||
graph_id); | |||
GELOGE(FAILED, "compute graph is null"); | |||
return FAILED; | |||
} | |||
@@ -453,15 +453,15 @@ Status GraphManager::AddGraphWithCopy(const GraphId &graph_id, const Graph &grap | |||
GraphNodePtr graph_node = MakeShared<ge::GraphNode>(graph_id); | |||
if (graph_node == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "New GraphNode fail, graph_id:%u, when GraphManager %s", | |||
graph_id, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "New GraphNode fail, graph_id:%u", | |||
graph_id); | |||
GELOGE(FAILED, "GraphNode make shared failed"); | |||
return FAILED; | |||
} | |||
std::shared_ptr<Graph> graph_ptr = GraphUtils::CreateGraphPtrFromComputeGraph(new_compute_graph); | |||
if (graph_ptr == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "New Graph fail, graph_id:%u, when GraphManager %s", | |||
graph_id, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "New Graph fail, graph_id:%u", | |||
graph_id); | |||
GELOGE(FAILED, "GraphPtr make shared failed"); | |||
return FAILED; | |||
} | |||
@@ -505,8 +505,8 @@ Status GraphManager::MergeSubGraph(ComputeGraphPtr &compute_graph, const ge::Com | |||
Status ret_topo = compute_graph->TopologicalSorting(); | |||
if (ret_topo != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "TopologicalSorting fail, graph_id:%u, when GraphManager %s", | |||
compute_graph->GetGraphID(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "TopologicalSorting fail, graph_id:%u", | |||
compute_graph->GetGraphID()); | |||
GELOGE(ret_topo, "[GraphManager]: TopologicalSorting the merged graph failed."); | |||
return ret_topo; | |||
} | |||
@@ -542,15 +542,15 @@ Status GraphManager::CopySubGraphAndMarkFusion(const ComputeGraphPtr &compute_gr | |||
std::vector<NodePtr> output_nodes; | |||
ComputeGraphPtr new_compute_graph = GraphUtils::CloneGraph(old_compute_graph, "", input_nodes, output_nodes); | |||
if (new_compute_graph == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "CloneGraph fail, graph_id:%u, when GraphManager %s", | |||
compute_graph->GetGraphID(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "CloneGraph fail, graph_id:%u", | |||
compute_graph->GetGraphID()); | |||
GELOGE(INTERNAL_ERROR, "Clone graph failed."); | |||
return INTERNAL_ERROR; | |||
} | |||
copy_graphs.emplace(old_compute_graph->GetName(), new_compute_graph); | |||
if (!AttrUtils::SetBool(old_compute_graph, ATTR_NAME_NEED_LX_FUSION, true)) { | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s to graph:%u fail when GraphManager %s", | |||
ATTR_NAME_NEED_LX_FUSION.c_str(), old_compute_graph->GetGraphID(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s to graph:%u fail", | |||
ATTR_NAME_NEED_LX_FUSION.c_str(), old_compute_graph->GetGraphID()); | |||
GELOGE(INTERNAL_ERROR, "Set attr lx_fusion to graph failed."); | |||
return INTERNAL_ERROR; | |||
} | |||
@@ -616,7 +616,7 @@ Status GraphManager::OptimizeSubGraphWithMultiThreads(ComputeGraphPtr compute_gr | |||
for (size_t i = 0; i < vector_future.size(); ++i) { | |||
Status ret_status = vector_future[i].get(); | |||
if (ret_status != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "subgraph %zu optimize failed, when GraphManager %s", i, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "subgraph %zu optimize failed", i); | |||
GELOGE(ret_status, "subgraph %zu optimize failed", i); | |||
return ret_status; | |||
} | |||
@@ -627,7 +627,7 @@ Status GraphManager::OptimizeSubGraphWithMultiThreads(ComputeGraphPtr compute_gr | |||
bool GraphManager::CheckAllFusionOptimizeSuccess(const ComputeGraphPtr &compute_graph, | |||
Graph2SubGraphInfoList &sub_graph_map) { | |||
if (compute_graph == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Param compute_graph is nullptr, check invalid when GraphManager %s", __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Param compute_graph is nullptr, check invalid"); | |||
GELOGE(PARAM_INVALID, "Input param compute_graph is nullptr."); | |||
return false; | |||
} | |||
@@ -667,8 +667,8 @@ Status GraphManager::ReplaceSubgraphWithOriGraph(const ComputeGraphPtr &compute_ | |||
for (const auto &subgraph : root_subgraph_list) { | |||
auto iter = copy_graphs.find(subgraph->GetSubGraph()->GetName()); | |||
if (iter == copy_graphs.end()) { | |||
REPORT_INNER_ERROR("E19999", "Can not find subgraph:%s in copy graphs, check invalid when GraphManager %s", | |||
subgraph->GetSubGraph()->GetName().c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Can not find subgraph:%s in copy graphs, check invalid", | |||
subgraph->GetSubGraph()->GetName().c_str()); | |||
GELOGE(FAILED, "Can not find subgraph:%s in copy graphs.", subgraph->GetSubGraph()->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -680,8 +680,8 @@ Status GraphManager::ReplaceSubgraphWithOriGraph(const ComputeGraphPtr &compute_ | |||
for (const auto &subgraph : subgraph_list) { | |||
auto iter = copy_graphs.find(subgraph->GetSubGraph()->GetName()); | |||
if (iter == copy_graphs.end()) { | |||
REPORT_INNER_ERROR("E19999", "Can not find subgraph:%s in copy graphs, check invalid when GraphManager %s", | |||
subgraph->GetSubGraph()->GetName().c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Can not find subgraph:%s in copy graphs, check invalid", | |||
subgraph->GetSubGraph()->GetName().c_str()); | |||
GELOGE(FAILED, "Can not find subgraph:%s in copy graphs.", subgraph->GetSubGraph()->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -780,8 +780,8 @@ Status GraphManager::PreRunAfterOptimizeSubGraph(const GraphNodePtr &graph_node, | |||
Status ret = compute_graph->TopologicalSorting(); | |||
if (ret != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "TopologicalSorting fail, graph_id:%u, when GraphManager %s", | |||
compute_graph->GetGraphID(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "TopologicalSorting fail, graph_id:%u", | |||
compute_graph->GetGraphID()); | |||
GELOGE(ret, "Graph topological sort failed, ret:%d.", ret); | |||
return ret; | |||
} | |||
@@ -797,15 +797,15 @@ Status GraphManager::SetRtContext(rtContext_t rt_context, rtCtxMode_t mode, uint | |||
rtError_t rt_ret = rtCtxCreate(&rt_context, mode, ge::GetContext().DeviceId()); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtCtxCreate faileded, session_id:%lu, graph_id:%u, mode:%d, when GraphManager %s", | |||
session_id, graph_id, mode, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtCtxCreate faileded, session_id:%lu, graph_id:%u, mode:%d", | |||
session_id, graph_id, mode); | |||
GELOGE(FAILED, "Call rt api failed, ret: 0x%X", rt_ret); | |||
return FAILED; | |||
} | |||
rt_ret = rtCtxSetCurrent(rt_context); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtCtxSetCurrent failed, session_id:%lu, graph_id:%u, mode:%d, " | |||
"when GraphManager %s", session_id, graph_id, mode, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtCtxSetCurrent failed, session_id:%lu, graph_id:%u, mode:%d", | |||
session_id, graph_id, mode); | |||
GELOGE(FAILED, "Call rt api failed, ret: 0x%X", rt_ret); | |||
return FAILED; | |||
} | |||
@@ -939,7 +939,7 @@ Status GraphManager::StartForRunGraph(const GraphNodePtr &graph_node, const std: | |||
ErrorManager::GetInstance().SetStage(ErrorMessage::kModelCompile, ErrorMessage::kOther); | |||
if (graph_node->GetBuildFlag()) { | |||
REPORT_INNER_ERROR("E19999", "Graph:%u has not build before, can't run directly, " | |||
"check invalid when GraphManager %s", graph_node->GetGraphId(), __FUNCTION__); | |||
"check invalid", graph_node->GetGraphId()); | |||
GELOGE(PARAM_INVALID, | |||
"The graph %u need to re-build, you should remove it from GE " | |||
"first, then AddGraph again and rebuild it.", | |||
@@ -1141,22 +1141,22 @@ Status GraphManager::RunGraph(const GraphId &graph_id, const std::vector<GeTenso | |||
GraphNodePtr graph_node = nullptr; | |||
Status ret = GetGraphNode(graph_id, graph_node); | |||
if (ret != SUCCESS) { | |||
REPORT_INNER_ERROR("E19999", "Graph:%u not exist in graph_map, check invalid when GraphManager %s", | |||
graph_id, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Graph:%u not exist in graph_map, check invalid", | |||
graph_id); | |||
GELOGE(ret, "[RunGraph] graph not exist, graph_id = %u.", graph_id); | |||
return ret; | |||
} | |||
if (graph_node == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Graph node is nullptr in graph_map, graph_id:%u, check invalid when GraphManager %s", | |||
graph_id, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Graph node is nullptr in graph_map, graph_id:%u, check invalid", | |||
graph_id); | |||
GELOGE(GE_GRAPH_GRAPH_NODE_NULL, "[RunGraph] graph node is NULL, graph_id = %u.", graph_id); | |||
return GE_GRAPH_GRAPH_NODE_NULL; | |||
} | |||
if (graph_node->GetRunFlag()) { | |||
REPORT_INNER_ERROR("E19999", "Graph is already running, can't be run again, graph_id:%u, " | |||
"check invalid when GraphManager %s", graph_id, __FUNCTION__); | |||
"check invalid", graph_id); | |||
GELOGE(GE_GRAPH_ALREADY_RUNNING, "[RunGraph] graph already running, graph id = %u", graph_id); | |||
return GE_GRAPH_ALREADY_RUNNING; | |||
} | |||
@@ -1170,7 +1170,7 @@ Status GraphManager::RunGraph(const GraphId &graph_id, const std::vector<GeTenso | |||
GE_IF_BOOL_EXEC(GetTrainFlag(), | |||
GE_IF_BOOL_EXEC(compute_graph_tmp == nullptr, | |||
REPORT_CALL_ERROR("E19999", "compute_graph is nullptr in graph_node, graph_id:%u, " | |||
"check invalid when GraphManager %s", graph_id, __FUNCTION__); | |||
"check invalid", graph_id); | |||
GELOGE(GE_GRAPH_GRAPH_NODE_NULL, | |||
"[RunGraph] compute_graph_tmp is NULL, graph id = %u.", graph_id); | |||
return GE_GRAPH_GRAPH_NODE_NULL;)) | |||
@@ -1228,15 +1228,15 @@ Status GraphManager::GenerateInfershapeGraph(GraphId &graph_id) { | |||
GraphNodePtr graph_node = nullptr; | |||
Status ret = GetGraphNode(graph_id, graph_node); | |||
if (ret != SUCCESS) { | |||
REPORT_INNER_ERROR("E19999", "Graph:%u not exist in graph_map, check invalid when GraphManager %s", | |||
graph_id, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Graph:%u not exist in graph_map, check invalid", | |||
graph_id); | |||
GELOGE(ret, "[BuildGraph] graph not exist, graph_id = %u.", graph_id); | |||
return ret; | |||
} | |||
if (graph_node == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Graph node is nullptr in graph_map, graph_id:%u, check invalid when GraphManager %s", | |||
graph_id, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Graph node is nullptr in graph_map, graph_id:%u, check invalid", | |||
graph_id); | |||
GELOGE(GE_GRAPH_GRAPH_NODE_NULL, "[BuildGraph] graph node is NULL, graphId = %u.", graph_id); | |||
return GE_GRAPH_GRAPH_NODE_NULL; | |||
} | |||
@@ -1259,15 +1259,15 @@ Status GraphManager::BuildGraphForUnregisteredOp(const GraphId &graph_id, const | |||
GraphNodePtr graph_node = nullptr; | |||
Status ret = GetGraphNode(graph_id, graph_node); | |||
if (ret != SUCCESS) { | |||
REPORT_INNER_ERROR("E19999", "Graph:%u not exist in graph_map, check invalid when GraphManager %s", | |||
graph_id, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Graph:%u not exist in graph_map, check invalid", | |||
graph_id); | |||
GELOGE(ret, "[BuildGraph] graph not exist, graph_id = %u.", graph_id); | |||
return ret; | |||
} | |||
if (graph_node == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Graph node is nullptr in graph_map, graph_id:%u, check invalid when GraphManager %s", | |||
graph_id, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Graph node is nullptr in graph_map, graph_id:%u, check invalid", | |||
graph_id); | |||
GELOGE(GE_GRAPH_GRAPH_NODE_NULL, "[BuildGraph] graph node is NULL, graphId = %u.", graph_id); | |||
return GE_GRAPH_GRAPH_NODE_NULL; | |||
} | |||
@@ -1288,8 +1288,8 @@ Status GraphManager::BuildGraphForUnregisteredOp(const GraphId &graph_id, const | |||
auto instance_ptr = ge::GELib::GetInstance(); | |||
if (instance_ptr == nullptr || !instance_ptr->InitFlag()) { | |||
REPORT_INNER_ERROR("E19999", "GELib is not init before, graph_id:%u, check invalid when GraphManager %s", | |||
graph_id, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "GELib is not init before, graph_id:%u, check invalid", | |||
graph_id); | |||
GELOGE(GE_CLI_GE_NOT_INITIALIZED, "GE is not initialized"); | |||
return GE_CLI_GE_NOT_INITIALIZED; | |||
} | |||
@@ -1298,8 +1298,8 @@ Status GraphManager::BuildGraphForUnregisteredOp(const GraphId &graph_id, const | |||
instance_ptr->OpsKernelManagerObj().GetOpsKernelInfoStore(op_desc->GetOpKernelLibName()); | |||
if (kernel_info == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "GetOpsKernelInfoStore fail for op:%s(%s), kernel_lib_name:%s, graph_id:%u, " | |||
"check invalid when GraphManager %s", op_desc->GetName().c_str(), op_desc->GetType().c_str(), | |||
op_desc->GetOpKernelLibName().c_str(), graph_id, __FUNCTION__); | |||
"check invalid", op_desc->GetName().c_str(), op_desc->GetType().c_str(), | |||
op_desc->GetOpKernelLibName().c_str(), graph_id); | |||
GELOGE(FAILED, "Get op kernel info store failed"); | |||
return FAILED; | |||
} | |||
@@ -1307,8 +1307,8 @@ Status GraphManager::BuildGraphForUnregisteredOp(const GraphId &graph_id, const | |||
ret = kernel_info->CompileOp(node_vec); | |||
if (ret != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Call CompileOp fail for op:%s(%s), kernel_lib_name:%s, graph_id:%u, " | |||
"check invalid when GraphManager %s", op_desc->GetName().c_str(), op_desc->GetType().c_str(), | |||
op_desc->GetOpKernelLibName().c_str(), graph_id, __FUNCTION__); | |||
"check invalid", op_desc->GetName().c_str(), op_desc->GetType().c_str(), | |||
op_desc->GetOpKernelLibName().c_str(), graph_id); | |||
GELOGE(FAILED, "Get op kernel info store failed"); | |||
GELOGE(ret, "Compile op failed, op = %s, graph_id = %u.", op_desc->GetName().c_str(), graph_id); | |||
return ret; | |||
@@ -1333,22 +1333,22 @@ Status GraphManager::BuildGraph(const GraphId &graph_id, const std::vector<GeTen | |||
GraphNodePtr graph_node = nullptr; | |||
Status ret = GetGraphNode(graph_id, graph_node); | |||
if (ret != SUCCESS) { | |||
REPORT_INNER_ERROR("E19999", "Graph:%u not exist in graph_map, check invalid when GraphManager %s", | |||
graph_id, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Graph:%u not exist in graph_map, check invalid", | |||
graph_id); | |||
GELOGE(ret, "[BuildGraph] graph not exist, graph_id = %u.", graph_id); | |||
return ret; | |||
} | |||
if (graph_node == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Graph node is nullptr in graph_map, graph_id:%u, check invalid when GraphManager %s", | |||
graph_id, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Graph node is nullptr in graph_map, graph_id:%u, check invalid", | |||
graph_id); | |||
GELOGE(GE_GRAPH_GRAPH_NODE_NULL, "[BuildGraph] graph node is NULL, graphId = %u.", graph_id); | |||
return GE_GRAPH_GRAPH_NODE_NULL; | |||
} | |||
if (graph_node->GetRunFlag()) { | |||
REPORT_INNER_ERROR("E19999", "Graph is already running, can't be run again, graph_id:%u, " | |||
"check invalid when GraphManager %s", graph_id, __FUNCTION__); | |||
"check invalid", graph_id); | |||
GELOGE(GE_GRAPH_ALREADY_RUNNING, "[BuildGraph] graph already running, graph id = %u", graph_node->GetGraphId()); | |||
return GE_GRAPH_ALREADY_RUNNING; | |||
} | |||
@@ -1416,15 +1416,15 @@ Status GraphManager::RemoveGraph(const GraphId &graph_id) { | |||
GraphNodePtr graph_node = nullptr; | |||
Status ret = GetGraphNode(graph_id, graph_node); | |||
if (ret != SUCCESS) { | |||
REPORT_INNER_ERROR("E19999", "Graph:%u not exist in graph_map, check invalid when GraphManager %s", | |||
graph_id, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Graph:%u not exist in graph_map, check invalid", | |||
graph_id); | |||
GELOGE(GE_GRAPH_GRAPH_NOT_EXIST, "[GraphManager] Id %u does not exists.", graph_id); | |||
return GE_GRAPH_GRAPH_NOT_EXIST; | |||
} | |||
if ((graph_node == nullptr) || (graph_node->GetRunFlag())) { | |||
REPORT_INNER_ERROR("E19999", "Graph:%u is running, can't be remove, check invalid when GraphManager %s", | |||
graph_id, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Graph:%u is running, can't be remove, check invalid", | |||
graph_id); | |||
GELOGE(GE_GRAPH_GRAPH_IS_RUNNING, "[GraphManager] Id %u is running, can't be deleted.", graph_id); | |||
return GE_GRAPH_GRAPH_IS_RUNNING; | |||
} | |||
@@ -1446,8 +1446,8 @@ Status GraphManager::RemoveGraph(const GraphId &graph_id) { | |||
GELOGI("UnloadModel via new ome."); | |||
rt_ret = rtSetDevice(GetContext().DeviceId()); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtSetDevice failed, device_id:%u, graph_id:%u, when GraphManager %s", | |||
GetContext().DeviceId(), graph_id, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtSetDevice failed, device_id:%u, graph_id:%u", | |||
GetContext().DeviceId(), graph_id); | |||
GELOGE(RT_FAILED, "[GraphManager:] rtSetDevice failed, modelId=%u, graphId=%u.", | |||
all_sub_graph[i]->GetModelIdInfo().model_id, graph_id); | |||
ret = FAILED; | |||
@@ -1461,8 +1461,8 @@ Status GraphManager::RemoveGraph(const GraphId &graph_id) { | |||
} | |||
rt_ret = rtDeviceReset(GetContext().DeviceId()); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtDeviceReset fail, device_id:%u, graph_id:%u, when GraphManager %s", | |||
GetContext().DeviceId(), graph_id, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtDeviceReset fail, device_id:%u, graph_id:%u", | |||
GetContext().DeviceId(), graph_id); | |||
GELOGE(RT_FAILED, "[GraphManager:] unload model failed, modelId=%u, graphId=%u.", | |||
all_sub_graph[i]->GetModelIdInfo().model_id, graph_id); | |||
ret = FAILED; | |||
@@ -1479,8 +1479,8 @@ Status GraphManager::RemoveGraph(const GraphId &graph_id) { | |||
GELOGI("Unload model %u.", ge_root_model->GetModelId()); | |||
rt_ret = rtSetDevice(GetContext().DeviceId()); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtSetDevice failed, device_id:%u, graph_id:%u, when GraphManager %s", | |||
GetContext().DeviceId(), graph_id, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtSetDevice failed, device_id:%u, graph_id:%u", | |||
GetContext().DeviceId(), graph_id); | |||
GELOGE(RT_FAILED, "[GraphManager:] rtSetDevice failed, modelId=%u, graphId=%u.", ge_root_model->GetModelId(), | |||
graph_id); | |||
return FAILED; | |||
@@ -1493,8 +1493,8 @@ Status GraphManager::RemoveGraph(const GraphId &graph_id) { | |||
} | |||
rt_ret = rtDeviceReset(GetContext().DeviceId()); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtDeviceReset failed, device_id:%u, graph_id:%u, when GraphManager %s", | |||
GetContext().DeviceId(), graph_id, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtDeviceReset failed, device_id:%u, graph_id:%u", | |||
GetContext().DeviceId(), graph_id); | |||
GELOGE(RT_FAILED, "[GraphManager:] rtDeviceReset failed, modelId=%u, graphId=%u.", ge_root_model->GetModelId(), | |||
graph_id); | |||
ret = FAILED; | |||
@@ -1681,8 +1681,8 @@ Status GraphManager::ParseOption(const std::map<std::string, std::string> &optio | |||
} else if (flag == "1") { | |||
option = true; | |||
} else { | |||
REPORT_INNER_ERROR("E19999", "Option:%s value:%s must be 0 or 1, check invalid when GraphManager %s", | |||
key.c_str(), flag.c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Option:%s value:%s must be 0 or 1, check invalid", | |||
key.c_str(), flag.c_str()); | |||
GELOGE(GE_GRAPH_OPTIONS_INVALID, "Key:%s, its value %s is invalid, it must be 0 or 1.", key.c_str(), | |||
flag.c_str()); | |||
return GE_GRAPH_OPTIONS_INVALID; | |||
@@ -1699,8 +1699,8 @@ Status GraphManager::ParseOption(const std::map<std::string, std::string> &optio | |||
if (iter != options.end()) { | |||
option = static_cast<int32_t>(std::strtol(iter->second.c_str(), &ptr, kDecimal)); | |||
if (ptr != nullptr && *ptr != '\0') { | |||
REPORT_INNER_ERROR("E19999", "Option:%s value:%s must be int32_t type, check invalid when GraphManager %s", | |||
key.c_str(), iter->second.c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Option:%s value:%s must be int32_t type, check invalid", | |||
key.c_str(), iter->second.c_str()); | |||
GELOGE(GE_GRAPH_OPTIONS_INVALID, "Key:%s, its value %s is invalid, must be int32_t type.", key.c_str(), | |||
iter->second.c_str()); | |||
return GE_GRAPH_OPTIONS_INVALID; | |||
@@ -1744,8 +1744,8 @@ Status GraphManager::ParseOption(const std::map<std::string, std::string> &optio | |||
// split engine and num by : | |||
size_t pos = engine_parallel.find(':'); | |||
if (pos == string::npos) { | |||
REPORT_INNER_ERROR("E19999", "Option:%s, value:%s, engine and num must be connected by :, check invalid " | |||
"when GraphManager %s", key.c_str(), engine_parallel.c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Option:%s, value:%s, engine and num must be connected by :, check invalid", | |||
key.c_str(), engine_parallel.c_str()); | |||
GELOGE(GE_GRAPH_OPTIONS_INVALID, | |||
"engine and num must be connected by :, " | |||
"while your input is %s", | |||
@@ -1779,8 +1779,8 @@ Status GraphManager::ParseOption(const std::map<std::string, std::string> &optio | |||
Status GraphManager::CheckEngineName(const std::string &engine_name, const std::string &key, | |||
const std::map<std::string, int> &option) { | |||
if (engine_name.empty()) { | |||
REPORT_INNER_ERROR("E19999", "Option:%s, param engine_name:%s is empty, check invalid when GraphManager %s", | |||
key.c_str(), engine_name.c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Option:%s, param engine_name:%s is empty, check invalid", | |||
key.c_str(), engine_name.c_str()); | |||
GELOGE(GE_GRAPH_OPTIONS_INVALID, "engine name of %s is empty", key.c_str()); | |||
return GE_GRAPH_OPTIONS_INVALID; | |||
} | |||
@@ -1791,8 +1791,8 @@ Status GraphManager::CheckEngineName(const std::string &engine_name, const std:: | |||
auto it_stream_repeat = option.find(engine_name); | |||
if (it_stream_repeat != option.end()) { | |||
REPORT_INNER_ERROR("E19999", "Option:%s, param engine_name:%s is repeated, check invalid when GraphManager %s", | |||
key.c_str(), engine_name.c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Option:%s, param engine_name:%s is repeated, check invalid", | |||
key.c_str(), engine_name.c_str()); | |||
GELOGE(GE_GRAPH_OPTIONS_INVALID, "engine : %s of %s is repeated", engine_name.c_str(), key.c_str()); | |||
return GE_GRAPH_OPTIONS_INVALID; | |||
} | |||
@@ -1801,15 +1801,15 @@ Status GraphManager::CheckEngineName(const std::string &engine_name, const std:: | |||
Status GraphManager::ParseParallelNum(const std::string ¶llel_num, const std::string &key, int &num) { | |||
if (parallel_num.empty()) { | |||
REPORT_INNER_ERROR("E19999", "Option:%s, param parallel num:%s is empty, check invalid when GraphManager %s", | |||
key.c_str(), parallel_num.c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Option:%s, param parallel num:%s is empty, check invalid", | |||
key.c_str(), parallel_num.c_str()); | |||
GELOGE(GE_GRAPH_OPTIONS_INVALID, "parallel num of %s is empty", key.c_str()); | |||
return GE_GRAPH_OPTIONS_INVALID; | |||
} | |||
for (char c : parallel_num) { | |||
if (!isdigit(c)) { | |||
REPORT_INNER_ERROR("E19999", "Option:%s, param parallel num:%s is not digit, check invalid when GraphManager %s", | |||
key.c_str(), parallel_num.c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Option:%s, param parallel num:%s is not digit, check invalid", | |||
key.c_str(), parallel_num.c_str()); | |||
GELOGE(GE_GRAPH_OPTIONS_INVALID, "%s input is invalid ", key.c_str()); | |||
return GE_GRAPH_OPTIONS_INVALID; | |||
} | |||
@@ -1818,25 +1818,25 @@ Status GraphManager::ParseParallelNum(const std::string ¶llel_num, const std | |||
try { | |||
num = std::stoi(parallel_num); | |||
} catch (std::invalid_argument &) { | |||
REPORT_INNER_ERROR("E19999", "Option:%s, param parallel num:%s is invalid argument, check when GraphManager %s", | |||
key.c_str(), parallel_num.c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Option:%s, param parallel num:%s is invalid argument, check", | |||
key.c_str(), parallel_num.c_str()); | |||
GELOGE(GE_GRAPH_OPTIONS_INVALID, "parallel num : %s of %s is invalid argument", parallel_num.c_str(), key.c_str()); | |||
return GE_GRAPH_OPTIONS_INVALID; | |||
} catch (std::out_of_range &) { | |||
REPORT_INNER_ERROR("E19999", "Option:%s, param parallel num:%s is out of range, check when GraphManager %s", | |||
key.c_str(), parallel_num.c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Option:%s, param parallel num:%s is out of range, check", | |||
key.c_str(), parallel_num.c_str()); | |||
GELOGE(GE_GRAPH_OPTIONS_INVALID, "parallel num : %s of %s is out of range", parallel_num.c_str(), key.c_str()); | |||
return GE_GRAPH_OPTIONS_INVALID; | |||
} catch (...) { | |||
REPORT_INNER_ERROR("E19999", "Option:%s, param parallel num:%s is invalid argument, check when GraphManager %s", | |||
key.c_str(), parallel_num.c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Option:%s, param parallel num:%s is invalid argument, check", | |||
key.c_str(), parallel_num.c_str()); | |||
GELOGE(GE_GRAPH_OPTIONS_INVALID, "parallel num : %s of %s is invalid argument", parallel_num.c_str(), key.c_str()); | |||
return GE_GRAPH_OPTIONS_INVALID; | |||
} | |||
if (num < 1) { | |||
REPORT_INNER_ERROR("E19999", "Option:%s, param parallel num:%s < 1, check invalid when GraphManager %s", | |||
key.c_str(), parallel_num.c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Option:%s, param parallel num:%s < 1, check invalid", | |||
key.c_str(), parallel_num.c_str()); | |||
GELOGE(GE_GRAPH_OPTIONS_INVALID, "parallel num : %s of %s must bigger than 0", parallel_num.c_str(), key.c_str()); | |||
return GE_GRAPH_OPTIONS_INVALID; | |||
} | |||
@@ -1864,8 +1864,8 @@ Status GraphManager::GetGraphNode(const GraphId &graph_id, GraphNodePtr &out) { | |||
auto iter = graph_map_.find(graph_id); | |||
if (iter == graph_map_.end()) { | |||
out = nullptr; | |||
REPORT_INNER_ERROR("E19999", "Graph:%u not exist in graph_map, check invalid when GraphManager %s", | |||
graph_id, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Graph:%u not exist in graph_map, check invalid", | |||
graph_id); | |||
GELOGE(GE_GRAPH_GRAPH_NOT_EXIST, "[GraphManager] graph not exist, graph_id= %u.", graph_id); | |||
return GE_GRAPH_GRAPH_NOT_EXIST; | |||
} | |||
@@ -1886,8 +1886,7 @@ Status GraphManager::SummaryHandle(const GraphId &graph_id, std::vector<GeTensor | |||
const std::map<uint32_t, std::map<string, size_t>> &whole_summary_output_indexes = | |||
GetCompilerStages(graph_id).optimizer.GetSummaryOutputIndexes(); | |||
if (whole_summary_output_indexes.find(graph_id) == whole_summary_output_indexes.end()) { | |||
REPORT_INNER_ERROR("E19999", "Graph:%u not exist in whole_summary_output_indexes, check invalid " | |||
"when GraphManager %s", graph_id, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Graph:%u not exist in whole_summary_output_indexes, check invalid", graph_id); | |||
GELOGE(FAILED, "No Summary graph found in map."); | |||
return FAILED; | |||
} | |||
@@ -1933,8 +1932,8 @@ Status GraphManager::CheckpointHandle(const GraphId &graph_id, const ComputeGrap | |||
} | |||
} | |||
if (netoutput == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "No netoutput node in graph:%u, check invalid when GraphManager %s", | |||
graph_id, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "No netoutput node in graph:%u, check invalid", | |||
graph_id); | |||
GELOGE(FAILED, "Netoutput is null."); | |||
return FAILED; | |||
} | |||
@@ -1942,9 +1941,9 @@ Status GraphManager::CheckpointHandle(const GraphId &graph_id, const ComputeGrap | |||
std::string desc_name; | |||
auto out_anchor = in->GetPeerOutAnchor(); | |||
if (out_anchor == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Peer anchor of op:%s(%s), in_index:%u is nullptr, graph_id:%u, check invalid " | |||
"when GraphManager %s", netoutput->GetName().c_str(), netoutput->GetType().c_str(), | |||
in->GetIdx(), graph_id, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Peer anchor of op:%s(%s), in_index:%u is nullptr, graph_id:%u, check invalid", | |||
netoutput->GetName().c_str(), netoutput->GetType().c_str(), | |||
in->GetIdx(), graph_id); | |||
GELOGE(FAILED, "out_anchor is null."); | |||
return FAILED; | |||
} | |||
@@ -1953,8 +1952,7 @@ Status GraphManager::CheckpointHandle(const GraphId &graph_id, const ComputeGrap | |||
while (peer_node != nullptr && peer_node->GetType() != kVariable) { | |||
if (peer_node->GetAllInDataAnchors().size() != 1) { | |||
REPORT_INNER_ERROR("E19999", "More than one prior nodes of peer_node:%s(%s) in checkpoint Graph:%u, " | |||
"check invalid when GraphManager %s", | |||
peer_node->GetName().c_str(), peer_node->GetType().c_str(), graph_id, __FUNCTION__); | |||
"check invalid", peer_node->GetName().c_str(), peer_node->GetType().c_str(), graph_id); | |||
GELOGE(FAILED, "More than one prior nodes of peer_node %s in checkpoint Graph.", peer_node->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -1968,9 +1966,9 @@ Status GraphManager::CheckpointHandle(const GraphId &graph_id, const ComputeGrap | |||
} | |||
} | |||
if (peer_node == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Peer anchor node of op:%s(%s), in_index:%u is nullptr, graph_id:%u, check invalid " | |||
"when GraphManager %s", netoutput->GetName().c_str(), netoutput->GetType().c_str(), | |||
in->GetIdx(), graph_id, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Peer anchor node of op:%s(%s), in_index:%u is nullptr, graph_id:%u, check invalid", | |||
netoutput->GetName().c_str(), netoutput->GetType().c_str(), | |||
in->GetIdx(), graph_id); | |||
GELOGE(FAILED, "No variable op found in one branch, checkpoint graph illegal."); | |||
return FAILED; | |||
} | |||
@@ -1978,8 +1976,8 @@ Status GraphManager::CheckpointHandle(const GraphId &graph_id, const ComputeGrap | |||
GELOGI("[GraphManager] CheckpointHandle, descName=%s.", desc_name.c_str()); | |||
if (in->GetIdx() >= static_cast<int>(outputs.size())) { | |||
REPORT_INNER_ERROR("E19999", "in index:%u of op:%s(%s) is out of outputs.size:%zu range, graph_id:%u, " | |||
"check invalid when GraphManager %s", in->GetIdx(), netoutput->GetName().c_str(), | |||
netoutput->GetType().c_str(), outputs.size(), graph_id, __FUNCTION__); | |||
"check invalid", in->GetIdx(), netoutput->GetName().c_str(), | |||
netoutput->GetType().c_str(), outputs.size(), graph_id); | |||
GELOGE(FAILED, "variable index out of range."); | |||
return FAILED; | |||
} | |||
@@ -2026,8 +2024,8 @@ Status GraphManager::PushSummaryData2ME(const GraphId &graph_id, | |||
} | |||
return iter->second(graph_id, tmp_summary_data); | |||
} | |||
REPORT_INNER_ERROR("E19999", "No summary callback found, graph_id:%u, check invalid when GraphManager %s", | |||
graph_id, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "No summary callback found, graph_id:%u, check invalid", | |||
graph_id); | |||
GELOGE(FAILED, "[GraphManager] PushSummaryData2ME failed, not found summary callback."); | |||
return FAILED; | |||
} | |||
@@ -2048,8 +2046,8 @@ Status GraphManager::PushSaveData2ME(const GraphId &graph_id, const std::map<std | |||
} | |||
return iter->second(graph_id, tmp_save_data); | |||
} | |||
REPORT_INNER_ERROR("E19999", "No checkpoint callback found, graph_id:%u, check invalid when GraphManager %s", | |||
graph_id, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "No checkpoint callback found, graph_id:%u, check invalid", | |||
graph_id); | |||
GELOGE(FAILED, "[GraphManager] PushSaveData2ME failed, not found checkpoint callback."); | |||
return FAILED; | |||
} | |||
@@ -2078,8 +2076,8 @@ bool GraphManager::CheckVariableForCheckpointGraph(NodePtr &node) { | |||
} | |||
auto out = node->GetOutDataAnchor(0); | |||
if (out == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "anchor index:0 of op:%s(%s) is nullptr, check invalid when GraphManager %s", | |||
node->GetName().c_str(), node->GetType().c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "anchor index:0 of op:%s(%s) is nullptr, check invalid", | |||
node->GetName().c_str(), node->GetType().c_str()); | |||
GELOGE(GE_GRAPH_PARAM_NULLPTR, "out is nullptr."); | |||
return false; | |||
} | |||
@@ -2112,7 +2110,7 @@ static inline bool CheckConstanOpForCheckpointGraph(NodePtr &node) { return node | |||
bool GraphManager::IsCheckpointGraph(ComputeGraphPtr &compute_graph) { | |||
if (compute_graph == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Param compute_graph is nullptr, check invalid when GraphManager %s", __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Param compute_graph is nullptr, check invalid"); | |||
GELOGE(GE_GRAPH_PARAM_NULLPTR, "[IsCheckpointGraph] computeGraph is nullptr."); | |||
return false; | |||
} | |||
@@ -2247,8 +2245,8 @@ Status GraphManager::RemoveIsolatedConstInThisGraph(ge::ComputeGraphPtr &compute | |||
if (n->GetOutAllNodes().empty() && n->GetInAllNodes().empty()) { | |||
// it is an isolated constant, just remove it | |||
if (GraphUtils::RemoveJustNode(compute_graph, n) != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Remove constant op:%s(%s) failed when GraphManager %s", | |||
n->GetName().c_str(), n->GetType().c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Remove constant op:%s(%s) failed", | |||
n->GetName().c_str(), n->GetType().c_str()); | |||
GELOGE(FAILED, "remove constant %s failed.", n->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -2643,8 +2641,8 @@ Status GraphManager::CheckAndReleaseMemory(const GeModelPtr &ge_model, const Gra | |||
" Device[%u] free_memory_size[%ld]", | |||
graph_node->GetGraphId(), memory_size, weight_size, GetContext().DeviceId(), free_memory); | |||
if (ge::CheckInt64AddOverflow(memory_size, weight_size) != SUCCESS) { | |||
REPORT_INNER_ERROR("E19999", "memory_size:%ld and weight_size:%ld will overflow after add, check invalid " | |||
"when GraphManager %s", memory_size, weight_size, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "memory_size:%ld and weight_size:%ld will overflow after add, check invalid", | |||
memory_size, weight_size); | |||
GELOGE(INTERNAL_ERROR, "The sum of Memory size and weight size exceeds INT64_MAX"); | |||
return INTERNAL_ERROR; | |||
} | |||
@@ -2688,8 +2686,8 @@ Status GraphManager::CheckAndReleaseMemory(const GeModelPtr &ge_model, const Gra | |||
max_memory_size); | |||
rtError_t rt_ret = rtSetDevice(GetContext().DeviceId()); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtSetDevice failed, device_id:%u, when GraphManager %s", | |||
GetContext().DeviceId(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtSetDevice failed, device_id:%u", | |||
GetContext().DeviceId()); | |||
GELOGE(RT_FAILED, "[GraphManager:] rtSetDevice failed, modelId=%u, graphId=%u.", model_id, graph_id); | |||
continue; | |||
} | |||
@@ -2704,8 +2702,8 @@ Status GraphManager::CheckAndReleaseMemory(const GeModelPtr &ge_model, const Gra | |||
} | |||
rt_ret = rtDeviceReset(GetContext().DeviceId()); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtDeviceReset failed, device_id:%u, when GraphManager %s", | |||
GetContext().DeviceId(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtDeviceReset failed, device_id:%u", | |||
GetContext().DeviceId()); | |||
GELOGE(RT_FAILED, "[GraphManager:] rtDeviceReset failed, modelId=%u, graphId=%u.", model_id, graph_id); | |||
continue; | |||
} | |||
@@ -2735,14 +2733,14 @@ Status GraphManager::ProcessSubGraphWithMultiThreads(GraphManager *graph_manager | |||
GE_DUMP(compute_graph_tmp, "OptimizeSubGraphBefore"); | |||
GE_CHECK_NOTNULL(compute_graph_tmp); | |||
if (!AttrUtils::SetInt(*compute_graph_tmp, ATTR_NAME_ROOT_GRAPH_ID, root_graph_id)) { | |||
REPORT_CALL_ERROR("E19999", "Set Attr:%s to graph:%u, when GraphManager %s", ATTR_NAME_ROOT_GRAPH_ID.c_str(), | |||
compute_graph_tmp->GetGraphID(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Set Attr:%s to graph:%u", ATTR_NAME_ROOT_GRAPH_ID.c_str(), | |||
compute_graph_tmp->GetGraphID()); | |||
GELOGE(FAILED, "Failed to set attr ATTR_NAME_ROOT_GRAPH_ID for subgraph, graph_id: %u.", root_graph_id); | |||
return FAILED; | |||
} | |||
if (!AttrUtils::SetStr(*compute_graph_tmp, ATTR_NAME_ROOT_GRAPH_NAME, root_graph_name)) { | |||
REPORT_CALL_ERROR("E19999", "Set Attr:%s to graph:%u, when GraphManager %s", ATTR_NAME_ROOT_GRAPH_NAME.c_str(), | |||
compute_graph_tmp->GetGraphID(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Set Attr:%s to graph:%u", ATTR_NAME_ROOT_GRAPH_NAME.c_str(), | |||
compute_graph_tmp->GetGraphID()); | |||
GELOGE(FAILED, "Failed to set attr ATTR_NAME_ROOT_GRAPH_NAME for subgraph, \ | |||
root_graph_name: %s.", root_graph_name.c_str()); | |||
return FAILED; | |||
@@ -2762,8 +2760,7 @@ Status GraphManager::ProcessSubGraphWithMultiThreads(GraphManager *graph_manager | |||
compute_graph_tmp != nullptr ? compute_graph_tmp->GetName().c_str() : "", engine_name.c_str(), | |||
pthread_self()); | |||
} else { | |||
REPORT_INNER_ERROR("E19999", "Param sub_graph_info_ptr or graph_manager is nullptr when GraphManager %s", | |||
__FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Param sub_graph_info_ptr or graph_manager is nullptr"); | |||
GELOGE(FAILED, "graph_manager or sub_graph_info_ptr is nullptr"); | |||
return FAILED; | |||
} | |||
@@ -2977,16 +2974,16 @@ Status GraphManager::ParseInputsDimsForGetNexNosinkAndData(const vector<NodePtr> | |||
} | |||
GeAttrValue::INT index = 0; | |||
if (!(AttrUtils::GetInt(op_desc, ATTR_NAME_INDEX, index))) { | |||
REPORT_CALL_ERROR("E19999", "Get Attr:%s from op:%s(%s) fail when GraphManager %s", ATTR_NAME_INDEX.c_str(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Get Attr:%s from op:%s(%s) fail", ATTR_NAME_INDEX.c_str(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(PARAM_INVALID, "Get index from attr failed"); | |||
return PARAM_INVALID; | |||
} | |||
if (static_cast<size_t>(index) > input_tensor.size()) { | |||
REPORT_INNER_ERROR("E19999", "Attr:%s in op:%s(%s) value:%ld > param input_tensor.size:%zu, " | |||
"check invalid when GraphManager %s", ATTR_NAME_INDEX.c_str(), | |||
"check invalid", ATTR_NAME_INDEX.c_str(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), | |||
index, input_tensor.size(), __FUNCTION__); | |||
index, input_tensor.size()); | |||
GELOGE(PARAM_INVALID, "The count of input tensor should be equal to the count of data."); | |||
return PARAM_INVALID; | |||
} | |||
@@ -3135,7 +3132,7 @@ void GraphManager::ReturnError(GraphManager *graph_manager, GraphNodePtr &graph_ | |||
auto compute_graph = GraphUtils::GetComputeGraph(*graph_node->GetGraph()); | |||
if (graph_manager == nullptr || compute_graph == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Param graph_manager or compute_graph in graph_node is nullptr, " | |||
"check invalid when GraphManager %s", __FUNCTION__); | |||
"check invalid"); | |||
GELOGE(GRAPH_FAILED, "[Analyze Mode] compute graph is null!"); | |||
callback(GRAPH_FAILED, outputs); | |||
return; | |||
@@ -3156,8 +3153,8 @@ void GraphManager::ReturnError(GraphManager *graph_manager, GraphNodePtr &graph_ | |||
} | |||
if (len < 0) { | |||
REPORT_INNER_ERROR("E19999", "InputIndex:%zu ShapeSize:%ld of op:%s(%s) < 0, unknown shape is not support, " | |||
"check invalid when GraphManager %s", i, len, | |||
node->GetName().c_str(), node->GetType().c_str(), __FUNCTION__); | |||
"check invalid", i, len, | |||
node->GetName().c_str(), node->GetType().c_str()); | |||
GELOGE(GRAPH_FAILED, "Analyze Mode does not support GEOP output unknown shape!"); | |||
callback(GRAPH_FAILED, outputs); | |||
return; | |||
@@ -3167,10 +3164,9 @@ void GraphManager::ReturnError(GraphManager *graph_manager, GraphNodePtr &graph_ | |||
} | |||
auto size = GetSizeByDataType(input_desc->GetDataType()); | |||
if (size <= 0) { | |||
REPORT_INNER_ERROR("E19999", "data_type:%s of op:%s(%s) is not support, input_index:%zu check invalid " | |||
"when GraphManager %s", | |||
REPORT_INNER_ERROR("E19999", "data_type:%s of op:%s(%s) is not support, input_index:%zu check invalid", | |||
ge::TypeUtils::DataTypeToSerialString(input_desc->GetDataType()).c_str(), | |||
node->GetName().c_str(), node->GetType().c_str(), i, __FUNCTION__); | |||
node->GetName().c_str(), node->GetType().c_str(), i); | |||
GELOGE(PARAM_INVALID, "Failed to get cube size, the data type %s is invalid", | |||
ge::TypeUtils::DataTypeToSerialString(input_desc->GetDataType()).c_str()); | |||
callback(GRAPH_FAILED, outputs); | |||
@@ -3178,9 +3174,9 @@ void GraphManager::ReturnError(GraphManager *graph_manager, GraphNodePtr &graph_ | |||
} | |||
if (CheckInt64MulOverflow(len, static_cast<int64_t>(size)) != true) { | |||
REPORT_INNER_ERROR("E19999", "shape_size:%ld of op:%s(%s) will overflow after multiply by " | |||
"size:%u of data_type:%s, input_index:%zu, check invalid when GraphManager %s", len, | |||
"size:%u of data_type:%s, input_index:%zu, check invalid", len, | |||
node->GetName().c_str(), node->GetType().c_str(), size, | |||
ge::TypeUtils::DataTypeToSerialString(input_desc->GetDataType()).c_str(), i, __FUNCTION__); | |||
ge::TypeUtils::DataTypeToSerialString(input_desc->GetDataType()).c_str(), i); | |||
GELOGE(MEMALLOC_FAILED, "int64 multiply happens overflow! a:%ld b:%d", len, size); | |||
callback(GRAPH_FAILED, outputs); | |||
return; | |||
@@ -3203,15 +3199,15 @@ bool GraphManager::IsGraphNeedRebuild(uint32_t graph_id) { | |||
GraphNodePtr graph_node = nullptr; | |||
Status ret = GetGraphNode(graph_id, graph_node); | |||
if (ret != SUCCESS) { | |||
REPORT_INNER_ERROR("E19999", "Graph:%u not exist in graph_map, check invalid when GraphManager %s", | |||
graph_id, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Graph:%u not exist in graph_map, check invalid", | |||
graph_id); | |||
GELOGE(ret, "[RunGraph] graph not exist, graph_id=%u.", graph_id); | |||
return true; | |||
} | |||
if (graph_node == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Graph node is nullptr in graph_map, graph_id:%u, check invalid when GraphManager %s", | |||
graph_id, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Graph node is nullptr in graph_map, graph_id:%u, check invalid", | |||
graph_id); | |||
GELOGE(GE_GRAPH_GRAPH_NODE_NULL, "[RunGraph] graph node is NULL, graphId=%u.", graph_id); | |||
return true; | |||
} | |||
@@ -3226,15 +3222,15 @@ const map<std::string, std::string> *GraphManager::GetGraphOptions(uint32_t grap | |||
GraphNodePtr graph_node = nullptr; | |||
Status ret = GetGraphNode(graph_id, graph_node); | |||
if (ret != SUCCESS) { | |||
REPORT_INNER_ERROR("E19999", "Graph:%u not exist in graph_map, check invalid when GraphManager %s", | |||
graph_id, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Graph:%u not exist in graph_map, check invalid", | |||
graph_id); | |||
GELOGE(ret, "[RunGraph] graph not exist, graph_id=%u.", graph_id); | |||
return nullptr; | |||
} | |||
if (!graph_node) { | |||
REPORT_INNER_ERROR("E19999", "Graph node is nullptr in graph_map, graph_id:%u, check invalid when GraphManager %s", | |||
graph_id, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Graph node is nullptr in graph_map, graph_id:%u, check invalid", | |||
graph_id); | |||
GELOGE(GE_GRAPH_GRAPH_NODE_NULL, "[RunGraph] graph node is NULL, graph_id=%u.", graph_id); | |||
return nullptr; | |||
} | |||
@@ -3265,8 +3261,8 @@ Status GraphManager::OptimizeSubgraph(const GraphNodePtr &graph_node, ComputeGra | |||
} | |||
bool dynamic_shape_partitioned = false; | |||
if (!AttrUtils::GetBool(*compute_graph, ATTR_NAME_DYNAMIC_SHAPE_PARTITIONED, dynamic_shape_partitioned)) { | |||
REPORT_INNER_ERROR("E19999", "Get Attr:%s from graph:%u fail when GraphManager %s", | |||
ATTR_NAME_DYNAMIC_SHAPE_PARTITIONED.c_str(), compute_graph->GetGraphID(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Get Attr:%s from graph:%u fail", | |||
ATTR_NAME_DYNAMIC_SHAPE_PARTITIONED.c_str(), compute_graph->GetGraphID()); | |||
GELOGE(FAILED, "failed get dynamic shape partitioned flag on partitioned graph."); | |||
return FAILED; | |||
} | |||
@@ -3324,8 +3320,8 @@ Status GraphManager::OptimizeSubgraph(const GraphNodePtr &graph_node, ComputeGra | |||
if (AttrUtils::GetBool(compute_graph, ATTR_NAME_OFF_SUPERKERNEL_ATTR, off_superkernel)) { | |||
GELOGI("Compute graph %s get superkernel flag %d.", compute_graph->GetName().c_str(), off_superkernel); | |||
if (!AttrUtils::SetBool(merged_compute_graph, ATTR_NAME_OFF_SUPERKERNEL_ATTR, off_superkernel)) { | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s to graph:%u fail when GraphManager %s", | |||
ATTR_NAME_OFF_SUPERKERNEL_ATTR.c_str(), compute_graph->GetGraphID(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s to graph:%u fail", | |||
ATTR_NAME_OFF_SUPERKERNEL_ATTR.c_str(), compute_graph->GetGraphID()); | |||
GELOGE(FAILED, "Compute graph %s set superkernel flag %d failed", merged_compute_graph->GetName().c_str(), | |||
off_superkernel); | |||
return FAILED; | |||
@@ -3335,8 +3331,8 @@ Status GraphManager::OptimizeSubgraph(const GraphNodePtr &graph_node, ComputeGra | |||
GE_DUMP(merged_compute_graph, "mergedComputeGraph"); | |||
compute_graph = merged_compute_graph; | |||
if (!AttrUtils::SetBool(*compute_graph, ATTR_NAME_DYNAMIC_SHAPE_PARTITIONED, dynamic_shape_partitioned)) { | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s to graph:%u fail when GraphManager %s", | |||
ATTR_NAME_DYNAMIC_SHAPE_PARTITIONED.c_str(), compute_graph->GetGraphID(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Set Attr:%s to graph:%u fail", | |||
ATTR_NAME_DYNAMIC_SHAPE_PARTITIONED.c_str(), compute_graph->GetGraphID()); | |||
GELOGE(FAILED, "failed set dynamic shape partitioned flag on partitioned graph."); | |||
return FAILED; | |||
} | |||
@@ -3450,8 +3446,8 @@ Status GraphManager::SaveVariables(const Graph &graph, const std::vector<std::st | |||
if (!var_names.empty()) { | |||
for (const auto &var_name : var_names) { | |||
if (var_results.count(var_name) == 0) { | |||
REPORT_INNER_ERROR("E19999", "Fetch Var:%s result value fail when GraphManager %s", | |||
var_name.c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Fetch Var:%s result value fail", | |||
var_name.c_str()); | |||
GELOGE(FAILED, "Fetch var[%s] value failed.", var_name.c_str()); | |||
return FAILED; | |||
} else { | |||
@@ -3491,8 +3487,8 @@ Status GraphManager::SaveCheckPointResult(const Graph &graph, const std::vector< | |||
while (peer_node->GetType() != VARIABLE) { | |||
if (peer_node->GetAllInDataAnchors().size() != 1) { | |||
REPORT_INNER_ERROR("E19999", "peer node:%s(%s) of netoutput has more than 1 input in checkpoint Graph, " | |||
"check invalid when GraphManager %s", | |||
peer_node->GetName().c_str(), peer_node->GetType().c_str(), __FUNCTION__); | |||
"check invalid", | |||
peer_node->GetName().c_str(), peer_node->GetType().c_str()); | |||
GELOGE(FAILED, "peer_node [%s] has more than 1 input in checkpoint Graph.", peer_node->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -3507,8 +3503,8 @@ Status GraphManager::SaveCheckPointResult(const Graph &graph, const std::vector< | |||
} | |||
if (peer_node->GetType() != VARIABLE) { | |||
REPORT_INNER_ERROR("E19999", "peer node:%s(%s) of netoutput is not variable in checkpoint Graph, " | |||
"check invalid when GraphManager %s", | |||
peer_node->GetName().c_str(), peer_node->GetType().c_str(), __FUNCTION__); | |||
"check invalid", | |||
peer_node->GetName().c_str(), peer_node->GetType().c_str()); | |||
GELOGE(FAILED, " peer_node %s is not variable in checkpoint Graph.", peer_node->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -3516,7 +3512,7 @@ Status GraphManager::SaveCheckPointResult(const Graph &graph, const std::vector< | |||
GELOGI("[GraphManager] SaveVariables, varName is %s.", var_name.c_str()); | |||
if (in->GetIdx() >= static_cast<int>(outputs.size())) { | |||
REPORT_INNER_ERROR("E19999", "In index:%u of netoutput is out of outputs.size:%zu range in checkpoint Graph, " | |||
"check invalid when GraphManager %s", in->GetIdx(), outputs.size(), __FUNCTION__); | |||
"check invalid", in->GetIdx(), outputs.size()); | |||
GELOGE(FAILED, "variable index[%d] out of range[%zu].", in->GetIdx(), outputs.size()); | |||
return FAILED; | |||
} | |||
@@ -84,7 +84,7 @@ Status SubGraphInfo::FreeInOutBuffer() { | |||
rtError_t rt_ret; | |||
rt_ret = rtFreeHost(*iter); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtFreeHost fail when SubGraphInfo %s", __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtFreeHost fail"); | |||
GELOGE(rt_ret, "[GraphManager] subgraph free buffer failed, modelId = %u", model_id_info_.model_id); | |||
buffer_addr_.erase(buffer_addr_.begin(), iter); | |||
return GE_GRAPH_FREE_FAILED; | |||
@@ -120,7 +120,7 @@ Status GraphModelListener::OnComputeDone(uint32_t model_id, uint32_t task_id, ui | |||
uint32_t GraphModelListener::GetResultCode() const { | |||
if (!is_finished_) { | |||
REPORT_CALL_ERROR("E19999", "Model not run finish, fail for %s", __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Model not run finish"); | |||
GELOGE(INTERNAL_ERROR, "[GraphManager] model not run finish."); | |||
return INTERNAL_ERROR; | |||
} | |||
@@ -49,8 +49,8 @@ uint8_t *MemoryAllocator::MallocMemory(const string &purpose, size_t memory_size | |||
uint8_t *memory_addr = nullptr; | |||
if (rtMalloc(reinterpret_cast<void **>(&memory_addr), memory_size, memory_type_) != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc fail, purpose:%s, size:%zu, device_id:%u, when MemoryAllocator %s", | |||
purpose.c_str(), memory_size, device_id, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc fail, purpose:%s, size:%zu, device_id:%u", | |||
purpose.c_str(), memory_size, device_id); | |||
GELOGE(ge::INTERNAL_ERROR, | |||
"MemoryAllocator::MallocMemory device_id = %u," | |||
" size= %lu", | |||
@@ -68,7 +68,7 @@ Status MemoryAllocator::FreeMemory(uint8_t *memory_addr, uint32_t device_id) con | |||
GELOGI("MemoryAllocator::FreeMemory device_id = %u", device_id); | |||
auto rtRet = rtFree(memory_addr); | |||
if (rtRet != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtFree fail, device_id:%u, when MemoryAllocator %s", device_id, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtFree fail, device_id:%u", device_id); | |||
GELOGE(rtRet, "MemoryAllocator::MallocMemory device_id = %u", device_id); | |||
return RT_ERROR_TO_GE_STATUS(rtRet); | |||
} | |||
@@ -87,9 +87,8 @@ uint8_t *MemoryAllocator::MallocMemory(const string &purpose, const string &memo | |||
uint8_t *memory_addr = MallocMemory(purpose, memory_size, device_id); | |||
if (memory_addr == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "Malloc Memory fail, purpose:%s, memory_key:%s, memory_size:%zu, device_id:%u, " | |||
"when MemoryAllocator %s", purpose.c_str(), memory_key.c_str(), | |||
memory_size, device_id, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Malloc Memory fail, purpose:%s, memory_key:%s, memory_size:%zu, device_id:%u", | |||
purpose.c_str(), memory_key.c_str(), memory_size, device_id); | |||
GELOGE(ge::INTERNAL_ERROR, | |||
"MemoryAllocator::MallocMemory failed," | |||
" memory_key[%s], size = %lu.", | |||
@@ -126,8 +125,8 @@ Status MemoryAllocator::FreeMemory(const string &memory_key, uint32_t device_id) | |||
} | |||
if (FreeMemory(it->second.memory_addr_, device_id) != ge::SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Free Memory fail, memory_key:%s, device_id:%u, when MemoryAllocator %s", | |||
memory_key.c_str(), device_id, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Free Memory fail, memory_key:%s, device_id:%u", | |||
memory_key.c_str(), device_id); | |||
GELOGE(ge::INTERNAL_ERROR, | |||
"MemoryAllocator::FreeMemory rtFree failed," | |||
" memory_key[%s]", | |||
@@ -177,7 +176,7 @@ Status MemManager::Initialize(const std::vector<rtMemType_t> &memory_type) { | |||
memory_allocator_map_[index] = memory_allocator; | |||
GELOGI("Create MemoryAllocator memory type[%u] success.", index); | |||
} else { | |||
REPORT_CALL_ERROR("E19999", "New MemoryAllocator fail, index:%u, when MemoryAllocator %s", index, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "New MemoryAllocator fail, index:%u", index); | |||
GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "Alloc MemoryAllocator failed."); | |||
} | |||
} else { | |||
@@ -40,7 +40,7 @@ ge::Status VarResource::GetVarAddr(const std::string &var_name, const ge::GeTens | |||
rtMemType_t &memory_type) { | |||
if (dev_ptr == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Param dev_ptr is nullptr, var_name:%s, session_id:%lu, " | |||
"check invalid when VarResource %s", var_name.c_str(), session_id_, __FUNCTION__); | |||
"check invalid", var_name.c_str(), session_id_); | |||
GELOGE(FAILED, "[GetVarAddr] dev_ptr is null!"); | |||
return FAILED; | |||
} | |||
@@ -50,8 +50,8 @@ ge::Status VarResource::GetVarAddr(const std::string &var_name, const ge::GeTens | |||
auto iter = var_addr_mgr_map_.find(var_key); | |||
if (iter == var_addr_mgr_map_.end()) { | |||
REPORT_INNER_ERROR("E19999", "var_key:%s can't find in var_addr_mgr_map_, var_name:%s, session_id:%lu, " | |||
"check invalid when VarResource %s", var_key.c_str(), var_name.c_str(), | |||
session_id_, __FUNCTION__); | |||
"check invalid", var_key.c_str(), var_name.c_str(), | |||
session_id_); | |||
GELOGE(FAILED, "VarResource::GetVarAddr failed, var_key %s", var_key.c_str()); | |||
return FAILED; | |||
} | |||
@@ -108,8 +108,8 @@ ge::Status VarResource::SaveVarAddr(const std::string &var_name, const ge::GeTen | |||
} | |||
REPORT_INNER_ERROR("E19999", "var_key:%s conflict in var_addr_mgr_map_, var_name:%s, session_id:%lu, " | |||
"check invalid when VarResource %s", var_key.c_str(), var_name.c_str(), | |||
session_id_, __FUNCTION__); | |||
"check invalid", var_key.c_str(), var_name.c_str(), | |||
session_id_); | |||
GELOGE(FAILED, "VarResource::SaveVarAddr, var_key %s save addr conflict", var_key.c_str()); | |||
return FAILED; | |||
} | |||
@@ -144,8 +144,8 @@ ge::Status VarResource::RenewCurVarDesc(const std::string &var_name, const ge::O | |||
} | |||
if (op_desc == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Param op_desc is nullptr, var_name:%s, session_id:%lu, check invalid " | |||
"when VarResource %s", var_name.c_str(), session_id_, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Param op_desc is nullptr, var_name:%s, session_id:%lu, check invalid", | |||
var_name.c_str(), session_id_); | |||
GELOGE(FAILED, "[RenewCurVarDesc] renew var desc fail! input opdesc is null!"); | |||
return FAILED; | |||
} | |||
@@ -163,8 +163,8 @@ ge::Status VarResource::RenewCurVarDesc(const std::string &var_name, const ge::O | |||
auto iter = var_addr_mgr_map_.find(key); | |||
if (iter == var_addr_mgr_map_.end()) { | |||
REPORT_INNER_ERROR("E19999", "var_key:%s can't find in var_addr_mgr_map_, var_name:%s, session_id:%lu, op:%s(%s), " | |||
"check invalid when VarResource %s", key.c_str(), var_name.c_str(), | |||
session_id_, op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); | |||
"check invalid", key.c_str(), var_name.c_str(), | |||
session_id_, op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(FAILED, "[RenewCurVarDesc] can't find ele with key [%s]", key.c_str()); | |||
return FAILED; | |||
} | |||
@@ -285,14 +285,14 @@ Status HbmMemResource::AssignVarMem(const std::string &var_name, uint64_t size, | |||
total_size_ = VarManager::Instance(session_id)->GetVarMemMaxSize(); | |||
if (total_size_ < var_mem_size_) { | |||
REPORT_INNER_ERROR("E19999", "VarMemMaxSize:%lu < var_mem_size_:%lu, var_size:%lu, var_name:%s, check invalid" | |||
" when HbmMemResource %s", total_size_, var_mem_size_, size, var_name.c_str(), __FUNCTION__); | |||
"", total_size_, var_mem_size_, size, var_name.c_str()); | |||
GELOGE(PARAM_INVALID, "total_size_: %lu is smaller than var_mem_size_: %lu", total_size_, var_mem_size_); | |||
return PARAM_INVALID; | |||
} | |||
uint64_t free_size = total_size_ - var_mem_size_; | |||
if (free_size < (size + kSessionMemAlignSize * kSessionMemAlignUnit)) { | |||
REPORT_INNER_ERROR("E19999", "free_size:%lu not enough, var_align_size:%lu, var_name:%s, check invalid " | |||
"when HbmMemResource %s", free_size, size, var_name.c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "free_size:%lu not enough, var_align_size:%lu, var_name:%s, check invalid", | |||
free_size, size, var_name.c_str()); | |||
GELOGE(PARAM_INVALID, "Out of memory : current var size[%lu] exceeds total var size[%lu]", | |||
size + kSessionMemAlignSize * kSessionMemAlignUnit + var_mem_size_, total_size_); | |||
return PARAM_INVALID; | |||
@@ -316,8 +316,8 @@ Status HbmMemResource::AssignVarMem(const std::string &var_name, uint64_t size, | |||
Status RdmaMemResource::AssignVarMem(const std::string &var_name, uint64_t size, uint64_t session_id, size_t &address) { | |||
uint8_t *buffer = MemManager::Instance().RdmaPoolInstance(RT_MEMORY_HBM).Malloc(size); | |||
if (buffer == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "malloc rdma memory fail, var_size:%lu, var_name:%s when RdmaMemResource %s", | |||
size, var_name.c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "malloc rdma memory fail, var_size:%lu, var_name:%s", | |||
size, var_name.c_str()); | |||
GELOGE(MEMALLOC_FAILED, "Failed to malloc rdma memory for node %s, size = %lu", var_name.c_str(), size); | |||
return MEMALLOC_FAILED; | |||
} | |||
@@ -467,8 +467,8 @@ int64_t VarManager::GetVarMemSize(rtMemType_t memory_type) { | |||
} | |||
if (mem_resource == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Find no mem_resource in map, memory_type:%d, session_id:%lu when VarManager %s", | |||
memory_type, session_id_, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Find no mem_resource in map, memory_type:%d, session_id:%lu", | |||
memory_type, session_id_); | |||
GELOGE(ge::INTERNAL_ERROR, "MemResource is invalid."); | |||
return 0; | |||
} | |||
@@ -482,8 +482,8 @@ Status VarManager::UpdateVarMemSize(rtMemType_t memory_type, int64_t mem_size) { | |||
if (iter == mem_resource_map_.end()) { | |||
mem_resource = MemResource::BuildMemResourceFromType(memory_type); | |||
if (mem_resource == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "memory_type:%d invalid or New MemResource fail, session_id:%lu when VarManager %s", | |||
memory_type, session_id_, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "memory_type:%d invalid or New MemResource fail, session_id:%lu", | |||
memory_type, session_id_); | |||
GELOGE(ge::INTERNAL_ERROR, "Alloc MemResource failed, memory_type = %u.", memory_type); | |||
return ge::INTERNAL_ERROR; | |||
} else { | |||
@@ -494,8 +494,8 @@ Status VarManager::UpdateVarMemSize(rtMemType_t memory_type, int64_t mem_size) { | |||
} | |||
if (mem_resource == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "MemResource is invalid, memory_type:%d, session_id:%lu when VarManager %s", | |||
memory_type, session_id_, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "MemResource is invalid, memory_type:%d, session_id:%lu", | |||
memory_type, session_id_); | |||
GELOGE(ge::INTERNAL_ERROR, "MemResource is invalid."); | |||
return FAILED; | |||
} | |||
@@ -514,8 +514,8 @@ ge::Status VarManager::AssignVarMem(const std::string &var_name, const ge::GeTen | |||
size_t mem_offset = 0; | |||
ge::Status result = TensorUtils::GetSize(tensor_desc, tensor_desc_size); | |||
if (result != ge::SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Get size from tensor fail, var_name:%s, memory_type:%d, session_id:%lu, " | |||
"when VarManager %s", var_name.c_str(), memory_type, session_id_, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Get size from tensor fail, var_name:%s, memory_type:%d, session_id:%lu", | |||
var_name.c_str(), memory_type, session_id_); | |||
GELOGE(result, "get size from TensorDesc failed"); | |||
return result; | |||
} | |||
@@ -525,8 +525,8 @@ ge::Status VarManager::AssignVarMem(const std::string &var_name, const ge::GeTen | |||
if (it == mem_resource_map_.end()) { | |||
mem_resource = MemResource::BuildMemResourceFromType(memory_type); | |||
if (mem_resource == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "memory_type:%d invalid or New MemResource fail, session_id:%lu when VarManager %s", | |||
memory_type, session_id_, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "memory_type:%d invalid or New MemResource fail, session_id:%lu", | |||
memory_type, session_id_); | |||
GELOGE(ge::INTERNAL_ERROR, "Alloc MemResource failed, memory_type = %u.", memory_type); | |||
return ge::INTERNAL_ERROR; | |||
} else { | |||
@@ -537,8 +537,8 @@ ge::Status VarManager::AssignVarMem(const std::string &var_name, const ge::GeTen | |||
} | |||
if (mem_resource == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "MemResource is invalid, memory_type:%d, session_id:%lu when VarManager %s", | |||
memory_type, session_id_, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "MemResource is invalid, memory_type:%d, session_id:%lu", | |||
memory_type, session_id_); | |||
GELOGE(ge::INTERNAL_ERROR, "MemResource is invalid, memory_type = %u.", memory_type); | |||
return ge::INTERNAL_ERROR; | |||
} | |||
@@ -549,7 +549,7 @@ ge::Status VarManager::AssignVarMem(const std::string &var_name, const ge::GeTen | |||
} | |||
if (var_resource_ == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "VarManager has not been init, memory_type:%d, session_id:%lu, " | |||
"check invalid when VarManager %s", memory_type, session_id_, __FUNCTION__); | |||
"check invalid", memory_type, session_id_); | |||
GELOGW("VarManager has not been init."); | |||
return ge::INTERNAL_ERROR; | |||
} | |||
@@ -668,9 +668,9 @@ ge::Status VarManager::RenewCurVarDesc(const std::string &var_name, ge::OpDescPt | |||
GELOGD("VarManager::RenewCurVarDesc var_name = %s.", var_name.c_str()); | |||
if (var_resource_ == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "VarManager has not been init, op:%s(%s), session_id:%lu, check invalid " | |||
"when VarManager %s", op_desc->GetName().c_str(), op_desc->GetType().c_str(), | |||
session_id_, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "VarManager has not been init, op:%s(%s), session_id:%lu, check invalid", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), | |||
session_id_); | |||
GELOGE(ge::INTERNAL_ERROR, "VarManager has not been init."); | |||
return ge::INTERNAL_ERROR; | |||
} | |||
@@ -822,8 +822,8 @@ Status VarManager::SetMemoryMallocSize(const map<string, string> &options) { | |||
var_mem_logic_base_ = graph_mem_max_size_ + kGraphMemoryBuffer; | |||
if (var_mem_logic_base_ > kMaxMemorySize) { | |||
REPORT_INNER_ERROR("E19999", "var_login_base:%zu can not exeed limit:%zu, session_id:%lu, check invalid " | |||
"when VarManager %s", var_mem_logic_base_, kMaxMemorySize, session_id_, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "var_login_base:%zu can not exeed limit:%zu, session_id:%lu, check invalid", | |||
var_mem_logic_base_, kMaxMemorySize, session_id_); | |||
GELOGE(ge::GE_GRAPH_OPTIONS_INVALID, "kMemoryVarLogicBase : %zu can not exceed max memory size : %zu.", | |||
var_mem_logic_base_, kMaxMemorySize); | |||
return ge::GE_GRAPH_OPTIONS_INVALID; | |||
@@ -831,8 +831,8 @@ Status VarManager::SetMemoryMallocSize(const map<string, string> &options) { | |||
use_max_mem_size_ = graph_mem_max_size_ + var_mem_max_size_; | |||
if (use_max_mem_size_ > kMaxMemorySize) { | |||
REPORT_INNER_ERROR("E19999", "all mem_use size:%zu can not exeed limit:%zu, session_id:%lu, check invalid " | |||
"when VarManager %s", use_max_mem_size_, kMaxMemorySize, session_id_, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "all mem_use size:%zu can not exeed limit:%zu, session_id:%lu, check invalid", | |||
use_max_mem_size_, kMaxMemorySize, session_id_); | |||
GELOGE(ge::GE_GRAPH_OPTIONS_INVALID, "kUseMaxMemorySize : %zu can not exceed max memory size : %zu.", | |||
use_max_mem_size_, kMaxMemorySize); | |||
return ge::GE_GRAPH_OPTIONS_INVALID; | |||
@@ -843,8 +843,8 @@ Status VarManager::SetMemoryMallocSize(const map<string, string> &options) { | |||
Status VarManager::ParseMemoryMallocSize(string &memory_size, size_t &result) { | |||
if (memory_size.empty()) { | |||
REPORT_INNER_ERROR("E19999", "Param memory_size is empty, session_id:%lu, check invalid when VarManager %s", | |||
session_id_, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Param memory_size is empty, session_id:%lu, check invalid", | |||
session_id_); | |||
GELOGE(GE_GRAPH_OPTIONS_INVALID, "Memory malloc size input is empty."); | |||
return GE_GRAPH_OPTIONS_INVALID; | |||
} | |||
@@ -870,8 +870,8 @@ Status VarManager::ParseMemoryMallocSize(string &memory_size, size_t &result) { | |||
for (char c : split) { | |||
if (!isdigit(c)) { | |||
REPORT_INNER_ERROR("E19999", "Param memory_size:%s contains non digit, session_id:%lu, check invalid " | |||
"when VarManager %s", memory_size.c_str(), session_id_, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Param memory_size:%s contains non digit, session_id:%lu, check invalid", | |||
memory_size.c_str(), session_id_); | |||
GELOGE(GE_GRAPH_OPTIONS_INVALID, "Memory malloc size input contains non digit."); | |||
return GE_GRAPH_OPTIONS_INVALID; | |||
} | |||
@@ -879,14 +879,14 @@ Status VarManager::ParseMemoryMallocSize(string &memory_size, size_t &result) { | |||
uint64_t num = std::strtoul(split.c_str(), nullptr, 0); | |||
GE_IF_BOOL_EXEC(TypeUtils::CheckUint64MulOverflow(result, static_cast<uint32_t>(num)), | |||
REPORT_INNER_ERROR("E19999", "Param memory_size:%s will overflow after multi all, session_id:%lu, " | |||
"check invalid when VarManager %s", memory_size.c_str(), | |||
session_id_, __FUNCTION__); | |||
"check invalid", memory_size.c_str(), | |||
session_id_); | |||
GELOGE(FAILED, "Input memory size is out of range."); | |||
return FAILED); | |||
if ((num > kMaxMemorySize) || (result * static_cast<size_t>(num) > kMaxMemorySize)) { | |||
REPORT_INNER_ERROR("E19999", "Param memory_size:%s after multi will exceed limit:%lu, session_id:%lu, " | |||
"check invalid when VarManager %s", memory_size.c_str(), kMaxMemorySize, | |||
session_id_, __FUNCTION__); | |||
"check invalid", memory_size.c_str(), kMaxMemorySize, | |||
session_id_); | |||
GELOGE(FAILED, "Input memory size can not exceed max memory size : %zu.", kMaxMemorySize); | |||
return FAILED; | |||
} | |||
@@ -990,7 +990,7 @@ VarManager *VarManagerPool::GetVarManager(uint64_t session_id) { | |||
VarManager *var_manager = new (std::nothrow) VarManager(session_id); | |||
if (var_manager == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "New VarManager fail, session_id:%lu, when VarManager %s", session_id, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "New VarManager fail, session_id:%lu", session_id); | |||
GELOGE(INTERNAL_ERROR, | |||
"VarManager::Instance find session by " | |||
"session_id[%lu] failed.", | |||
@@ -34,7 +34,7 @@ uint8_t *HostMemAllocator::Malloc(size_t size) { | |||
std::lock_guard<std::mutex> lock(mutex_); | |||
std::shared_ptr<AlignedPtr> aligned_ptr = MakeShared<AlignedPtr>(size); | |||
if (aligned_ptr == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "New AlignedPtr fail, when HostMemAllocator %s", __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "New AlignedPtr fail"); | |||
GELOGE(INTERNAL_ERROR, "make shared_ptr for AlignedPtr failed"); | |||
return nullptr; | |||
} | |||
@@ -45,7 +45,7 @@ uint8_t *HostMemAllocator::Malloc(size_t size) { | |||
Status HostMemAllocator::Free(const void *memory_addr) { | |||
if (memory_addr == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Param memory_addr is nullptr, check invalid when HostMemAllocator %s", __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Param memory_addr is nullptr, check invalid"); | |||
GELOGE(GE_GRAPH_FREE_FAILED, "Invalid memory pointer"); | |||
return GE_GRAPH_FREE_FAILED; | |||
} | |||
@@ -53,8 +53,7 @@ Status HostMemAllocator::Free(const void *memory_addr) { | |||
std::lock_guard<std::mutex> lock(mutex_); | |||
auto it = allocated_blocks_.find(memory_addr); | |||
if (it == allocated_blocks_.end()) { | |||
REPORT_INNER_ERROR("E19999", "Memory_addr is not alloc before, check invalid when HostMemAllocator %s", | |||
__FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Memory_addr is not alloc before, check invalid"); | |||
GELOGE(PARAM_INVALID, "Invalid memory pointer"); | |||
return PARAM_INVALID; | |||
} | |||
@@ -39,8 +39,8 @@ Status SharedMemAllocator::Allocate(SharedMemInfo &mem_info) { | |||
rtMallocHostSharedMemoryOut output_para; | |||
rtError_t rt_ret = rtMallocHostSharedMemory(&input_para, &output_para); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMallocHostSharedMemory fail, ret:0x%X, when SharedMemAllocator %s", | |||
rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMallocHostSharedMemory fail, ret:0x%X", | |||
rt_ret); | |||
GELOGE(RT_FAILED, "Call rt api(rtMallocHostSharedMemory) failed, devid:[%u].", device_id); | |||
return GE_GRAPH_MEMORY_ALLOC_FAILED; | |||
} | |||
@@ -61,8 +61,8 @@ Status SharedMemAllocator::DeAllocate(SharedMemInfo &mem_info) { | |||
mem_info.host_aligned_ptr->MutableGet(), mem_info.device_address}; | |||
rtError_t rt_ret = rtFreeHostSharedMemory(&free_para); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtFreeHostSharedMemory fail, ret:0x%X, when SharedMemAllocator %s", | |||
rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtFreeHostSharedMemory fail, ret:0x%X", | |||
rt_ret); | |||
GELOGE(RT_FAILED, "Call rt api(rtFreeHostSharedMemory) failed, ret: 0x%X.", rt_ret); | |||
return RT_FAILED; | |||
} | |||
@@ -78,7 +78,7 @@ Status HostMemManager::Initialize() { | |||
std::lock_guard<std::recursive_mutex> lock(mutex_); | |||
allocator_ = std::unique_ptr<SharedMemAllocator>(new (std::nothrow) SharedMemAllocator()); | |||
if (allocator_ == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "New SharedMemAllocator fail when SharedMemAllocator %s", __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "New SharedMemAllocator fail"); | |||
GELOGE(GE_GRAPH_MALLOC_FAILED, "Shared memory allocator init failed!"); | |||
return GE_GRAPH_MALLOC_FAILED; | |||
} | |||
@@ -99,8 +99,8 @@ Status HostMemManager::MallocSharedMemory(SharedMemInfo &mem_info) { | |||
std::lock_guard<std::recursive_mutex> lock(mutex_); | |||
auto iter = var_memory_base_map_.find(mem_info.op_name); | |||
if (iter != var_memory_base_map_.end()) { | |||
REPORT_INNER_ERROR("E19999", "MemInfo.op_name:%s can't find in var_memory_base_map_ when HostMemManager %s", | |||
mem_info.op_name.c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "MemInfo.op_name:%s can't find in var_memory_base_map_", | |||
mem_info.op_name.c_str()); | |||
GELOGE(FAILED, "Host shared memory for op %s has been malloced", mem_info.op_name.c_str()); | |||
return FAILED; | |||
} | |||
@@ -114,8 +114,8 @@ Status HostMemManager::MallocSharedMemory(SharedMemInfo &mem_info) { | |||
Status HostMemManager::QueryVarMemInfo(const string &op_name, uint64_t &base_addr, uint64_t &data_size) { | |||
std::lock_guard<std::recursive_mutex> lock(mutex_); | |||
if (var_memory_base_map_.find(op_name) == var_memory_base_map_.end()) { | |||
REPORT_INNER_ERROR("E19999", "MemInfo.op_name:%s can't find in var_memory_base_map_ when HostMemManager %s", | |||
op_name.c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "MemInfo.op_name:%s can't find in var_memory_base_map_", | |||
op_name.c_str()); | |||
GELOGE(INTERNAL_ERROR, "Find host base base_addr failed,node name:%s!", op_name.c_str()); | |||
return INTERNAL_ERROR; | |||
} | |||
@@ -50,8 +50,8 @@ Status RdmaRemoteRegister(const std::vector<HostVarInfo> &var_info, rtMemType_t | |||
path.append(file_name); | |||
string canonical_path = RealPath(path.c_str()); | |||
if (canonical_path.empty()) { | |||
REPORT_INNER_ERROR("E19999", "canonical_path:%s is empty, check invalid when %s", | |||
canonical_path.c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "canonical_path:%s is empty, check invalid", | |||
canonical_path.c_str()); | |||
GELOGE(FAILED, "Failed to get realpath of %s", path.c_str()); | |||
return FAILED; | |||
} | |||
@@ -67,16 +67,16 @@ Status RdmaRemoteRegister(const std::vector<HostVarInfo> &var_info, rtMemType_t | |||
auto hcom_remote_mem_register = | |||
(HcclResult(*)(const MemRegisterAddr *, uint32_t))dlsym(handle, "HcomRegRemoteAccessMem"); | |||
if (hcom_remote_mem_register == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "Symbol HcomRegRemoteAccessMem can't find in %s, check invalid when %s", | |||
canonical_path.c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Symbol HcomRegRemoteAccessMem can't find in %s, check invalid", | |||
canonical_path.c_str()); | |||
GELOGE(FAILED, "Failed to invoke hcom_remote_mem_register function."); | |||
return FAILED; | |||
} | |||
HcclResult hccl_ret = hcom_remote_mem_register(reg_addrs.get(), table_len); | |||
if (hccl_ret != HCCL_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Call hcom_remote_mem_register failed, ret:%d, when %s", | |||
hccl_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call hcom_remote_mem_register failed, ret:%d,", | |||
hccl_ret); | |||
GELOGE(HCCL_E_INTERNAL, "Rdma mem register failed, ret: 0x%X", hccl_ret); | |||
return HCCL_E_INTERNAL; | |||
} | |||
@@ -81,8 +81,7 @@ Status RdmaPoolAllocator::InitMemory(size_t mem_size) { | |||
auto device_id = GetContext().DeviceId(); | |||
GELOGD("Init Rdma Memory with size [%zu] for devid:[%u]", mem_size, device_id); | |||
if (rdma_base_addr_ != nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Param rdma_base_addr_ is nullptr, check invalid when RdmaPoolAllocator %s", | |||
__FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Param rdma_base_addr_ is nullptr, check invalid"); | |||
GELOGE(GE_MULTI_INIT, "Rdma pool has been malloced"); | |||
return GE_MULTI_INIT; | |||
} | |||
@@ -102,7 +101,7 @@ Status RdmaPoolAllocator::InitMemory(size_t mem_size) { | |||
// Init with a base block. | |||
auto *base_block = new (std::nothrow) Block(device_id, mem_size, rdma_base_addr_); | |||
if (base_block == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "New Block failed, device_id:%u, when RdmaPoolAllocator %s", device_id, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "New Block failed, device_id:%u", device_id); | |||
GELOGE(GE_GRAPH_MALLOC_FAILED, "Block malloc failed"); | |||
return GE_GRAPH_MALLOC_FAILED; | |||
} | |||
@@ -121,8 +120,8 @@ uint8_t *RdmaPoolAllocator::Malloc(size_t size, uint32_t device_id) { | |||
block_bin_.erase(it); | |||
block->allocated = true; | |||
if (block->ptr == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Rdmapool memory address is nullptr, device_id:%u, check invalid when RdmaPoolAllocator %s", | |||
device_id, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Rdmapool memory address is nullptr, device_id:%u, check invalid", | |||
device_id); | |||
GELOGE(INTERNAL_ERROR, "Rdmapool memory address is nullptr."); | |||
return nullptr; | |||
} | |||
@@ -155,8 +154,8 @@ uint8_t *RdmaPoolAllocator::Malloc(size_t size, uint32_t device_id) { | |||
Status RdmaPoolAllocator::Free(uint8_t *memory_addr, uint32_t device_id) { | |||
GELOGI("Free rdma memory, device id = %u", device_id); | |||
if (memory_addr == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Param memory_addr is nullptr, device_id:%u, check invalid when RdmaPoolAllocator %s", | |||
device_id, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Param memory_addr is nullptr, device_id:%u, check invalid", | |||
device_id); | |||
GELOGE(GE_GRAPH_FREE_FAILED, "Invalid memory pointer"); | |||
return GE_GRAPH_FREE_FAILED; | |||
} | |||
@@ -165,7 +164,7 @@ Status RdmaPoolAllocator::Free(uint8_t *memory_addr, uint32_t device_id) { | |||
auto it = allocated_blocks_.find(memory_addr); | |||
if (it == allocated_blocks_.end()) { | |||
REPORT_INNER_ERROR("E19999", "Param memory_addr is not allocated before, device_id:%u, " | |||
"check invalid when RdmaPoolAllocator %s", device_id, __FUNCTION__); | |||
"check invalid", device_id); | |||
GELOGE(PARAM_INVALID, "Invalid memory pointer"); | |||
return PARAM_INVALID; | |||
} | |||
@@ -208,8 +207,7 @@ void RdmaPoolAllocator::MergeBlocks(Block *dst, Block *src) { | |||
Status RdmaPoolAllocator::GetBaseAddr(uint64_t &base_addr, uint64_t &mem_size) { | |||
if (rdma_base_addr_ == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Param rdma_base_addr_ is nullptr, check invalid when RdmaPoolAllocator %s", | |||
__FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Param rdma_base_addr_ is nullptr, check invalid"); | |||
GELOGE(INTERNAL_ERROR, "Rdma base addr is nullptr."); | |||
return INTERNAL_ERROR; | |||
} | |||
@@ -35,24 +35,24 @@ class RtContextSwitchGuard { | |||
RtContextSwitchGuard(rtCtxMode_t mode, uint32_t device_id) : last_(nullptr), current_(nullptr) { | |||
auto ret = rtCtxGetCurrent(&last_); | |||
if (ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtCtxGetCurrent failed, device_id:%u, ret:0x%X, when %s", | |||
device_id, ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtCtxGetCurrent failed, device_id:%u, ret:0x%X,", | |||
device_id, ret); | |||
GELOGE(RT_FAILED, "Failed to get current context from rt, error-code %d", ret); | |||
return; | |||
} | |||
ret = rtCtxCreate(¤t_, mode, static_cast<int32_t>(device_id)); | |||
if (ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtCtxCreate failed, device_id:%u, ret:0x%X, when %s", | |||
device_id, ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtCtxCreate failed, device_id:%u, ret:0x%X,", | |||
device_id, ret); | |||
GELOGE(RT_FAILED, "Failed to create new context for device %u, error-code %d", device_id, ret); | |||
return; | |||
} | |||
ret = rtCtxSetCurrent(current_); | |||
if (ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtCtxSetCurrent failed, device_id:%u, ret:0x%X, when %s", | |||
device_id, ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtCtxSetCurrent failed, device_id:%u, ret:0x%X,", | |||
device_id, ret); | |||
GELOGE(RT_FAILED, "Failed to switch context to normal, context %p, device %u", current_, device_id); | |||
return; | |||
} | |||
@@ -78,8 +78,8 @@ class RtContextSwitchGuard { | |||
int64_t CalcVarSizeInBytes(const GeTensorDesc &desc) { | |||
int64_t var_size = GetSizeByDataType(desc.GetDataType()); | |||
if (var_size <= 0) { | |||
REPORT_INNER_ERROR("E19999", "Data type:%s in desc, it's size:%ld < 0, check invalid when %s", | |||
TypeUtils::DataTypeToSerialString(desc.GetDataType()).c_str(), var_size, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Data type:%s in desc, it's size:%ld < 0, check invalid", | |||
TypeUtils::DataTypeToSerialString(desc.GetDataType()).c_str(), var_size); | |||
GELOGE(PARAM_INVALID, "Failed to calc var data size from data type %s", | |||
TypeUtils::DataTypeToSerialString(desc.GetDataType()).c_str()); | |||
return -1; | |||
@@ -97,8 +97,8 @@ Status CopyVarToDevice(const NodePtr &var, const formats::TransResult &trans_res | |||
auto ret = rtMemcpy(var_addr, trans_result.length, reinterpret_cast<void *>(trans_result.data.get()), | |||
trans_result.length, RT_MEMCPY_HOST_TO_DEVICE); | |||
if (ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, op:%s(%s), size:%lu, ret:0x%X, when %s", var->GetName().c_str(), | |||
var->GetType().c_str(), trans_result.length, ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, op:%s(%s), size:%lu, ret:0x%X,", var->GetName().c_str(), | |||
var->GetType().c_str(), trans_result.length, ret); | |||
GELOGE(RT_FAILED, "Failed to copy memory to device, size %zu", trans_result.length); | |||
return RT_FAILED; | |||
} | |||
@@ -120,8 +120,8 @@ Status CopyVarFromDevice(uint64_t session_id, const NodePtr &var, std::unique_pt | |||
uint8_t *var_addr = VarManager::Instance(session_id)->GetVarMemoryAddr(var_logic, RT_MEMORY_HBM); | |||
if (var_addr == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "Get variable memory addr failed, mem_type:%d, op:%s(%s), session_id:%lu, when %s", | |||
RT_MEMORY_HBM, var->GetName().c_str(), var->GetType().c_str(), session_id, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Get variable memory addr failed, mem_type:%d, op:%s(%s), session_id:%lu,", | |||
RT_MEMORY_HBM, var->GetName().c_str(), var->GetType().c_str(), session_id); | |||
GELOGE(INTERNAL_ERROR, | |||
"Failed to copy var %s from device, cant not get " | |||
"var addr from logic addr %p", | |||
@@ -136,8 +136,8 @@ Status CopyVarFromDevice(uint64_t session_id, const NodePtr &var, std::unique_pt | |||
std::unique_ptr<uint8_t[]> var_host(new(std::nothrow) uint8_t[var_size_bytes]); | |||
if (var_host == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "New host memory failed, size:%ld, op:%s(%s), session_id:%lu, when %s", | |||
var_size_bytes, var->GetName().c_str(), var->GetType().c_str(), session_id, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "New host memory failed, size:%ld, op:%s(%s), session_id:%lu,", | |||
var_size_bytes, var->GetName().c_str(), var->GetType().c_str(), session_id); | |||
GELOGE(OUT_OF_MEMORY, "Failed to malloc rt-host memory, size %ld", var_size_bytes); | |||
return OUT_OF_MEMORY; | |||
} | |||
@@ -145,8 +145,8 @@ Status CopyVarFromDevice(uint64_t session_id, const NodePtr &var, std::unique_pt | |||
ret = rtMemcpy(reinterpret_cast<void *>(var_host.get()), var_size_bytes, reinterpret_cast<void *>(var_addr), | |||
var_size_bytes, RT_MEMCPY_DEVICE_TO_HOST); | |||
if (ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%ld, op:%s(%s), session_id:%lu, ret:0x%X when %s", | |||
var_size_bytes, var->GetName().c_str(), var->GetType().c_str(), session_id, ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%ld, op:%s(%s), session_id:%lu, ret:0x%X", | |||
var_size_bytes, var->GetName().c_str(), var->GetType().c_str(), session_id, ret); | |||
GELOGE(RT_FAILED, | |||
"Failed to copy var memory from device, var %s, size %ld," | |||
" rt-error-code %u", | |||
@@ -191,12 +191,12 @@ Status TransVarOnHost(uint8_t *var_data, const VarTransRoad &trans_road, formats | |||
TypeUtils::DataTypeToSerialString(data_type).c_str()); | |||
auto ret = formats::TransFormat({src_data, src_format, dst_format, src_shape, dst_shape, data_type}, tmp_result); | |||
if (ret != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Trans format from %s to %s, shape %s to %s failed, data type:%s, ret:%u, when %s", | |||
REPORT_CALL_ERROR("E19999", "Trans format from %s to %s, shape %s to %s failed, data type:%s, ret:%u,", | |||
TypeUtils::FormatToSerialString(src_format).c_str(), | |||
TypeUtils::FormatToSerialString(dst_format).c_str(), | |||
formats::ShapeToString(src_shape).c_str(), | |||
formats::ShapeToString(dst_shape).c_str(), | |||
TypeUtils::DataTypeToSerialString(data_type).c_str(), ret, __FUNCTION__); | |||
TypeUtils::DataTypeToSerialString(data_type).c_str(), ret); | |||
GELOGE(INTERNAL_ERROR, | |||
"Failed to trans format from %s to %s, shape %s to %s, " | |||
"data type %s error code %u", | |||
@@ -217,10 +217,10 @@ Status TransVarOnHost(uint8_t *var_data, const VarTransRoad &trans_road, formats | |||
auto ret = formats::TransDataType({src_data, static_cast<size_t>(src_data_size), src_data_type, dst_data_type}, | |||
tmp_result); | |||
if (ret != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Trans data type from %s to %s failed, input shape %s, data size %ld, ret:%u, " | |||
"when %s", TypeUtils::DataTypeToSerialString(src_data_type).c_str(), | |||
REPORT_CALL_ERROR("E19999", "Trans data type from %s to %s failed, input shape %s, data size %ld, ret:%u", | |||
TypeUtils::DataTypeToSerialString(src_data_type).c_str(), | |||
TypeUtils::DataTypeToSerialString(dst_data_type).c_str(), | |||
formats::ShapeToString(input_shape).c_str(), src_data_size, ret, __FUNCTION__); | |||
formats::ShapeToString(input_shape).c_str(), src_data_size, ret); | |||
GELOGE(INTERNAL_ERROR, "Failed to trans data type from %s to %s, input shape %s, data size %ld, error code %u", | |||
TypeUtils::DataTypeToSerialString(src_data_type).c_str(), | |||
TypeUtils::DataTypeToSerialString(dst_data_type).c_str(), formats::ShapeToString(input_shape).c_str(), | |||
@@ -228,8 +228,8 @@ Status TransVarOnHost(uint8_t *var_data, const VarTransRoad &trans_road, formats | |||
return ret; | |||
} | |||
} else { | |||
REPORT_INNER_ERROR("E19999", "Trans var data failed, the trans type %s does not supported, check invalid when %s", | |||
trans_info.node_type.c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Trans var data failed, the trans type %s does not supported, check invalid", | |||
trans_info.node_type.c_str()); | |||
GELOGE(UNSUPPORTED, "Failed to trans var data, the trans type %s does not supported", | |||
trans_info.node_type.c_str()); | |||
return UNSUPPORTED; | |||
@@ -264,8 +264,8 @@ Status ReAssignVarAddr(uint64_t session_id, | |||
uint8_t *var_addr = VarManager::Instance(session_id)->GetVarMemoryAddr(var_logic, RT_MEMORY_HBM); | |||
if (var_addr == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "Get variable memory addr failed, mem_type:%d, var_name:%s, session_id:%lu, when %s", | |||
RT_MEMORY_HBM, var_name.c_str(), session_id, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Get variable memory addr failed, mem_type:%d, var_name:%s, session_id:%lu,", | |||
RT_MEMORY_HBM, var_name.c_str(), session_id); | |||
GELOGE(INTERNAL_ERROR, "Failed to convert var %s logic addr to real addr", var_name.c_str()); | |||
return INTERNAL_ERROR; | |||
} | |||
@@ -293,8 +293,8 @@ Status TransVarData(const NodePtr &var, const VarTransRoad &trans_road, uint64_t | |||
// Sync var data from device | |||
std::unique_ptr<uint8_t[]> var_data; | |||
if (trans_road.empty()) { | |||
REPORT_INNER_ERROR("E19999", "Param trans_road is empty, session_id:%lu, check invalid when %s", | |||
session_id, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Param trans_road is empty, session_id:%lu, check invalid", | |||
session_id); | |||
GELOGE(INTERNAL_ERROR, "Failed to get trans_road, trans_road is empty."); | |||
return INTERNAL_ERROR; | |||
} | |||
@@ -346,10 +346,10 @@ Status TransTensor(uint8_t *var_data, const NodePtr &var_src, const NodePtr &var | |||
auto ret = formats::TransDataType( | |||
{var_data, static_cast<size_t>(src_data_shape_size), src_data_datatype, dst_data_datatype}, result); | |||
if (ret != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Trans data type from %s to %s failed, data size %ld, ret:%u, " | |||
"when %s", TypeUtils::DataTypeToSerialString(src_data_datatype).c_str(), | |||
REPORT_CALL_ERROR("E19999", "Trans data type from %s to %s failed, data size %ld, ret:%u", | |||
TypeUtils::DataTypeToSerialString(src_data_datatype).c_str(), | |||
TypeUtils::DataTypeToSerialString(dst_data_datatype).c_str(), | |||
src_data_shape_size, ret, __FUNCTION__); | |||
src_data_shape_size, ret); | |||
GELOGE(INTERNAL_ERROR, "trans var data on host failed"); | |||
return ret; | |||
}); | |||
@@ -367,7 +367,7 @@ Status CopyTensorFromSrcVarNode(const NodePtr &var_src, | |||
/// [opdesc of var_src and var_dst are checked before passed in, no need to check if they are nullptr] | |||
GE_IF_BOOL_EXEC(var_src == nullptr || var_dst == nullptr, | |||
REPORT_INNER_ERROR("E19999", "Param var_src or var_dst is empty, session_id:%lu, device_id:%u, " | |||
"check invalid when %s", session_id, device_id, __FUNCTION__); | |||
"check invalid", session_id, device_id); | |||
GELOGE(FAILED, "node var is nullptr"); return FAILED); | |||
// src_node output_desc (fp32) | |||
GeTensorDesc output_desc = var_src->GetOpDesc()->GetOutputDesc(0); | |||
@@ -491,16 +491,16 @@ Status TransVarDataUtils::TransAllVarData(const vector<NodePtr> &variable_nodes, | |||
ErrorManager::GetInstance().SetErrorContext(error_context); | |||
rtError_t rt_ret = rtCtxSetCurrent(ctx); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtCtxSetCurrent failed, session_id:%lu, graph_id:%u, ret:0x%X, when %s", | |||
session_id, graph_id, rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtCtxSetCurrent failed, session_id:%lu, graph_id:%u, ret:0x%X,", | |||
session_id, graph_id, rt_ret); | |||
GELOGE(RT_FAILED, "Failed to set context, error_code is: 0x%X.", rt_ret); | |||
return RT_ERROR_TO_GE_STATUS(rt_ret); | |||
} | |||
uint32_t allocated_graph_id = 0; | |||
Status ret = VarManager::Instance(session_id)->GetAllocatedGraphId(node->GetName(), allocated_graph_id); | |||
if (ret != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Get allocated GraphId failed, session_id:%lu, graph_id:%u, ret:0x%X, when %s", | |||
session_id, graph_id, ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Get allocated GraphId failed, session_id:%lu, graph_id:%u, ret:0x%X,", | |||
session_id, graph_id, ret); | |||
GELOGE(INTERNAL_ERROR, "var has not been allocated, node:%s, graph_id:%u.", node->GetName().c_str(), | |||
graph_id); | |||
return INTERNAL_ERROR; | |||
@@ -548,8 +548,8 @@ Status TransVarDataUtils::TransAllVarData(const vector<NodePtr> &variable_nodes, | |||
Status TransVarDataUtils::CopyVarData(const ComputeGraphPtr &compute_graph, uint64_t session_id, uint32_t device_id) { | |||
GELOGD("CopyVarData start: session_id:%lu.", session_id); | |||
if (compute_graph == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Param compute_graph is nullptr, session_id:%lu, device_id:%u, check invalid when %s", | |||
session_id, device_id, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Param compute_graph is nullptr, session_id:%lu, device_id:%u, check invalid", | |||
session_id, device_id); | |||
GELOGE(FAILED, "compute_graph is nullptr"); | |||
return FAILED; | |||
} | |||
@@ -63,16 +63,16 @@ Status Debug::DumpDevMem(const char *file, const void *addr, int64_t size) { | |||
uint8_t *host_addr = nullptr; | |||
rtError_t ret = rtMallocHost(reinterpret_cast<void **>(&host_addr), size); | |||
if (ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMallocHost failed, size:%zu, ret: 0x%X when Debug %s", | |||
size, ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMallocHost failed, size:%zu, ret: 0x%X", | |||
size, ret); | |||
GELOGE(FAILED, "Call rt api rtMallocHost failed, ret: 0x%X", ret); | |||
return FAILED; | |||
} | |||
GE_MAKE_GUARD_RTMEM(host_addr); | |||
ret = rtMemcpy(host_addr, size, addr, size, RT_MEMCPY_DEVICE_TO_HOST); | |||
if (ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret: 0x%X when Debug %s", | |||
size, ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret: 0x%X", | |||
size, ret); | |||
GELOGE(FAILED, "Call rt api rtMemcpy failed, ret: 0x%X", ret); | |||
return FAILED; | |||
} | |||
@@ -40,9 +40,9 @@ Status HcomOmeUtil::GetHcclDataType(const ge::ConstOpDescPtr &op_desc, | |||
if (op_desc->GetType() == HCOMRECEIVE) { | |||
bool ret = ge::AttrUtils::GetDataType(op_desc, HCOM_ATTR_DATA_TYPE, src_data_type); | |||
if (ret == false) { | |||
REPORT_INNER_ERROR("E19999", "Get Attr:%s in op:%s(%s) fail when HcomOmeUtil %s", | |||
REPORT_INNER_ERROR("E19999", "Get Attr:%s in op:%s(%s) fail", | |||
HCOM_ATTR_DATA_TYPE.c_str(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(PARAM_INVALID, "op:HcomReceive, op desc no attr: dtype."); | |||
return PARAM_INVALID; | |||
} | |||
@@ -55,9 +55,9 @@ Status HcomOmeUtil::GetHcclDataType(const ge::ConstOpDescPtr &op_desc, | |||
auto iter = kConstOpHcclDataType.find(static_cast<int64_t>(src_data_type)); | |||
if (iter == kConstOpHcclDataType.end()) { | |||
REPORT_INNER_ERROR("E19999", "Attr:%s in op:%s(%s), value data_type:%s, not support in kConstOpHcclDataType now, " | |||
"check invalid when HcomOmeUtil %s", HCOM_ATTR_DATA_TYPE.c_str(), | |||
"check invalid", HCOM_ATTR_DATA_TYPE.c_str(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), | |||
ge::TypeUtils::DataTypeToSerialString(src_data_type).c_str(), __FUNCTION__); | |||
ge::TypeUtils::DataTypeToSerialString(src_data_type).c_str()); | |||
GELOGE(PARAM_INVALID, | |||
"HcomOmeUtil:: Node: %s Optype: %s HcomDataType cann't support! Current Davinci Data Type : %s", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), | |||
@@ -83,8 +83,8 @@ Status HcomOmeUtil::GetHcomCount(const ge::ConstOpDescPtr &op_desc, HcclDataType | |||
int &count) { | |||
GE_CHECK_NOTNULL(op_desc); | |||
if (!IsHCOMOp(op_desc->GetType())) { | |||
REPORT_INNER_ERROR("E19999", "Op:%s(%s) is not hcom op, check invalid when HcomOmeUtil %s", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Op:%s(%s) is not hcom op, check invalid", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(PARAM_INVALID, "HcomOmeUtil:: operator is not Hcom operator."); | |||
return PARAM_INVALID; | |||
} | |||
@@ -151,8 +151,8 @@ Status HcomOmeUtil::GetHorovodCount(const ge::ConstOpDescPtr &op_desc, | |||
std::vector<GETaskKernelHcclInfo> &kernel_hccl_infos) { | |||
GE_CHECK_NOTNULL(op_desc); | |||
if (!IsHorovodOp(op_desc->GetType())) { | |||
REPORT_INNER_ERROR("E19999", "Op:%s(%s) is not horovod op, check invalid when HcomOmeUtil %s", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Op:%s(%s) is not horovod op, check invalid", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(PARAM_INVALID, "HcomOmeUtil:: operator is not Horovod operator."); | |||
return PARAM_INVALID; | |||
} | |||
@@ -225,9 +225,9 @@ Status HcomOmeUtil::GetHcclOperationType(const ge::ConstOpDescPtr &op_desc, Hccl | |||
if (IsHCOMOp(op_desc->GetType())) { | |||
std::string hcom_op_type; | |||
GE_CHK_BOOL_EXEC(ge::AttrUtils::GetStr(op_desc, HCOM_ATTR_REDUCE_TYPE, hcom_op_type), | |||
REPORT_INNER_ERROR("E19999", "Get Attr:%s in op:%s(%s) fail when HcomOmeUtil %s", | |||
REPORT_INNER_ERROR("E19999", "Get Attr:%s in op:%s(%s) fail", | |||
HCOM_ATTR_REDUCE_TYPE.c_str(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
return PARAM_INVALID, | |||
"HcomOmeUtil:: Node: %s Optype: %s Get HCOM_ATTR_REDUCE_TYPE fail, not support!", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
@@ -242,8 +242,8 @@ Status HcomOmeUtil::GetHcclOperationType(const ge::ConstOpDescPtr &op_desc, Hccl | |||
op_type = HCCL_REDUCE_SUM; | |||
} else { | |||
REPORT_INNER_ERROR("E19999", "Attr:%s in Op:%s(%s), hcom_op_type value:%s is not support now, " | |||
"check invalid when HcomOmeUtil %s", HCOM_ATTR_REDUCE_TYPE.c_str(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), hcom_op_type.c_str(), __FUNCTION__); | |||
"check invalid", HCOM_ATTR_REDUCE_TYPE.c_str(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), hcom_op_type.c_str()); | |||
GELOGE(PARAM_INVALID, "HcomOmeUtil::Get HCOM_ATTR_REDUCE_TYPE fail, [%s] not support!", hcom_op_type.c_str()); | |||
return PARAM_INVALID; | |||
} | |||
@@ -252,9 +252,9 @@ Status HcomOmeUtil::GetHcclOperationType(const ge::ConstOpDescPtr &op_desc, Hccl | |||
if (IsHorovodOp(op_desc->GetType())) { | |||
int64_t horovod_op_type; | |||
GE_CHK_BOOL_EXEC(ge::AttrUtils::GetInt(op_desc, ATTR_HOROVOD_ATTR_REDUCE_TYPE, horovod_op_type), | |||
REPORT_INNER_ERROR("E19999", "Get Attr:%s in op:%s(%s) fail when HcomOmeUtil %s", | |||
REPORT_INNER_ERROR("E19999", "Get Attr:%s in op:%s(%s) fail", | |||
ATTR_HOROVOD_ATTR_REDUCE_TYPE.c_str(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
return PARAM_INVALID, | |||
"HcomOmeUtil:: Node: %s Optype: %s Get ATTR_HOROVOD_ATTR_REDUCE_TYPE fail, not support!", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
@@ -262,8 +262,8 @@ Status HcomOmeUtil::GetHcclOperationType(const ge::ConstOpDescPtr &op_desc, Hccl | |||
auto iter = kHorovodRedOpToHcclRedOp.find(static_cast<HorovodReduceOp>(horovod_op_type)); | |||
if (iter == kHorovodRedOpToHcclRedOp.end()) { | |||
REPORT_INNER_ERROR("E19999", "Attr:%s in Op:%s(%s), horovod_op_type value:%ld is not support now, " | |||
"check invalid when HcomOmeUtil %s", ATTR_HOROVOD_ATTR_REDUCE_TYPE.c_str(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), horovod_op_type, __FUNCTION__); | |||
"check invalid", ATTR_HOROVOD_ATTR_REDUCE_TYPE.c_str(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), horovod_op_type); | |||
GELOGE(PARAM_INVALID, "HcomOmeUtil:: Node: %s Optype: %s HcomOpType cann't support! Current HcomOpType : %ld", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), horovod_op_type); | |||
return PARAM_INVALID; | |||
@@ -277,9 +277,9 @@ Status HcomOmeUtil::GetHcclOperationType(const ge::ConstOpDescPtr &op_desc, Hccl | |||
Status HcomOmeUtil::GetHcclRootId(const ge::ConstOpDescPtr &op_desc, int64_t &root_id) { | |||
GE_CHECK_NOTNULL(op_desc); | |||
GE_CHK_BOOL_EXEC(ge::AttrUtils::GetInt(op_desc, HCOM_ATTR_ROOT_RANK, root_id), | |||
REPORT_INNER_ERROR("E19999", "Get Attr:%s in op:%s(%s) fail when HcomOmeUtil %s", | |||
REPORT_INNER_ERROR("E19999", "Get Attr:%s in op:%s(%s) fail", | |||
HCOM_ATTR_ROOT_RANK.c_str(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
return PARAM_INVALID, | |||
"HcomOmeUtil::Node %s Optype: %s Get HCOM_ATTR_ROOT_INDEX fail, not support!", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
@@ -322,8 +322,8 @@ Status HcomOmeUtil::CheckKernelHcclInfo(const ge::ConstOpDescPtr &op_desc, | |||
GE_CHECK_NOTNULL(op_desc); | |||
if (IsHCOMOp(op_desc->GetType()) && kernel_hccl_infos.size() != 1) { | |||
REPORT_INNER_ERROR("E19999", "Op:%s(%s) is not hcom op or param kernel_hccl_infos.size:%zu != 1, " | |||
"check invalid when HcomOmeUtil %s", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), kernel_hccl_infos.size(), __FUNCTION__); | |||
"check invalid", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), kernel_hccl_infos.size()); | |||
GELOGE(PARAM_INVALID, "HcomOmeUtil:: in Hcom scenario, the number of GETaskKernelHcclInfo is invalid."); | |||
return PARAM_INVALID; | |||
} | |||
@@ -334,9 +334,9 @@ Status HcomOmeUtil::CheckKernelHcclInfo(const ge::ConstOpDescPtr &op_desc, | |||
} | |||
if (kernel_hccl_infos.empty() || op_desc->GetInputsSize() != kernel_hccl_infos.size()) { | |||
REPORT_INNER_ERROR("E19999", "Param kernel_hccl_infos.size:%zu is empty or not equal to input_desc size:%zu " | |||
"in op:%s(%s), check invalid when HcomOmeUtil %s", | |||
"in op:%s(%s), check invalid", | |||
kernel_hccl_infos.size(), op_desc->GetInputsSize(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(PARAM_INVALID, "HcomOmeUtil:: in Horovod scenario, the number of GETaskKernelHcclInfo is invalid."); | |||
return PARAM_INVALID; | |||
} | |||
@@ -37,7 +37,7 @@ GraphOptimize::GraphOptimize() | |||
void AddNodeInputProperty(ComputeGraphPtr &compute_graph) { | |||
if (compute_graph == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Param compute_graph is nullptr, check invalid when %s", __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Param compute_graph is nullptr, check invalid"); | |||
GELOGE(GE_GRAPH_OPTIMIZE_COMPUTE_GRAPH_NULL, "[AddNodeInputProperty]: compute_graph is nullptr."); | |||
return; | |||
} | |||
@@ -79,7 +79,7 @@ void AddNodeInputProperty(ComputeGraphPtr &compute_graph) { | |||
Status GraphOptimize::OptimizeSubGraph(ComputeGraphPtr &compute_graph, const std::string &engine_name) { | |||
if (compute_graph == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Param compute_graph is nullptr, check invalid when GraphOptimize %s", __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Param compute_graph is nullptr, check invalid"); | |||
GELOGE(GE_GRAPH_OPTIMIZE_COMPUTE_GRAPH_NULL, "[OptimizeSubGraph]: compute_graph is nullptr."); | |||
return GE_GRAPH_OPTIMIZE_COMPUTE_GRAPH_NULL; | |||
} | |||
@@ -89,7 +89,7 @@ Status GraphOptimize::OptimizeSubGraph(ComputeGraphPtr &compute_graph, const std | |||
std::shared_ptr<GELib> instance_ptr = ge::GELib::GetInstance(); | |||
if (instance_ptr == nullptr || !instance_ptr->InitFlag()) { | |||
REPORT_INNER_ERROR("E19999", "Gelib not init before, check invalid when GraphOptimize %s", __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Gelib not init before, check invalid"); | |||
GELOGE(GE_CLI_GE_NOT_INITIALIZED, "GraphOptimzer: GE is not initialized"); | |||
return GE_CLI_GE_NOT_INITIALIZED; | |||
} | |||
@@ -109,8 +109,8 @@ Status GraphOptimize::OptimizeSubGraph(ComputeGraphPtr &compute_graph, const std | |||
Status ret = (*iter)->OptimizeFusedGraphAfterGraphSlice(*(compute_graph)); | |||
if (ret != SUCCESS) { | |||
REPORT_INNER_ERROR("E19999", "Call OptimizeFusedGraphAfterGraphSlice failed, ret:%d, engine_name:%s, " | |||
"graph_name:%s when GraphOptimize %s", ret, engine_name.c_str(), | |||
compute_graph->GetName().c_str(), __FUNCTION__); | |||
"graph_name:%s", ret, engine_name.c_str(), | |||
compute_graph->GetName().c_str()); | |||
GELOGE(ret, "[OptimizeSubGraph][OptimizeFusedGraphAfterGraphSlice]: graph optimize failed, ret:%d", ret); | |||
return ret; | |||
} | |||
@@ -122,8 +122,8 @@ Status GraphOptimize::OptimizeSubGraph(ComputeGraphPtr &compute_graph, const std | |||
ret = (*iter)->OptimizeFusedGraph(*(compute_graph)); | |||
if (ret != SUCCESS) { | |||
REPORT_INNER_ERROR("E19999", "Call OptimizeFusedGraph failed, ret:%d, engine_name:%s, " | |||
"graph_name:%s when GraphOptimize %s", ret, engine_name.c_str(), | |||
compute_graph->GetName().c_str(), __FUNCTION__); | |||
"graph_name:%s", ret, engine_name.c_str(), | |||
compute_graph->GetName().c_str()); | |||
GELOGE(ret, "[OptimizeSubGraph][OptimizeFusedGraph]: graph optimize failed, ret:%d", ret); | |||
return ret; | |||
} | |||
@@ -141,7 +141,7 @@ Status GraphOptimize::OptimizeOriginalGraph(ComputeGraphPtr &compute_graph) { | |||
return SUCCESS; | |||
} | |||
if (compute_graph == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Param compute_graph is nullptr, check invalid when GraphOptimize %s", __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Param compute_graph is nullptr, check invalid"); | |||
GELOGE(GE_GRAPH_OPTIMIZE_COMPUTE_GRAPH_NULL, "[OptimizeOriginalGraph]: compute_graph is nullptr."); | |||
return GE_GRAPH_OPTIMIZE_COMPUTE_GRAPH_NULL; | |||
} | |||
@@ -149,7 +149,7 @@ Status GraphOptimize::OptimizeOriginalGraph(ComputeGraphPtr &compute_graph) { | |||
Status ret = SUCCESS; | |||
std::shared_ptr<GELib> instance_ptr = ge::GELib::GetInstance(); | |||
if (instance_ptr == nullptr || !instance_ptr->InitFlag()) { | |||
REPORT_INNER_ERROR("E19999", "Gelib not init before, check invalid when GraphOptimize %s", __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Gelib not init before, check invalid"); | |||
GELOGE(GE_CLI_GE_NOT_INITIALIZED, "OptimizeOriginalGraph failed."); | |||
return GE_CLI_GE_NOT_INITIALIZED; | |||
} | |||
@@ -167,8 +167,8 @@ Status GraphOptimize::OptimizeOriginalGraph(ComputeGraphPtr &compute_graph) { | |||
ret = (iter->second)->OptimizeOriginalGraph(*compute_graph); | |||
if (ret != SUCCESS) { | |||
REPORT_INNER_ERROR("E19999", "Call OptimizeOriginalGraph failed, ret:%d, engine_name:%s, " | |||
"graph_name:%s when GraphOptimize %s", ret, iter->first.c_str(), | |||
compute_graph->GetName().c_str(), __FUNCTION__); | |||
"graph_name:%s", ret, iter->first.c_str(), | |||
compute_graph->GetName().c_str()); | |||
GELOGE(ret, "[OptimizeOriginalGraph]: graph optimize failed, ret:%d", ret); | |||
return ret; | |||
} | |||
@@ -188,7 +188,7 @@ Status GraphOptimize::OptimizeOriginalGraphJudgeInsert(ComputeGraphPtr &compute_ | |||
Status ret = SUCCESS; | |||
std::shared_ptr<GELib> instance_ptr = ge::GELib::GetInstance(); | |||
if (instance_ptr == nullptr || !instance_ptr->InitFlag()) { | |||
REPORT_INNER_ERROR("E19999", "Gelib not init before, check invalid when GraphOptimize %s", __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Gelib not init before, check invalid"); | |||
GELOGE(GE_CLI_GE_NOT_INITIALIZED, "OptimizeOriginalGraph failed."); | |||
return GE_CLI_GE_NOT_INITIALIZED; | |||
} | |||
@@ -207,8 +207,8 @@ Status GraphOptimize::OptimizeOriginalGraphJudgeInsert(ComputeGraphPtr &compute_ | |||
ret = (iter->second)->OptimizeOriginalGraphJudgeInsert(*compute_graph); | |||
if (ret != SUCCESS) { | |||
REPORT_INNER_ERROR("E19999", "Call OptimizeOriginalGraphJudgeInsert failed, ret:%d, engine_name:%s, " | |||
"graph_name:%s when GraphOptimize %s", ret, iter->first.c_str(), | |||
compute_graph->GetName().c_str(), __FUNCTION__); | |||
"graph_name:%s", ret, iter->first.c_str(), | |||
compute_graph->GetName().c_str()); | |||
GELOGE(ret, "[OptimizeOriginalGraphJudgeInsert]: graph optimize failed, ret:%d", ret); | |||
return ret; | |||
} | |||
@@ -219,14 +219,14 @@ Status GraphOptimize::OptimizeOriginalGraphJudgeInsert(ComputeGraphPtr &compute_ | |||
Status GraphOptimize::OptimizeOriginalGraphForQuantize(ComputeGraphPtr &compute_graph) { | |||
if (compute_graph == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Param compute_graph is nullptr, check invalid when GraphOptimize %s", __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Param compute_graph is nullptr, check invalid"); | |||
GELOGE(GE_GRAPH_OPTIMIZE_COMPUTE_GRAPH_NULL, "[OptimizeOriginalGraph]: compute_graph is nullptr."); | |||
return GE_GRAPH_OPTIMIZE_COMPUTE_GRAPH_NULL; | |||
} | |||
std::shared_ptr<GELib> instance_ptr = ge::GELib::GetInstance(); | |||
if (instance_ptr == nullptr || !instance_ptr->InitFlag()) { | |||
REPORT_INNER_ERROR("E19999", "Gelib not init before, check invalid when GraphOptimize %s", __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Gelib not init before, check invalid"); | |||
GELOGE(GE_CLI_GE_NOT_INITIALIZED, "OptimizeOriginalGraph failed."); | |||
return GE_CLI_GE_NOT_INITIALIZED; | |||
} | |||
@@ -245,8 +245,8 @@ Status GraphOptimize::OptimizeOriginalGraphForQuantize(ComputeGraphPtr &compute_ | |||
ret = iter->second->OptimizeGraphPrepare(*compute_graph); | |||
if (ret != SUCCESS) { | |||
REPORT_INNER_ERROR("E19999", "Call OptimizeGraphPrepare failed, ret:%d, engine_name:%s, " | |||
"graph_name:%s when GraphOptimize %s", ret, iter->first.c_str(), | |||
compute_graph->GetName().c_str(), __FUNCTION__); | |||
"graph_name:%s", ret, iter->first.c_str(), | |||
compute_graph->GetName().c_str()); | |||
GELOGE(ret, "[OptimizeOriginalGraphForQuantize]: graph optimize failed, ret:%u", ret); | |||
return ret; | |||
} | |||
@@ -257,14 +257,14 @@ Status GraphOptimize::OptimizeOriginalGraphForQuantize(ComputeGraphPtr &compute_ | |||
Status GraphOptimize::OptimizeGraphBeforeBuildForRts(ComputeGraphPtr &compute_graph) { | |||
if (compute_graph == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Param compute_graph is nullptr, check invalid when GraphOptimize %s", __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Param compute_graph is nullptr, check invalid"); | |||
GELOGE(GE_GRAPH_OPTIMIZE_COMPUTE_GRAPH_NULL, "[OptimizeGraphBeforeBuildForRts]: compute_graph is nullptr."); | |||
return GE_GRAPH_OPTIMIZE_COMPUTE_GRAPH_NULL; | |||
} | |||
std::shared_ptr<GELib> instance_ptr = ge::GELib::GetInstance(); | |||
if (instance_ptr == nullptr || !instance_ptr->InitFlag()) { | |||
REPORT_INNER_ERROR("E19999", "Gelib not init before, check invalid when GraphOptimize %s", __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Gelib not init before, check invalid"); | |||
GELOGE(GE_CLI_GE_NOT_INITIALIZED, "OptimizeGraphBeforeBuildForRts failed."); | |||
return GE_CLI_GE_NOT_INITIALIZED; | |||
} | |||
@@ -284,8 +284,8 @@ Status GraphOptimize::OptimizeGraphBeforeBuildForRts(ComputeGraphPtr &compute_gr | |||
ret = iter->second->OptimizeGraphBeforeBuild(*compute_graph); | |||
if (ret != SUCCESS) { | |||
REPORT_INNER_ERROR("E19999", "Call OptimizeGraphBeforeBuild failed, ret:%d, engine_name:%s, " | |||
"graph_name:%s when GraphOptimize %s", ret, iter->first.c_str(), | |||
compute_graph->GetName().c_str(), __FUNCTION__); | |||
"graph_name:%s", ret, iter->first.c_str(), | |||
compute_graph->GetName().c_str()); | |||
GELOGE(ret, "[OptimizeGraphBeforeBuildForRts]: graph optimize failed, ret:%u", ret); | |||
return ret; | |||
} | |||
@@ -296,8 +296,8 @@ Status GraphOptimize::OptimizeGraphBeforeBuildForRts(ComputeGraphPtr &compute_gr | |||
Status GraphOptimize::SetOptions(const ge::GraphManagerOptions &options) { | |||
if (options.framework_type >= static_cast<int32_t>(domi::FrameworkType::FRAMEWORK_RESERVED)) { | |||
REPORT_INNER_ERROR("E19999", "Param framework_type:%d in option check invalid when GraphOptimize %s", | |||
options.framework_type, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Param framework_type:%d in option check invalid", | |||
options.framework_type); | |||
GELOGE(GE_GRAPH_OPTIONS_INVALID, "Optimize Type %d invalid.", options.framework_type); | |||
return GE_GRAPH_OPTIONS_INVALID; | |||
} | |||
@@ -372,14 +372,14 @@ Status GraphOptimize::IdentifyReference(ComputeGraphPtr &compute_graph) { | |||
} | |||
Status GraphOptimize::OptimizeWholeGraph(ComputeGraphPtr &compute_graph) { | |||
if (compute_graph == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Param compute_graph is nullptr, check invalid when GraphOptimize %s", __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Param compute_graph is nullptr, check invalid"); | |||
GELOGE(GE_GRAPH_OPTIMIZE_COMPUTE_GRAPH_NULL, "[OptimizeWholeGraph]: compute_graph is nullptr."); | |||
return GE_GRAPH_OPTIMIZE_COMPUTE_GRAPH_NULL; | |||
} | |||
std::shared_ptr<GELib> instance_ptr = ge::GELib::GetInstance(); | |||
if (instance_ptr == nullptr || !instance_ptr->InitFlag()) { | |||
REPORT_INNER_ERROR("E19999", "Gelib not init before, check invalid when GraphOptimize %s", __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Gelib not init before, check invalid"); | |||
GELOGE(GE_CLI_GE_NOT_INITIALIZED, "OptimizeWholeGraph failed."); | |||
return GE_CLI_GE_NOT_INITIALIZED; | |||
} | |||
@@ -399,8 +399,8 @@ Status GraphOptimize::OptimizeWholeGraph(ComputeGraphPtr &compute_graph) { | |||
GE_DUMP(compute_graph, "OptimizeWholeGraph" + iter.first); | |||
if (ret != SUCCESS) { | |||
REPORT_INNER_ERROR("E19999", "Call OptimizeWholeGraph failed, ret:%d, engine_name:%s, " | |||
"graph_name:%s when GraphOptimize %s", ret, iter.first.c_str(), | |||
compute_graph->GetName().c_str(), __FUNCTION__); | |||
"graph_name:%s", ret, iter.first.c_str(), | |||
compute_graph->GetName().c_str()); | |||
GELOGE(ret, "[OptimizeWholeGraph]: graph optimize failed, ret:%u", ret); | |||
return ret; | |||
} | |||
@@ -26,14 +26,14 @@ const size_t kInputSizeSingle = 1; | |||
Status AddNPass::Run(NodePtr &node) { | |||
GELOGD("AddNPass running"); | |||
if (node == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Param node is nullptr, check invalid when AddNPass %s", __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Param node is nullptr, check invalid"); | |||
GELOGE(PARAM_INVALID, "param [node] must not be null."); | |||
return PARAM_INVALID; | |||
} | |||
if (node->GetType() == ADDN) { | |||
if (node->GetOpDesc() == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Param op_desc of node is nullptr, check invalid when AddNPass %s", __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Param op_desc of node is nullptr, check invalid"); | |||
GELOGE(PARAM_INVALID, "Param [node] op desc is null."); | |||
return PARAM_INVALID; | |||
} | |||
@@ -122,8 +122,7 @@ bool AicpuConstantFoldingPass::CheckInput(const NodePtr &node, vector<ConstGeTen | |||
Status AicpuConstantFoldingPass::GetInputAddrs(const vector<ConstGeTensorPtr> &weight_vec, | |||
vector<AddrAndType> &input_addrs) { | |||
if (weight_vec.empty()) { | |||
REPORT_INNER_ERROR("E19999", "Param weight_vec is empty, check invalid when AicpuConstantFoldingPass :%s", | |||
__FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Param weight_vec is empty, check invalid"); | |||
GELOGE(FAILED, "Weight is null"); | |||
return FAILED; | |||
} | |||
@@ -134,8 +133,8 @@ Status AicpuConstantFoldingPass::GetInputAddrs(const vector<ConstGeTensorPtr> &w | |||
rtError_t rt_ret = rtMemcpy(input_addr, weight->GetData().size(), weight->GetData().data(), | |||
weight->GetData().size(), RT_MEMCPY_HOST_TO_DEVICE); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret = 0x%X, when AicpuConstantFoldingPass %s", | |||
weight->GetData().size(), rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret = 0x%X", | |||
weight->GetData().size(), rt_ret); | |||
GELOGE(rt_ret, "rtMemcpy error"); | |||
GE_CHK_RT(rtFree(input_addr)); | |||
return FAILED; | |||
@@ -149,8 +148,8 @@ Status AicpuConstantFoldingPass::GetInputAddrs(const vector<ConstGeTensorPtr> &w | |||
Status AicpuConstantFoldingPass::GetOutputAddrs(const OpDescPtr &node_desc, vector<uint64_t> &output_addrs) { | |||
if (node_desc->GetOutputsSize() == 0) { | |||
REPORT_INNER_ERROR("E19999", "Ouput desc size of op:%s(%s) is 0, check invalid when AicpuConstantFoldingPass :%s", | |||
node_desc->GetName().c_str(), node_desc->GetType().c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Ouput desc size of op:%s(%s) is 0, check invalid", | |||
node_desc->GetName().c_str(), node_desc->GetType().c_str()); | |||
GELOGE(FAILED, "Output size is 0 "); | |||
return FAILED; | |||
} | |||
@@ -177,8 +176,8 @@ Status AicpuConstantFoldingPass::GenerateDataPtrInfo(const vector<uint64_t> &out | |||
if (result_summary.shape_data_size != 0) { | |||
rtError_t rt_ret = rtMalloc(&shape_data_addr, result_summary.shape_data_size, RT_MEMORY_HBM); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%lu, ret = 0x%X, when AicpuConstantFoldingPass %s", | |||
result_summary.shape_data_size, rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMalloc failed, size:%lu, ret = 0x%X", | |||
result_summary.shape_data_size, rt_ret); | |||
GELOGE(rt_ret, "rtMalloc error"); | |||
GE_CHK_RT(rtFree(raw_data_addr)); | |||
return FAILED; | |||
@@ -208,8 +207,7 @@ Status AicpuConstantFoldingPass::GenerateDataPtrInfo(const vector<uint64_t> &out | |||
Status AicpuConstantFoldingPass::UpdateWorkSpaceAddr(string &task_info, STR_FWK_OP_KERNEL &task) { | |||
// Update the workspace_addr | |||
if (task_info.empty()) { | |||
REPORT_INNER_ERROR("E19999", "Param task_info is empty, check invalid when AicpuConstantFoldingPass :%s", | |||
__FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Param task_info is empty, check invalid"); | |||
GELOGE(FAILED, "task_info is empty "); | |||
return FAILED; | |||
} | |||
@@ -218,8 +216,8 @@ Status AicpuConstantFoldingPass::UpdateWorkSpaceAddr(string &task_info, STR_FWK_ | |||
rtError_t rt_ret = | |||
rtMemcpy(workspace_addr, task_info.size(), task_info.data(), task_info.size(), RT_MEMCPY_HOST_TO_DEVICE); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret = 0x%X, when AicpuConstantFoldingPass %s", | |||
task_info.size(), rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret = 0x%X", | |||
task_info.size(), rt_ret); | |||
GELOGE(rt_ret, "rtMemcpy error"); | |||
GE_CHK_RT(rtFree(workspace_addr)); | |||
return FAILED; | |||
@@ -233,8 +231,7 @@ Status AicpuConstantFoldingPass::UpdateWorkSpaceAddr(string &task_info, STR_FWK_ | |||
Status AicpuConstantFoldingPass::UpdateInputAndOutputAddr(const vector<uint64_t> &io_addrs, STR_FWK_OP_KERNEL &task) { | |||
auto addrs_size = sizeof(uint64_t) * (io_addrs.size()); | |||
if (addrs_size <= 0) { | |||
REPORT_INNER_ERROR("E19999", "Param io_addrs size is 0, check invalid when AicpuConstantFoldingPass :%s", | |||
__FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Param io_addrs size is 0, check invalid"); | |||
GELOGE(FAILED, "addrs_size is less than 1 "); | |||
return FAILED; | |||
} | |||
@@ -242,8 +239,8 @@ Status AicpuConstantFoldingPass::UpdateInputAndOutputAddr(const vector<uint64_t> | |||
GE_CHK_RT_RET(rtMalloc(&input_output_addr, addrs_size, RT_MEMORY_HBM)); | |||
rtError_t rt_ret = rtMemcpy(input_output_addr, addrs_size, io_addrs.data(), addrs_size, RT_MEMCPY_HOST_TO_DEVICE); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret = 0x%X, when AicpuConstantFoldingPass %s", | |||
addrs_size, rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret = 0x%X", | |||
addrs_size, rt_ret); | |||
GELOGE(rt_ret, "rtMemcpy error"); | |||
GE_CHK_RT(rtFree(input_output_addr)); | |||
return FAILED; | |||
@@ -300,8 +297,8 @@ Status AicpuConstantFoldingPass::UpdateMemCopyAddr(string &task_info, const vect | |||
GE_CHK_RT_RET(rtMalloc(&input_addr_ptr, data_size, RT_MEMORY_HBM)); | |||
rtError_t rt_ret = rtMemcpy(input_addr_ptr, data_size, item.data(), data_size, RT_MEMCPY_HOST_TO_DEVICE); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret = 0x%X, when AicpuConstantFoldingPass %s", | |||
data_size, rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret = 0x%X", | |||
data_size, rt_ret); | |||
GELOGE(rt_ret, "rtMemcpy error"); | |||
GE_CHK_RT(rtFree(input_addr_ptr)); | |||
return FAILED; | |||
@@ -330,15 +327,14 @@ Status AicpuConstantFoldingPass::LaunchSingleOpRunTask(const NodePtr &node, cons | |||
void *task_buf = nullptr; | |||
auto instance_ptr = ge::GELib::GetInstance(); | |||
if (instance_ptr == nullptr || !instance_ptr->InitFlag()) { | |||
REPORT_INNER_ERROR("E19999", "GeLib is not init before, check invalid when AicpuConstantFoldingPass %s", | |||
__FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "GeLib is not init before, check invalid"); | |||
GELOGE(GE_CLI_GE_NOT_INITIALIZED, "GE is not initialized"); | |||
return GE_CLI_GE_NOT_INITIALIZED; | |||
} | |||
auto kernel_builder = OpsKernelBuilderManager::Instance().GetOpsKernelBuilder(kKernelLibName); | |||
if (kernel_builder == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Find ops kernel by name:%s failed, when AicpuConstantFoldingPass %s", | |||
kKernelLibName, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Find ops kernel by name:%s failed", | |||
kKernelLibName); | |||
GELOGE(FAILED, "Get op kernel info store failed"); | |||
return FAILED; | |||
} | |||
@@ -389,15 +385,14 @@ Status AicpuConstantFoldingPass::LaunchMemCopyTask(const vector<uint64_t> &data_ | |||
void *task_buf = nullptr; | |||
auto instance_ptr = ge::GELib::GetInstance(); | |||
if (instance_ptr == nullptr || !instance_ptr->InitFlag()) { | |||
REPORT_INNER_ERROR("E19999", "GeLib is not init before, check invalid when AicpuConstantFoldingPass %s", | |||
__FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "GeLib is not init before, check invalid"); | |||
GELOGE(GE_CLI_GE_NOT_INITIALIZED, "GE is not initialized"); | |||
return GE_CLI_GE_NOT_INITIALIZED; | |||
} | |||
auto kernel_builder = OpsKernelBuilderManager::Instance().GetOpsKernelBuilder(kKernelLibName); | |||
if (kernel_builder == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Find ops kernel by name:%s failed, when AicpuConstantFoldingPass %s", | |||
kKernelLibName, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Find ops kernel by name:%s failed", | |||
kKernelLibName); | |||
GELOGE(FAILED, "Get op kernel info store failed"); | |||
return FAILED; | |||
} | |||
@@ -454,8 +449,8 @@ Status AicpuConstantFoldingPass::GenerateTaskForLaunch(STR_FWK_OP_KERNEL &aicpu_ | |||
rtError_t rt_ret = rtMemcpy(task_buf, sizeof(STR_FWK_OP_KERNEL), reinterpret_cast<void *>(&aicpu_task), | |||
sizeof(STR_FWK_OP_KERNEL), RT_MEMCPY_HOST_TO_DEVICE); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret = 0x%X, when AicpuConstantFoldingPass %s", | |||
sizeof(STR_FWK_OP_KERNEL), rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtMemcpy failed, size:%zu, ret = 0x%X", | |||
sizeof(STR_FWK_OP_KERNEL), rt_ret); | |||
GELOGE(rt_ret, "rtMemcpy error"); | |||
GE_CHK_RT(rtFree(task_buf)); | |||
return FAILED; | |||
@@ -485,57 +480,57 @@ Status AicpuConstantFoldingPass::KernelLaunch(void *task_buf) { | |||
rtError_t rt_ret = rtModelCreate(&model, 0); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtModelCreate failed, ret = 0x%X, when AicpuConstantFoldingPass %s", | |||
rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtModelCreate failed, ret = 0x%X", | |||
rt_ret); | |||
GELOGE(rt_ret, "create model failed."); | |||
return FAILED; | |||
} | |||
rt_ret = rtStreamCreate(&stream, 0); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtStreamCreate failed, ret = 0x%X, when AicpuConstantFoldingPass %s", | |||
rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtStreamCreate failed, ret = 0x%X", | |||
rt_ret); | |||
GELOGE(rt_ret, "create stream failed."); | |||
return FAILED; | |||
} | |||
rt_ret = rtModelBindStream(model, stream, 0); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtModelBindStream failed, ret = 0x%X, when AicpuConstantFoldingPass %s", | |||
rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtModelBindStream failed, ret = 0x%X", | |||
rt_ret); | |||
GELOGE(rt_ret, "rtModelBindStream failed."); | |||
return FAILED; | |||
} | |||
rt_ret = rtKernelLaunchEx(task_buf, sizeof(STR_FWK_OP_KERNEL), 0, stream); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtModelBindStream failed, ret = 0x%X, when AicpuConstantFoldingPass %s", | |||
rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtModelBindStream failed, ret = 0x%X", | |||
rt_ret); | |||
GELOGE(rt_ret, "rtKernelLaunchEx failed."); | |||
return FAILED; | |||
} | |||
rt_ret = rtModelLoadComplete(model); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtModelLoadComplete failed, ret = 0x%X, when AicpuConstantFoldingPass %s", | |||
rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtModelLoadComplete failed, ret = 0x%X", | |||
rt_ret); | |||
GELOGE(rt_ret, "rtModelLoadComplete failed."); | |||
return FAILED; | |||
} | |||
rt_ret = rtStreamCreate(&stream_run, 0); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtStreamCreate failed, ret = 0x%X, when AicpuConstantFoldingPass %s", | |||
rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtStreamCreate failed, ret = 0x%X", | |||
rt_ret); | |||
GELOGE(rt_ret, "create run stream failed."); | |||
return FAILED; | |||
} | |||
rt_ret = rtModelExecute(model, stream_run, 0); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtModelExecute failed, ret = 0x%X, when AicpuConstantFoldingPass %s", | |||
rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtModelExecute failed, ret = 0x%X", | |||
rt_ret); | |||
GELOGE(rt_ret, "rtModelExecute failed."); | |||
return FAILED; | |||
} | |||
rt_ret = rtStreamSynchronize(stream_run); | |||
if (rt_ret != RT_ERROR_NONE) { | |||
REPORT_CALL_ERROR("E19999", "Call rtStreamSynchronize failed, ret = 0x%X, when AicpuConstantFoldingPass %s", | |||
rt_ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call rtStreamSynchronize failed, ret = 0x%X", | |||
rt_ret); | |||
GELOGE(rt_ret, "rtStreamSynchronize failed."); | |||
return FAILED; | |||
} | |||
@@ -546,8 +541,8 @@ Status AicpuConstantFoldingPass::GenerateGeTensor(const OpDescPtr &node_desc, co | |||
vector<GeTensorPtr> &outputs) { | |||
if ((node_desc->GetOutputsSize() * kDouble) != data_vec.size()) { | |||
REPORT_INNER_ERROR("E19999", "Output desc size:%zu of op:%s(%s), after multi 2, not equal to data_vec.size:%zu, " | |||
"check invalid when AicpuConstantFoldingPass %s", node_desc->GetOutputsSize(), | |||
node_desc->GetName().c_str(), node_desc->GetType().c_str(), data_vec.size(), __FUNCTION__); | |||
"check invalid", node_desc->GetOutputsSize(), | |||
node_desc->GetName().c_str(), node_desc->GetType().c_str(), data_vec.size()); | |||
GELOGE(FAILED, "node[%s] something wrong with output size", node_desc->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -556,7 +551,7 @@ Status AicpuConstantFoldingPass::GenerateGeTensor(const OpDescPtr &node_desc, co | |||
auto output_tensor_desc = node_desc->GetOutputDesc(static_cast<uint32_t>(i)); | |||
GeTensorPtr output_ptr = MakeShared<GeTensor>(output_tensor_desc); | |||
if (output_ptr == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "New GeTensor failed when AicpuConstantFoldingPass %s", __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "New GeTensor failed"); | |||
GELOGE(FAILED, "node[%s] something wrong with construct GeTensor", node_desc->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -564,8 +559,8 @@ Status AicpuConstantFoldingPass::GenerateGeTensor(const OpDescPtr &node_desc, co | |||
uint64_t raw_data_size = raw_data_info.data_size; | |||
std::unique_ptr<uint8_t[]> data_addr(new (std::nothrow) uint8_t[raw_data_size]()); | |||
if (data_addr == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "New Buffer failed, size:%lu, when AicpuConstantFoldingPass %s", | |||
raw_data_size, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "New Buffer failed, size:%lu", | |||
raw_data_size); | |||
GELOGE(MEMALLOC_FAILED, "new data_addr failed"); | |||
return INTERNAL_ERROR; | |||
} | |||
@@ -589,8 +584,8 @@ Status AicpuConstantFoldingPass::GenerateGeTensor(const OpDescPtr &node_desc, co | |||
uint64_t dim_num = shape_data_size / sizeof(uint64_t); | |||
std::unique_ptr<int64_t[]> shape_addr(new (std::nothrow) int64_t[dim_num]()); | |||
if (shape_addr == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "New Buffer failed, size:%lu, when AicpuConstantFoldingPass %s", | |||
dim_num, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "New Buffer failed, size:%lu", | |||
dim_num); | |||
GELOGE(MEMALLOC_FAILED, "new shape_addr failed"); | |||
return INTERNAL_ERROR; | |||
} | |||
@@ -636,24 +631,22 @@ bool AicpuConstantFoldingPass::IsSkipFold(const ge::NodePtr &node) { | |||
} | |||
auto instance_ptr = ge::GELib::GetInstance(); | |||
if (instance_ptr == nullptr || !instance_ptr->InitFlag()) { | |||
REPORT_INNER_ERROR("E19999", "GeLib is not init before, check invalid when AicpuConstantFoldingPass %s", | |||
__FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "GeLib is not init before, check invalid"); | |||
GELOGE(GE_CLI_GE_NOT_INITIALIZED, "GE is not initialized"); | |||
return true; | |||
} | |||
OpsKernelInfoStorePtr kernel_info = instance_ptr->OpsKernelManagerObj().GetOpsKernelInfoStore(kKernelLibName); | |||
if (kernel_info == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Find ops kernel by name:%s failed, when AicpuConstantFoldingPass %s", | |||
kKernelLibName, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Find ops kernel by name:%s failed", | |||
kKernelLibName); | |||
GELOGE(FAILED, "Get op kernel info store failed"); | |||
return true; | |||
} | |||
std::string check_result; | |||
kernel_info->opsFlagCheck(*node, check_result); | |||
if (check_result.empty()) { | |||
REPORT_CALL_ERROR("E19999", "Call opsFlagCheck faled, ops kernel name:%s, op:%s(%s), " | |||
"when AicpuConstantFoldingPass %s", kKernelLibName, | |||
node->GetName().c_str(), node->GetType().c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call opsFlagCheck faled, ops kernel name:%s, op:%s(%s)", | |||
kKernelLibName, node->GetName().c_str(), node->GetType().c_str()); | |||
GELOGE(FAILED, "Get op check_result failed"); | |||
return true; | |||
} | |||
@@ -30,12 +30,12 @@ namespace ge { | |||
Status AssertPass::Run(NodePtr &node) { | |||
GELOGD("AssertPass running"); | |||
if (node == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Param node is nullptr, check invalid when AssertPass %s", __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Param node is nullptr, check invalid"); | |||
GELOGE(PARAM_INVALID, "param [node] must not be null."); | |||
return PARAM_INVALID; | |||
} | |||
if (node->GetOpDesc() == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Param op_desc of node is nullptr, check invalid when AssertPass %s", __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Param op_desc of node is nullptr, check invalid"); | |||
GELOGE(PARAM_INVALID, "param [node] [opDesc] must not be null."); | |||
return PARAM_INVALID; | |||
} | |||
@@ -95,8 +95,8 @@ Status AssertPass::RemoveUnusedNode(std::vector<NodePtr> &nodes_unused) { | |||
} | |||
if (IsolateAndDeleteNode(node, assert_io_map) != SUCCESS) { | |||
REPORT_INNER_ERROR("E19999", "Isolate and delete node:%s(%s) faild when AssertPass %s", | |||
node->GetName().c_str(), node->GetType().c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Isolate and delete node:%s(%s) faild", | |||
node->GetName().c_str(), node->GetType().c_str()); | |||
return FAILED; | |||
} | |||
} | |||
@@ -57,18 +57,18 @@ Status AssignRemovePass::OptimizedAssignNode(NodePtr &assign_node) { | |||
const auto &ref_in_anchor = assign_node->GetInDataAnchor(kAssignRefInputIndex); | |||
const auto &value_in_anchor = assign_node->GetInDataAnchor(kAssignValueInputIndex); | |||
if ((ref_in_anchor == nullptr) || (value_in_anchor == nullptr)) { | |||
REPORT_INNER_ERROR("E19999", "Index %d or %d input anchor of node:%s(%s) is nullptr, check invalid " | |||
"when AssignRemovePass %s", kAssignRefInputIndex, kAssignValueInputIndex, | |||
assign_node->GetName().c_str(), assign_node->GetType().c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Index %d or %d input anchor of node:%s(%s) is nullptr, check invalid", | |||
kAssignRefInputIndex, kAssignValueInputIndex, | |||
assign_node->GetName().c_str(), assign_node->GetType().c_str()); | |||
GELOGE(FAILED, "In data anchor is null, node:%s", assign_node->GetName().c_str()); | |||
return FAILED; | |||
} | |||
const auto &ref_peer_anchor = ref_in_anchor->GetPeerOutAnchor(); | |||
const auto &value_peer_anchor = value_in_anchor->GetPeerOutAnchor(); | |||
if ((ref_peer_anchor == nullptr) || (value_peer_anchor == nullptr)) { | |||
REPORT_INNER_ERROR("E19999", "Index %d or %d input anchor of node:%s(%s), peer anchor is nullptr, check invalid " | |||
"when AssignRemovePass %s", kAssignRefInputIndex, kAssignValueInputIndex, | |||
assign_node->GetName().c_str(), assign_node->GetType().c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Index %d or %d input anchor of node:%s(%s), peer anchor is nullptr, check invalid", | |||
kAssignRefInputIndex, kAssignValueInputIndex, | |||
assign_node->GetName().c_str(), assign_node->GetType().c_str()); | |||
GELOGE(FAILED, "Peer data anchor is null, node:%s", assign_node->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -85,8 +85,8 @@ Status AssignRemovePass::OptimizedAssignNode(NodePtr &assign_node) { | |||
/// | |||
GELOGD("Optimization for assign_node %s start", assign_node->GetName().c_str()); | |||
if (IsolateAndDeleteNode(assign_node, {kAssignRefInputIndex}) != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Isolate and delete node:%s(%s) failed when AssignRemovePass %s", | |||
assign_node->GetName().c_str(), assign_node->GetType().c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Isolate and delete node:%s(%s) failed", | |||
assign_node->GetName().c_str(), assign_node->GetType().c_str()); | |||
GELOGE(FAILED, "Isolate and delete assign_node %s failed.", assign_node->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -94,27 +94,26 @@ Status AssignRemovePass::OptimizedAssignNode(NodePtr &assign_node) { | |||
const auto &ref_input = ref_peer_anchor->GetOwnerNode()->GetOpDesc(); | |||
const auto &value_input = value_peer_anchor->GetOwnerNode()->GetOpDesc(); | |||
if ((ref_input == nullptr) || (value_input == nullptr)) { | |||
REPORT_INNER_ERROR("E19999", "Input index %d or %d of node:%s(%s), peer op is nullptr, check invalid " | |||
"when AssignRemovePass %s", kAssignRefInputIndex, kAssignValueInputIndex, | |||
assign_node->GetName().c_str(), assign_node->GetType().c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Input index %d or %d of node:%s(%s), peer op is nullptr, check invalid", | |||
kAssignRefInputIndex, kAssignValueInputIndex, | |||
assign_node->GetName().c_str(), assign_node->GetType().c_str()); | |||
GELOGE(FAILED, "value input is null"); | |||
return FAILED; | |||
} | |||
// variable has and only has one input | |||
if (ref_input->UpdateInputDesc(0, value_input->GetOutputDesc(value_peer_anchor->GetIdx())) != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Input index %d of node:%s(%s), update it's peer op input:0 desc failed " | |||
"when AssignRemovePass %s", kAssignRefInputIndex, | |||
assign_node->GetName().c_str(), assign_node->GetType().c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Input index %d of node:%s(%s), update it's peer op input:0 desc failed", | |||
kAssignRefInputIndex, assign_node->GetName().c_str(), assign_node->GetType().c_str()); | |||
GELOGE(FAILED, "Update input_desc for variable %s failed.", ref_input->GetName().c_str()); | |||
return FAILED; | |||
} | |||
if (GraphUtils::AddEdge(value_peer_anchor, ref_peer_anchor->GetOwnerNode()->GetInDataAnchor(0)) != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(out_index:%d) and op:%s(%s)(in_index:0) failed " | |||
"when AssignRemovePass %s", value_peer_anchor->GetOwnerNode()->GetName().c_str(), | |||
REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(out_index:%d) and op:%s(%s)(in_index:0) failed", | |||
value_peer_anchor->GetOwnerNode()->GetName().c_str(), | |||
value_peer_anchor->GetOwnerNode()->GetType().c_str(), value_peer_anchor->GetIdx(), | |||
ref_peer_anchor->GetOwnerNode()->GetName().c_str(), | |||
ref_peer_anchor->GetOwnerNode()->GetType().c_str(), __FUNCTION__); | |||
ref_peer_anchor->GetOwnerNode()->GetType().c_str()); | |||
GELOGE(FAILED, "Add data edge %s->%s failed", value_input->GetName().c_str(), ref_input->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -123,9 +122,9 @@ Status AssignRemovePass::OptimizedAssignNode(NodePtr &assign_node) { | |||
value_input->GetName().c_str(), ref_input->GetName().c_str()); | |||
if (!AttrUtils::SetStr(value_input->MutableOutputDesc(value_peer_anchor->GetIdx()), ASSIGN_VAR_NAME, | |||
ref_input->GetName())) { | |||
REPORT_CALL_ERROR("E19999", "Set Attr:%s to output:%d desc of node:%s(%s) failed when %s", | |||
REPORT_CALL_ERROR("E19999", "Set Attr:%s to output:%d desc of node:%s(%s) failed", | |||
ASSIGN_VAR_NAME.c_str(), value_peer_anchor->GetIdx(), | |||
value_input->GetName().c_str(), value_input->GetType().c_str(), __FUNCTION__); | |||
value_input->GetName().c_str(), value_input->GetType().c_str()); | |||
GELOGE(FAILED, "Set attr ASSIGN_VAR_NAME failed."); | |||
return FAILED; | |||
} | |||
@@ -158,9 +157,9 @@ Status AssignRemovePass::TransformAttr(NodePtr &node) { | |||
GELOGD("add attr ASSIGN_VAR_NAME on node %s, var_name=%s", in_node->GetName().c_str(), assign_var_name.c_str()); | |||
if (!AttrUtils::SetStr(in_node->GetOpDesc()->MutableOutputDesc(peer_data_anchor->GetIdx()), | |||
ASSIGN_VAR_NAME, assign_var_name)) { | |||
REPORT_CALL_ERROR("E19999", "Set Attr:%s to output:%d desc of node:%s(%s) failed when %s", | |||
REPORT_CALL_ERROR("E19999", "Set Attr:%s to output:%d desc of node:%s(%s) failed", | |||
ASSIGN_VAR_NAME.c_str(), peer_data_anchor->GetIdx(), | |||
in_node->GetName().c_str(), in_node->GetType().c_str(), __FUNCTION__); | |||
in_node->GetName().c_str(), in_node->GetType().c_str()); | |||
GELOGE(FAILED, "Set attr ASSIGN_VAR_NAME failed."); | |||
return FAILED; | |||
} | |||
@@ -299,7 +299,7 @@ Status AtomicAddrCleanPass::HandleDispersedAtomicNodes(ComputeGraphPtr &graph, | |||
NodePtr AtomicAddrCleanPass::InsertAtomicAddrCleanNode(ComputeGraphPtr &graph) { | |||
OpDescPtr op_desc = MakeShared<OpDesc>(NODE_NAME_ATOMIC_ADDR_CLEAN, ATOMICADDRCLEAN); | |||
if (op_desc == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "New OpDesc failed when AtomicAddrCleanPass %s", __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "New OpDesc failed"); | |||
GELOGE(INTERNAL_ERROR, "Make shared atomic addr clean op failed."); | |||
return nullptr; | |||
} | |||
@@ -327,16 +327,16 @@ NodePtr AtomicAddrCleanPass::InsertAtomicAddrCleanNode(ComputeGraphPtr &graph) { | |||
Status AtomicAddrCleanPass::LinkToAtomicNode(const NodePtr &atomic_node, NodePtr &atomic_clean_node) { | |||
GE_IF_BOOL_EXEC(atomic_node == nullptr || atomic_clean_node == nullptr, | |||
REPORT_INNER_ERROR("E19999", "Param atomic_node or atomic_clean_node is nullptr, " | |||
"check invalid when AtomicAddrCleanPass %s", __FUNCTION__); | |||
"check invalid"); | |||
DOMI_LOGE("param [atomic_node][atomic_clean_node] must not be null."); | |||
return PARAM_INVALID); | |||
InControlAnchorPtr in_ctrl_anchor = atomic_node->GetInControlAnchor(); | |||
OutControlAnchorPtr out_ctrl_anchor = atomic_clean_node->GetOutControlAnchor(); | |||
if (in_ctrl_anchor == nullptr || out_ctrl_anchor == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "in_ctrl_anchor of op:%s(%s) or out_ctrl_anchor of op:%s(%s) is nullptr, " | |||
"check invalid when AtomicAddrCleanPass %s", | |||
"check invalid", | |||
atomic_node->GetName().c_str(), atomic_node->GetType().c_str(), | |||
atomic_clean_node->GetName().c_str(), atomic_clean_node->GetType().c_str(), __FUNCTION__); | |||
atomic_clean_node->GetName().c_str(), atomic_clean_node->GetType().c_str()); | |||
GELOGE(INTERNAL_ERROR, | |||
"Get control anchor faild, dst node: %s.", | |||
atomic_node->GetName().c_str()); | |||
@@ -345,11 +345,11 @@ Status AtomicAddrCleanPass::LinkToAtomicNode(const NodePtr &atomic_node, NodePtr | |||
graphStatus status = GraphUtils::AddEdge(out_ctrl_anchor, in_ctrl_anchor); | |||
if (status != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(out_index:%d) and op:%s(%s)(in_index:%d) failed " | |||
"when AssignRemovePass %s", out_ctrl_anchor->GetOwnerNode()->GetName().c_str(), | |||
out_ctrl_anchor->GetOwnerNode()->GetType().c_str(), out_ctrl_anchor->GetIdx(), | |||
REPORT_CALL_ERROR("E19999", "Add control edge between op:%s(%s) and op:%s(%s) failed", | |||
out_ctrl_anchor->GetOwnerNode()->GetName().c_str(), | |||
out_ctrl_anchor->GetOwnerNode()->GetType().c_str(), | |||
in_ctrl_anchor->GetOwnerNode()->GetName().c_str(), | |||
in_ctrl_anchor->GetOwnerNode()->GetType().c_str(), in_ctrl_anchor->GetIdx(), __FUNCTION__); | |||
in_ctrl_anchor->GetOwnerNode()->GetType().c_str()); | |||
GELOGE(INTERNAL_ERROR, | |||
"Graph add cleanAddrNode op out ctrl edge fail, dst node: %s.", | |||
atomic_node->GetName().c_str()); | |||
@@ -407,8 +407,7 @@ Status AtomicAddrCleanPass::CompileUnknownGraphOp(const vector<NodePtr> &atomic_ | |||
std::unordered_map<string, vector<ge::NodePtr>> node_vector_map; | |||
std::shared_ptr<GELib> instance = ge::GELib::GetInstance(); | |||
if ((instance == nullptr) || !instance->InitFlag()) { | |||
REPORT_INNER_ERROR("E19999", "GeLib is not init before, check invalid when AtomicAddrCleanPass %s", | |||
__FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "GeLib is not init before, check invalid"); | |||
GELOGE(ge::GE_CLI_GE_NOT_INITIALIZED, "CompileSingleOp failed."); | |||
return ge::GE_CLI_GE_NOT_INITIALIZED; | |||
} | |||
@@ -421,8 +420,8 @@ Status AtomicAddrCleanPass::CompileUnknownGraphOp(const vector<NodePtr> &atomic_ | |||
} | |||
string kernel_lib_name = op_desc->GetOpKernelLibName(); | |||
if (kernel_lib_name.empty()) { | |||
REPORT_INNER_ERROR("E19999", "Find ops kernel by name:%s failed, when AtomicAddrCleanPass %s", | |||
kernel_lib_name.c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Find ops kernel by name:%s failed", | |||
kernel_lib_name.c_str()); | |||
GELOGE(ge::INTERNAL_ERROR, "Get atomic node:%s(%s) kernel lib failed.", atomic_node->GetName().c_str(), | |||
atomic_node->GetType().c_str()); | |||
return ge::INTERNAL_ERROR; | |||
@@ -443,8 +442,8 @@ Status AtomicAddrCleanPass::CompileUnknownGraphOp(const vector<NodePtr> &atomic_ | |||
GELOGI("The atomic node size of compile op of %s is %zu", kernel_lib_name.c_str(), node_vector.size()); | |||
GE_TIMESTAMP_ADD(UnknownGraphCompileOp); | |||
if (ret != ge::SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Call CompileOp failed, kernel_lib_name:%s, ret:%d, when AtomicAddrCleanPass %s", | |||
kernel_lib_name.c_str(), ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call CompileOp failed, kernel_lib_name:%s, ret:%d", | |||
kernel_lib_name.c_str(), ret); | |||
GELOGE(ret, "Compile atomic op failed, kernel lib name is %s", kernel_lib_name.c_str()); | |||
return ret; | |||
} | |||
@@ -119,8 +119,8 @@ Status AttachStreamLabelPass::UpdateCondBranch(const NodePtr &node) { | |||
GELOGD("Attach label %s to node: %s.", stream_label.c_str(), tmp_node->GetName().c_str()); | |||
auto status = SetStreamLabel(tmp_node, stream_label); | |||
if (status != ge::SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Set stream_label:%s to op:%s(%s) failed when AttachStreamLabelPass %s", | |||
stream_label.c_str(), tmp_node->GetName().c_str(), tmp_node->GetType().c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Set stream_label:%s to op:%s(%s) failed", | |||
stream_label.c_str(), tmp_node->GetName().c_str(), tmp_node->GetType().c_str()); | |||
GELOGE(status, "Set stream label failed."); | |||
return status; | |||
} | |||
@@ -139,8 +139,8 @@ Status AttachStreamLabelPass::AttachFlag(const NodePtr &node, std::string &strea | |||
const std::string &type = node->GetType(); | |||
if (type == STREAMSWITCH) { | |||
if (node->GetInDataNodes().empty()) { | |||
REPORT_INNER_ERROR("E19999", "In data nodes is empty of op:%s(%s), check invalid when AttachStreamLabelPass %s", | |||
node->GetName().c_str(), node->GetType().c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "In data nodes is empty of op:%s(%s), check invalid", | |||
node->GetName().c_str(), node->GetType().c_str()); | |||
GELOGE(INTERNAL_ERROR, "node %s has no input_data_node.", node->GetName().c_str()); | |||
return INTERNAL_ERROR; | |||
} | |||
@@ -149,16 +149,16 @@ Status AttachStreamLabelPass::AttachFlag(const NodePtr &node, std::string &strea | |||
OpDescPtr op_desc = node->GetOpDesc(); | |||
GE_CHECK_NOTNULL(op_desc); | |||
GE_CHK_BOOL_EXEC(AttrUtils::GetBool(op_desc, ATTR_NAME_SWITCH_TRUE_BRANCH_FLAG, value), | |||
REPORT_CALL_ERROR("E19999", "Get Attr:%s of op:%s(%s) failed when AttachStreamLabelPass %s", | |||
REPORT_CALL_ERROR("E19999", "Get Attr:%s of op:%s(%s) failed", | |||
ATTR_NAME_SWITCH_TRUE_BRANCH_FLAG.c_str(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
return FAILED, | |||
"StreamSwitch get attr TRUE_BRANCH_STREAM failed."); | |||
stream_label += (value ? "_t" : "_f"); | |||
auto status = SetActiveLabelList(node, {stream_label}); | |||
if (status != ge::SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Set active label list:%s to op:%s(%s) failed when AttachStreamLabelPass %s", | |||
stream_label.c_str(), node->GetName().c_str(), node->GetType().c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Set active label list:%s to op:%s(%s) failed", | |||
stream_label.c_str(), node->GetName().c_str(), node->GetType().c_str()); | |||
GELOGE(status, "set active_label_list failed."); | |||
return status; | |||
} | |||
@@ -166,8 +166,8 @@ Status AttachStreamLabelPass::AttachFlag(const NodePtr &node, std::string &strea | |||
stream_label = node->GetName(); | |||
auto status = SetStreamLabel(node, stream_label); | |||
if (status != ge::SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Set stream_label:%s to op:%s(%s) failed when AttachStreamLabelPass %s", | |||
stream_label.c_str(), node->GetName().c_str(), node->GetType().c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Set stream_label:%s to op:%s(%s) failed", | |||
stream_label.c_str(), node->GetName().c_str(), node->GetType().c_str()); | |||
GELOGE(status, "Set stream label failed."); | |||
return status; | |||
} | |||
@@ -207,9 +207,9 @@ Status AttachStreamLabelPass::UpdateEnterNode() { | |||
bool get_attr = AttrUtils::GetListStr(active_node->GetOpDesc(), ATTR_NAME_ACTIVE_LABEL_LIST, active_label_list) && | |||
(active_label_list.size() == 1) && !active_label_list[0].empty(); | |||
if (!get_attr) { | |||
REPORT_CALL_ERROR("E19999", "Get Attr:%s of op:%s(%s) failed when AttachStreamLabelPass %s", | |||
REPORT_CALL_ERROR("E19999", "Get Attr:%s of op:%s(%s) failed", | |||
ATTR_NAME_ACTIVE_LABEL_LIST.c_str(), | |||
active_node->GetName().c_str(), active_node->GetType().c_str(), __FUNCTION__); | |||
active_node->GetName().c_str(), active_node->GetType().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Get attr ATTR_NAME_ACTIVE_LABEL_LIST failed, node: %s.", active_node->GetName().c_str()); | |||
return INTERNAL_ERROR; | |||
} | |||
@@ -245,9 +245,8 @@ Status AttachStreamLabelPass::SetEnterLabel(const std::vector<NodePtr> &enter_no | |||
for (const auto &enter_node : enter_nodes) { | |||
auto status = SetStreamLabel(enter_node, stream_label); | |||
if (status != ge::SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Set stream_label:%s to op:%s(%s) failed when AttachStreamLabelPass %s", | |||
stream_label.c_str(), enter_node->GetName().c_str(), enter_node->GetType().c_str(), | |||
__FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Set stream_label:%s to op:%s(%s) failed", | |||
stream_label.c_str(), enter_node->GetName().c_str(), enter_node->GetType().c_str()); | |||
GELOGE(status, "Set stream label failed."); | |||
return status; | |||
} | |||
@@ -281,9 +280,8 @@ Status AttachStreamLabelPass::UpdateLoopBranch(const std::stack<NodePtr> &enter_ | |||
GELOGD("Attach label %s to node: %s.", stream_label.c_str(), out_node->GetName().c_str()); | |||
auto status = SetStreamLabel(out_node, stream_label); | |||
if (status != ge::SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Set stream_label:%s to op:%s(%s) failed when AttachStreamLabelPass %s", | |||
stream_label.c_str(), out_node->GetName().c_str(), out_node->GetType().c_str(), | |||
__FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Set stream_label:%s to op:%s(%s) failed", | |||
stream_label.c_str(), out_node->GetName().c_str(), out_node->GetType().c_str()); | |||
GELOGE(status, "Set stream label failed."); | |||
return status; | |||
} | |||
@@ -32,7 +32,7 @@ const char *const kAttrNameType = "type"; | |||
Status BitcastPass::Run(NodePtr &node) { | |||
GELOGD("Bitcast running"); | |||
if (node == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Param node is nullptr, check invalid when BitcastPass %s", __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Param node is nullptr, check invalid"); | |||
GELOGE(PARAM_INVALID, "Param [node] must not be null."); | |||
return PARAM_INVALID; | |||
} | |||
@@ -43,7 +43,7 @@ Status BitcastPass::Run(NodePtr &node) { | |||
OpDescPtr op_desc = node->GetOpDesc(); | |||
if (op_desc == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Param op_desc of node is nullptr, check invalid when BitcastPass %s", __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Param op_desc of node is nullptr, check invalid"); | |||
return PARAM_INVALID; | |||
} | |||
ge::DataType dst_data_type; | |||
@@ -61,31 +61,30 @@ Status BitcastPass::Run(NodePtr &node) { | |||
Status BitcastPass::CheckDstDataType(const OpDescPtr op_desc, ge::DataType &dst_data_type) { | |||
if (!ge::AttrUtils::GetDataType(op_desc, kAttrNameType, dst_data_type)) { | |||
REPORT_CALL_ERROR("E19999", "Get Attr:%s of op:%s(%s) failed when BitcastPass %s", | |||
kAttrNameType, op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Get Attr:%s of op:%s(%s) failed", | |||
kAttrNameType, op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(PARAM_INVALID, "Node failed to get attribute type."); | |||
return PARAM_INVALID; | |||
} | |||
if (dst_data_type >= ge::DT_UNDEFINED) { | |||
REPORT_INNER_ERROR("E19999", "Param dst_data_type:%d check invalid, op:%s(%s), when BitcastPass %s", | |||
dst_data_type, op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Param dst_data_type:%d check invalid, op:%s(%s)", | |||
dst_data_type, op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(PARAM_INVALID, "dst_data_type[%s] is not valid.", | |||
TypeUtils::DataTypeToSerialString(dst_data_type).c_str()); | |||
return PARAM_INVALID; | |||
} | |||
if (op_desc->GetOutputDescPtr(0) == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Index 0 ouput desc of op:%s(%s) not exist, check invalid when BitcastPass %s", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Index 0 ouput desc of op:%s(%s) not exist, check invalid", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(PARAM_INVALID, "Bitcast node outputDesc is null."); | |||
return PARAM_INVALID; | |||
} | |||
if (op_desc->GetOutputDescPtr(0)->GetDataType() != dst_data_type) { | |||
REPORT_INNER_ERROR("E19999", "Index 0 ouput desc of op:%s(%s), it't data type:%s not equal to dst_data_type:%s, " | |||
"check invalid when BitcastPass %s", op_desc->GetName().c_str(), op_desc->GetType().c_str(), | |||
"check invalid", op_desc->GetName().c_str(), op_desc->GetType().c_str(), | |||
TypeUtils::DataTypeToSerialString(dst_data_type).c_str(), | |||
TypeUtils::DataTypeToSerialString(op_desc->GetOutputDescPtr(0)->GetDataType()).c_str(), | |||
__FUNCTION__); | |||
TypeUtils::DataTypeToSerialString(op_desc->GetOutputDescPtr(0)->GetDataType()).c_str()); | |||
GELOGE(PARAM_INVALID, "dst_data_type[%s] is not equal to output_data_type[%s].", | |||
TypeUtils::DataTypeToSerialString(dst_data_type).c_str(), | |||
TypeUtils::DataTypeToSerialString(op_desc->GetOutputDescPtr(0)->GetDataType()).c_str()); | |||
@@ -98,8 +97,8 @@ Status BitcastPass::CheckOutputShape(const OpDescPtr op_desc, const ge::DataType | |||
const GeTensorDescPtr &input_tensor_desc = op_desc->MutableInputDesc(0); | |||
const GeTensorDescPtr &output_tensor_desc = op_desc->MutableOutputDesc(0); | |||
if (input_tensor_desc == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Index 0 input desc of op:%s(%s) not exist, check invalid when BitcastPass %s", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Index 0 input desc of op:%s(%s) not exist, check invalid", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(PARAM_INVALID, "input_tensor_desc must not be null."); | |||
return PARAM_INVALID; | |||
} | |||
@@ -108,8 +107,8 @@ Status BitcastPass::CheckOutputShape(const OpDescPtr op_desc, const ge::DataType | |||
ge::DataType ori_data_type = input_tensor_desc->GetDataType(); | |||
if (ori_data_type >= ge::DT_UNDEFINED) { | |||
REPORT_INNER_ERROR("E19999", "ori_data_type:%d of index 0 input desc in op:%s(%s), " | |||
"check invalid when BitcastPass %s", | |||
ori_data_type, op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); | |||
"check invalid", | |||
ori_data_type, op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(PARAM_INVALID, "ori_data_type[%s] is not valid.", | |||
TypeUtils::DataTypeToSerialString(ori_data_type).c_str()); | |||
return PARAM_INVALID; | |||
@@ -128,10 +127,9 @@ Status BitcastPass::CheckOutputShape(const OpDescPtr op_desc, const ge::DataType | |||
if (dim_vec != output_tensor_desc->GetShape().GetDims()) { | |||
REPORT_INNER_ERROR("E19999", "Shape:%s of index 0 output desc in op:%s(%s), different from expect shape:%s ," | |||
"check invalid when BitcastPass %s", | |||
"check invalid", | |||
formats::JoinToString(output_tensor_desc->GetShape().GetDims()).c_str(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), formats::JoinToString(dim_vec).c_str(), | |||
__FUNCTION__); | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), formats::JoinToString(dim_vec).c_str()); | |||
GELOGE(PARAM_INVALID, "out_put_shape is different from expectations."); | |||
return PARAM_INVALID; | |||
} | |||
@@ -142,7 +140,7 @@ Status BitcastPass::CheckOutputShape(const OpDescPtr op_desc, const ge::DataType | |||
Status BitcastPass::CalcAndUpdateShape(BitcastPass::kVecInt64 &dim_vec, ge::DataType ori_data_type, | |||
ge::DataType dst_data_type) { | |||
if (dim_vec.size() == 0) { | |||
REPORT_INNER_ERROR("E19999", "Param dim_vec is empty, check invalid when BitcastPass %s", __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Param dim_vec is empty, check invalid"); | |||
GELOGE(PARAM_INVALID, "Pre node shape size is zero."); | |||
return PARAM_INVALID; | |||
} | |||
@@ -154,9 +152,9 @@ Status BitcastPass::CalcAndUpdateShape(BitcastPass::kVecInt64 &dim_vec, ge::Data | |||
} else if (ori_data_size > dst_data_size) { | |||
if (ori_data_size % dst_data_size != 0) { | |||
REPORT_INNER_ERROR("E19999", "size:%ld of ori_data_type:%s is not divisible by size:%ld of dst_data_type:%s ," | |||
"check invalid when BitcastPass %s", | |||
"check invalid", | |||
ori_data_size, TypeUtils::DataTypeToSerialString(ori_data_type).c_str(), | |||
dst_data_size, TypeUtils::DataTypeToSerialString(dst_data_type).c_str(), __FUNCTION__); | |||
dst_data_size, TypeUtils::DataTypeToSerialString(dst_data_type).c_str()); | |||
GELOGE(PARAM_INVALID, "ori_data_size is not divisible by dst_data_size."); | |||
return PARAM_INVALID; | |||
} | |||
@@ -165,17 +163,17 @@ Status BitcastPass::CalcAndUpdateShape(BitcastPass::kVecInt64 &dim_vec, ge::Data | |||
} else { | |||
if (dst_data_size % ori_data_size != 0) { | |||
REPORT_INNER_ERROR("E19999", "size:%ld of dst_data_type:%s is not divisible by size:%ld of ori_data_type:%s ," | |||
"check invalid when BitcastPass %s", | |||
"check invalid", | |||
dst_data_size, TypeUtils::DataTypeToSerialString(dst_data_type).c_str(), | |||
ori_data_size, TypeUtils::DataTypeToSerialString(ori_data_type).c_str(), __FUNCTION__); | |||
ori_data_size, TypeUtils::DataTypeToSerialString(ori_data_type).c_str()); | |||
GELOGE(PARAM_INVALID, "dst_data_size is not divisible by ori_data_size."); | |||
return PARAM_INVALID; | |||
} | |||
if (dim_vec[dim_vec.size() - 1] != (dst_data_size / ori_data_size)) { | |||
REPORT_INNER_ERROR("E19999", "The last dim:%ld in param dim_vec is not equal to " | |||
"dst_data_size:%ld / ori_data_size:%ld, check invalid when BitcastPass %s", | |||
dim_vec[dim_vec.size() - 1], dst_data_size, ori_data_size, __FUNCTION__); | |||
"dst_data_size:%ld / ori_data_size:%ld, check invalid", | |||
dim_vec[dim_vec.size() - 1], dst_data_size, ori_data_size); | |||
GELOGE(PARAM_INVALID, "The last dim is not equal to dst_data_size / ori_data_size."); | |||
return PARAM_INVALID; | |||
} | |||
@@ -25,14 +25,13 @@ | |||
namespace ge { | |||
Status CastRemovePass::Run(NodePtr &node) { | |||
if (node == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Param node is nullptr, check invalid when CastRemovePass %s", __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Param node is nullptr, check invalid"); | |||
GELOGE(PARAM_INVALID, "Param [node] must not be null."); | |||
return PARAM_INVALID; | |||
} | |||
OpDescPtr op_desc = node->GetOpDesc(); | |||
if (op_desc == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Param op_desc of node is nullptr, check invalid when CastRemovePass %s", | |||
__FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Param op_desc of node is nullptr, check invalid"); | |||
GELOGE(PARAM_INVALID, "OpDesc of param [node] must not be null."); | |||
return PARAM_INVALID; | |||
} | |||
@@ -49,7 +48,7 @@ Status CastRemovePass::Run(NodePtr &node) { | |||
} | |||
OpDescPtr end_op_desc = end_node->GetOpDesc(); | |||
if (end_op_desc == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "op_desc of end_node is nullptr, check invalid when CastRemovePass %s", __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "op_desc of end_node is nullptr, check invalid"); | |||
GELOGE(PARAM_INVALID, "OpDesc of end node must not be null."); | |||
return PARAM_INVALID; | |||
} | |||
@@ -103,8 +102,8 @@ Status CastRemovePass::RemoveCast(DataType &type, std::vector<NodePtr> &nodes_to | |||
GELOGI("CastRemovePass, remove Cast %s.", node->GetName().c_str()); | |||
cast_name = node->GetName(); | |||
if (IsolateAndDeleteNode(node, {0}) != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Isolate and delete node:%s(%s) failed when CastRemovePass %s", | |||
node->GetName().c_str(), node->GetType().c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Isolate and delete node:%s(%s) failed", | |||
node->GetName().c_str(), node->GetType().c_str()); | |||
GELOGE(FAILED, "IsolateAndDeleteNode %s failed.", node->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -120,8 +119,7 @@ Status CastRemovePass::RemoveCast(DataType &type, std::vector<NodePtr> &nodes_to | |||
} | |||
OpDescPtr op_desc = node->GetOpDesc(); | |||
if (op_desc == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Find nullptr op_desc in node, check invalid when CastRemovePass %s", | |||
__FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Find nullptr op_desc in node, check invalid"); | |||
GELOGE(FAILED, "OpDesc must not be null."); | |||
return FAILED; | |||
} | |||
@@ -131,9 +129,9 @@ Status CastRemovePass::RemoveCast(DataType &type, std::vector<NodePtr> &nodes_to | |||
op_desc->SetName(new_node_name); | |||
// add attr to changed TransData, then will be rebuild | |||
if (!AttrUtils::SetBool(op_desc, ATTR_NEED_COMPILE, true)) { | |||
REPORT_CALL_ERROR("E19999", "Set Attr:%s of op:%s(%s) failed when CastRemovePass %s", | |||
REPORT_CALL_ERROR("E19999", "Set Attr:%s of op:%s(%s) failed", | |||
ATTR_NEED_COMPILE.c_str(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(FAILED, "Set ATTR_NEED_COMPILE Attr fail."); | |||
return FAILED; | |||
} | |||
@@ -223,8 +223,8 @@ Status CastTranslatePass::Run(NodePtr &node) { | |||
continue; | |||
} | |||
if (IsolateAndDeleteNode(out_data_node, {0}) != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Isolate and delete node:%s(%s) failed when CastTranslatePass %s", | |||
out_data_node->GetName().c_str(), out_data_node->GetType().c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Isolate and delete node:%s(%s) failed", | |||
out_data_node->GetName().c_str(), out_data_node->GetType().c_str()); | |||
return FAILED; | |||
} | |||
} | |||
@@ -249,14 +249,14 @@ Status CastTranslatePass::FuseDstNTranslates(NodePtr &node) { | |||
GE_CHECK_NOTNULL(out_data_node); | |||
AddRePassNodesWithInOut(out_data_node); | |||
// Has checked nodes only has one in data anchor one out data anchor | |||
GE_CHK_STATUS_RET(NodeUtils::MoveOutputEdges(out_data_node, base_node), "move out put edge failed"); | |||
GE_CHK_GRAPH_STATUS_RET(NodeUtils::MoveOutputEdges(out_data_node, base_node), "move out put edge failed"); | |||
// Relink in control anchor, delete in data anchor | |||
auto in_ctr_anchor = out_data_node->GetInControlAnchor(); | |||
GE_CHECK_NOTNULL(in_ctr_anchor); | |||
for (const auto &peer_anchor : in_ctr_anchor->GetPeerOutControlAnchors()) { | |||
GE_CHECK_NOTNULL(base_node->GetInControlAnchor()); | |||
GE_CHK_STATUS_RET(base_node->GetInControlAnchor()->LinkFrom(peer_anchor), "link from peer anchor failed"); | |||
GE_CHK_GRAPH_STATUS_RET(base_node->GetInControlAnchor()->LinkFrom(peer_anchor), "link from peer anchor failed"); | |||
} | |||
in_ctr_anchor->UnlinkAll(); | |||
out_data_node->GetAllInDataAnchors().at(0)->UnlinkAll(); | |||
@@ -264,9 +264,8 @@ Status CastTranslatePass::FuseDstNTranslates(NodePtr &node) { | |||
ComputeGraphPtr graph = out_data_node->GetOwnerComputeGraph(); | |||
GE_CHECK_NOTNULL(graph); | |||
if (GraphUtils::RemoveNodeWithoutRelink(graph, out_data_node) != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Remove node:%s(%s) without relink in graph:%s failed when CastTranslatePass %s", | |||
out_data_node->GetName().c_str(), out_data_node->GetType().c_str(), graph->GetName().c_str(), | |||
__FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Remove node:%s(%s) without relink in graph:%s failed", | |||
out_data_node->GetName().c_str(), out_data_node->GetType().c_str(), graph->GetName().c_str()); | |||
GELOGE(FAILED, "[%s] RemoveNodeWithoutRelink failed.", out_data_node->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -106,9 +106,9 @@ Status CommonSubexpressionEliminationPass::Run(ComputeGraphPtr graph) { | |||
ret = GraphUtils::ReplaceNodeAnchors(iter->second, node, {}, output_map); | |||
if (ret != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Replace node:%s(%s) by node:%s(%s) failed " | |||
"when CommonSubexpressionEliminationPass %s", node->GetName().c_str(), node->GetType().c_str(), | |||
iter->second->GetName().c_str(), iter->second->GetType().c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Replace node:%s(%s)'s anchor by node:%s(%s) failed", | |||
node->GetName().c_str(), node->GetType().c_str(), | |||
iter->second->GetName().c_str(), iter->second->GetType().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Failed to replace node %s by node %s error node %u", | |||
node->GetName().c_str(), iter->second->GetName().c_str(), ret); | |||
return INTERNAL_ERROR; | |||
@@ -118,9 +118,8 @@ Status CommonSubexpressionEliminationPass::Run(ComputeGraphPtr graph) { | |||
ret = GraphUtils::RemoveNodeWithoutRelink(graph, node); | |||
if (ret != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Remove node:%s(%s) without relink in graph:%s failed " | |||
"when CommonSubexpressionEliminationPass %s", | |||
node->GetName().c_str(), node->GetType().c_str(), graph->GetName().c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Remove node:%s(%s) without relink in graph:%s failed", | |||
node->GetName().c_str(), node->GetType().c_str(), graph->GetName().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Failed to remove node %s from graph", node->GetName().c_str()); | |||
return INTERNAL_ERROR; | |||
} | |||
@@ -41,7 +41,7 @@ graphStatus CompileNodesPass::Run(ComputeGraphPtr graph) { | |||
} | |||
std::shared_ptr<GELib> instance = ge::GELib::GetInstance(); | |||
if (instance == nullptr || !instance->InitFlag()) { | |||
REPORT_INNER_ERROR("E19999", "Gelib not init before, check invalid when CompileNodesPass %s", __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Gelib not init before, check invalid"); | |||
GELOGE(ge::GE_CLI_GE_NOT_INITIALIZED, "Run CompileNodesPass failed."); | |||
return ge::GE_CLI_GE_NOT_INITIALIZED; | |||
} | |||
@@ -100,8 +100,8 @@ graphStatus CompileNodesPass::GetSupportedKernel(const NodePtr &node, const std: | |||
(void)instance->DNNEngineManagerObj().GetDNNEngineName(node); | |||
kernel_lib_name = op_desc->GetOpKernelLibName(); | |||
if (kernel_lib_name.empty()) { | |||
REPORT_INNER_ERROR("E19999", "kernel_lib_name in op:%s(%s) is empty, check invalid when CompileNodesPass %s", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "kernel_lib_name in op:%s(%s) is empty, check invalid", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(GRAPH_FAILED, "Get node:%s, type:%s kernel lib failed.", node->GetName().c_str(), | |||
op_desc->GetType().c_str()); | |||
return GRAPH_FAILED; | |||
@@ -109,8 +109,8 @@ graphStatus CompileNodesPass::GetSupportedKernel(const NodePtr &node, const std: | |||
} | |||
OpsKernelInfoStorePtr kernel_info = instance->OpsKernelManagerObj().GetOpsKernelInfoStore(kernel_lib_name); | |||
if (kernel_info == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Find ops kernel by name:%s failed for op:%s(%s), when CompileNodesPass %s", | |||
kernel_lib_name.c_str(), op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Find ops kernel by name:%s failed for op:%s(%s)", | |||
kernel_lib_name.c_str(), op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(ge::GE_GRAPH_PARAM_NULLPTR, "Get op %s ops kernel info store failed", node->GetName().c_str()); | |||
return ge::GE_GRAPH_PARAM_NULLPTR; | |||
} | |||
@@ -173,8 +173,8 @@ graphStatus CompileNodesPass::CompileNodes(const std::shared_ptr<GELib> instance | |||
for (auto &kernel_nodes : kernel_to_compile_nodes) { | |||
kernel_info = instance->OpsKernelManagerObj().GetOpsKernelInfoStore(kernel_nodes.first); | |||
if (kernel_info == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Find ops kernel by name:%s failed, when CompileNodesPass %s", | |||
kernel_nodes.first.c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Find ops kernel by name:%s failed", | |||
kernel_nodes.first.c_str()); | |||
GELOGE(ge::GE_GRAPH_PARAM_NULLPTR, "Get op %s ops kernel info store failed", kernel_nodes.first.c_str()); | |||
return ge::GE_GRAPH_PARAM_NULLPTR; | |||
} | |||
@@ -190,8 +190,8 @@ graphStatus CompileNodesPass::CompileNodes(const std::shared_ptr<GELib> instance | |||
} | |||
auto ret = kernel_info->CompileOp(kernel_nodes.second); | |||
if (ret != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Call CompileOp failed, kernel_lib_name:%s, ret:%d, when CompileNodesPass %s", | |||
kernel_nodes.first.c_str(), ret, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Call CompileOp failed, kernel_lib_name:%s, ret:%d", | |||
kernel_nodes.first.c_str(), ret); | |||
GELOGE(ret, "Compile op failed, kernel name is %s", kernel_nodes.first.c_str()); | |||
return GRAPH_FAILED; | |||
} | |||
@@ -76,9 +76,9 @@ Status CondPass::Run(NodePtr &node) { | |||
break; | |||
default: | |||
REPORT_INNER_ERROR("E19999", | |||
"data_type:%d of index:%d input tensor in op:%s(%s) check invalid when CondPass %s", | |||
"data_type:%d of index:%d input tensor in op:%s(%s) check invalid", | |||
cond_tensor.GetDataType(), cond_in_anchor->GetIdx(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(FAILED, "UpdateInputDesc for node %s failed.", op_desc->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -89,8 +89,8 @@ Status CondPass::Run(NodePtr &node) { | |||
cond_tensor.SetShape(GeShape()); | |||
cond_tensor.SetOriginShape(GeShape()); | |||
if (op_desc->UpdateInputDesc(cond_in_anchor->GetIdx(), cond_tensor) != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Update input desc of op:%s(%s) failed, index:%d, when CondPass %s", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), cond_in_anchor->GetIdx(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Update input desc of op:%s(%s) failed, index:%d", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), cond_in_anchor->GetIdx()); | |||
GELOGE(FAILED, "UpdateInputDesc for node %s failed.", op_desc->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -165,8 +165,8 @@ Status CondPass::GetCondInfoForWhile(const NodePtr &node, ComputeGraphPtr &graph | |||
auto iter = subgraph_names_to_index.find(ATTR_NAME_WHILE_COND); | |||
if (iter == subgraph_names_to_index.end()) { | |||
REPORT_INNER_ERROR("E19999", "subgraph name:%s not exist in SubgraphNameIndexes map of op:%s(%s), " | |||
"check invalid when CondPass %s", ATTR_NAME_WHILE_COND.c_str(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); | |||
"check invalid", ATTR_NAME_WHILE_COND.c_str(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(FAILED, "Get cond_graph index failed, while_node:%s.", node->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -179,8 +179,8 @@ Status CondPass::GetCondInfoForWhile(const NodePtr &node, ComputeGraphPtr &graph | |||
// cond_graph has and only has one output | |||
uint32_t output_num = net_output_node->GetAllInDataAnchorsSize(); | |||
if (output_num != 1) { | |||
REPORT_INNER_ERROR("E19999", "Input data anchor num:%u of op:%s(%s) not equal to 1, check invalid when CondPass %s", | |||
output_num, op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Input data anchor num:%u of op:%s(%s) not equal to 1, check invalid", | |||
output_num, op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(FAILED, "output size of cond_graph is invalid, expect 1 but %u exactly, while_node:%s.", | |||
output_num, node->GetName().c_str()); | |||
return FAILED; | |||
@@ -244,12 +244,12 @@ Status CondPass::HandleScalarCond(const ComputeGraphPtr &graph, const OutDataAnc | |||
} | |||
if (GraphUtils::InsertNodeAfter(peer_out_anchor, { cond_in_anchor }, cast_node) != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Insert Cast node %s(%s) between %s(%s)->%s(%s) failed, when CondPass %s", | |||
REPORT_CALL_ERROR("E19999", "Insert Cast node %s(%s) between %s(%s)->%s(%s) failed", | |||
cast_node->GetName().c_str(), cast_node->GetType().c_str(), | |||
peer_out_anchor->GetOwnerNode()->GetName().c_str(), | |||
peer_out_anchor->GetOwnerNode()->GetType().c_str(), | |||
cond_in_anchor->GetOwnerNode()->GetName().c_str(), | |||
cond_in_anchor->GetOwnerNode()->GetType().c_str(), __FUNCTION__); | |||
cond_in_anchor->GetOwnerNode()->GetType().c_str()); | |||
GELOGE(FAILED, "Insert Cast node %s between %s->%s failed.", | |||
cast_node->GetName().c_str(), peer_out_anchor->GetOwnerNode()->GetName().c_str(), | |||
cond_in_anchor->GetOwnerNode()->GetName().c_str()); | |||
@@ -285,27 +285,27 @@ Status CondPass::InsertNode(const ComputeGraphPtr &graph, const OutDataAnchorPtr | |||
OpDescBuilder op_desc_builder(in_data_anchor->GetOwnerNode()->GetName() + "_" + type, type); | |||
OpDescPtr op_desc = op_desc_builder.AddInput("x", in_tensor).AddOutput("y", out_tensor).Build(); | |||
if (op_desc == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "Create op_desc:%s(%s) failed, when CondPass %s", | |||
(in_data_anchor->GetOwnerNode()->GetName() + "_" + type).c_str(), type.c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Create op_desc:%s(%s) failed", | |||
(in_data_anchor->GetOwnerNode()->GetName() + "_" + type).c_str(), type.c_str()); | |||
GELOGE(FAILED, "Create op_desc failed."); | |||
return FAILED; | |||
} | |||
NodePtr new_node = graph->AddNode(op_desc); | |||
if (new_node == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "Add node:%s(%s) to graph:%s failed when CondPass %s", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), graph->GetName().c_str(), __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Add node:%s(%s) to graph:%s failed", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), graph->GetName().c_str()); | |||
GELOGE(FAILED, "Create %s node failed.", type.c_str()); | |||
return FAILED; | |||
} | |||
AddRePassNode(new_node); | |||
if (GraphUtils::InsertNodeAfter(peer_out_anchor, { in_data_anchor }, new_node) != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Insert node %s(%s) between %s(%s)->%s(%s) failed, when CondPass %s", | |||
REPORT_CALL_ERROR("E19999", "Insert node %s(%s) between %s(%s)->%s(%s) failed", | |||
new_node->GetName().c_str(), new_node->GetType().c_str(), | |||
peer_out_anchor->GetOwnerNode()->GetName().c_str(), | |||
peer_out_anchor->GetOwnerNode()->GetType().c_str(), | |||
in_data_anchor->GetOwnerNode()->GetName().c_str(), | |||
in_data_anchor->GetOwnerNode()->GetType().c_str(), __FUNCTION__); | |||
in_data_anchor->GetOwnerNode()->GetType().c_str()); | |||
GELOGE(FAILED, "Insert %s node %s between %s->%s failed.", type.c_str(), | |||
new_node->GetName().c_str(), peer_out_anchor->GetOwnerNode()->GetName().c_str(), | |||
in_data_anchor->GetOwnerNode()->GetName().c_str()); | |||
@@ -337,8 +337,8 @@ NodePtr CondPass::AddCastNode(const ComputeGraphPtr &graph, const std::string &n | |||
OpDescBuilder op_desc_builder(name, CAST); | |||
OpDescPtr cast_desc = op_desc_builder.AddInput("x", in_tensor).AddOutput("y", out_tensor).Build(); | |||
if (cast_desc == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "Create op_desc:%s(%s) failed, when CondPass %s", | |||
name.c_str(), CAST, __FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Create op_desc:%s(%s) failed", | |||
name.c_str(), CAST); | |||
GELOGE(FAILED, "Create cast op_desc failed, name: %s.", name.c_str()); | |||
return nullptr; | |||
} | |||
@@ -346,19 +346,18 @@ NodePtr CondPass::AddCastNode(const ComputeGraphPtr &graph, const std::string &n | |||
AttrUtils::SetInt(cast_desc, CAST_ATTR_DSTT, dst) && | |||
AttrUtils::SetInt(cast_desc, CAST_ATTR_DST_TYPE, dst) && | |||
AttrUtils::SetBool(cast_desc, CAST_ATTR_TRUNCATE, false))) { | |||
REPORT_CALL_ERROR("E19999", "Set Attr:%s,%s,%s,%s to node:%s(%s) not all success, when CondPass %s", | |||
REPORT_CALL_ERROR("E19999", "Set Attr:%s,%s,%s,%s to node:%s(%s) not all success", | |||
CAST_ATTR_SRCT.c_str(), CAST_ATTR_DSTT.c_str(), | |||
CAST_ATTR_DST_TYPE.c_str(), CAST_ATTR_TRUNCATE.c_str(), | |||
cast_desc->GetName().c_str(), cast_desc->GetType().c_str(), __FUNCTION__); | |||
cast_desc->GetName().c_str(), cast_desc->GetType().c_str()); | |||
GELOGE(FAILED, "Set CAST_ATTR failed, node: %s.", name.c_str()); | |||
return nullptr; | |||
} | |||
NodePtr cast_node = graph->AddNode(cast_desc); | |||
if (cast_node == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "Add node:%s(%s) to graph:%s failed when CondPass %s", | |||
cast_desc->GetName().c_str(), cast_desc->GetType().c_str(), graph->GetName().c_str(), | |||
__FUNCTION__); | |||
REPORT_CALL_ERROR("E19999", "Add node:%s(%s) to graph:%s failed", | |||
cast_desc->GetName().c_str(), cast_desc->GetType().c_str(), graph->GetName().c_str()); | |||
GELOGE(FAILED, "Add cast node failed, name: %s.", name.c_str()); | |||
return nullptr; | |||
} | |||
@@ -85,12 +85,11 @@ Status CondRemovePass::RemoveDeadCondLink(const int32_t index, const NodePtr &no | |||
const auto &in_anchor = node->GetInDataAnchor(index); | |||
const auto &peerout_anchor = in_anchor->GetPeerOutAnchor(); | |||
if (GraphUtils::RemoveEdge(peerout_anchor, in_anchor) != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Remove edge between op:%s(%s)(out_index:%d) and op:%s(%s)(in_index:%d) failed " | |||
"when CondRemovePass %s", | |||
REPORT_CALL_ERROR("E19999", "Remove edge between op:%s(%s)(out_index:%d) and op:%s(%s)(in_index:%d) failed", | |||
peerout_anchor->GetOwnerNode()->GetName().c_str(), | |||
peerout_anchor->GetOwnerNode()->GetType().c_str(), peerout_anchor->GetIdx(), | |||
in_anchor->GetOwnerNode()->GetName().c_str(), in_anchor->GetOwnerNode()->GetType().c_str(), | |||
in_anchor->GetIdx(), __FUNCTION__); | |||
in_anchor->GetIdx()); | |||
GELOGE(FAILED, "Remove edge from node %s index %d to node %s index %d.", | |||
peerout_anchor->GetOwnerNode()->GetName().c_str(), peerout_anchor->GetIdx(), | |||
in_anchor->GetOwnerNode()->GetName().c_str(), in_anchor->GetIdx()); | |||
@@ -104,8 +103,8 @@ Status CondRemovePass::GetCaseChosenBranch(const NodePtr &node, const uint32_t c | |||
uint32_t subgraph_names_size = static_cast<uint32_t>(node->GetOpDesc()->GetSubgraphInstanceNames().size()); | |||
uint32_t cond_index_new = cond_index; | |||
if (subgraph_names_size == 0) { | |||
REPORT_INNER_ERROR("E19999", "subgraph size of op:%s(%s) is 0, check invavlid when CondRemovePass %s", | |||
node->GetName().c_str(), node->GetType().c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "subgraph size of op:%s(%s) is 0, check invavlid", | |||
node->GetName().c_str(), node->GetType().c_str()); | |||
GELOGE(FAILED, "Node %s has none subgraph.", node->GetName().c_str()); | |||
return ge::FAILED; | |||
} | |||
@@ -115,8 +114,8 @@ Status CondRemovePass::GetCaseChosenBranch(const NodePtr &node, const uint32_t c | |||
} | |||
const auto &chosen_branch_name = node->GetOpDesc()->GetSubgraphInstanceName(cond_index_new); | |||
if (chosen_branch_name.empty()) { | |||
REPORT_INNER_ERROR("E19999", "Get subgraph name from op:%s(%s) by index:%u failed, when CondRemovePass %s", | |||
node->GetName().c_str(), node->GetType().c_str(), cond_index_new, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Get subgraph name from op:%s(%s) by index:%u failed", | |||
node->GetName().c_str(), node->GetType().c_str(), cond_index_new); | |||
GELOGE(FAILED, "Node %s has no subgraph, index is %u.", node->GetName().c_str(), cond_index_new); | |||
return ge::FAILED; | |||
} | |||
@@ -131,8 +130,8 @@ Status CondRemovePass::GetIfChosenBranch(const NodePtr &node, const uint32_t con | |||
uint32_t subgraph_names_size = static_cast<uint32_t>(node->GetOpDesc()->GetSubgraphInstanceNames().size()); | |||
uint32_t cond_index_new = 0; | |||
if (subgraph_names_size == 0) { | |||
REPORT_INNER_ERROR("E19999", "subgraph size of op:%s(%s) is 0, check invavlid when CondRemovePass %s", | |||
node->GetName().c_str(), node->GetType().c_str(), __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "subgraph size of op:%s(%s) is 0, check invavlid", | |||
node->GetName().c_str(), node->GetType().c_str()); | |||
GELOGE(FAILED, "Node %s has none subgraph.", node->GetName().c_str()); | |||
return ge::FAILED; | |||
} | |||
@@ -142,16 +141,16 @@ Status CondRemovePass::GetIfChosenBranch(const NodePtr &node, const uint32_t con | |||
} | |||
const auto &chosen_branch_name = node->GetOpDesc()->GetSubgraphInstanceName(cond_index_new); | |||
if (chosen_branch_name.empty()) { | |||
REPORT_INNER_ERROR("E19999", "Get subgraph name from op:%s(%s) by index:%u failed, when CondRemovePass %s", | |||
node->GetName().c_str(), node->GetType().c_str(), cond_index_new, __FUNCTION__); | |||
REPORT_INNER_ERROR("E19999", "Get subgraph name from op:%s(%s) by index:%u failed", | |||
node->GetName().c_str(), node->GetType().c_str(), cond_index_new); | |||
GELOGE(FAILED, "Node %s has no subgraph, index is %u.", node->GetName().c_str(), cond_index_new); | |||
return ge::FAILED; | |||
} | |||
auto chosen_graph = GraphUtils::FindRootGraph(node->GetOwnerComputeGraph())->GetSubgraph(chosen_branch_name); | |||
if (chosen_graph == nullptr) { | |||
REPORT_INNER_ERROR("E19999", | |||
"Find subgraph by name:%s from node:%s(%s)'s root_graph failed, when CondRemovePass %s", | |||
chosen_branch_name.c_str(), node->GetName().c_str(), node->GetType().c_str(), __FUNCTION__); | |||
"Find subgraph by name:%s from node:%s(%s)'s root_graph failed", | |||
chosen_branch_name.c_str(), node->GetName().c_str(), node->GetType().c_str()); | |||
GELOGE(FAILED, "Can not find branch %s in node %s's parent graph %s.", chosen_branch_name.c_str(), | |||
node->GetName().c_str(), node->GetOwnerComputeGraph()->GetName().c_str()); | |||
return ge::FAILED; | |||
@@ -259,12 +258,11 @@ Status CondRemovePass::ReplaceIfCaseNodeWithPartitioncall(const NodePtr &node, c | |||
for (const auto &peerout_anchor : input_anchor->GetPeerAnchors()) { | |||
if (GraphUtils::AddEdge(peerout_anchor, partitioncall_node->GetInAnchor( | |||
input_anchor->GetIdx() - kConditionIndexNum)) != ge::GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(out_index:%d) and op:%s(%s)(in_index:%d) failed " | |||
"when CondRemovePass %s", | |||
REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(out_index:%d) and op:%s(%s)(in_index:%d) failed", | |||
peerout_anchor->GetOwnerNode()->GetName().c_str(), | |||
peerout_anchor->GetOwnerNode()->GetType().c_str(), peerout_anchor->GetIdx(), | |||
partitioncall_node->GetName().c_str(), | |||
partitioncall_node->GetType().c_str(), input_anchor->GetIdx(), __FUNCTION__); | |||
partitioncall_node->GetType().c_str(), input_anchor->GetIdx()); | |||
GELOGE(FAILED, "Add edge failed, from node:%s idx:%d to node:%s idx:%d, input num:%zu, output num:%zu", | |||
peerout_anchor->GetOwnerNode()->GetName().c_str(), peerout_anchor->GetIdx(), | |||
partitioncall_node->GetName().c_str(), input_anchor->GetIdx(), input_desc_size, | |||
@@ -278,11 +276,10 @@ Status CondRemovePass::ReplaceIfCaseNodeWithPartitioncall(const NodePtr &node, c | |||
for (const auto &output_anchor : node->GetAllOutAnchors()) { | |||
for (const auto &peerin_anchor : output_anchor->GetPeerAnchors()) { | |||
if (GraphUtils::RemoveEdge(node->GetOutAnchor(output_anchor->GetIdx()), peerin_anchor) != ge::GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Remove edge between op:%s(%s)(out_index:%d) and op:%s(%s)(in_index:%d) failed " | |||
"when CondRemovePass %s", | |||
REPORT_CALL_ERROR("E19999", "Remove edge between op:%s(%s)(out_index:%d) and op:%s(%s)(in_index:%d) failed", | |||
node->GetName().c_str(), node->GetType().c_str(), output_anchor->GetIdx(), | |||
peerin_anchor->GetOwnerNode()->GetName().c_str(), | |||
peerin_anchor->GetOwnerNode()->GetType().c_str(), peerin_anchor->GetIdx(), __FUNCTION__); | |||
peerin_anchor->GetOwnerNode()->GetType().c_str(), peerin_anchor->GetIdx()); | |||
GELOGE(FAILED, "Remove edge failed, from node:%s idx:%d to node:%s idx:%d, input num:%zu, output num:%zu", | |||
node->GetName().c_str(), output_anchor->GetIdx(), peerin_anchor->GetOwnerNode()->GetName().c_str(), | |||
peerin_anchor->GetIdx(), input_desc_size, output_desc_size); | |||
@@ -290,12 +287,11 @@ Status CondRemovePass::ReplaceIfCaseNodeWithPartitioncall(const NodePtr &node, c | |||
} | |||
if (GraphUtils::AddEdge(partitioncall_node->GetOutAnchor(output_anchor->GetIdx()), peerin_anchor) != | |||
ge::GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Remove edge between op:%s(%s)(out_index:%d) and op:%s(%s)(in_index:%d) failed " | |||
"when CondRemovePass %s", | |||
REPORT_CALL_ERROR("E19999", "Remove edge between op:%s(%s)(out_index:%d) and op:%s(%s)(in_index:%d) failed", | |||
partitioncall_node->GetName().c_str(), | |||
partitioncall_node->GetType().c_str(), output_anchor->GetIdx(), | |||
peerin_anchor->GetOwnerNode()->GetName().c_str(), | |||
peerin_anchor->GetOwnerNode()->GetType().c_str(), peerin_anchor->GetIdx(), __FUNCTION__); | |||
peerin_anchor->GetOwnerNode()->GetType().c_str(), peerin_anchor->GetIdx()); | |||
GELOGE(FAILED, "Add edge failed, from node:%s idx:%d to node:%s idx:%d, input num:%zu, output num:%zu", | |||
partitioncall_node->GetName().c_str(), output_anchor->GetIdx(), | |||
peerin_anchor->GetOwnerNode()->GetName().c_str(), peerin_anchor->GetIdx(), input_desc_size, | |||
@@ -108,6 +108,8 @@ Status ConstantFoldingPass::Run(ge::NodePtr &node) { | |||
node->GetType().c_str()); | |||
return SUCCESS; | |||
} | |||
REPORT_CALL_ERROR("E19999", "Calculate for node %s(%s) failed", | |||
node->GetName().c_str(), node->GetType().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Calculate for node %s failed in constant folding", node->GetName().c_str()); | |||
return ret; | |||
} | |||
@@ -125,6 +127,8 @@ Status ConstantFoldingPass::Run(ge::NodePtr &node) { | |||
} | |||
if (outputs.empty()) { | |||
REPORT_INNER_ERROR("E19999", "After calculate for node %s(%s), output weight is empty, check invalid", | |||
node->GetName().c_str(), node->GetType().c_str()); | |||
GELOGE(INTERNAL_ERROR, | |||
"Failed to constant folding on node %s," | |||
" no output weight", | |||
@@ -57,6 +57,7 @@ void GetOutDataNodeToIndexMap(NodePtr &node, std::map<string, InDataAnchorPtr> & | |||
Status ConstantFuseSamePass::Run(ge::ComputeGraphPtr graph) { | |||
if (graph == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Param graph is nullptr, check invalid"); | |||
GELOGE(GE_GRAPH_PARAM_NULLPTR, "Compute graph is null."); | |||
return GE_GRAPH_PARAM_NULLPTR; | |||
} | |||
@@ -159,6 +160,11 @@ Status ConstantFuseSamePass::MoveOutDataEdges(NodePtr &src_node, NodePtr &dst_no | |||
} | |||
auto ret = dst_out_data_anchor->LinkTo(it->second); | |||
if (ret != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", | |||
"Op:%s(%s) out index:0 link to op:%s(%s) in index:%d failed", | |||
dst_node->GetName().c_str(), dst_node->GetType().c_str(), | |||
it->second->GetOwnerNode()->GetName().c_str(), it->second->GetOwnerNode()->GetType().c_str(), | |||
it->second->GetIdx()); | |||
GELOGE(FAILED, "Failed to move out data edge from %s to %s", src_node->GetName().c_str(), | |||
dst_node->GetName().c_str()); | |||
return FAILED; | |||
@@ -185,6 +191,8 @@ Status ConstantFuseSamePass::FuseConstNodes(ComputeGraphPtr &graph, | |||
return FAILED; | |||
} | |||
if (GraphUtils::RemoveNodeWithoutRelink(graph, node) != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Remove node:%s(%s) without relink in graph:%s failed", | |||
node->GetName().c_str(), node->GetType().c_str(), graph->GetName().c_str()); | |||
GELOGE(FAILED, "[%s] RemoveNodeWithoutRelink failed.", node->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -70,6 +70,12 @@ Status ControlTriggerPass::HandleDynamicCtrlEdges(ComputeGraphPtr &graph, NodePt | |||
NodePtr constant = (branch_flag ? iter2->second.second : iter2->second.first); | |||
if ((GraphUtils::RemoveEdge(in_ctrl_node->GetOutControlAnchor(), node->GetInControlAnchor()) != GRAPH_SUCCESS) || | |||
(GraphUtils::AddEdge(in_ctrl_node->GetOutControlAnchor(), constant->GetInControlAnchor()) != GRAPH_SUCCESS)) { | |||
REPORT_CALL_ERROR("E19999", "Remove control edge between op:%s(%s) and op:%s(%s), then " | |||
"add control edge between op:%s(%s) and op:%s(%s) failed", | |||
in_ctrl_node->GetName().c_str(), in_ctrl_node->GetType().c_str(), | |||
node->GetName().c_str(), node->GetType().c_str(), | |||
in_ctrl_node->GetName().c_str(), in_ctrl_node->GetType().c_str(), | |||
constant->GetName().c_str(), constant->GetType().c_str()); | |||
GELOGE(FAILED, "Replace ctrl edge fail, %s->%s, %s->%s.", in_ctrl_node->GetName().c_str(), | |||
node->GetName().c_str(), in_ctrl_node->GetName().c_str(), constant->GetName().c_str()); | |||
return FAILED; | |||
@@ -185,6 +191,7 @@ ControlNodeType ControlTriggerPass::TransferNodeType(const NodePtr &node, uint32 | |||
} else if ((type == MERGE) || (type == REFMERGE)) { | |||
OpDescPtr merge_desc = node->GetOpDesc(); | |||
if (merge_desc == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "op_desc in merge node is nullptr, check invalid"); | |||
GELOGE(INTERNAL_ERROR, "FindPredInput fail, merge_desc is null, merge_node: %s.", node->GetName().c_str()); | |||
return kInvalidType; | |||
} | |||
@@ -264,14 +271,23 @@ Status ControlTriggerPass::InsertOppositeBranch(ComputeGraphPtr &graph, NodePtr | |||
} | |||
if (GraphUtils::AddEdge(in_ctrl_node->GetOutControlAnchor(), orig_const->GetInControlAnchor()) != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Add control edge between op:%s(%s) and op:%s(%s) failed", | |||
in_ctrl_node->GetName().c_str(), in_ctrl_node->GetType().c_str(), | |||
orig_const->GetName().c_str(), orig_const->GetType().c_str()); | |||
GELOGE(FAILED, "Add in ctrl edge fail, %s->%s.", in_ctrl_node->GetName().c_str(), orig_const->GetName().c_str()); | |||
return FAILED; | |||
} | |||
if (GraphUtils::AddEdge(switch_node->GetOutDataAnchor(new_idx), identity_node->GetInDataAnchor(0)) != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(index:%u) and op:%s(%s)(index:0) failed", | |||
switch_node->GetName().c_str(), switch_node->GetType().c_str(), new_idx, | |||
identity_node->GetName().c_str(), identity_node->GetType().c_str()); | |||
GELOGE(FAILED, "Add in data edge fail, %s->%s.", switch_desc->GetName().c_str(), identity_node->GetName().c_str()); | |||
return FAILED; | |||
} | |||
if (GraphUtils::AddEdge(identity_node->GetOutControlAnchor(), new_const->GetInControlAnchor()) != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Add control edge between op:%s(%s) and op:%s(%s) failed", | |||
identity_node->GetName().c_str(), identity_node->GetType().c_str(), | |||
new_const->GetName().c_str(), new_const->GetType().c_str()); | |||
GELOGE(FAILED, "Add in ctrl edge fail, %s->%s.", identity_node->GetName().c_str(), new_const->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -282,6 +298,7 @@ Status ControlTriggerPass::InsertOppositeBranch(ComputeGraphPtr &graph, NodePtr | |||
control_trigger_map_[node] = {pred_const}; | |||
} else { | |||
if (!iter->second.insert(pred_const).second) { | |||
REPORT_INNER_ERROR("E19999", "Insert to control_trigger_map_ failed"); | |||
GELOGE(FAILED, "control_trigger_map_ insert failed."); | |||
return FAILED; | |||
} | |||
@@ -303,12 +320,15 @@ NodePtr ControlTriggerPass::InsertMergeNode(ComputeGraphPtr &graph, NodePtr &nod | |||
const std::string name = node->GetName() + "_" + MERGE; | |||
OpDescPtr op_desc = MakeShared<OpDesc>(name, MERGE); | |||
if (op_desc == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "New OpDesc failed"); | |||
GELOGE(FAILED, "Create Merge op %s: create op_desc fail.", name.c_str()); | |||
return nullptr; | |||
} | |||
if ((op_desc->AddInputDesc(data_desc) != GRAPH_SUCCESS) || (op_desc->AddInputDesc(data_desc) != GRAPH_SUCCESS) || | |||
(op_desc->AddOutputDesc(data_desc) != GRAPH_SUCCESS) || (op_desc->AddOutputDesc(data_desc) != GRAPH_SUCCESS)) { | |||
REPORT_CALL_ERROR("E19999", "Add input or ouput desc to op:%s(%s) failed", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Create Merge op %s: add input/output desc fail.", name.c_str()); | |||
return nullptr; | |||
} | |||
@@ -316,12 +336,20 @@ NodePtr ControlTriggerPass::InsertMergeNode(ComputeGraphPtr &graph, NodePtr &nod | |||
GELOGI("Create Merge op:%s.", name.c_str()); | |||
NodePtr merge_node = graph->AddNode(op_desc); | |||
if (merge_node == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "Add node:%s(%s) to graph:%s failed", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), graph->GetName().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Create Merge op %s fail.", name.c_str()); | |||
return nullptr; | |||
} | |||
if ((GraphUtils::RemoveEdge(in_ctrl_node->GetOutControlAnchor(), node->GetInControlAnchor()) != GRAPH_SUCCESS) || | |||
(GraphUtils::AddEdge(merge_node->GetOutControlAnchor(), node->GetInControlAnchor()) != GRAPH_SUCCESS)) { | |||
REPORT_CALL_ERROR("E19999", "Remove control edge between op:%s(%s) and op:%s(%s), then " | |||
"add control edge between op:%s(%s) and op:%s(%s) failed", | |||
in_ctrl_node->GetName().c_str(), in_ctrl_node->GetType().c_str(), | |||
node->GetName().c_str(), node->GetType().c_str(), | |||
merge_node->GetName().c_str(), merge_node->GetType().c_str(), | |||
node->GetName().c_str(), node->GetType().c_str()); | |||
GELOGE(FAILED, "Replace ctrl edge fail, %s->%s, %s->%s", in_ctrl_node->GetName().c_str(), node->GetName().c_str(), | |||
merge_node->GetName().c_str(), node->GetName().c_str()); | |||
return nullptr; | |||
@@ -343,6 +371,7 @@ NodePtr ControlTriggerPass::InsertConstNode(ComputeGraphPtr &graph, NodePtr &mer | |||
const std::string name = merge_node->GetName() + "_" + CONSTANT + (flag ? "_t" : "_f"); | |||
OpDescPtr op_desc = MakeShared<OpDesc>(name, CONSTANT); | |||
if (op_desc == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "New OpDesc failed"); | |||
GELOGE(FAILED, "Create Const op %s: create op_desc fail.", name.c_str()); | |||
return nullptr; | |||
} | |||
@@ -350,15 +379,20 @@ NodePtr ControlTriggerPass::InsertConstNode(ComputeGraphPtr &graph, NodePtr &mer | |||
int32_t value = 0; | |||
GeTensorPtr const_value = MakeShared<GeTensor>(data_desc, reinterpret_cast<uint8_t *>(&value), sizeof(int32_t)); | |||
if (const_value == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "New GeTensor failed"); | |||
GELOGE(FAILED, "Create tensor fail."); | |||
return nullptr; | |||
} | |||
if (!AttrUtils::SetTensor(op_desc, ATTR_NAME_WEIGHTS, const_value)) { | |||
REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed", ATTR_NAME_WEIGHTS.c_str(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Create Const op %s: set attr ATTR_NAME_WEIGHTS fail.", name.c_str()); | |||
return nullptr; | |||
} | |||
if (op_desc->AddOutputDesc(data_desc) != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Add ouput desc to op:%s(%s) failed", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Create Const op %s: add output desc fail.", name.c_str()); | |||
return nullptr; | |||
} | |||
@@ -366,12 +400,17 @@ NodePtr ControlTriggerPass::InsertConstNode(ComputeGraphPtr &graph, NodePtr &mer | |||
GELOGI("Create Const op: %s", name.c_str()); | |||
NodePtr const_node = graph->AddNode(op_desc); | |||
if (const_node == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "Add node:%s(%s) to graph:%s failed", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), graph->GetName().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Create Const op %s fail.", name.c_str()); | |||
return nullptr; | |||
} | |||
uint32_t out_idx = (flag ? SWITCH_TRUE_OUTPUT : SWITCH_FALSE_OUTPUT); | |||
if (GraphUtils::AddEdge(const_node->GetOutDataAnchor(0), merge_node->GetInDataAnchor(out_idx)) != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(index:0) and op:%s(%s)(index:%u) failed", | |||
const_node->GetName().c_str(), const_node->GetType().c_str(), | |||
merge_node->GetName().c_str(), merge_node->GetType().c_str(), out_idx); | |||
GELOGE(FAILED, "Add in data edge fail, %s->%s", const_node->GetName().c_str(), merge_node->GetName().c_str()); | |||
return nullptr; | |||
} | |||
@@ -390,11 +429,14 @@ NodePtr ControlTriggerPass::InsertIdentityNode(ComputeGraphPtr &graph, const std | |||
const GeTensorDesc &data_desc) { | |||
OpDescPtr op_desc = MakeShared<OpDesc>(name, IDENTITY); | |||
if (op_desc == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "New OpDesc failed"); | |||
GELOGE(FAILED, "Create Identity op %s: create op_desc fail.", name.c_str()); | |||
return nullptr; | |||
} | |||
if ((op_desc->AddInputDesc(data_desc) != GRAPH_SUCCESS) || (op_desc->AddOutputDesc(data_desc) != GRAPH_SUCCESS)) { | |||
REPORT_CALL_ERROR("E19999", "Add input or output desc to op:%s(%s) failed", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Create Identity op %s: add input/output desc fail.", name.c_str()); | |||
return nullptr; | |||
} | |||
@@ -402,6 +444,8 @@ NodePtr ControlTriggerPass::InsertIdentityNode(ComputeGraphPtr &graph, const std | |||
GELOGI("Create Identity op:%s.", name.c_str()); | |||
NodePtr identity_node = graph->AddNode(op_desc); | |||
if (identity_node == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "Add node:%s(%s) to graph:%s failed", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), graph->GetName().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Create Identity op %s fail.", name.c_str()); | |||
return nullptr; | |||
} | |||
@@ -418,17 +462,24 @@ NodePtr ControlTriggerPass::InsertIdentityNode(ComputeGraphPtr &graph, const std | |||
/// | |||
Status ControlTriggerPass::FindPredInput(const NodePtr &switch_node) { | |||
if (switch_node == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Param switch_node is nullptr, check invalid"); | |||
GELOGE(INTERNAL_ERROR, "switch_node is null"); | |||
return INTERNAL_ERROR; | |||
} | |||
InDataAnchorPtr in_cond_anchor = switch_node->GetInDataAnchor(SWITCH_PRED_INPUT); | |||
if (in_cond_anchor == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Index:%d in anchor of switch_node:%s(%s) is nullptr, check invalid", | |||
SWITCH_PRED_INPUT, | |||
switch_node->GetName().c_str(), switch_node->GetType().c_str()); | |||
GELOGE(INTERNAL_ERROR, "in_cond_anchor is nullptr, node: %s.", switch_node->GetName().c_str()); | |||
return INTERNAL_ERROR; | |||
} | |||
OutDataAnchorPtr pred_cond_anchor = in_cond_anchor->GetPeerOutAnchor(); | |||
if (pred_cond_anchor == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Index:%d in anchor of switch_node:%s(%s), it's peer anchor is nullptr, " | |||
"check invalid", SWITCH_PRED_INPUT, | |||
switch_node->GetName().c_str(), switch_node->GetType().c_str()); | |||
GELOGE(INTERNAL_ERROR, "pred_cond_anchor is nullptr, node: %s.", switch_node->GetName().c_str()); | |||
return INTERNAL_ERROR; | |||
} | |||
@@ -64,13 +64,13 @@ Status CtrlEdgeTransferPass::Run(ge::ComputeGraphPtr graph) { | |||
for (auto &in_control_node : n->GetInControlNodes()) { | |||
GE_CHECK_NOTNULL(in_control_node); | |||
GE_CHK_STATUS_RET(ge::GraphUtils::RemoveEdge(in_control_node->GetOutControlAnchor(), | |||
GE_CHK_GRAPH_STATUS_RET(ge::GraphUtils::RemoveEdge(in_control_node->GetOutControlAnchor(), | |||
n->GetInControlAnchor()), "remove edge failed"); | |||
for (auto &out_node : n->GetOutNodes()) { | |||
if (out_node == nullptr) { | |||
continue; | |||
} | |||
GE_CHK_STATUS_RET(ge::GraphUtils::AddEdge(in_control_node->GetOutControlAnchor(), | |||
GE_CHK_GRAPH_STATUS_RET(ge::GraphUtils::AddEdge(in_control_node->GetOutControlAnchor(), | |||
out_node->GetInControlAnchor()), "add edge failed."); | |||
} | |||
} | |||
@@ -30,6 +30,8 @@ Status MappingSubgraphInput(const ComputeGraphPtr &graph, const std::function<in | |||
int index = -1; | |||
if (!AttrUtils::GetInt(node->GetOpDesc(), "index", index)) { | |||
REPORT_CALL_ERROR("E19999", "Get Attr:%s from op:%s(%s) failed", "index", | |||
node->GetName().c_str(), node->GetType().c_str()); | |||
GELOGE(FAILED, "Failed to get index from data[%s]", node->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -38,6 +40,8 @@ Status MappingSubgraphInput(const ComputeGraphPtr &graph, const std::function<in | |||
GELOGI("Generate subgraph input map for subgraph %s, data index %d, parent index %d", | |||
graph->GetName().c_str(), index, parent_index); | |||
if (!AttrUtils::SetInt(node->GetOpDesc(), ATTR_NAME_PARENT_NODE_INDEX, parent_index)) { | |||
REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed", ATTR_NAME_PARENT_NODE_INDEX.c_str(), | |||
node->GetName().c_str(), node->GetType().c_str()); | |||
GELOGE(FAILED, "Failed to set parent index for node %s", node->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -65,6 +69,9 @@ Status MappingSubgraphOutput(const ComputeGraphPtr &graph, const std::function<i | |||
GeTensorDescPtr tensor = op_desc->MutableInputDesc(index); | |||
GE_CHECK_NOTNULL(tensor); | |||
if (!AttrUtils::SetInt(tensor, ATTR_NAME_PARENT_NODE_INDEX, parent_index)) { | |||
REPORT_CALL_ERROR("E19999", "Set Attr:%s to tensor of op:%s(%s) input:%zu failed", | |||
ATTR_NAME_PARENT_NODE_INDEX.c_str(), op_desc->GetName().c_str(), op_desc->GetType().c_str(), | |||
index); | |||
GELOGE(FAILED, "Failed to set parent index for graph %s", graph->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -140,12 +147,16 @@ Status DataPass::PostParseSubgraph(const ComputeGraphPtr &graph, const string &i | |||
auto post_func_it = subgraph_handle.find(parent_node->GetType()); | |||
if (post_func_it == subgraph_handle.end()) { | |||
REPORT_INNER_ERROR("E19999", "The subgraph post func for node %s type %s is null, check invalid", | |||
parent_node->GetName().c_str(), parent_node->GetType().c_str()); | |||
GELOGE(FAILED, "The subgraph post func for node %s type %s is null.", | |||
parent_node->GetName().c_str(), parent_node->GetType().c_str()); | |||
return FAILED; | |||
} | |||
if (post_func_it->second(ir_name, graph) != SUCCESS) { | |||
REPORT_INNER_ERROR("E19999", "Post process subgraph %s on node %s type %s failed", | |||
graph->GetName().c_str(), parent_node->GetName().c_str(), parent_node->GetType().c_str()); | |||
GELOGE(FAILED, "Failed to post process subgraph %s on node %s type %s", | |||
graph->GetName().c_str(), parent_node->GetName().c_str(), parent_node->GetType().c_str()); | |||
return FAILED; | |||
@@ -29,12 +29,14 @@ const int kRemoveInputIndex = 1; | |||
Status DimensionAdjustPass::Run(ge::NodePtr &node) { | |||
if (node == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Param node is nullptr, check invalid"); | |||
GELOGE(PARAM_INVALID, "node is nullptr."); | |||
return PARAM_INVALID; | |||
} | |||
OpDescPtr op_desc_ptr = node->GetOpDesc(); | |||
if (op_desc_ptr == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Param op_desc of node is nullptr, check invalid"); | |||
GELOGE(PARAM_INVALID, "GetOpDesc return nullptr."); | |||
return PARAM_INVALID; | |||
} | |||
@@ -42,6 +44,8 @@ Status DimensionAdjustPass::Run(ge::NodePtr &node) { | |||
string type; | |||
Status ret = GetOriginalType(node, type); | |||
if (ret != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Get OriginalType of op:%s(%s) failed", | |||
node->GetName().c_str(), node->GetType().c_str()); | |||
GELOGE(ret, "DimensionAdjustPass get originnal type fail."); | |||
return ret; | |||
} | |||
@@ -69,12 +73,16 @@ Status DimensionAdjustPass::Run(ge::NodePtr &node) { | |||
if (ret == NOT_CHANGED) { | |||
return SUCCESS; | |||
} | |||
REPORT_CALL_ERROR("E19999", "kernel compute for op:%s(%s) failed", | |||
node->GetName().c_str(), node->GetType().c_str()); | |||
GELOGE(ret, "DimensionAdjustPass compute failed"); | |||
return ret; | |||
} | |||
if (node->GetAllInDataAnchors().size() > static_cast<size_t>(kRemoveInputIndex)) { | |||
ret = PassUtils::UnlinkNodeWithControlCopy(node, kRemoveInputIndex); | |||
if (ret != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Unlink op:%s(%s) data input:%u with control edge copy failed", | |||
node->GetName().c_str(), node->GetType().c_str(), kRemoveInputIndex); | |||
GELOGE(ret, "DimensionAdjustPass unlink node with control copy fail."); | |||
return ret; | |||
} | |||
@@ -111,12 +119,12 @@ Status DimensionAdjustPass::DealWithInNodes(NodePtr &node) { | |||
GE_CHECK_NOTNULL(identity); | |||
GELOGI("Create new identity node[%s] after node %s[type: %s] success.", identity->GetName().c_str(), | |||
in_node->GetName().c_str(), in_node->GetType().c_str()); | |||
GE_CHK_STATUS_RET(GraphUtils::AddEdge(in_node_anchor, identity->GetInDataAnchor(0))) | |||
GE_CHK_GRAPH_STATUS_RET(GraphUtils::AddEdge(in_node_anchor, identity->GetInDataAnchor(0))) | |||
GE_CHECK_NOTNULL(identity->GetOutControlAnchor()); | |||
if (identity->GetOutControlAnchor()->IsLinkedWith(node->GetInControlAnchor())) { | |||
continue; | |||
} | |||
GE_CHK_STATUS_RET(GraphUtils::AddEdge(identity->GetOutControlAnchor(), node->GetInControlAnchor())) | |||
GE_CHK_GRAPH_STATUS_RET(GraphUtils::AddEdge(identity->GetOutControlAnchor(), node->GetInControlAnchor())) | |||
} | |||
} | |||
@@ -126,12 +134,14 @@ Status DimensionAdjustPass::DealWithInNodes(NodePtr &node) { | |||
NodePtr DimensionAdjustPass::AddIdentityNodeToGraph(const string &name, const GeTensorDesc &tensor, | |||
ComputeGraphPtr &graph) { | |||
if (graph == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Param graph is nullptr, check invalid"); | |||
GELOGE(INTERNAL_ERROR, "Comput graph ptr is null in creating identity node."); | |||
return nullptr; | |||
} | |||
OpDescPtr desc = MakeShared<OpDesc>("", ""); | |||
if (desc == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "New OpDesc failed"); | |||
GELOGE(MEMALLOC_FAILED, "Failed to create op desc."); | |||
return nullptr; | |||
} | |||
@@ -141,6 +151,8 @@ NodePtr DimensionAdjustPass::AddIdentityNodeToGraph(const string &name, const Ge | |||
auto ret = desc->AddInputDesc(tensor); | |||
auto ret2 = desc->AddOutputDesc(tensor); | |||
if ((ret != GRAPH_SUCCESS) || (ret2 != GRAPH_SUCCESS)) { | |||
REPORT_CALL_ERROR("E19999", "Add input or ouput desc to op:%s(%s) failed", | |||
desc->GetName().c_str(), desc->GetType().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Failed to add input/output desc in creating identity."); | |||
return nullptr; | |||
} | |||
@@ -39,12 +39,16 @@ Status DimensionComputePass::Run(ge::NodePtr &node) { | |||
if (ret == NOT_CHANGED) { | |||
return SUCCESS; | |||
} else { | |||
REPORT_CALL_ERROR("E19999", "kernel compute for op:%s(%s) failed", | |||
node->GetName().c_str(), node->GetType().c_str()); | |||
GELOGE(ret, "DimensionComputePass Compute failed"); | |||
return ret; | |||
} | |||
} | |||
if (outputs.empty()) { | |||
REPORT_INNER_ERROR("E19999", "After compute for node %s(%s), output weight is empty, check invalid", | |||
node->GetName().c_str(), node->GetType().c_str()); | |||
GELOGE(INTERNAL_ERROR, | |||
"Failed to compute dims for node %s," | |||
" no output weight", | |||
@@ -31,10 +31,12 @@ namespace ge { | |||
Status DropOutPass::Run(NodePtr &node) { | |||
GELOGD("DropOutPass running"); | |||
if (node == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Param node is nullptr, check invalid"); | |||
GELOGE(FAILED, "parameter is null."); | |||
return FAILED; | |||
} | |||
if (node->GetOpDesc() == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Param op_desc of node is nullptr, check invalid"); | |||
GELOGE(PARAM_INVALID, "param [opDesc] must not be null."); | |||
return PARAM_INVALID; | |||
} | |||
@@ -26,6 +26,7 @@ namespace ge { | |||
Status EndOfSequenceAddControlPass::Run(ComputeGraphPtr graph) { | |||
if (graph == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Param graph is nullptr, check invalid"); | |||
GELOGE(PARAM_INVALID, "param [graph] must not be null."); | |||
return PARAM_INVALID; | |||
} | |||
@@ -82,6 +83,10 @@ Status EndOfSequenceAddControlPass::AddControlEdge(NodePtr &end_of_sequence, std | |||
} | |||
Status status = GraphUtils::AddEdge(out_ctrl_anchor, in_ctrl_anchor); | |||
if (status != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", | |||
"Add control edge between op:%s(%s) and op:%s(%s) failed", | |||
end_of_sequence->GetName().c_str(), end_of_sequence->GetType().c_str(), | |||
node->GetName().c_str(), node->GetType().c_str()); | |||
GELOGE(FAILED, "Graph add EndOfSequence op out ctrl edge fail, dst node: %s.", node->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -37,6 +37,7 @@ Status EnterPass::Run(NodePtr &node) { | |||
// enter node has only one input | |||
if (node->GetInDataNodes().empty()) { | |||
REPORT_INNER_ERROR("E19999", "Param node in data nodes is empty, check invalid"); | |||
GELOGE(PARAM_INVALID, "enter_node %s has no input", node->GetName().c_str()); | |||
return PARAM_INVALID; | |||
} | |||
@@ -58,6 +59,9 @@ Status EnterPass::Run(NodePtr &node) { | |||
} | |||
GELOGI("Remove control edge from %s to %s.", node->GetName().c_str(), out_ctrl_node->GetName().c_str()); | |||
if (GraphUtils::RemoveEdge(node->GetOutControlAnchor(), out_ctrl_node->GetInControlAnchor()) != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Remove control edge between op:%s(%s) and op:%s(%s) failed", | |||
node->GetName().c_str(), node->GetType().c_str(), | |||
out_ctrl_node->GetName().c_str(), out_ctrl_node->GetType().c_str()); | |||
GELOGE(FAILED, "Remove Enter ctrl output fail, %s->%s", node->GetName().c_str(), | |||
out_ctrl_node->GetName().c_str()); | |||
return FAILED; | |||
@@ -89,14 +93,14 @@ Status EnterPass::OptimizeEnterWithOnlyDataOut(NodePtr &node, NodePtr &in_node) | |||
} | |||
GE_CHECK_NOTNULL(in_node->GetOutDataAnchor(0)); | |||
GE_CHK_STATUS_RET(in_node->GetOutDataAnchor(0)->Unlink(node->GetInDataAnchor(0))) | |||
GE_CHK_GRAPH_STATUS_RET(in_node->GetOutDataAnchor(0)->Unlink(node->GetInDataAnchor(0))) | |||
const auto &out_data_anchor = node->GetOutDataAnchor(0); | |||
GE_CHECK_NOTNULL(out_data_anchor); | |||
for (const auto &peer_in_data_anchor : out_data_anchor->GetPeerInDataAnchors()) { | |||
GE_CHK_STATUS_RET(out_data_anchor->Unlink(peer_in_data_anchor)) | |||
GE_CHK_STATUS_RET(in_node->GetOutDataAnchor(0)->LinkTo(peer_in_data_anchor)) | |||
GE_CHK_GRAPH_STATUS_RET(out_data_anchor->Unlink(peer_in_data_anchor)) | |||
GE_CHK_GRAPH_STATUS_RET(in_node->GetOutDataAnchor(0)->LinkTo(peer_in_data_anchor)) | |||
} | |||
GE_CHK_STATUS_RET(GraphUtils::RemoveNodeWithoutRelink(node->GetOwnerComputeGraph(), node)) | |||
GE_CHK_GRAPH_STATUS_RET(GraphUtils::RemoveNodeWithoutRelink(node->GetOwnerComputeGraph(), node)) | |||
AddNodeDeleted(node); | |||
AddRePassNodesWithInOut(in_node); | |||
@@ -136,11 +140,11 @@ Status EnterPass::UnlinkCtrlEdgeBeforeConst(NodePtr &node) { | |||
} | |||
GELOGI("Unlink control edge from %s to %s.", node->GetName().c_str(), out_ctrl_node->GetName().c_str()); | |||
GE_CHK_STATUS_RET(out_ctrl_anchor->Unlink(out_ctrl_node->GetInControlAnchor())) | |||
GE_CHK_GRAPH_STATUS_RET(out_ctrl_anchor->Unlink(out_ctrl_node->GetInControlAnchor())) | |||
for (auto &out_node_of_const : out_nodes_of_const) { | |||
if (!out_ctrl_anchor->IsLinkedWith(out_node_of_const->GetInControlAnchor())) { | |||
GELOGI("Link control edge from %s to %s.", node->GetName().c_str(), out_node_of_const->GetName().c_str()); | |||
GE_CHK_STATUS_RET(out_ctrl_anchor->LinkTo(out_node_of_const->GetInControlAnchor())) | |||
GE_CHK_GRAPH_STATUS_RET(out_ctrl_anchor->LinkTo(out_node_of_const->GetInControlAnchor())) | |||
} | |||
} | |||
} | |||
@@ -115,6 +115,7 @@ NodePtr FlowCtrlPass::InsertOp(ComputeGraphPtr &compute_graph, const string &nod | |||
const std::vector<GeTensorDesc> &output_list) { | |||
OpDescPtr op_desc = MakeShared<OpDesc>(node_name, node_type); | |||
if (op_desc == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "New OpDesc failed"); | |||
GELOGE(FAILED, "Make OpDesc failed, name:%s, type:%s.", node_name.c_str(), node_type.c_str()); | |||
return nullptr; | |||
} | |||
@@ -122,6 +123,8 @@ NodePtr FlowCtrlPass::InsertOp(ComputeGraphPtr &compute_graph, const string &nod | |||
for (auto &input_desc : input_list) { | |||
graphStatus graph_status = op_desc->AddInputDesc(input_desc); | |||
if (graph_status != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Add input desc to op:%s(%s) failed", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(FAILED, "Add node:%s intput desc failed, error=%u.", node_name.c_str(), graph_status); | |||
return nullptr; | |||
} | |||
@@ -130,14 +133,21 @@ NodePtr FlowCtrlPass::InsertOp(ComputeGraphPtr &compute_graph, const string &nod | |||
for (auto &output_desc : output_list) { | |||
graphStatus graph_status = op_desc->AddOutputDesc(output_desc); | |||
if (graph_status != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Add output desc to op:%s(%s) failed", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(FAILED, "Add node:%s output desc failed, error=%u.", node_name.c_str(), graph_status); | |||
return nullptr; | |||
} | |||
} | |||
GE_IF_BOOL_EXEC(compute_graph == nullptr, DOMI_LOGE("compute_graph is nullptr"); return nullptr); | |||
GE_IF_BOOL_EXEC(compute_graph == nullptr, | |||
REPORT_INNER_ERROR("E19999", "Param compute_graph is nullptr, check invalid"); | |||
DOMI_LOGE("compute_graph is nullptr"); | |||
return nullptr); | |||
NodePtr node = compute_graph->AddNode(op_desc); | |||
if (node == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "Add node:%s(%s) to graph:%s failed", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), compute_graph->GetName().c_str()); | |||
GELOGE(FAILED, "add node failed, name:%s, type:%s.", node_name.c_str(), node_type.c_str()); | |||
return nullptr; | |||
} | |||
@@ -149,9 +159,15 @@ NodePtr FlowCtrlPass::InsertOp(ComputeGraphPtr &compute_graph, const string &nod | |||
NodePtr FlowCtrlPass::InsertStreamSwitchOp(ComputeGraphPtr &compute_graph, const string &switch_name, | |||
const NodePtr &loop_cond, const NodePtr &iter_per_loop) { | |||
GE_IF_BOOL_EXEC(loop_cond == nullptr || loop_cond->GetOpDesc() == nullptr, | |||
GELOGE(FAILED, "loop_cond is null"); return nullptr); | |||
REPORT_INNER_ERROR("E19999", "Param loop_cond or its op_desc is nullptr, " | |||
"check invalid"); | |||
GELOGE(FAILED, "loop_cond is null"); | |||
return nullptr); | |||
GE_IF_BOOL_EXEC(iter_per_loop == nullptr || iter_per_loop->GetOpDesc() == nullptr, | |||
GELOGE(FAILED, "iter_per_loop is nullptr"); return nullptr); | |||
REPORT_INNER_ERROR("E19999", "Param iter_per_loop or its op_desc is nullptr, " | |||
"check invalid"); | |||
GELOGE(FAILED, "iter_per_loop is nullptr"); | |||
return nullptr); | |||
std::vector<GeTensorDesc> input_desc_list = {loop_cond->GetOpDesc()->GetOutputDesc(0), | |||
iter_per_loop->GetOpDesc()->GetOutputDesc(0)}; | |||
std::vector<GeTensorDesc> output_desc_list; | |||
@@ -164,6 +180,9 @@ NodePtr FlowCtrlPass::InsertStreamSwitchOp(ComputeGraphPtr &compute_graph, const | |||
// set input 0 | |||
graphStatus add_ret = GraphUtils::AddEdge(loop_cond->GetOutDataAnchor(0), stream_switch->GetInDataAnchor(0)); | |||
if (add_ret != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(index:0) and op:%s(%s)(index:0) failed", | |||
loop_cond->GetName().c_str(), loop_cond->GetType().c_str(), | |||
stream_switch->GetName().c_str(), stream_switch->GetType().c_str()); | |||
GELOGE(FAILED, "Add loop_cond_node to switch_node:%s edge failed, ret = %u.", switch_name.c_str(), add_ret); | |||
return nullptr; | |||
} | |||
@@ -171,6 +190,9 @@ NodePtr FlowCtrlPass::InsertStreamSwitchOp(ComputeGraphPtr &compute_graph, const | |||
// set input 1 | |||
add_ret = GraphUtils::AddEdge(iter_per_loop->GetOutDataAnchor(0), stream_switch->GetInDataAnchor(1)); | |||
if (add_ret != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(index:0) and op:%s(%s)(index:1) failed", | |||
iter_per_loop->GetName().c_str(), iter_per_loop->GetType().c_str(), | |||
stream_switch->GetName().c_str(), stream_switch->GetType().c_str()); | |||
GELOGE(FAILED, "Add iter_per_loop_node to switch_node:%s edge failed, ret = %u.", switch_name.c_str(), add_ret); | |||
return nullptr; | |||
} | |||
@@ -178,13 +200,19 @@ NodePtr FlowCtrlPass::InsertStreamSwitchOp(ComputeGraphPtr &compute_graph, const | |||
// stream switch op need switch cond by attr. | |||
GE_IF_BOOL_EXEC(!AttrUtils::SetInt(stream_switch->GetOpDesc(), ATTR_NAME_STREAM_SWITCH_COND, | |||
static_cast<int64_t>(RT_LESS)), | |||
DOMI_LOGE("set ATTR_NAME_STREAM_SWITCH_COND failed"); return nullptr); | |||
REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed", | |||
ATTR_NAME_STREAM_SWITCH_COND.c_str(), | |||
stream_switch->GetName().c_str(), stream_switch->GetType().c_str()); | |||
DOMI_LOGE("set ATTR_NAME_STREAM_SWITCH_COND failed"); return nullptr); | |||
return stream_switch; | |||
} | |||
NodePtr FlowCtrlPass::AddVariableNode(ComputeGraphPtr &compute_graph, const string &name) { | |||
GE_IF_BOOL_EXEC(compute_graph == nullptr, DOMI_LOGE("compute_graph is nullptr"); return nullptr); | |||
GE_IF_BOOL_EXEC(compute_graph == nullptr, | |||
REPORT_INNER_ERROR("E19999", "Param compute_graph is nullptr, check invalid"); | |||
DOMI_LOGE("compute_graph is nullptr"); | |||
return nullptr); | |||
NodePtr exist_node = compute_graph->FindNode(name); | |||
if (exist_node != nullptr) { | |||
GELOGD("Node %s already exist, no need add.", name.c_str()); | |||
@@ -193,10 +221,14 @@ NodePtr FlowCtrlPass::AddVariableNode(ComputeGraphPtr &compute_graph, const stri | |||
// fetch and set tensor desc | |||
GeTensorDesc tensor_desc; | |||
if (ge::VarManager::Instance(compute_graph->GetSessionID()) == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Get VarManager by session_id:%lu failed", | |||
compute_graph->GetSessionID()); | |||
return nullptr; | |||
} | |||
Status ret = ge::VarManager::Instance(compute_graph->GetSessionID())->GetCurVarDesc(name, tensor_desc); | |||
if (ret != SUCCESS) { | |||
REPORT_INNER_ERROR("E19999", "Get var tensor from VarManager by name:%s failed, session_id:%lu", | |||
name.c_str(), compute_graph->GetSessionID()); | |||
GELOGE(FAILED, "Get var desc fail, name:%s", name.c_str()); | |||
return nullptr; | |||
} | |||
@@ -238,6 +270,9 @@ Status FlowCtrlPass::AddGlobalStepVariableNode(ComputeGraphPtr &compute_graph) { | |||
// add ctrl edges | |||
graphStatus add_ret = GraphUtils::AddEdge(global_step->GetOutControlAnchor(), output_node->GetInControlAnchor()); | |||
if (add_ret != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Add control edge between op:%s(%s) and op:%s(%s) failed", | |||
global_step->GetName().c_str(), global_step->GetType().c_str(), | |||
output_node->GetName().c_str(), output_node->GetType().c_str()); | |||
GELOGE(FAILED, "Add global_step to netoutput edge failed, add_ret=%u.", add_ret); | |||
return FAILED; | |||
} | |||
@@ -249,6 +284,8 @@ NodePtr FlowCtrlPass::InsertAssignOp(ge::ComputeGraphPtr &compute_graph, const s | |||
const string &node_name, const NodePtr &ref_node, const NodePtr &value_node) { | |||
GE_IF_BOOL_EXEC(ref_node == nullptr || value_node == nullptr || | |||
ref_node->GetOpDesc() == nullptr || value_node->GetOpDesc() == nullptr, | |||
REPORT_INNER_ERROR("E19999", "Param ref_node or value_node or their op_desc has nullptr, " | |||
"check invalid"); | |||
GELOGE(FAILED, "ref node or value node is null"); | |||
return nullptr); | |||
GeTensorDesc ref_tensor_desc = ref_node->GetOpDesc()->GetOutputDesc(0); | |||
@@ -263,12 +300,18 @@ NodePtr FlowCtrlPass::InsertAssignOp(ge::ComputeGraphPtr &compute_graph, const s | |||
// assign node input 0 = ref_node | |||
graphStatus add_ret = GraphUtils::AddEdge(ref_node->GetOutDataAnchor(0), assign_node->GetInDataAnchor(0)); | |||
if (add_ret != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(index:0) and op:%s(%s)(index:0) failed", | |||
ref_node->GetName().c_str(), ref_node->GetType().c_str(), | |||
assign_node->GetName().c_str(), assign_node->GetType().c_str()); | |||
GELOGE(FAILED, "Add ref_node to %s edge failed, add_ret=%u.", node_name.c_str(), add_ret); | |||
return nullptr; | |||
} | |||
// assign input 1 = value_node | |||
add_ret = GraphUtils::AddEdge(value_node->GetOutDataAnchor(0), assign_node->GetInDataAnchor(1)); | |||
if (add_ret != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(index:0) and op:%s(%s)(index:1) failed", | |||
value_node->GetName().c_str(), value_node->GetType().c_str(), | |||
assign_node->GetName().c_str(), assign_node->GetType().c_str()); | |||
GELOGE(FAILED, "Add value_node to %s edge failed, add_ret=%u.", node_name.c_str(), add_ret); | |||
return nullptr; | |||
} | |||
@@ -298,10 +341,23 @@ Status FlowCtrlPass::CreateIterCtrlTrueBranch(ComputeGraphPtr &compute_graph, co | |||
string active_name = switch_node->GetName() + "_StreamActive"; | |||
// add attr for stream assign model to break branch. | |||
GE_CHK_STATUS_RET(SetStreamLabel(assign_add_node_in_fpbp_loop_, active_name), "set stream label failed"); | |||
auto status = SetStreamLabel(assign_add_node_in_fpbp_loop_, active_name); | |||
if (status != ge::SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Set stream_label:%s to op:%s(%s) failed", | |||
active_name.c_str(), assign_add_node_in_fpbp_loop_->GetName().c_str(), | |||
assign_add_node_in_fpbp_loop_->GetType().c_str()); | |||
GELOGE(status, "Set stream label failed."); | |||
return status; | |||
} | |||
// used for stream assign to find true branch | |||
GE_CHK_STATUS_RET(SetActiveLabelList(switch_node, { active_name }), "set active label list failed"); | |||
status = SetActiveLabelList(switch_node, { active_name }); | |||
if (status != ge::SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Set active label list:%s to op:%s(%s) failed", | |||
active_name.c_str(), switch_node->GetName().c_str(), switch_node->GetType().c_str()); | |||
GELOGE(status, "set active_label_list failed."); | |||
return status; | |||
} | |||
// 2. Insert active node | |||
NodePtr active_node = InsertOp(compute_graph, STREAMACTIVE, active_name, {}, {}); | |||
@@ -309,14 +365,28 @@ Status FlowCtrlPass::CreateIterCtrlTrueBranch(ComputeGraphPtr &compute_graph, co | |||
GELOGE(FAILED, "Insert stream active node:%s for IterCtrlTrueStream failed.", active_name.c_str()); | |||
return FAILED; | |||
} | |||
GE_CHK_STATUS_RET(SetStreamLabel(active_node, active_name), "set stream label failed"); | |||
status = SetStreamLabel(active_node, active_name); | |||
if (status != ge::SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Set stream_label:%s to op:%s(%s) failed", | |||
active_name.c_str(), active_node->GetName().c_str(), active_node->GetType().c_str()); | |||
GELOGE(status, "Set stream label failed."); | |||
return status; | |||
} | |||
GE_IF_BOOL_EXEC(!AttrUtils::SetBool(active_node->GetOpDesc(), ATTR_NAME_IS_LOOP_ACTIVE, true), | |||
DOMI_LOGE("set ATTR_NAME_IS_LOOP_ACTIVE failed"); return FAILED); | |||
REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed", | |||
ATTR_NAME_IS_LOOP_ACTIVE.c_str(), | |||
active_node->GetName().c_str(), active_node->GetType().c_str()); | |||
DOMI_LOGE("set ATTR_NAME_IS_LOOP_ACTIVE failed"); | |||
return FAILED); | |||
// add ctrl edges | |||
graphStatus add_ret = GraphUtils::AddEdge(switch_node->GetOutControlAnchor(), | |||
assign_add_node_in_fpbp_loop_->GetInControlAnchor()); | |||
if (add_ret != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Add control edge between op:%s(%s) and op:%s(%s) failed", | |||
switch_node->GetName().c_str(), switch_node->GetType().c_str(), | |||
assign_add_node_in_fpbp_loop_->GetName().c_str(), | |||
assign_add_node_in_fpbp_loop_->GetType().c_str()); | |||
GELOGE(FAILED, "Add switch_node to assign_add_node ctrl edge failed, add_ret=%u.", add_ret); | |||
return FAILED; | |||
} | |||
@@ -324,6 +394,10 @@ Status FlowCtrlPass::CreateIterCtrlTrueBranch(ComputeGraphPtr &compute_graph, co | |||
add_ret = GraphUtils::AddEdge(assign_add_node_in_fpbp_loop_->GetOutControlAnchor(), | |||
active_node->GetInControlAnchor()); | |||
if (add_ret != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Add control edge between op:%s(%s) and op:%s(%s) failed", | |||
assign_add_node_in_fpbp_loop_->GetName().c_str(), | |||
assign_add_node_in_fpbp_loop_->GetType().c_str(), | |||
active_node->GetName().c_str(), active_node->GetType().c_str()); | |||
GELOGE(FAILED, "Add assign_add_node to active_node ctrl edge failed, add_ret=%u.", add_ret); | |||
return FAILED; | |||
} | |||
@@ -351,10 +425,19 @@ Status FlowCtrlPass::CreateIterCtrlFalseBranch(ComputeGraphPtr &compute_graph, c | |||
return FAILED; | |||
} | |||
GE_CHK_STATUS_RET(SetStreamLabel(assign_node, switch_node->GetName()), "set stream label failed."); | |||
auto status = SetStreamLabel(assign_node, switch_node->GetName()); | |||
if (status != ge::SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Set stream_label:%s to op:%s(%s) failed", | |||
switch_node->GetName().c_str(), assign_node->GetName().c_str(), assign_node->GetType().c_str()); | |||
GELOGE(status, "Set stream label failed."); | |||
return status; | |||
} | |||
graphStatus add_ret = GraphUtils::AddEdge(switch_node->GetOutControlAnchor(), assign_node->GetInControlAnchor()); | |||
if (add_ret != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Add control edge between op:%s(%s) and op:%s(%s) failed", | |||
switch_node->GetName().c_str(), switch_node->GetType().c_str(), | |||
assign_node->GetName().c_str(), assign_node->GetType().c_str()); | |||
GELOGE(FAILED, "Add switch_node to assign_node ctrl edge failed, add_ret=%u.", add_ret); | |||
return FAILED; | |||
} | |||
@@ -368,15 +451,30 @@ Status FlowCtrlPass::CreateIterCtrlFalseBranch(ComputeGraphPtr &compute_graph, c | |||
GELOGE(FAILED, "Insert stream active node:%s for IterCtrlTrueStream failed.", active_name.c_str()); | |||
return FAILED; | |||
} | |||
GE_CHK_STATUS_RET(SetStreamLabel(active_node, switch_node->GetName()), "set stream label failed"); | |||
status = SetStreamLabel(active_node, switch_node->GetName()); | |||
if (status != ge::SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Set stream_label:%s to op:%s(%s) failed", | |||
switch_node->GetName().c_str(), active_node->GetName().c_str(), active_node->GetType().c_str()); | |||
GELOGE(status, "Set stream label failed."); | |||
return status; | |||
} | |||
GE_CHK_STATUS_RET(SetSwitchBranchNodeLabel(active_node, switch_node->GetName()), | |||
"set switch branch node label failed."); | |||
string model_exit_name = switch_node->GetName() + "_ModelExit"; | |||
GE_CHK_STATUS_RET(SetActiveLabelList(active_node, { model_exit_name }), "set active label list failed"); | |||
status = SetActiveLabelList(active_node, { model_exit_name }); | |||
if (status != ge::SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Set active label list:%s to op:%s(%s) failed", | |||
model_exit_name.c_str(), active_node->GetName().c_str(), active_node->GetType().c_str()); | |||
GELOGE(status, "set active_label_list failed."); | |||
return status; | |||
} | |||
add_ret = GraphUtils::AddEdge(assign_node->GetOutControlAnchor(), active_node->GetInControlAnchor()); | |||
if (add_ret != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Add control edge between op:%s(%s) and op:%s(%s) failed", | |||
assign_node->GetName().c_str(), assign_node->GetType().c_str(), | |||
active_node->GetName().c_str(), active_node->GetType().c_str()); | |||
GELOGE(FAILED, "Add assign_node to active_node ctrl edge failed, add_ret=%u.", add_ret); | |||
return FAILED; | |||
} | |||
@@ -387,10 +485,20 @@ Status FlowCtrlPass::CreateIterCtrlFalseBranch(ComputeGraphPtr &compute_graph, c | |||
GELOGE(FAILED, "Insert model_exit node:%s for IterCtrlTrueStream failed.", model_exit_name.c_str()); | |||
return FAILED; | |||
} | |||
GE_CHK_STATUS_RET(SetStreamLabel(model_exit_node, model_exit_name), "set stream label failed"); | |||
status = SetStreamLabel(model_exit_node, model_exit_name); | |||
if (status != ge::SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Set stream_label:%s to op:%s(%s) failed", | |||
model_exit_name.c_str(), model_exit_node->GetName().c_str(), | |||
model_exit_node->GetType().c_str()); | |||
GELOGE(status, "Set stream label failed."); | |||
return status; | |||
} | |||
add_ret = GraphUtils::AddEdge(active_node->GetOutControlAnchor(), model_exit_node->GetInControlAnchor()); | |||
if (add_ret != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Add control edge between op:%s(%s) and op:%s(%s) failed", | |||
active_node->GetName().c_str(), assign_node->GetType().c_str(), | |||
model_exit_node->GetName().c_str(), model_exit_node->GetType().c_str()); | |||
GELOGE(FAILED, "Add active_node to model_exit_node ctrl edge failed, add_ret=%u.", add_ret); | |||
return FAILED; | |||
} | |||
@@ -433,10 +541,19 @@ Status FlowCtrlPass::AddFpBpIteratorCtrl(ComputeGraphPtr &compute_graph, NodePtr | |||
GELOGE(FAILED, "InsertStreamSwitchOp:%s failed.", switch_name.c_str()); | |||
return FAILED; | |||
} | |||
GE_CHK_STATUS_RET(SetStreamLabel(switch_node, switch_name), "set stream label failed"); | |||
auto status = SetStreamLabel(switch_node, switch_name); | |||
if (status != ge::SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Set stream label:%s to op:%s(%s) failed", | |||
switch_name.c_str(), switch_node->GetName().c_str(), switch_node->GetType().c_str()); | |||
GELOGE(status, "set stream label failed."); | |||
return status; | |||
} | |||
graphStatus add_ret = GraphUtils::AddEdge(pre_node->GetOutControlAnchor(), switch_node->GetInControlAnchor()); | |||
if (add_ret != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Add control edge between op:%s(%s) and op:%s(%s) failed", | |||
pre_node->GetName().c_str(), pre_node->GetType().c_str(), | |||
switch_node->GetName().c_str(), switch_node->GetType().c_str()); | |||
GELOGE(FAILED, "Add pre node:%s to switch_node:%s ctrl edge failed, ret = %u.", pre_node_name.c_str(), | |||
switch_name.c_str(), add_ret); | |||
return FAILED; | |||
@@ -477,9 +594,14 @@ Status FlowCtrlPass::AddSpecialNodeIteratorCtrl(ComputeGraphPtr &compute_graph, | |||
* itersPerLoop loopCond | |||
*/ | |||
GE_IF_BOOL_EXEC(loop_after_node == nullptr || compute_graph == nullptr, | |||
DOMI_LOGE("loop after node or compute graph is null."); return FAILED); | |||
REPORT_INNER_ERROR("E19999", "Param loop_after_node or compute_graph is nullptr, " | |||
"check invalid"); | |||
DOMI_LOGE("loop after node or compute graph is null."); | |||
return FAILED); | |||
InDataAnchorPtr in_anchor = loop_after_node->GetInDataAnchor(0); | |||
if (in_anchor == nullptr || in_anchor->GetPeerOutAnchor() == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Param loop_after_node:%s(%s) no in data node, check invalid", | |||
loop_after_node->GetName().c_str(), loop_after_node->GetType().c_str()); | |||
GELOGE(FAILED, "Find %s in data anchor failed.", loop_after_node->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -488,17 +610,26 @@ Status FlowCtrlPass::AddSpecialNodeIteratorCtrl(ComputeGraphPtr &compute_graph, | |||
// 1. Get variables | |||
NodePtr loop_cond_node = compute_graph->FindNode(NODE_NAME_FLOWCTRL_LOOP_COND); | |||
if (loop_cond_node == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Node:%s not found in graph:%s, check invalid", | |||
NODE_NAME_FLOWCTRL_LOOP_COND.c_str(), compute_graph->GetName().c_str()); | |||
GELOGE(FAILED, "Find node :%s failed.", NODE_NAME_FLOWCTRL_LOOP_COND.c_str()); | |||
return FAILED; | |||
} | |||
NodePtr iter_per_loop_node = compute_graph->FindNode(NODE_NAME_FLOWCTRL_LOOP_PER_ITER); | |||
if (iter_per_loop_node == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Node:%s not found in graph:%s, check invalid", | |||
NODE_NAME_FLOWCTRL_LOOP_PER_ITER.c_str(), compute_graph->GetName().c_str()); | |||
GELOGE(FAILED, "Find node :%s failed.", NODE_NAME_FLOWCTRL_LOOP_PER_ITER.c_str()); | |||
return FAILED; | |||
} | |||
// 2. Add StreamSwitch and edges to switch_node. | |||
GE_IF_BOOL_EXEC(loop_pre_node == nullptr, DOMI_LOGE("loop pre node is null."); return FAILED); | |||
GE_IF_BOOL_EXEC(loop_pre_node == nullptr, | |||
REPORT_INNER_ERROR("E19999", "Param loop_after_node:%s(%s) no in data node, " | |||
"check invalid", loop_after_node->GetName().c_str(), | |||
loop_after_node->GetType().c_str()); | |||
DOMI_LOGE("loop pre node is null."); | |||
return FAILED); | |||
string switch_name = loop_pre_node->GetName() + "_" + NODE_NAME_STREAM_SWITCH; | |||
NodePtr switch_node = InsertStreamSwitchOp(compute_graph, switch_name, loop_cond_node, iter_per_loop_node); | |||
if (switch_node == nullptr) { | |||
@@ -506,16 +637,28 @@ Status FlowCtrlPass::AddSpecialNodeIteratorCtrl(ComputeGraphPtr &compute_graph, | |||
return FAILED; | |||
} | |||
GE_CHK_STATUS_RET(SetStreamLabel(switch_node, switch_name), "set stream label failed."); | |||
auto status = SetStreamLabel(switch_node, switch_name); | |||
if (status != ge::SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Set stream label:%s to op:%s(%s) failed", | |||
switch_name.c_str(), switch_node->GetName().c_str(), switch_node->GetType().c_str()); | |||
GELOGE(status, "set stream label failed."); | |||
return status; | |||
} | |||
graphStatus add_ret = GraphUtils::AddEdge(loop_pre_node->GetOutControlAnchor(), switch_node->GetInControlAnchor()); | |||
if (add_ret != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Add control edge between op:%s(%s) and op:%s(%s) failed", | |||
loop_pre_node->GetName().c_str(), loop_pre_node->GetType().c_str(), | |||
switch_node->GetName().c_str(), switch_node->GetType().c_str()); | |||
GELOGE(FAILED, "Add loop_pre_node:%s to switch_node:%s ctrl edge failed, ret = %u.", | |||
loop_pre_node->GetName().c_str(), switch_name.c_str(), add_ret); | |||
return FAILED; | |||
} | |||
add_ret = GraphUtils::AddEdge(loop_after_node->GetOutControlAnchor(), switch_node->GetInControlAnchor()); | |||
if (add_ret != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Add control edge between op:%s(%s) and op:%s(%s) failed", | |||
loop_after_node->GetName().c_str(), loop_after_node->GetType().c_str(), | |||
switch_node->GetName().c_str(), switch_node->GetType().c_str()); | |||
GELOGE(FAILED, "Add node:%s to switch_node:%s ctrl edge failed, ret = %u.", loop_after_node->GetName().c_str(), | |||
switch_name.c_str(), add_ret); | |||
return FAILED; | |||
@@ -529,22 +672,47 @@ Status FlowCtrlPass::AddSpecialNodeIteratorCtrl(ComputeGraphPtr &compute_graph, | |||
return FAILED; | |||
} | |||
GE_CHK_STATUS_RET(SetStreamLabel(active_node, active_name), "set stream label failed."); | |||
status = SetStreamLabel(active_node, active_name); | |||
if (status != ge::SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Set stream label:%s to op:%s(%s) failed", | |||
active_name.c_str(), active_node->GetName().c_str(), active_node->GetType().c_str()); | |||
GELOGE(status, "set stream label failed."); | |||
return status; | |||
} | |||
GE_IF_BOOL_EXEC(!AttrUtils::SetBool(active_node->GetOpDesc(), ATTR_NAME_IS_LOOP_ACTIVE, true), | |||
DOMI_LOGE("set ATTR_NAME_IS_LOOP_ACTIVE failed"); return FAILED); | |||
REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed", | |||
ATTR_NAME_IS_LOOP_ACTIVE.c_str(), | |||
active_node->GetName().c_str(), active_node->GetType().c_str()); | |||
DOMI_LOGE("set ATTR_NAME_IS_LOOP_ACTIVE failed"); | |||
return FAILED); | |||
add_ret = GraphUtils::AddEdge(switch_node->GetOutControlAnchor(), active_node->GetInControlAnchor()); | |||
if (add_ret != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Add control edge between op:%s(%s) and op:%s(%s) failed", | |||
switch_node->GetName().c_str(), switch_node->GetType().c_str(), | |||
active_node->GetName().c_str(), active_node->GetType().c_str()); | |||
GELOGE(FAILED, "Add switch_node:%s to active_node:%s ctrl edge failed, ret = %u.", switch_name.c_str(), | |||
active_name.c_str(), add_ret); | |||
return FAILED; | |||
} | |||
// used for stream assign to find true branch | |||
GE_CHK_STATUS_RET(SetActiveLabelList(switch_node, { active_name }), "set active label list failed."); | |||
status = SetActiveLabelList(switch_node, { active_name }); | |||
if (status != ge::SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Set active label list:%s to op:%s(%s) failed", | |||
active_name.c_str(), switch_node->GetName().c_str(), switch_node->GetType().c_str()); | |||
GELOGE(status, "set active_label_list failed."); | |||
return status; | |||
} | |||
// used for stream assign to find active stream | |||
GE_CHK_STATUS_RET(SetActiveLabelList(active_node, { loop_pre_node->GetName() }), "set active label list failed"); | |||
status = SetActiveLabelList(active_node, { loop_pre_node->GetName() }); | |||
if (status != ge::SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Set active label list:%s to op:%s(%s) failed", | |||
loop_pre_node->GetName().c_str(), active_node->GetName().c_str(), active_node->GetType().c_str()); | |||
GELOGE(status, "set active_label_list failed."); | |||
return status; | |||
} | |||
active_nodes_in_iter_loop_.push_back(active_node); | |||
return SUCCESS; | |||
} | |||
@@ -35,6 +35,7 @@ namespace ge { | |||
namespace folding_pass { | |||
shared_ptr<Kernel> GetKernelByType(const NodePtr &node) { | |||
if (node == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Param node is nullptr, check invalid"); | |||
GELOGE(FAILED, "parameter is null."); | |||
return nullptr; | |||
} | |||
@@ -42,6 +43,9 @@ shared_ptr<Kernel> GetKernelByType(const NodePtr &node) { | |||
string type = node->GetType(); | |||
if (type == FRAMEWORKOP) { | |||
if (!ge::AttrUtils::GetStr(node->GetOpDesc(), ATTR_NAME_FRAMEWORK_ORIGINAL_TYPE, type)) { | |||
REPORT_CALL_ERROR("E19999", "Get Attr:%s from op:%s(%s) failed", | |||
ATTR_NAME_FRAMEWORK_ORIGINAL_TYPE.c_str(), | |||
node->GetName().c_str(), node->GetType().c_str()); | |||
return nullptr; | |||
} | |||
} | |||
@@ -79,6 +83,7 @@ IndexsToAnchors GetIndexAndPeerInDataAnchors(NodePtr &node) { | |||
NodePtr AddConstNodeToGraph(GeTensorPtr &tensor, ComputeGraphPtr &graph) { | |||
auto const_desc = OpDescUtils::CreateConstOp(tensor); | |||
if (const_desc == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "Create Const op failed"); | |||
GELOGE(OUT_OF_MEMORY, "Failed to get const desc from tensor"); | |||
return nullptr; | |||
} | |||
@@ -90,12 +95,14 @@ NodePtr AddConstNodeToGraph(GeTensorPtr &tensor, ComputeGraphPtr &graph) { | |||
NodePtr AddIdentityNodeToGraph(const std::string &name, const GeTensorDesc &tensor, ComputeGraphPtr &graph) { | |||
if (graph == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Param graph is nullptr, check invalid"); | |||
GELOGE(INTERNAL_ERROR, "Compute graph ptr is null in creating identity node."); | |||
return nullptr; | |||
} | |||
OpDescPtr desc = MakeShared<OpDesc>("", ""); | |||
if (desc == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "New OpDesc failed"); | |||
GELOGE(MEMALLOC_FAILED, "Failed to create op desc."); | |||
return nullptr; | |||
} | |||
@@ -105,6 +112,8 @@ NodePtr AddIdentityNodeToGraph(const std::string &name, const GeTensorDesc &tens | |||
auto ret = desc->AddInputDesc(tensor); | |||
auto ret2 = desc->AddOutputDesc(tensor); | |||
if ((ret != GRAPH_SUCCESS) || (ret2 != GRAPH_SUCCESS)) { | |||
REPORT_CALL_ERROR("E19999", "Add input or output desc to op:%s(%s) failed", | |||
desc->GetName().c_str(), desc->GetType().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Failed to add input/output desc in creating Identity."); | |||
return nullptr; | |||
} | |||
@@ -137,6 +146,8 @@ Status FoldingPass::Folding(NodePtr &node, vector<GeTensorPtr> &outputs) { | |||
auto in_data_nodes = node->GetInDataNodes(); | |||
std::unordered_set<NodePtr> in_data_nodes_set(in_data_nodes.begin(), in_data_nodes.end()); | |||
if (IsolateAndDeleteNode(node, {}) != SUCCESS) { | |||
REPORT_INNER_ERROR("E19999", "Isolate and delete node:%s(%s) faild", | |||
node->GetName().c_str(), node->GetType().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Failed to isolate and delete node %s, type %s.", | |||
node->GetName().c_str(), node->GetType().c_str()); | |||
return INTERNAL_ERROR; | |||
@@ -149,6 +160,8 @@ Status FoldingPass::Folding(NodePtr &node, vector<GeTensorPtr> &outputs) { | |||
continue; | |||
} | |||
if (IsolateAndDeleteNode(pre_node, {}) != SUCCESS) { | |||
REPORT_INNER_ERROR("E19999", "Isolate and delete node:%s(%s) faild", | |||
pre_node->GetName().c_str(), pre_node->GetType().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Failed to isolate and delete in data node %s, type %s.", | |||
pre_node->GetName().c_str(), pre_node->GetType().c_str()); | |||
return INTERNAL_ERROR; | |||
@@ -177,6 +190,10 @@ Status FoldingPass::DealWithInNodes(NodePtr &node) { | |||
GELOGI("The in_node name is %s, and node type is %s.", in_node->GetName().c_str(), in_node->GetType().c_str()); | |||
auto ret = in_node_anchor->Unlink(in_data_anchor); | |||
if (ret != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", | |||
"Op:%s(%s) out index:%d unlink from op:%s(%s) in index:%d failed", | |||
in_node->GetName().c_str(), in_node->GetType().c_str(), in_node_anchor->GetIdx(), | |||
node->GetName().c_str(), node->GetType().c_str(), in_data_anchor->GetIdx()); | |||
GELOGE(INTERNAL_ERROR, "Failed to unlink anchor between const node %s to constant-folding-node %s, type %s.", | |||
in_node->GetName().c_str(), node->GetName().c_str(), node->GetType().c_str()); | |||
return INTERNAL_ERROR; | |||
@@ -192,6 +209,9 @@ Status FoldingPass::DealWithInNodes(NodePtr &node) { | |||
} | |||
ret = GraphUtils::AddEdge(in_node_anchor, identity->GetInDataAnchor(0)); | |||
if (ret != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(index:%d) and op:%s(%s)(inde:0) failed", | |||
in_node->GetName().c_str(), in_node->GetType().c_str(), in_node_anchor->GetIdx(), | |||
identity->GetName().c_str(), identity->GetType().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Failed to add edge, from node %s to node %s.", in_node->GetName().c_str(), | |||
identity->GetName().c_str()); | |||
return INTERNAL_ERROR; | |||
@@ -199,6 +219,9 @@ Status FoldingPass::DealWithInNodes(NodePtr &node) { | |||
GELOGI("Create new identity node success."); | |||
ret = GraphUtils::AddEdge(identity->GetOutControlAnchor(), node->GetInControlAnchor()); | |||
if (ret != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Add control edge between op:%s(%s) and op:%s(%s) failed", | |||
identity->GetName().c_str(), identity->GetType().c_str(), | |||
node->GetName().c_str(), node->GetType().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Failed to add edge, from node %s to node %s.", in_node->GetName().c_str(), | |||
node->GetName().c_str()); | |||
return INTERNAL_ERROR; | |||
@@ -212,6 +235,7 @@ Status FoldingPass::DealWithInNodes(NodePtr &node) { | |||
Status FoldingPass::AddConstNode(NodePtr &node, IndexsToAnchors indexes_to_anchors, | |||
std::vector<GeTensorPtr> &v_weight) { | |||
if (node == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Param node is nullptr, check invalid"); | |||
GELOGE(PARAM_INVALID, "node is null"); | |||
return FAILED; | |||
} | |||
@@ -219,6 +243,8 @@ Status FoldingPass::AddConstNode(NodePtr &node, IndexsToAnchors indexes_to_ancho | |||
for (auto &index_to_anchors : indexes_to_anchors) { | |||
auto index = static_cast<size_t>(index_to_anchors.first); | |||
if (index >= v_weight.size()) { | |||
REPORT_INNER_ERROR("E19999", "Index:%lu in param index_to_anchors >= param v_weight.size:%zu, " | |||
"check invalid", index, v_weight.size()); | |||
GELOGE(INTERNAL_ERROR, | |||
"Failed to constant fold on node %s type %s, " | |||
"the out nodes num %lu calculated is less than the node out anchor index %zu", | |||
@@ -227,6 +253,8 @@ Status FoldingPass::AddConstNode(NodePtr &node, IndexsToAnchors indexes_to_ancho | |||
} | |||
GeTensorPtr weight = v_weight[index]; | |||
if (weight == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Index:%lu in param v_weight is nullptr check invalid", | |||
index); | |||
GELOGE(INTERNAL_ERROR, "Failed to constant fold on node %s type %s, the %lust node calculated is null", | |||
node->GetName().c_str(), node->GetType().c_str(), index); | |||
return INTERNAL_ERROR; | |||
@@ -243,6 +271,8 @@ Status FoldingPass::AddConstNode(NodePtr &node, IndexsToAnchors indexes_to_ancho | |||
// add new const to re-pass node | |||
for (auto &in_anchor : index_to_anchors.second) { | |||
if (in_anchor == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Index:%lu in param index_to_anchors has nullptr member in_anchor, " | |||
"check invalid", index); | |||
GELOGE(INTERNAL_ERROR, "In anchor is nullptr."); | |||
return INTERNAL_ERROR; | |||
} | |||
@@ -254,6 +284,9 @@ Status FoldingPass::AddConstNode(NodePtr &node, IndexsToAnchors indexes_to_ancho | |||
} | |||
Status ret = GraphUtils::AddEdge(node->GetOutControlAnchor(), const_node->GetInControlAnchor()); | |||
if (ret != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Add control edge between op:%s(%s) and op:%s(%s) failed", | |||
node->GetName().c_str(), node->GetType().c_str(), | |||
const_node->GetName().c_str(), const_node->GetType().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Failed to add control edge, from node %s to const node %s.", node->GetName().c_str(), | |||
const_node->GetName().c_str()); | |||
return INTERNAL_ERROR; | |||
@@ -263,6 +296,9 @@ Status FoldingPass::AddConstNode(NodePtr &node, IndexsToAnchors indexes_to_ancho | |||
if (AttrUtils::GetStr(node->GetOpDesc(), ATTR_NAME_STREAM_LABEL, stream_label)) { | |||
GE_CHECK_NOTNULL(const_node->GetOpDesc()); | |||
if (!AttrUtils::SetStr(const_node->GetOpDesc(), ATTR_NAME_STREAM_LABEL, stream_label)) { | |||
REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed", | |||
ATTR_NAME_STREAM_LABEL.c_str(), | |||
const_node->GetName().c_str(), const_node->GetType().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Failed to set stream label on dynamic const node %s, with stream label:%s.", | |||
const_node->GetName().c_str(), stream_label.c_str()); | |||
return INTERNAL_ERROR; | |||
@@ -279,6 +315,8 @@ Status FoldingPass::RemoveNodeKeepingCtrlEdges(NodePtr &node) { | |||
GE_IF_BOOL_EXEC(node == nullptr, GELOGE(PARAM_INVALID, "node is null"); return PARAM_INVALID); | |||
auto ret = GraphUtils::IsolateNode(node, {}); | |||
if (ret != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Isolate node:%s(%s) in graph failed", | |||
node->GetName().c_str(), node->GetType().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Failed to isolate the folding-node %s type %s", node->GetName().c_str(), | |||
node->GetType().c_str()); | |||
return INTERNAL_ERROR; | |||
@@ -287,6 +325,8 @@ Status FoldingPass::RemoveNodeKeepingCtrlEdges(NodePtr &node) { | |||
auto graph = node->GetOwnerComputeGraph(); | |||
ret = GraphUtils::RemoveNodeWithoutRelink(graph, node); | |||
if (ret != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Remove node:%s(%s) without relink in graph:%s failed", | |||
node->GetName().c_str(), node->GetType().c_str(), graph->GetName().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Failed to remove node %s from graph", node->GetName().c_str()); | |||
return INTERNAL_ERROR; | |||
} | |||
@@ -297,6 +337,7 @@ Status FoldingPass::RemoveNodeKeepingCtrlEdges(NodePtr &node) { | |||
Status FoldingPass::ConnectNodeToInAnchor(InDataAnchorPtr &in_anchor, NodePtr &node, int node_index) { | |||
// the origin edge must be removed before add | |||
if (in_anchor == nullptr || node == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Param node or in_anchor is nullptr, check invalid"); | |||
GELOGE(PARAM_INVALID, "in anchor or node is null"); | |||
return PARAM_INVALID; | |||
} | |||
@@ -309,6 +350,8 @@ Status FoldingPass::ConnectNodeToInAnchor(InDataAnchorPtr &in_anchor, NodePtr &n | |||
auto new_out_anchor = node->GetOutDataAnchor(node_index); | |||
if (new_out_anchor == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Param out index:%d data anchor of node:%s(%s) is nullptr, check invalid", | |||
node_index, node->GetName().c_str(), node->GetType().c_str()); | |||
GELOGE(INTERNAL_ERROR, | |||
"Failed to add node to in anchor," | |||
" the index %d for node %s, type %s is invalid", | |||
@@ -316,6 +359,10 @@ Status FoldingPass::ConnectNodeToInAnchor(InDataAnchorPtr &in_anchor, NodePtr &n | |||
return INTERNAL_ERROR; | |||
} | |||
if (GraphUtils::AddEdge(new_out_anchor, in_anchor) != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(index:%d) and op:%s(%s)(index:%d) failed", | |||
node->GetName().c_str(), node->GetType().c_str(), node_index, | |||
in_anchor->GetOwnerNode()->GetName().c_str(), in_anchor->GetOwnerNode()->GetType().c_str(), | |||
in_anchor->GetIdx()); | |||
GELOGE(INTERNAL_ERROR, | |||
"Failed to add edge between anchors," | |||
" new node %s, type %s", | |||
@@ -64,12 +64,16 @@ Status ForPass::Run(NodePtr &node) { | |||
ComputeGraphPtr cond_graph = BuildCondGraph(while_info); | |||
if ((cond_graph == nullptr) || (root_graph->AddSubgraph(cond_graph) != GRAPH_SUCCESS)) { | |||
REPORT_CALL_ERROR("E19999", "Build cond graph failed or add cond subgraph to root_graph:%s failed", | |||
root_graph->GetName().c_str()); | |||
GELOGE(FAILED, "Add while_cond_graph failed, node:%s.", node->GetName().c_str()); | |||
return FAILED; | |||
} | |||
ComputeGraphPtr body_graph = BuildBodyGraph(while_info); | |||
if ((body_graph == nullptr) || (root_graph->AddSubgraph(body_graph) != GRAPH_SUCCESS)) { | |||
REPORT_CALL_ERROR("E19999", "Build body graph failed or add body subgraph to root_graph:%s failed", | |||
root_graph->GetName().c_str()); | |||
GELOGE(FAILED, "Add while_body_graph failed, node:%s.", node->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -99,6 +103,10 @@ Status ForPass::BuildForInfo(const ComputeGraphPtr &root_graph, const NodePtr &n | |||
OutDataAnchorPtr limit = FindInputWithIndex(node, FOR_LIMIT_INPUT); | |||
OutDataAnchorPtr delta = FindInputWithIndex(node, FOR_DELTA_INPUT); | |||
if ((start == nullptr) || (limit == nullptr) || (delta == nullptr)) { | |||
REPORT_INNER_ERROR("E19999", "FOR_START_INPUT index:%d or FOR_LIMIT_INPUT index:%d or FOR_DELTA_INPUT index:%d " | |||
"in data anchor of op:%s(%s) lack, check invalid", | |||
FOR_START_INPUT, FOR_LIMIT_INPUT, FOR_DELTA_INPUT, | |||
node->GetName().c_str(), node->GetType().c_str()); | |||
GELOGE(FAILED, "BuildForInfo for %s failed: start/limit/delta is NULL.", node->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -118,11 +126,15 @@ Status ForPass::BuildForInfo(const ComputeGraphPtr &root_graph, const NodePtr &n | |||
// For node has and only has one sub_graph | |||
std::string for_body_name = op_desc->GetSubgraphInstanceName(0); | |||
if (for_body_name.empty()) { | |||
REPORT_INNER_ERROR("E19999", "Get subgraph name from op:%s(%s) by index 0 failed", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(FAILED, "BuildForInfo for %s failed: sub_graph_name is empty.", node->GetName().c_str()); | |||
return FAILED; | |||
} | |||
ComputeGraphPtr for_body = root_graph->GetSubgraph(for_body_name); | |||
if (for_body == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Get subgraph from graph:%s by name:%s failed", | |||
root_graph->GetName().c_str(), for_body_name.c_str()); | |||
GELOGE(FAILED, "BuildForInfo for %s failed: for_body_graph is NULL.", node->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -222,6 +234,8 @@ Status ForPass::TranWhileInfo(const ComputeGraphPtr &graph, const ForInfo &for_i | |||
std::string i_name = for_name + "_i"; | |||
NodePtr i_node = graph->AddNode(CreateConstDesc(i_name, 0)); | |||
if (i_node == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "Add node:%s(Const) to graph:%s failed", | |||
i_name.c_str(), graph->GetName().c_str()); | |||
GELOGE(FAILED, "TranWhileInfo failed: create i_node failed."); | |||
return FAILED; | |||
} | |||
@@ -232,6 +246,9 @@ Status ForPass::TranWhileInfo(const ComputeGraphPtr &graph, const ForInfo &for_i | |||
// Const node has and only has one output, Identity node has and only has one input | |||
if ((identity_node == nullptr) || | |||
(GraphUtils::AddEdge(i_node->GetOutDataAnchor(0), identity_node->GetInDataAnchor(0)) != GRAPH_SUCCESS)) { | |||
REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(index:0) and op:%s(%s)(index:0) failed", | |||
i_node->GetName().c_str(), i_node->GetType().c_str(), | |||
identity_node->GetName().c_str(), identity_node->GetType().c_str()); | |||
GELOGE(FAILED, "TranWhileInfo failed: Add data-edge %s:0->%s:0 failed.", i_name.c_str(), identity_name.c_str()); | |||
return FAILED; | |||
} | |||
@@ -240,6 +257,8 @@ Status ForPass::TranWhileInfo(const ComputeGraphPtr &graph, const ForInfo &for_i | |||
// Identity node has and only has one output | |||
OutDataAnchorPtr i_input = identity_node->GetOutDataAnchor(0); | |||
if (i_input == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Out data anchor index:0 in op:%s(%s) is nullptr, check invalid", | |||
identity_node->GetName().c_str(), identity_node->GetType().c_str()); | |||
GELOGE(FAILED, "TranWhileInfo failed: i_input is NULL."); | |||
return FAILED; | |||
} | |||
@@ -272,6 +291,7 @@ Status ForPass::TranWhileInfo(const ComputeGraphPtr &graph, const ForInfo &for_i | |||
OpDescPtr ForPass::CreateConstDesc(const std::string &name, int32_t value) { | |||
OpDescPtr const_op_desc = MakeShared<OpDesc>(name, CONSTANT); | |||
if (const_op_desc == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "New OpDesc failed"); | |||
GELOGE(FAILED, "Create op_desc failed, const:%s.", name.c_str()); | |||
return nullptr; | |||
} | |||
@@ -279,16 +299,21 @@ OpDescPtr ForPass::CreateConstDesc(const std::string &name, int32_t value) { | |||
GeTensorDesc data_desc(GeShape(), FORMAT_ND, DT_INT32); | |||
GeTensorPtr const_value = MakeShared<GeTensor>(data_desc, reinterpret_cast<uint8_t *>(&value), sizeof(int32_t)); | |||
if (const_value == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "New GeTensor failed"); | |||
GELOGE(FAILED, "Create tensor failed, const:%s.", name.c_str()); | |||
return nullptr; | |||
} | |||
if (!AttrUtils::SetTensor(const_op_desc, ATTR_NAME_WEIGHTS, const_value)) { | |||
REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed", ATTR_NAME_WEIGHTS.c_str(), | |||
const_op_desc->GetName().c_str(), const_op_desc->GetType().c_str()); | |||
GELOGE(FAILED, "Set ATTR_NAME_WEIGHTS failed, const:%s.", name.c_str()); | |||
return nullptr; | |||
} | |||
if (const_op_desc->AddOutputDesc("y", data_desc) != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Add ouput desc to op:%s(%s) failed, name:y", | |||
const_op_desc->GetName().c_str(), const_op_desc->GetType().c_str()); | |||
GELOGE(FAILED, "Add output desc failed, const:%s.", name.c_str()); | |||
return nullptr; | |||
} | |||
@@ -334,6 +359,7 @@ Status ForPass::CreateLoopInput(const ComputeGraphPtr &graph, const ForInfo &for | |||
graphStatus error_code = GRAPH_SUCCESS; | |||
std::string error_msg; | |||
if ((graph_builder.Build(error_code, error_msg) == nullptr) || (error_code != GRAPH_SUCCESS)) { | |||
REPORT_CALL_ERROR("E19999", "Add loop input node to graph:%s failed", graph->GetName().c_str()); | |||
GELOGE(FAILED, "Create loop_count node failed: error_code:%u, error_msg:%s.", error_code, error_msg.c_str()); | |||
return FAILED; | |||
} | |||
@@ -346,6 +372,7 @@ Status ForPass::CreateLoopInput(const ComputeGraphPtr &graph, const ForInfo &for | |||
NodePtr abs_delta_node = graph_builder.GetNode(abs_name_0); | |||
NodePtr loop_count_node = graph_builder.GetNode(abs_name_1); | |||
if ((abs_delta_node == nullptr) || (loop_count_node == nullptr)) { | |||
REPORT_CALL_ERROR("E19999", "Add loop input node to graph:%s failed", graph->GetName().c_str()); | |||
GELOGE(FAILED, "Create loop node failed: node is NULL."); | |||
return FAILED; | |||
} | |||
@@ -431,11 +458,15 @@ Status ForPass::InsertWhileNode(const ComputeGraphPtr &graph, const std::string | |||
OpDescBuilder op_desc_builder(name, WHILE); | |||
OpDescPtr op_desc = op_desc_builder.AddDynamicInput("input", arg_num).AddDynamicOutput("output", arg_num).Build(); | |||
if (op_desc == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "Add dynamic input or output to op:%s(%s) failed", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(FAILED, "Create while op_desc failed, name:%s.", name.c_str()); | |||
return FAILED; | |||
} | |||
NodePtr while_node = graph->AddNode(op_desc); | |||
if (while_node == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "Add node:%s(%s) to graph:%s failed", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), graph->GetName().c_str()); | |||
GELOGE(FAILED, "Create while node failed, name:%s.", name.c_str()); | |||
return FAILED; | |||
} | |||
@@ -553,6 +584,7 @@ ComputeGraphPtr ForPass::BuildCondGraph(WhileInfo &while_info) { | |||
std::string error_msg; | |||
ComputeGraphPtr cond_graph = graph_builder.Build(error_code, error_msg); | |||
if (cond_graph == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "Build graph:%s failed", cond_name.c_str()); | |||
GELOGE(FAILED, "Build cond_graph failed: error_code:%u, error_msg:%s.", error_code, error_msg.c_str()); | |||
return nullptr; | |||
} | |||
@@ -667,6 +699,8 @@ OpDescPtr ForPass::CreateSubgraphOpDesc(const std::string &name, uint32_t input_ | |||
OpDescPtr op_desc = op_desc_builder.Build(); | |||
if (op_desc == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "Build op_desc:%s(%s) failed", | |||
name.c_str(), PARTITIONEDCALL); | |||
GELOGE(FAILED, "Create op_desc for subgraph node failed, name:%s.", name.c_str()); | |||
return nullptr; | |||
} | |||
@@ -34,6 +34,7 @@ using std::string; | |||
namespace ge { | |||
Status FuseDataNodesWithCommonInputPass::Run(ge::ComputeGraphPtr graph) { | |||
if (graph == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Param graph is nullptr, check invalid"); | |||
GELOGE(GE_GRAPH_PARAM_NULLPTR, "Compute graph is null."); | |||
return GE_GRAPH_PARAM_NULLPTR; | |||
} | |||
@@ -101,12 +102,20 @@ Status FuseDataNodesWithCommonInputPass::FuseDataNodes( | |||
first_node->GetName().c_str(), subgraph->GetName().c_str()); | |||
// the data node which can be fused has none input(both data and control in) | |||
if (GraphUtils::MoveOutCtrlEdges(node, first_node) != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Move out control edge from node:%s(%s) to node:%s(%s) failed", | |||
node->GetName().c_str(), node->GetType().c_str(), | |||
first_node->GetName().c_str(), first_node->GetType().c_str()); | |||
return FAILED; | |||
} | |||
if (GraphUtils::ReplaceNodeDataAnchors(first_node, node, {}, {0}) != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Replace data edge from node:%s(%s) to node:%s(%s) failed", | |||
node->GetName().c_str(), node->GetType().c_str(), | |||
first_node->GetName().c_str(), first_node->GetType().c_str()); | |||
return FAILED; | |||
} | |||
if (GraphUtils::RemoveNodeWithoutRelink(subgraph, node) != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Remove node:%s(%s) without relink in graph:%s failed", | |||
node->GetName().c_str(), node->GetType().c_str(), subgraph->GetName().c_str()); | |||
GELOGE(FAILED, "[%s] RemoveNodeWithoutRelink failed.", node->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -51,6 +51,9 @@ Status GetOriginalFormatPass::SetOriginalFormat(const ge::ComputeGraphPtr &graph | |||
GE_CHECK_NOTNULL(node_ptr); | |||
GE_IF_BOOL_EXEC(!AttrUtils::SetInt(node_ptr->GetOpDesc(), ATTR_NAME_INFERRED_FORMAT, DOMI_TENSOR_RESERVED), | |||
REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed", | |||
ATTR_NAME_INFERRED_FORMAT.c_str(), | |||
node_ptr->GetName().c_str(), node_ptr->GetType().c_str()); | |||
GELOGE(FAILED, "set ATTR_NAME_INFERRED_FORMAT failed"); | |||
return FAILED); | |||
} | |||
@@ -64,9 +67,15 @@ Status GetOriginalFormatPass::SetOriginalFormat(const ge::ComputeGraphPtr &graph | |||
GELOGI("Data node: %s,format :%d", node_ptr->GetName().c_str(), GetLocalOmgContext().format); | |||
ori_format = static_cast<int64_t>(GetLocalOmgContext().format); | |||
GE_IF_BOOL_EXEC(!AttrUtils::SetInt(desc_ptr, ATTR_NAME_FORMAT, ori_format), | |||
REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed", | |||
ATTR_NAME_FORMAT.c_str(), | |||
desc_ptr->GetName().c_str(), desc_ptr->GetType().c_str()); | |||
GELOGE(FAILED, "set ATTR_NAME_FORMAT failed"); | |||
return FAILED); | |||
GE_IF_BOOL_EXEC(!AttrUtils::SetInt(desc_ptr, ATTR_NAME_INFERRED_FORMAT, ori_format), | |||
REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed", | |||
ATTR_NAME_INFERRED_FORMAT.c_str(), | |||
desc_ptr->GetName().c_str(), desc_ptr->GetType().c_str()); | |||
GELOGE(FAILED, "set ATTR_NAME_INFERRED_FORMAT failed"); | |||
return FAILED); | |||
continue; | |||
@@ -130,6 +139,9 @@ Status GetOriginalFormatPass::SetOriginalFormat(const ge::ComputeGraphPtr &graph | |||
if (ignore_pred_format) { | |||
GE_IF_BOOL_EXEC(!AttrUtils::SetBool(tmp_op_ptr, ATTR_NAME_IGNORE_PRED_FORMAT, true), | |||
REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed", | |||
ATTR_NAME_IGNORE_PRED_FORMAT.c_str(), | |||
tmp_op_ptr->GetName().c_str(), tmp_op_ptr->GetType().c_str()); | |||
GELOGE(FAILED, "remove edge failed"); | |||
return FAILED); | |||
} | |||
@@ -137,9 +149,15 @@ Status GetOriginalFormatPass::SetOriginalFormat(const ge::ComputeGraphPtr &graph | |||
// Do not reset ATTR_NAME_FORMAT if it is set in the OpParser. | |||
if (!tmp_op_ptr->HasAttr(ATTR_NAME_FORMAT)) { | |||
GE_IF_BOOL_EXEC(!AttrUtils::SetInt(tmp_op_ptr, ATTR_NAME_FORMAT, ori_format), | |||
REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed", | |||
ATTR_NAME_FORMAT.c_str(), | |||
tmp_op_ptr->GetName().c_str(), tmp_op_ptr->GetType().c_str()); | |||
GELOGE(FAILED, "set ATTR_NAME_FORMAT failed"); | |||
return FAILED); | |||
GE_IF_BOOL_EXEC(!AttrUtils::SetInt(tmp_op_ptr, ATTR_NAME_INFERRED_FORMAT, ori_format), | |||
REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed", | |||
ATTR_NAME_INFERRED_FORMAT.c_str(), | |||
tmp_op_ptr->GetName().c_str(), tmp_op_ptr->GetType().c_str()); | |||
GELOGE(FAILED, "set ATTR_NAME_INFERRED_FORMAT failed"); | |||
return FAILED); | |||
} else { | |||
@@ -147,6 +165,9 @@ Status GetOriginalFormatPass::SetOriginalFormat(const ge::ComputeGraphPtr &graph | |||
GE_RETURN_WITH_LOG_IF_FALSE(AttrUtils::GetInt(tmp_op_ptr, ATTR_NAME_FORMAT, existingFormat), | |||
"Get existing_format attr failed"); | |||
if (!AttrUtils::SetInt(tmp_op_ptr, ATTR_NAME_INFERRED_FORMAT, existingFormat)) { | |||
REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed", | |||
ATTR_NAME_INFERRED_FORMAT.c_str(), | |||
tmp_op_ptr->GetName().c_str(), tmp_op_ptr->GetType().c_str()); | |||
GELOGE(FAILED, "set ATTR_NAME_INFERRED_FORMAT failed"); | |||
return FAILED; | |||
} | |||
@@ -34,11 +34,16 @@ NodePtr GlobalStepInsertPass::InsertOp(ComputeGraphPtr &compute_graph, | |||
const std::vector<GeTensorDesc> &input_list, | |||
const std::vector<GeTensorDesc> &output_list) { | |||
OpDescPtr op_desc = MakeShared<OpDesc>(node_name, node_type); | |||
GE_IF_BOOL_EXEC(op_desc == nullptr, GELOGE(FAILED,"Make OpDesc failed"); return nullptr); | |||
GE_IF_BOOL_EXEC(op_desc == nullptr, | |||
REPORT_CALL_ERROR("E19999", "New OpDesc failed"); | |||
GELOGE(FAILED,"Make OpDesc failed"); | |||
return nullptr); | |||
for (auto &input_desc : input_list) { | |||
graphStatus graph_status = op_desc->AddInputDesc(input_desc); | |||
if (graph_status != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Add input desc to op:%s(%s) failed", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(FAILED, "Add node:%s intput desc failed, error=%u.", node_name.c_str(), graph_status); | |||
return nullptr; | |||
} | |||
@@ -47,6 +52,8 @@ NodePtr GlobalStepInsertPass::InsertOp(ComputeGraphPtr &compute_graph, | |||
for (auto &output_desc : output_list) { | |||
graphStatus graph_status = op_desc->AddOutputDesc(output_desc); | |||
if (graph_status != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Add output desc to op:%s(%s) failed", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(FAILED, "Add node:%s output desc failed, error=%u.", node_name.c_str(), graph_status); | |||
return nullptr; | |||
} | |||
@@ -55,6 +62,8 @@ NodePtr GlobalStepInsertPass::InsertOp(ComputeGraphPtr &compute_graph, | |||
GE_IF_BOOL_EXEC(compute_graph == nullptr, GELOGE(FAILED,"compute_graph is nullptr"); return nullptr); | |||
NodePtr node = compute_graph->AddNode(op_desc); | |||
GE_IF_BOOL_EXEC(node == nullptr, | |||
REPORT_CALL_ERROR("E19999", "Add node:%s(%s) to graph:%s failed", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), compute_graph->GetName().c_str()); | |||
GELOGE(FAILED, "add node failed, name:%s, type:%s.", node_name.c_str(), node_type.c_str()); | |||
return nullptr); | |||
@@ -93,6 +102,9 @@ Status GlobalStepInsertPass::Run(ComputeGraphPtr compute_graph) { | |||
// add ctrl edges | |||
graphStatus add_ret = GraphUtils::AddEdge(global_step->GetOutControlAnchor(), output_node->GetInControlAnchor()); | |||
if (add_ret != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Add control edge between op:%s(%s) and op:%s(%s) failed", | |||
global_step->GetName().c_str(), global_step->GetType().c_str(), | |||
output_node->GetName().c_str(), output_node->GetType().c_str()); | |||
GELOGE(FAILED, "Add global_step to netoutput edge failed, add_ret=%u.", add_ret); | |||
return FAILED; | |||
} | |||
@@ -24,6 +24,7 @@ | |||
#include "graph/common/omg_util.h" | |||
#include "graph/utils/attr_utils.h" | |||
#include "graph/utils/graph_utils.h" | |||
#include "graph/utils/type_utils.h" | |||
namespace ge { | |||
namespace { | |||
@@ -35,6 +36,8 @@ Status GuaranteeConstPass::Run(NodePtr &node) { | |||
string type; | |||
Status status_ret = GetOriginalType(node, type); | |||
if (status_ret != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Get original type for node:%s failed", | |||
node->GetName().c_str()); | |||
GELOGE(status_ret, "GuaranteeConstPass get original type fail."); | |||
return status_ret; | |||
} | |||
@@ -42,6 +45,9 @@ Status GuaranteeConstPass::Run(NodePtr &node) { | |||
return SUCCESS; | |||
} | |||
if (node->GetOpDesc()->GetAllInputsDesc().size() != kGuaranteeConstInputsSize) { | |||
REPORT_CALL_ERROR("E19999", "Num:%zu of input desc node:%s(%s) not equal to %u, " | |||
"check invalid", node->GetOpDesc()->GetAllInputsDesc().size(), | |||
node->GetName().c_str(), node->GetType().c_str(), kGuaranteeConstInputsSize); | |||
GELOGE(PARAM_INVALID, "input size error. Input size:%zu", node->GetOpDesc()->GetAllInputsDesc().size()); | |||
return PARAM_INVALID; | |||
} | |||
@@ -51,6 +57,11 @@ Status GuaranteeConstPass::Run(NodePtr &node) { | |||
// Input tensor cannot be a resource variable handle. | |||
const DataType &input_dtype = in_desc->GetDataType(); | |||
if (input_dtype == DT_RESOURCE) { | |||
REPORT_CALL_ERROR("E19999", | |||
"Data type:%s of op:%s(%s) input0 tensor not equal to %s, check invalid", | |||
TypeUtils::DataTypeToSerialString(input_dtype).c_str(), | |||
node->GetName().c_str(), node->GetType().c_str(), | |||
TypeUtils::DataTypeToSerialString(DT_RESOURCE).c_str()); | |||
GELOGE(FAILED, "Input tensor cannot be a resource variable handle in [%s].", node->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -36,6 +36,8 @@ Status HcclContinuousMemcpyPass::Run(ge::ComputeGraphPtr graph) { | |||
for (const auto &node : graph->GetDirectNode()) { | |||
auto op_desc = node->GetOpDesc(); | |||
if (op_desc == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Node with nullptr op_desc exist in Param graph:%s, check invalid", | |||
graph->GetName().c_str()); | |||
GELOGE(INTERNAL_ERROR, "node has no op_desc, node_name : %s.", node->GetName().c_str()); | |||
return INTERNAL_ERROR; | |||
} | |||
@@ -76,6 +78,9 @@ Status HcclContinuousMemcpyPass::ContinuousInputProcess(const ComputeGraphPtr &g | |||
} | |||
auto src_out_anchor = hccl_in_anchor->GetPeerOutAnchor(); | |||
if (src_out_anchor == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Node:%s(%s) input:%d anchor, peer anchor is nullptr, check invalid", | |||
node->GetName().c_str(), node->GetType().c_str(), | |||
hccl_in_anchor->GetIdx()); | |||
GELOGE(INTERNAL_ERROR, "hcom op input has no peer anchor, node_name:%s", node->GetName().c_str()); | |||
return INTERNAL_ERROR; | |||
} | |||
@@ -115,6 +120,9 @@ Status HcclContinuousMemcpyPass::P2pmemInputProcess(const ComputeGraphPtr &graph | |||
} | |||
auto src_out_anchor = hccl_in_anchor->GetPeerOutAnchor(); | |||
if (src_out_anchor == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Node:%s(%s) input:%u anchor, peer anchor is nullptr, check invalid", | |||
node->GetName().c_str(), node->GetType().c_str(), | |||
index); | |||
GELOGE(INTERNAL_ERROR, "hcom op input has no peer anchor, node_name:%s", node->GetName().c_str()); | |||
return INTERNAL_ERROR; | |||
} | |||
@@ -146,6 +154,7 @@ NodePtr HcclContinuousMemcpyPass::CreateIdentityNode(const ComputeGraphPtr &grap | |||
NodePtr pre_node = out_data_anchor->GetOwnerNode(); | |||
OpDescPtr pre_op_desc = pre_node->GetOpDesc(); | |||
if (pre_op_desc == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "OpDesc in node is nullptr, check invalid"); | |||
GELOGE(INTERNAL_ERROR, "OpDesc of pre node is invalid."); | |||
return nullptr; | |||
} | |||
@@ -154,6 +163,7 @@ NodePtr HcclContinuousMemcpyPass::CreateIdentityNode(const ComputeGraphPtr &grap | |||
node_name = CheckDuplicateName(node_name); | |||
OpDescPtr op_desc = MakeShared<OpDesc>(node_name.c_str(), IDENTITY); | |||
if (op_desc == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "New OpDesc failed"); | |||
GELOGE(INTERNAL_ERROR, "Create Identity op: MakeShared op_desc fail."); | |||
return nullptr; | |||
} | |||
@@ -161,12 +171,16 @@ NodePtr HcclContinuousMemcpyPass::CreateIdentityNode(const ComputeGraphPtr &grap | |||
graphStatus ret = op_desc->AddInputDesc("x", pre_op_desc->GetOutputDesc(out_data_anchor->GetIdx())); | |||
if (ret != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Add input desc to op:%s(%s) failed", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Create Identity op: add input desc fail."); | |||
return nullptr; | |||
} | |||
ret = op_desc->AddOutputDesc("y", pre_op_desc->GetOutputDesc(out_data_anchor->GetIdx())); | |||
if (ret != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Add output desc to op:%s(%s) failed", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Create Identity op: add output desc fail."); | |||
return nullptr; | |||
} | |||
@@ -175,6 +189,8 @@ NodePtr HcclContinuousMemcpyPass::CreateIdentityNode(const ComputeGraphPtr &grap | |||
NodePtr memcpy_node = graph->AddNode(op_desc); | |||
if (memcpy_node == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "Add node:%s(%s) to graph:%s failed", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), graph->GetName().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Insert Identity node fail."); | |||
return nullptr; | |||
} | |||
@@ -247,6 +263,13 @@ Status HcclContinuousMemcpyPass::InsertIdentityBeforeHccl(const ComputeGraphPtr | |||
Status ret1 = src_out_anchor->Unlink(hccl_in_anchor); | |||
if (ret1 != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", | |||
"Op:%s(%s) out index:%d unlink from op:%s(%s) in index:%d failed", | |||
src_out_anchor->GetOwnerNode()->GetName().c_str(), | |||
src_out_anchor->GetOwnerNode()->GetType().c_str(), src_out_anchor->GetIdx(), | |||
hccl_in_anchor->GetOwnerNode()->GetName().c_str(), | |||
hccl_in_anchor->GetOwnerNode()->GetType().c_str(), | |||
hccl_in_anchor->GetIdx()); | |||
GELOGE(INTERNAL_ERROR, "The op %s Unlink anchor %s fail.", src_out_anchor->GetOwnerNode()->GetName().c_str(), | |||
hccl_in_anchor->GetOwnerNode()->GetName().c_str()); | |||
return FAILED; | |||
@@ -255,6 +278,13 @@ Status HcclContinuousMemcpyPass::InsertIdentityBeforeHccl(const ComputeGraphPtr | |||
GE_CHECK_NOTNULL(out_data_anchor_0); | |||
ret1 = out_data_anchor_0->LinkTo(hccl_in_anchor); | |||
if (ret1 != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", | |||
"Op:%s(%s) out index:%d link to op:%s(%s) in index:%d failed", | |||
out_data_anchor_0->GetOwnerNode()->GetName().c_str(), | |||
out_data_anchor_0->GetOwnerNode()->GetType().c_str(), out_data_anchor_0->GetIdx(), | |||
hccl_in_anchor->GetOwnerNode()->GetName().c_str(), | |||
hccl_in_anchor->GetOwnerNode()->GetType().c_str(), | |||
hccl_in_anchor->GetIdx()); | |||
GELOGE(INTERNAL_ERROR, "The op %s link anchor %s fail.", memcpy_node->GetName().c_str(), | |||
hccl_in_anchor->GetOwnerNode()->GetName().c_str()); | |||
return FAILED; | |||
@@ -262,6 +292,12 @@ Status HcclContinuousMemcpyPass::InsertIdentityBeforeHccl(const ComputeGraphPtr | |||
Status ret = src_out_anchor->LinkTo(memcpy_node->GetInDataAnchor(kAnchorNum)); | |||
if (ret != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", | |||
"Op:%s(%s) out index:%d link to op:%s(%s) in index:%u failed", | |||
src_out_anchor->GetOwnerNode()->GetName().c_str(), | |||
src_out_anchor->GetOwnerNode()->GetType().c_str(), src_out_anchor->GetIdx(), | |||
memcpy_node->GetName().c_str(), memcpy_node->GetType().c_str(), | |||
kAnchorNum); | |||
GELOGE(INTERNAL_ERROR, "The op %s link anchor %s fail.", src_out_anchor->GetOwnerNode()->GetName().c_str(), | |||
memcpy_node->GetName().c_str()); | |||
return FAILED; | |||
@@ -307,6 +343,12 @@ Status HcclContinuousMemcpyPass::InsertAssignAfterBroadcastIfNeed(const ComputeG | |||
Status ret = hccl_out_anchor->LinkTo(assign_node->GetInDataAnchor(kAnchorAssignValueIndex)); | |||
if (ret != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", | |||
"Op:%s(%s) out index:%d link to op:%s(%s) in index:%u failed", | |||
hccl_out_anchor->GetOwnerNode()->GetName().c_str(), | |||
hccl_out_anchor->GetOwnerNode()->GetType().c_str(), hccl_out_anchor->GetIdx(), | |||
assign_node->GetName().c_str(), assign_node->GetType().c_str(), | |||
kAnchorAssignValueIndex); | |||
GELOGE(INTERNAL_ERROR, "The op %s link anchor %s fail.", hccl_out_anchor->GetOwnerNode()->GetName().c_str(), | |||
assign_node->GetName().c_str()); | |||
return FAILED; | |||
@@ -314,6 +356,12 @@ Status HcclContinuousMemcpyPass::InsertAssignAfterBroadcastIfNeed(const ComputeG | |||
ret = var_out_anchor->LinkTo(assign_node->GetInDataAnchor(kAnchorAssignRefIndex)); | |||
if (ret != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", | |||
"Op:%s(%s) out index:%d link to op:%s(%s) in index:%u failed", | |||
var_out_anchor->GetOwnerNode()->GetName().c_str(), | |||
var_out_anchor->GetOwnerNode()->GetType().c_str(), var_out_anchor->GetIdx(), | |||
assign_node->GetName().c_str(), assign_node->GetType().c_str(), | |||
kAnchorAssignRefIndex); | |||
GELOGE(INTERNAL_ERROR, "The op %s link anchor %s fail.", var_out_anchor->GetOwnerNode()->GetName().c_str(), | |||
assign_node->GetName().c_str()); | |||
return FAILED; | |||
@@ -328,7 +376,12 @@ Status HcclContinuousMemcpyPass::InsertAssignAfterBroadcastIfNeed(const ComputeG | |||
continue; | |||
} | |||
ret = assign_out_control_anchor->LinkTo(in_data_anchor->GetOwnerNode()->GetInControlAnchor()); | |||
if (ret != SUCCESS) { | |||
if (ret != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Op:%s(%s) link control to op:%s(%s) failed", | |||
assign_out_control_anchor->GetOwnerNode()->GetName().c_str(), | |||
assign_out_control_anchor->GetOwnerNode()->GetType().c_str(), | |||
in_data_anchor->GetOwnerNode()->GetName().c_str(), | |||
in_data_anchor->GetOwnerNode()->GetType().c_str()); | |||
GELOGE(INTERNAL_ERROR, "The op %s link control anchor %s fail.", | |||
assign_out_control_anchor->GetOwnerNode()->GetName().c_str(), | |||
in_data_anchor->GetOwnerNode()->GetName().c_str()); | |||
@@ -342,6 +395,11 @@ Status HcclContinuousMemcpyPass::InsertAssignAfterBroadcastIfNeed(const ComputeG | |||
} | |||
ret = assign_out_control_anchor->LinkTo(in_control_anchor); | |||
if (ret != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Op:%s(%s) link control to op:%s(%s) failed", | |||
assign_out_control_anchor->GetOwnerNode()->GetName().c_str(), | |||
assign_out_control_anchor->GetOwnerNode()->GetType().c_str(), | |||
in_control_anchor->GetOwnerNode()->GetName().c_str(), | |||
in_control_anchor->GetOwnerNode()->GetType().c_str()); | |||
GELOGE(INTERNAL_ERROR, "The op %s link control anchor %s fail.", | |||
assign_out_control_anchor->GetOwnerNode()->GetName().c_str(), | |||
in_control_anchor->GetOwnerNode()->GetName().c_str()); | |||
@@ -363,6 +421,7 @@ NodePtr HcclContinuousMemcpyPass::CreateAssignNode(const ComputeGraphPtr &graph, | |||
NodePtr pre_node = out_data_anchor->GetOwnerNode(); | |||
OpDescPtr pre_op_desc = pre_node->GetOpDesc(); | |||
if (pre_op_desc == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "OpDesc in node is nullptr, check invalid"); | |||
GELOGE(INTERNAL_ERROR, "OpDesc of pre node is invalid."); | |||
return nullptr; | |||
} | |||
@@ -371,36 +430,48 @@ NodePtr HcclContinuousMemcpyPass::CreateAssignNode(const ComputeGraphPtr &graph, | |||
node_name = CheckDuplicateName(node_name); | |||
OpDescPtr op_desc = MakeShared<OpDesc>(node_name.c_str(), ASSIGN); | |||
if (op_desc == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "New OpDesc failed"); | |||
GELOGE(INTERNAL_ERROR, "Create Assign op: MakeShared op_desc fail."); | |||
return nullptr; | |||
} | |||
GELOGI("Create Assign op:%s.", op_desc->GetName().c_str()); | |||
if (!AttrUtils::SetBool(op_desc, ATTR_NEED_COMPILE, true)) { | |||
REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed", | |||
ATTR_NEED_COMPILE.c_str(), | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Set ATTR_NEED_COMPILE Attr for node:%s fail.", op_desc->GetName().c_str()); | |||
return nullptr; | |||
} | |||
graphStatus ret = op_desc->AddInputDesc("ref", pre_op_desc->GetOutputDesc(out_data_anchor->GetIdx())); | |||
if (ret != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Add input desc to op:%s(%s) failed, name:ref", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Create Assign op: add ref input desc fail."); | |||
return nullptr; | |||
} | |||
ret = op_desc->AddInputDesc("value", pre_op_desc->GetOutputDesc(out_data_anchor->GetIdx())); | |||
if (ret != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Add input desc to op:%s(%s) failed, name:value", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Create Assign op: add value input desc fail."); | |||
return nullptr; | |||
} | |||
ret = op_desc->AddOutputDesc("ref", pre_op_desc->GetOutputDesc(out_data_anchor->GetIdx())); | |||
if (ret != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Add output desc to op:%s(%s) failed, name:ref", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Create Assign op: add output desc fail."); | |||
return nullptr; | |||
} | |||
NodePtr assign_node = graph->AddNode(op_desc); | |||
if (assign_node == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "Add node:%s(%s) to graph:%s failed", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), graph->GetName().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Insert Identity node fail."); | |||
return nullptr; | |||
} | |||
@@ -38,6 +38,8 @@ Status HcclMemcpyPass::Run(ge::ComputeGraphPtr graph) { | |||
for (const auto &node : graph->GetDirectNode()) { | |||
auto op_desc = node->GetOpDesc(); | |||
if (op_desc == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Node with nullptr op_desc exist in Param graph:%s, check invalid", | |||
graph->GetName().c_str()); | |||
GELOGE(INTERNAL_ERROR, "node has no op_desc, node_name : %s.", node->GetName().c_str()); | |||
return INTERNAL_ERROR; | |||
} | |||
@@ -64,6 +66,8 @@ Status HcclMemcpyPass::MutableInputProcess(const ComputeGraphPtr &graph, const N | |||
} | |||
if (!AttrUtils::GetBool(op_desc, kInputMutable, node_input_mutable)) { | |||
REPORT_CALL_ERROR("E19999", "Get Attr:%s from op:%s(%s) failed", kInputMutable, | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(INTERNAL_ERROR, "node:%s get attr:_input_mutable failed.", node->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -116,6 +120,7 @@ NodePtr HcclMemcpyPass::CreateIdentityNode(const ComputeGraphPtr &graph, const O | |||
NodePtr pre_node = out_data_anchor->GetOwnerNode(); | |||
OpDescPtr pre_op_desc = pre_node->GetOpDesc(); | |||
if (pre_op_desc == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "OpDesc in node is nullptr, check invalid"); | |||
GELOGE(INTERNAL_ERROR, "OpDesc of pre node is invalid."); | |||
return nullptr; | |||
} | |||
@@ -124,6 +129,7 @@ NodePtr HcclMemcpyPass::CreateIdentityNode(const ComputeGraphPtr &graph, const O | |||
node_name = CheckDuplicateName(node_name); | |||
OpDescPtr op_desc = MakeShared<OpDesc>(node_name.c_str(), IDENTITY); | |||
if (op_desc == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "New OpDesc failed"); | |||
GELOGE(INTERNAL_ERROR, "Create Identity op: MakeShared op_desc fail."); | |||
return nullptr; | |||
} | |||
@@ -131,12 +137,16 @@ NodePtr HcclMemcpyPass::CreateIdentityNode(const ComputeGraphPtr &graph, const O | |||
graphStatus ret = op_desc->AddInputDesc("x", pre_op_desc->GetOutputDesc(out_data_anchor->GetIdx())); | |||
if (ret != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Add input desc to op:%s(%s) failed, name:x", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Create Identity op: add input desc fail."); | |||
return nullptr; | |||
} | |||
ret = op_desc->AddOutputDesc("y", pre_op_desc->GetOutputDesc(out_data_anchor->GetIdx())); | |||
if (ret != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Add output desc to op:%s(%s) failed, name:y", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Create Identity op: add output desc fail."); | |||
return nullptr; | |||
} | |||
@@ -145,6 +155,8 @@ NodePtr HcclMemcpyPass::CreateIdentityNode(const ComputeGraphPtr &graph, const O | |||
NodePtr memcpy_node = graph->AddNode(op_desc); | |||
if (memcpy_node == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "Add node:%s(%s) to graph:%s failed", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), graph->GetName().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Insert Identity node fail."); | |||
return nullptr; | |||
} | |||
@@ -215,6 +227,12 @@ Status HcclMemcpyPass::InsertIdentityBeforeHccl(const ComputeGraphPtr &graph, co | |||
Status ret1 = src_out_anchor->Unlink(hccl_in_anchor); | |||
if (ret1 != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", | |||
"Op:%s(%s) out index:%d unlink from op:%s(%s) in index:%d failed", | |||
src_out_anchor->GetOwnerNode()->GetName().c_str(), | |||
src_out_anchor->GetOwnerNode()->GetType().c_str(), src_out_anchor->GetIdx(), | |||
hccl_in_anchor->GetOwnerNode()->GetName().c_str(), | |||
hccl_in_anchor->GetOwnerNode()->GetType().c_str(), hccl_in_anchor->GetIdx()); | |||
GELOGE(INTERNAL_ERROR, "The op %s Unlink anchor %s fail.", src_out_anchor->GetOwnerNode()->GetName().c_str(), | |||
hccl_in_anchor->GetOwnerNode()->GetName().c_str()); | |||
return FAILED; | |||
@@ -223,6 +241,13 @@ Status HcclMemcpyPass::InsertIdentityBeforeHccl(const ComputeGraphPtr &graph, co | |||
GE_CHECK_NOTNULL(out_data_anchor_0); | |||
ret1 = out_data_anchor_0->LinkTo(hccl_in_anchor); | |||
if (ret1 != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", | |||
"Op:%s(%s) out index:%d link to op:%s(%s) in index:%d failed", | |||
out_data_anchor_0->GetOwnerNode()->GetName().c_str(), | |||
out_data_anchor_0->GetOwnerNode()->GetType().c_str(), out_data_anchor_0->GetIdx(), | |||
hccl_in_anchor->GetOwnerNode()->GetName().c_str(), | |||
hccl_in_anchor->GetOwnerNode()->GetType().c_str(), | |||
hccl_in_anchor->GetIdx()); | |||
GELOGE(INTERNAL_ERROR, "The op %s link anchor %s fail.", memcpy_node->GetName().c_str(), | |||
hccl_in_anchor->GetOwnerNode()->GetName().c_str()); | |||
return FAILED; | |||
@@ -230,6 +255,12 @@ Status HcclMemcpyPass::InsertIdentityBeforeHccl(const ComputeGraphPtr &graph, co | |||
Status ret = src_out_anchor->LinkTo(memcpy_node->GetInDataAnchor(kAnchorNum)); | |||
if (ret != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", | |||
"Op:%s(%s) out index:%d link to op:%s(%s) in index:%u failed", | |||
src_out_anchor->GetOwnerNode()->GetName().c_str(), | |||
src_out_anchor->GetOwnerNode()->GetType().c_str(), src_out_anchor->GetIdx(), | |||
memcpy_node->GetName().c_str(), memcpy_node->GetType().c_str(), | |||
kAnchorNum); | |||
GELOGE(INTERNAL_ERROR, "The op %s link anchor %s fail.", src_out_anchor->GetOwnerNode()->GetName().c_str(), | |||
memcpy_node->GetName().c_str()); | |||
return FAILED; | |||
@@ -275,6 +306,12 @@ Status HcclMemcpyPass::InsertAssignAfterBroadcastIfNeed(const ComputeGraphPtr &g | |||
Status ret = hccl_out_anchor->LinkTo(assign_node->GetInDataAnchor(kAnchorAssignValueIndex)); | |||
if (ret != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", | |||
"Op:%s(%s) out index:%d link to op:%s(%s) in index:%u failed", | |||
hccl_out_anchor->GetOwnerNode()->GetName().c_str(), | |||
hccl_out_anchor->GetOwnerNode()->GetType().c_str(), hccl_out_anchor->GetIdx(), | |||
assign_node->GetName().c_str(), assign_node->GetType().c_str(), | |||
kAnchorAssignValueIndex); | |||
GELOGE(INTERNAL_ERROR, "The op %s link anchor %s fail.", hccl_out_anchor->GetOwnerNode()->GetName().c_str(), | |||
assign_node->GetName().c_str()); | |||
return FAILED; | |||
@@ -282,6 +319,12 @@ Status HcclMemcpyPass::InsertAssignAfterBroadcastIfNeed(const ComputeGraphPtr &g | |||
ret = var_out_anchor->LinkTo(assign_node->GetInDataAnchor(kAnchorAssignRefIndex)); | |||
if (ret != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", | |||
"Op:%s(%s) out index:%d link to op:%s(%s) in index:%u failed", | |||
var_out_anchor->GetOwnerNode()->GetName().c_str(), | |||
var_out_anchor->GetOwnerNode()->GetType().c_str(), var_out_anchor->GetIdx(), | |||
assign_node->GetName().c_str(), assign_node->GetType().c_str(), | |||
kAnchorAssignRefIndex); | |||
GELOGE(INTERNAL_ERROR, "The op %s link anchor %s fail.", var_out_anchor->GetOwnerNode()->GetName().c_str(), | |||
assign_node->GetName().c_str()); | |||
return FAILED; | |||
@@ -296,7 +339,14 @@ Status HcclMemcpyPass::InsertAssignAfterBroadcastIfNeed(const ComputeGraphPtr &g | |||
continue; | |||
} | |||
ret = assign_out_control_anchor->LinkTo(in_data_anchor->GetOwnerNode()->GetInControlAnchor()); | |||
if (ret != SUCCESS) { | |||
if (ret != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", | |||
"Op:%s(%s) out index:%d link to op:%s(%s) in index:%d failed", | |||
assign_out_control_anchor->GetOwnerNode()->GetName().c_str(), | |||
assign_out_control_anchor->GetOwnerNode()->GetType().c_str(), assign_out_control_anchor->GetIdx(), | |||
in_data_anchor->GetOwnerNode()->GetName().c_str(), | |||
in_data_anchor->GetOwnerNode()->GetType().c_str(), | |||
in_data_anchor->GetIdx()); | |||
GELOGE(INTERNAL_ERROR, "The op %s link control anchor %s fail.", | |||
assign_out_control_anchor->GetOwnerNode()->GetName().c_str(), | |||
in_data_anchor->GetOwnerNode()->GetName().c_str()); | |||
@@ -310,6 +360,11 @@ Status HcclMemcpyPass::InsertAssignAfterBroadcastIfNeed(const ComputeGraphPtr &g | |||
} | |||
ret = assign_out_control_anchor->LinkTo(in_control_anchor); | |||
if (ret != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Op:%s(%s) link control to op:%s(%s) failed", | |||
assign_out_control_anchor->GetOwnerNode()->GetName().c_str(), | |||
assign_out_control_anchor->GetOwnerNode()->GetType().c_str(), | |||
in_control_anchor->GetOwnerNode()->GetName().c_str(), | |||
in_control_anchor->GetOwnerNode()->GetType().c_str()); | |||
GELOGE(INTERNAL_ERROR, "The op %s link control anchor %s fail.", | |||
assign_out_control_anchor->GetOwnerNode()->GetName().c_str(), | |||
in_control_anchor->GetOwnerNode()->GetName().c_str()); | |||
@@ -330,6 +385,7 @@ NodePtr HcclMemcpyPass::CreateAssignNode(const ComputeGraphPtr &graph, const Out | |||
NodePtr pre_node = out_data_anchor->GetOwnerNode(); | |||
OpDescPtr pre_op_desc = pre_node->GetOpDesc(); | |||
if (pre_op_desc == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "OpDesc in node is nullptr, check invalid"); | |||
GELOGE(INTERNAL_ERROR, "OpDesc of pre node is invalid."); | |||
return nullptr; | |||
} | |||
@@ -338,6 +394,7 @@ NodePtr HcclMemcpyPass::CreateAssignNode(const ComputeGraphPtr &graph, const Out | |||
node_name = CheckDuplicateName(node_name); | |||
OpDescPtr op_desc = MakeShared<OpDesc>(node_name.c_str(), ASSIGN); | |||
if (op_desc == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "New OpDesc failed"); | |||
GELOGE(INTERNAL_ERROR, "Create Assign op: MakeShared op_desc fail."); | |||
return nullptr; | |||
} | |||
@@ -345,24 +402,32 @@ NodePtr HcclMemcpyPass::CreateAssignNode(const ComputeGraphPtr &graph, const Out | |||
graphStatus ret = op_desc->AddInputDesc("ref", pre_op_desc->GetOutputDesc(out_data_anchor->GetIdx())); | |||
if (ret != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Add input desc to op:%s(%s) failed, name:ref", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Create Assign op: add ref input desc fail."); | |||
return nullptr; | |||
} | |||
ret = op_desc->AddInputDesc("value", pre_op_desc->GetOutputDesc(out_data_anchor->GetIdx())); | |||
if (ret != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Add input desc to op:%s(%s) failed, name:value", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Create Assign op: add value input desc fail."); | |||
return nullptr; | |||
} | |||
ret = op_desc->AddOutputDesc("ref", pre_op_desc->GetOutputDesc(out_data_anchor->GetIdx())); | |||
if (ret != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Add output desc to op:%s(%s) failed, name:ref", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Create Assign op: add output desc fail."); | |||
return nullptr; | |||
} | |||
NodePtr assign_node = graph->AddNode(op_desc); | |||
if (assign_node == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "Add node:%s(%s) to graph:%s failed", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str(), graph->GetName().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Insert Identity node fail."); | |||
return nullptr; | |||
} | |||
@@ -99,6 +99,8 @@ Status IdentityPass::Run(NodePtr &node) { | |||
string type; | |||
Status status_ret = GetOriginalType(node, type); | |||
if (status_ret != SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Get original type for node:%s failed", | |||
node->GetName().c_str()); | |||
GELOGE(status_ret, "Identity pass get original type fail."); | |||
return status_ret; | |||
} | |||
@@ -118,6 +120,9 @@ Status IdentityPass::Run(NodePtr &node) { | |||
} | |||
size_t n = node->GetOpDesc()->GetOutputsSize(); | |||
if (node->GetOpDesc()->GetInputsSize() != n) { | |||
REPORT_CALL_ERROR("E19999", "Num:%zu of input desc node:%s(%s) not equal to it's output desc num:%zu, " | |||
"check invalid", node->GetOpDesc()->GetInputsSize(), | |||
node->GetName().c_str(), node->GetType().c_str(), n); | |||
GELOGE(PARAM_INVALID, "Identity input / output size must be equal. in size:%lu, out size:%lu", | |||
node->GetOpDesc()->GetInputsSize(), n); | |||
return PARAM_INVALID; | |||
@@ -22,8 +22,58 @@ | |||
#include "framework/common/util.h" | |||
#include "graph/shape_refiner.h" | |||
#include "graph/utils/graph_utils.h" | |||
#include "utils/tensor_utils.h" | |||
#include "utils/type_utils.h" | |||
namespace ge { | |||
void SerialShapeRange(const GeTensorDescPtr &desc, std::string &desc_str) { | |||
desc_str += "["; | |||
std::vector<std::pair<int64_t, int64_t>> shape_range; | |||
(void)desc->GetShapeRange(shape_range); | |||
for (const auto &pair : shape_range) { | |||
desc_str += "{"; | |||
desc_str += std::to_string(pair.first) + "," + std::to_string(pair.second); | |||
desc_str += "},"; | |||
} | |||
desc_str += "]"; | |||
shape_range.clear(); | |||
(void)desc->GetOriginShapeRange(shape_range); | |||
for (const auto &pair : shape_range) { | |||
desc_str += ",{"; | |||
desc_str += std::to_string(pair.first) + "," + std::to_string(pair.second); | |||
desc_str += "},"; | |||
} | |||
} | |||
std::string GetInTensorInfoWithString(const ge::NodePtr &node) { | |||
ge::OpDescPtr op_desc = node->GetOpDesc(); | |||
std::stringstream ss; | |||
ss << "{"; | |||
int32_t in_idx = 0; | |||
for (const auto &input_desc : op_desc->GetAllInputsDescPtr()) { | |||
if (input_desc == nullptr) { | |||
in_idx++; | |||
continue; | |||
} | |||
if (in_idx > 0) { | |||
ss << " "; | |||
} | |||
ss << "input_" << in_idx << " " << "tensor: ["; | |||
ss << "(shape:[" << input_desc->MutableShape().ToString() << "]),"; | |||
ss << "(format:" << TypeUtils::FormatToSerialString(input_desc->GetFormat()) << "),"; | |||
ss << "(dtype:" << TypeUtils::DataTypeToSerialString(input_desc->GetDataType()) << "),"; | |||
ss << "(origin_shape:" << input_desc->GetOriginShape().ToString() << "),"; | |||
ss << "(origin_format:" << TypeUtils::FormatToSerialString(input_desc->GetOriginFormat()) << "),"; | |||
ss << "(origin_dtype:" << TypeUtils::DataTypeToSerialString(input_desc->GetOriginDataType()) << "),"; | |||
string range_str; | |||
SerialShapeRange(input_desc, range_str); | |||
ss << "(shape_range:" << range_str << ")]"; | |||
in_idx++; | |||
} | |||
return ss.str(); | |||
} | |||
Status InferShapePass::Run(NodePtr &node) { | |||
// kOptimizeAfterSubGraph exist means after subgraph | |||
auto ret = ShapeRefiner::InferShapeAndType(node, !OptionExists(kOptimizeAfterSubGraph)); | |||
@@ -39,6 +89,8 @@ Status InferShapePass::Run(NodePtr &node) { | |||
(void)Analyzer::GetInstance()->SaveAnalyzerDataToFile(root_graph->GetSessionID(), | |||
root_graph->GetGraphID()); | |||
REPORT_CALL_ERROR("E19999", "Call InferShapeAndType for node:%s(%s) failed, input_tensor:%s", | |||
node->GetName().c_str(), node->GetType().c_str(), GetInTensorInfoWithString(node).c_str()); | |||
GELOGE(GE_GRAPH_INFERSHAPE_FAILED, "infershape failed. node: %s", node->GetName().c_str()); | |||
return GE_GRAPH_INFERSHAPE_FAILED; | |||
} | |||
@@ -69,6 +69,9 @@ Status InplaceSupportCheckPass::Run(NodePtr &node) { | |||
GELOGD("add attr INPLACE_SUPPORT_INPUT_INDEX on node %s, input_idx=%d", node->GetName().c_str(), inplace_input_idx); | |||
if (!AttrUtils::SetInt(node->GetOpDesc()->MutableOutputDesc(kInplaceSupportOutputIndex), | |||
INPLACE_SUPPORT_INPUT_INDEX, inplace_input_idx)) { | |||
REPORT_CALL_ERROR("E19999", "Set Attr:%s to output:%u tensor of op:%s(%s) failed", | |||
INPLACE_SUPPORT_INPUT_INDEX.c_str(), kInplaceSupportOutputIndex, | |||
node->GetName().c_str(), node->GetType().c_str()); | |||
GELOGE(FAILED, "Set attr INPLACE_SUPPORT_INPUT_INDEX on node %s failed.", node->GetName().c_str()); | |||
return FAILED; | |||
} | |||
@@ -42,11 +42,14 @@ inline bool IsDataOp(const std::string &node_type) { | |||
Status InputOutputConnectionIdentifyPass::Run(ComputeGraphPtr graph) { | |||
if (graph == nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Param graph is nullptr, check invalid"); | |||
GELOGE(PARAM_INVALID, "Input param graph is null, skip identification of nodes that connect to input and output."); | |||
return PARAM_INVALID; | |||
} | |||
if (graph->GetParentGraph() != nullptr) { | |||
REPORT_INNER_ERROR("E19999", "Param graph's parent graph is nullptr, " | |||
"check invalid"); | |||
GELOGD("Current graph %s is a subgraph, skip identification of nodes that connect to input and output.", | |||
graph->GetName().c_str()); | |||
return SUCCESS; | |||
@@ -54,11 +57,15 @@ Status InputOutputConnectionIdentifyPass::Run(ComputeGraphPtr graph) { | |||
GELOGD("Start to identify nodes that connect to input and output."); | |||
if (graph->TopologicalSorting() != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Topological Sorting graph:%s failed", | |||
graph->GetName().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Graph topological sort failed."); | |||
return INTERNAL_ERROR; | |||
} | |||
if (GraphUtils::GetRefMapping(graph, symbol_to_anchors_, anchor_to_symbol_) != GRAPH_SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Get ref mapping from graph:%s failed", | |||
graph->GetName().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Get ref-mapping for graph %s failed.", graph->GetName().c_str()); | |||
return INTERNAL_ERROR; | |||
} | |||
@@ -125,6 +132,8 @@ Status InputOutputConnectionIdentifyPass::UpdateNodeIdxMap(const string &symbol_ | |||
map<NodePtr, vector<uint32_t>> &connect_output_node_idx) { | |||
auto symbol_iter = symbol_to_anchors_.find(symbol_string); | |||
if (symbol_iter == symbol_to_anchors_.end()) { | |||
REPORT_CALL_ERROR("E19999", "Can't find symbol:%s in symbol_to_anchors map, check invalid", | |||
symbol_string.c_str()); | |||
GELOGE(PARAM_INVALID, "Input param symbol string: %s is invalid.", symbol_string.c_str()); | |||
return PARAM_INVALID; | |||
} | |||
@@ -171,6 +180,9 @@ Status InputOutputConnectionIdentifyPass::SetNodeAttrOfConnectingInputOutput( | |||
GE_CHECK_NOTNULL(iter.first); | |||
if (iter.first->GetOpDesc() != nullptr) { | |||
if (!AttrUtils::SetListInt(iter.first->GetOpDesc(), ATTR_NAME_NODE_CONNECT_INPUT, iter.second)) { | |||
REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed", | |||
ATTR_NAME_NODE_CONNECT_INPUT.c_str(), | |||
iter.first->GetName().c_str(), iter.first->GetType().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Failed to set attr %s for node %s.", ATTR_NAME_NODE_CONNECT_INPUT.c_str(), | |||
iter.first->GetName().c_str()); | |||
return INTERNAL_ERROR; | |||
@@ -182,6 +194,9 @@ Status InputOutputConnectionIdentifyPass::SetNodeAttrOfConnectingInputOutput( | |||
GE_CHECK_NOTNULL(iter.first); | |||
if (iter.first->GetOpDesc() != nullptr) { | |||
if (!AttrUtils::SetListInt(iter.first->GetOpDesc(), ATTR_NAME_NODE_CONNECT_OUTPUT, iter.second)) { | |||
REPORT_CALL_ERROR("E19999", "Set Attr:%s to op:%s(%s) failed", | |||
ATTR_NAME_NODE_CONNECT_OUTPUT.c_str(), | |||
iter.first->GetName().c_str(), iter.first->GetType().c_str()); | |||
GELOGE(INTERNAL_ERROR, "Failed to set attr %s for node %s.", ATTR_NAME_NODE_CONNECT_OUTPUT.c_str(), | |||
iter.first->GetName().c_str()); | |||
return INTERNAL_ERROR; | |||
@@ -55,20 +55,36 @@ Status IteratorOpPass::Run(ge::ComputeGraphPtr graph) { | |||
if (type == "IteratorV2" || type == "Iterator" || op_type == kGetNext) { | |||
ge::NodePtr memcpy_async_node = InsertMemcpyAsyncNode(node, graph); | |||
GE_CHECK_NOTNULL(memcpy_async_node); | |||
GE_CHK_STATUS_RET(SetCycleEvent(memcpy_async_node), "Set cycle event fail, node:%s", | |||
memcpy_async_node->GetName().c_str()); | |||
auto status = SetCycleEvent(memcpy_async_node); | |||
if (status != ge::SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Set cycle event to op:%s(%s) failed", | |||
memcpy_async_node->GetName().c_str(), memcpy_async_node->GetType().c_str()); | |||
GELOGE(status, "Set cycle event failed."); | |||
return status; | |||
} | |||
GE_CHK_STATUS_RET(SetStreamLabel(memcpy_async_node, memcpy_async_node->GetName()), | |||
"Set stream label fail, node:%s", node->GetName().c_str()); | |||
status = SetStreamLabel(memcpy_async_node, memcpy_async_node->GetName()); | |||
if (status != ge::SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Set stream label:%s to op:%s(%s) failed", | |||
memcpy_async_node->GetName().c_str(), memcpy_async_node->GetName().c_str(), | |||
memcpy_async_node->GetType().c_str()); | |||
GELOGE(status, "set stream label failed."); | |||
return status; | |||
} | |||
GE_CHK_STATUS_RET(SetStreamLabel(node, node->GetName()), "Set stream label fail, node:%s", | |||
node->GetName().c_str()); | |||
status = SetStreamLabel(node, node->GetName()); | |||
if (status != ge::SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Set stream label:%s to op:%s(%s) failed", | |||
node->GetName().c_str(), node->GetName().c_str(), node->GetType().c_str()); | |||
GELOGE(status, "set stream label failed."); | |||
return status; | |||
} | |||
GELOGI("Set independent loop for iterator node success"); | |||
int64_t loop_per_iter = 0; | |||
ge::GeTensorDesc ge_tensor_desc; | |||
Status status = VarManager::Instance(graph->GetSessionID())->GetCurVarDesc(NODE_NAME_FLOWCTRL_LOOP_PER_ITER, | |||
status = VarManager::Instance(graph->GetSessionID())->GetCurVarDesc(NODE_NAME_FLOWCTRL_LOOP_PER_ITER, | |||
ge_tensor_desc); | |||
GE_IF_BOOL_EXEC(status != SUCCESS, GELOGW("Fail to Get var_desc of NODE_NAME_FLOWCTRL_LOOP_PER_ITER failed."); | |||
continue); | |||
@@ -92,8 +108,14 @@ Status IteratorOpPass::Run(ge::ComputeGraphPtr graph) { | |||
if (loop_per_iter == kMaxIterationsPerLoop) { | |||
ge::NodePtr end_of_sequence_node = InsertEndOfSequenceNode(node, memcpy_async_node, graph); | |||
GE_CHECK_NOTNULL(end_of_sequence_node); | |||
GE_CHK_STATUS_RET(SetStreamLabel(end_of_sequence_node, end_of_sequence_node->GetName()), | |||
"Set stream label fail, node:%s", node->GetName().c_str()); | |||
status = SetStreamLabel(end_of_sequence_node, end_of_sequence_node->GetName()); | |||
if (status != ge::SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Set stream label:%s to op:%s(%s) failed", | |||
end_of_sequence_node->GetName().c_str(), end_of_sequence_node->GetName().c_str(), | |||
end_of_sequence_node->GetType().c_str()); | |||
GELOGE(status, "set stream label failed."); | |||
return status; | |||
} | |||
GELOGI("Insert EndOfSequence node success."); | |||
} | |||
} | |||
@@ -110,8 +132,13 @@ Status IteratorOpPass::GetVariableValue(uint64_t session_id, const ge::GeTensorD | |||
GE_CHECK_NOTNULL(var_mem_base); | |||
// offset + logic_base | |||
uint8_t *dev_ptr = nullptr; | |||
GE_CHK_STATUS_RET(VarManager::Instance(session_id)->GetVarAddr(var_name, tensor_desc, &dev_ptr), | |||
"Get variable %s address failed.", var_name.c_str()); | |||
auto status = VarManager::Instance(session_id)->GetVarAddr(var_name, tensor_desc, &dev_ptr); | |||
if (status != ge::SUCCESS) { | |||
REPORT_CALL_ERROR("E19999", "Get Var add by name:%s failed, session_id:%lu", | |||
var_name.c_str(), session_id); | |||
GELOGE(status, "Get variable %s address failed.", var_name.c_str()); | |||
return status; | |||
} | |||
int64_t offset = static_cast<int64_t>(reinterpret_cast<intptr_t>(dev_ptr)); | |||
// logic_base_addr | |||
auto logic_var_base = VarManager::Instance(session_id)->GetVarMemLogicBase(); | |||
@@ -144,7 +171,11 @@ ge::NodePtr IteratorOpPass::InsertEndOfSequenceNode(const ge::NodePtr &pre_node, | |||
auto out_anchor = pre_node->GetOutDataAnchor(0); | |||
ge::graphStatus status; | |||
status = GraphUtils::AddEdge(out_anchor, end_of_seq_node->GetInDataAnchor(0)); | |||
GE_CHK_BOOL_EXEC(status == GRAPH_SUCCESS, return nullptr, | |||
GE_CHK_BOOL_EXEC(status == GRAPH_SUCCESS, | |||
REPORT_CALL_ERROR("E19999", "Add edge between op:%s(%s)(index:0) and op:%s(%s)(index:0) failed", | |||
pre_node->GetName().c_str(), pre_node->GetType().c_str(), | |||
end_of_seq_node->GetName().c_str(), end_of_seq_node->GetType().c_str()); | |||
return nullptr, | |||
"Graph add EndOfSequence op input edge fail, dst node: %s.", | |||
end_of_seq_node->GetName().c_str()); | |||
// EOS(control) --> subsequent of memcpy | |||
@@ -157,7 +188,11 @@ ge::NodePtr IteratorOpPass::InsertEndOfSequenceNode(const ge::NodePtr &pre_node, | |||
continue; | |||
} | |||
status = GraphUtils::AddEdge(out_ctrl_anchor, in_ctrl_anchor); | |||
GE_CHK_BOOL_EXEC(status == GRAPH_SUCCESS, return nullptr, | |||
GE_CHK_BOOL_EXEC(status == GRAPH_SUCCESS, | |||
REPORT_CALL_ERROR("E19999", "Add control edge between op:%s(%s) and op:%s(%s) failed", | |||
end_of_seq_node->GetName().c_str(), end_of_seq_node->GetType().c_str(), | |||
out_node->GetName().c_str(), out_node->GetType().c_str()); | |||
return nullptr, | |||
"Graph add EndOfSequence op out ctrl edge fail, dst node: %s.", | |||
out_node->GetName().c_str()); | |||
GELOGI("Graph add EndOfSequence op out ctrl edge, dst node: %s.", | |||
@@ -175,19 +210,27 @@ ge::NodePtr IteratorOpPass::InsertEndOfSequenceNode(const ge::NodePtr &pre_node, | |||
/// | |||
ge::OpDescPtr IteratorOpPass::CreateEndOfSequenceOp(const ge::NodePtr &pre_node) { | |||
GELOGI("Start to create endOfSequence op."); | |||
GE_CHK_BOOL_EXEC(pre_node != nullptr, return nullptr, "Input param invalid."); | |||
GE_CHK_BOOL_EXEC(pre_node != nullptr, | |||
REPORT_INNER_ERROR("E19999", "Param pre_node is nullptr, check invalid"); | |||
return nullptr, "Input param invalid."); | |||
string node_name = pre_node->GetName() + "_EndOfSequence"; | |||
ge::OpDescPtr op_desc = MakeShared<OpDesc>(node_name, ENDOFSEQUENCE); | |||
if (op_desc == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "New OpDesc failed"); | |||
GELOGE(FAILED, "MakeShared fail."); | |||
return op_desc; | |||
} | |||
ge::OpDescPtr pre_node_op_desc = pre_node->GetOpDesc(); | |||
GE_CHK_BOOL_EXEC(pre_node_op_desc != nullptr, return nullptr, "OpDesc of pre_node is invalid."); | |||
GE_CHK_BOOL_EXEC(pre_node_op_desc != nullptr, | |||
REPORT_INNER_ERROR("E19999", "OpDesc in node is nullptr, check invalid"); | |||
return nullptr, "OpDesc of pre_node is invalid."); | |||
GELOGI("Create EndOfSequence op:%s.", op_desc->GetName().c_str()); | |||
GE_CHK_BOOL_EXEC(op_desc->AddInputDesc(pre_node_op_desc->GetOutputDesc(0)) == GRAPH_SUCCESS, return nullptr, | |||
GE_CHK_BOOL_EXEC(op_desc->AddInputDesc(pre_node_op_desc->GetOutputDesc(0)) == GRAPH_SUCCESS, | |||
REPORT_CALL_ERROR("E19999", "Add input desc to op:%s(%s) failed", | |||
op_desc->GetName().c_str(), op_desc->GetType().c_str()); | |||
return nullptr, | |||
"Create EndOfSequence op:add input desc fail."); | |||
return op_desc; | |||
} | |||
@@ -205,7 +248,11 @@ ge::NodePtr IteratorOpPass::InsertMemcpyAsyncNode(const ge::NodePtr &pre_node, c | |||
ge::OpDescPtr memcpy_async_op_desc = CreateMemcpyAsyncOp(pre_node); | |||
GE_CHK_BOOL_EXEC(memcpy_async_op_desc != nullptr, GELOGW("Create memcpyAsync op fail."); return nullptr); | |||
ge::NodePtr memcpy_async_node = graph->AddNode(memcpy_async_op_desc); | |||
GE_CHK_BOOL_EXEC(memcpy_async_node != nullptr, return nullptr, "Insert mencpy node fail."); | |||
GE_CHK_BOOL_EXEC(memcpy_async_node != nullptr, | |||
REPORT_CALL_ERROR("E19999", "Add node:%s(%s) to graph:%s failed", | |||
memcpy_async_op_desc->GetName().c_str(), memcpy_async_op_desc->GetType().c_str(), | |||
graph->GetName().c_str()); | |||
return nullptr, "Insert mencpy node fail."); | |||
// Data out | |||
for (auto &out_anchor : pre_node->GetAllOutDataAnchors()) { | |||
@@ -217,9 +264,24 @@ ge::NodePtr IteratorOpPass::InsertMemcpyAsyncNode(const ge::NodePtr &pre_node, c | |||
for (auto &peer_in_anchor : out_anchor->GetPeerInDataAnchors()) { | |||
GE_IF_BOOL_EXEC(peer_in_anchor == nullptr, GELOGW("peer_in_anchor is nullptr"); return nullptr); | |||
status = GraphUtils::RemoveEdge(out_anchor, peer_in_anchor); | |||
GE_CHK_BOOL_EXEC(status == GRAPH_SUCCESS, return nullptr, "Remove edge failed, index:%d.", out_anchor->GetIdx()); | |||
GE_CHK_BOOL_EXEC(status == GRAPH_SUCCESS, | |||
REPORT_CALL_ERROR( | |||
"E19999", "Remove edge between op:%s(%s)(index:%d) and op:%s(%s)(index:%d) failed", | |||
pre_node->GetName().c_str(), pre_node->GetType().c_str(), out_anchor->GetIdx(), | |||
peer_in_anchor->GetOwnerNode()->GetName().c_str(), | |||
peer_in_anchor->GetOwnerNode()->GetType().c_str(), | |||
peer_in_anchor->GetIdx()); | |||
return nullptr, "Remove edge failed, index:%d.", out_anchor->GetIdx()); | |||
status = GraphUtils::AddEdge(memcpy_async_node->GetOutDataAnchor(out_anchor->GetIdx()), peer_in_anchor); | |||
GE_CHK_BOOL_EXEC(status == GRAPH_SUCCESS, return nullptr, | |||
GE_CHK_BOOL_EXEC(status == GRAPH_SUCCESS, | |||
REPORT_CALL_ERROR( | |||
"E19999", "Add edge between op:%s(%s)(index:%d) and op:%s(%s)(index:%d) failed", | |||
memcpy_async_node->GetName().c_str(), memcpy_async_node->GetType().c_str(), | |||
out_anchor->GetIdx(), | |||
peer_in_anchor->GetOwnerNode()->GetName().c_str(), | |||
peer_in_anchor->GetOwnerNode()->GetType().c_str(), | |||
peer_in_anchor->GetIdx()); | |||
return nullptr, | |||
"Graph add memcpyAsync op out edge fail, src index:%d, dst index:%d, dst node: %s.", | |||
out_anchor->GetIdx(), peer_in_anchor->GetIdx(), | |||
peer_in_anchor->GetOwnerNode()->GetName().c_str()); | |||
@@ -227,7 +289,13 @@ ge::NodePtr IteratorOpPass::InsertMemcpyAsyncNode(const ge::NodePtr &pre_node, c | |||
peer_in_anchor->GetIdx(), peer_in_anchor->GetOwnerNode()->GetName().c_str()); | |||
} | |||
status = GraphUtils::AddEdge(out_anchor, memcpy_async_node->GetInDataAnchor(out_anchor->GetIdx())); | |||
GE_CHK_BOOL_EXEC(status == GRAPH_SUCCESS, return nullptr, "Graph add memcpyAsync op in edge fail, index:%d.", | |||
GE_CHK_BOOL_EXEC(status == GRAPH_SUCCESS, | |||
REPORT_CALL_ERROR( | |||
"E19999", "Add edge between op:%s(%s)(index:%d) and op:%s(%s)(index:%d) failed", | |||
pre_node->GetName().c_str(), pre_node->GetType().c_str(), out_anchor->GetIdx(), | |||
memcpy_async_node->GetName().c_str(), memcpy_async_node->GetType().c_str(), | |||
out_anchor->GetIdx()); | |||
return nullptr, "Graph add memcpyAsync op in edge fail, index:%d.", | |||
out_anchor->GetIdx()); | |||
} | |||
// Control out | |||
@@ -235,10 +303,22 @@ ge::NodePtr IteratorOpPass::InsertMemcpyAsyncNode(const ge::NodePtr &pre_node, c | |||
GE_IF_BOOL_EXEC(out_ctrl_anchor != nullptr, | |||
for (auto &peer_in_ctrl_anchor : out_ctrl_anchor->GetPeerInControlAnchors()) { | |||
ge::graphStatus status = GraphUtils::RemoveEdge(out_ctrl_anchor, peer_in_ctrl_anchor); | |||
GE_CHK_BOOL_EXEC(status == GRAPH_SUCCESS, return nullptr, "Remove edge failed, dst node: %s.", | |||
GE_CHK_BOOL_EXEC(status == GRAPH_SUCCESS, | |||
REPORT_CALL_ERROR( | |||
"E19999", "Remove control edge between op:%s(%s) and op:%s(%s) failed", | |||
pre_node->GetName().c_str(), pre_node->GetType().c_str(), | |||
peer_in_ctrl_anchor->GetOwnerNode()->GetName().c_str(), | |||
peer_in_ctrl_anchor->GetOwnerNode()->GetType().c_str()); | |||
return nullptr, "Remove edge failed, dst node: %s.", | |||
peer_in_ctrl_anchor->GetOwnerNode()->GetName().c_str()); | |||
status = GraphUtils::AddEdge(memcpy_async_node->GetOutControlAnchor(), peer_in_ctrl_anchor); | |||
GE_CHK_BOOL_EXEC(status == GRAPH_SUCCESS, return nullptr, | |||
GE_CHK_BOOL_EXEC(status == GRAPH_SUCCESS, | |||
REPORT_CALL_ERROR( | |||
"E19999", "Add control edge between op:%s(%s) and op:%s(%s) failed", | |||
memcpy_async_node->GetName().c_str(), memcpy_async_node->GetType().c_str(), | |||
peer_in_ctrl_anchor->GetOwnerNode()->GetName().c_str(), | |||
peer_in_ctrl_anchor->GetOwnerNode()->GetType().c_str()); | |||
return nullptr, | |||
"Graph add memcpyAsync op out ctrl edge fail, dst node: %s.", | |||
peer_in_ctrl_anchor->GetOwnerNode()->GetName().c_str()); | |||
GELOGI("Graph add memcpyAsync op out ctrl edge, dst node: %s.", | |||
@@ -261,20 +341,29 @@ ge::OpDescPtr IteratorOpPass::CreateMemcpyAsyncOp(const ge::NodePtr &pre_node) { | |||
string node_name = pre_node->GetName() + "_MemcpyAsync"; | |||
ge::OpDescPtr op_desc = MakeShared<OpDesc>(node_name.c_str(), MEMCPYASYNC); | |||
if (op_desc == nullptr) { | |||
REPORT_CALL_ERROR("E19999", "New OpDesc failed"); | |||
GELOGE(FAILED, "MakeShared fail."); | |||
return op_desc; | |||
} | |||
GELOGI("Create memcpyAsync op:%s.", op_desc->GetName().c_str()); | |||
ge::OpDescPtr pre_node_op_desc = pre_node->GetOpDesc(); | |||
GE_CHK_BOOL_EXEC(pre_node_op_desc != nullptr, return nullptr, "OpDesc of pre_node is invalid."); | |||
GE_CHK_BOOL_EXEC(pre_node_op_desc != nullptr, | |||
REPORT_INNER_ERROR("E19999", "OpDesc in node is nullptr, check invalid"); | |||
return nullptr, "OpDesc of pre_node is invalid."); | |||
size_t out_size = pre_node_op_desc->GetOutputsSize(); | |||
GELOGI("Create memcpyAsync op, pre_node out_size: %zu.", out_size); | |||
for (size_t i = 0; i < out_size; i++) { | |||
GE_CHK_BOOL_EXEC(op_desc->AddInputDesc(pre_node_op_desc->GetOutputDesc(i)) == GRAPH_SUCCESS, return nullptr, | |||
GE_CHK_BOOL_EXEC(op_desc->AddInputDesc(pre_node_op_desc->GetOutputDesc(i)) == GRAPH_SUCCESS, | |||
REPORT_CALL_ERROR("E19999", "Add input desc to op:%s(%s) failed", | |||
pre_node_op_desc->GetName().c_str(), pre_node_op_desc->GetType().c_str()); | |||
return nullptr, | |||
"Create memcpyAsync op:add input desc fail."); | |||
GE_CHK_BOOL_EXEC(op_desc->AddOutputDesc(pre_node_op_desc->GetOutputDesc(i)) == GRAPH_SUCCESS, return nullptr, | |||
GE_CHK_BOOL_EXEC(op_desc->AddOutputDesc(pre_node_op_desc->GetOutputDesc(i)) == GRAPH_SUCCESS, | |||
REPORT_CALL_ERROR("E19999", "Add output desc to op:%s(%s) failed", | |||
pre_node_op_desc->GetName().c_str(), pre_node_op_desc->GetType().c_str()); | |||
return nullptr, | |||
"Create memcpyAsync op:add output desc fail."); | |||
} | |||