modify geloge and add err report

pull/1389/head
liudingyan 4 years ago
parent d85228d6fb
commit 9a7cb76cb9

@ -38,9 +38,11 @@ AllocationAttr::AllocationAttr(void *try_reuse_addr) : AllocationAttr(0, try_reu
NpuMemoryAllocator *NpuMemoryAllocator::GetAllocator() {
int32_t device_id = 0;
if (rtGetDevice(&device_id) != RT_ERROR_NONE) {
GELOGE(RT_FAILED, "[Get][Device] Failed.");
REPORT_INNER_ERROR("E19999", "rtGetDevice failed when %s.", __FUNCTION__);
auto rt_result = rtGetDevice(&device_id);
if (rt_result != RT_ERROR_NONE) {
GELOGE(RT_FAILED, "[Get][Device] Failed, result:%d.", rt_result);
REPORT_INNER_ERROR("E19999", "rtGetDevice failed when NpuMemoryAllocator %s, result:%d.",
__FUNCTION__, rt_result);
return nullptr;
}

@ -59,8 +59,7 @@ Status GraphExecutionContext::Synchronize(rtStream_t rt_stream) {
return SUCCESS;
}
GELOGE(RT_FAILED,
"[Invoke][rtStreamSynchronize] failed, ret = %d", rt_ret);
GELOGE(RT_FAILED, "[Invoke][rtStreamSynchronize] failed, ret = %d", rt_ret);
REPORT_CALL_ERROR("E19999",
"invoke rtStreamSynchronize failed when GraphExecutionContext %s, ret = %d", __FUNCTION__, rt_ret);
return RT_FAILED;

@ -51,7 +51,7 @@ void HybridModelAsyncExecutor::SetModelName(const string &model_name) {
}
Status HybridModelAsyncExecutor::EnqueueData(const shared_ptr<InputDataWrapper> &data) {
if(data_inputer_->Push(data) != SUCCESS){
if (data_inputer_->Push(data) != SUCCESS) {
REPORT_CALL_ERROR("E19999", "Data queue is full, please call again later when %s, model_id %u.",
__FUNCTION__, model_id_);
GELOGE(domi::DATA_QUEUE_ISFULL,
@ -65,9 +65,9 @@ Status HybridModelAsyncExecutor::EnqueueData(const shared_ptr<InputDataWrapper>
Status HybridModelAsyncExecutor::Start(const std::shared_ptr<ModelListener> &listener) {
GELOGD("HybridModelExecutor::Start IN, has listener = %d", listener != nullptr);
std::lock_guard<std::mutex> lk(mu_);
if(run_flag_){
REPORT_INNER_ERROR("E19999", "Model already started when HybridModelAsyncExecutor %s, model_id:%u.",
__FUNCTION__, model_id_);
if (run_flag_) {
REPORT_INNER_ERROR("E19999",
"Model already started when HybridModelAsyncExecutor %s, model_id:%u.", __FUNCTION__, model_id_);
GELOGE(INTERNAL_ERROR, "[Check][RunState] Model already started, model_id:%u.", model_id_);
return INTERNAL_ERROR;
}
@ -318,7 +318,7 @@ Status HybridModelAsyncExecutor::PrepareInputs(const InputData &current_data, Hy
const DataBuffer &data_buf = blobs[input_index];
auto mem_size = static_cast<uint64_t>(tensor_size);
if(mem_size < data_buf.length){
if (mem_size < data_buf.length) {
REPORT_INNER_ERROR("E19999",
"input data size(%lu) does not match model required size(%lu) when %s, ret failed, model_id = %u.",
data_buf.length, mem_size, __FUNCTION__, model_id_);

@ -59,9 +59,9 @@ Status StageExecutor::Start(const std::vector<TensorValue> &inputs, const std::v
task_queue_.Pop(task_info);
GELOGD("[Executor: %d] Got task, stage = %d, iteration = %ld", id_, task_info.stage, task_info.iteration);
if (task_info.iteration >= pipe_config_->iteration_end) {
GELOGE(INTERNAL_ERROR, "[Check][Range][Executor: %d] Unexpected iteration: %d.",
GELOGE(INTERNAL_ERROR, "[Check][Range][Executor: %d] Unexpected iteration: %ld.",
id_, task_info.iteration);
REPORT_INNER_ERROR("E19999", "[Executor: %d] Unexpected iteration: %d when StageExecutor %s.",
REPORT_INNER_ERROR("E19999", "[Executor: %d] Unexpected iteration: %ld when StageExecutor %s.",
id_, task_info.iteration, __FUNCTION__);
return INTERNAL_ERROR;
}
@ -69,11 +69,11 @@ Status StageExecutor::Start(const std::vector<TensorValue> &inputs, const std::v
if (task_info.event != nullptr) {
GELOGD("[%d] Add StreamWaitEvent", id_);
GE_CHK_RT_RET(rtStreamWaitEvent(stream_, task_info.event));
RECORD_MODEL_EXECUTION_EVENT(&context_, "[iteration = %d] [Stage = %d] End", task_info.iteration - 1,
RECORD_MODEL_EXECUTION_EVENT(&context_, "[iteration = %ld] [Stage = %d] End", task_info.iteration - 1,
task_info.stage);
}
RECORD_MODEL_EXECUTION_EVENT(&context_, "[iteration = %d] [Stage = %d] Start", task_info.iteration,
RECORD_MODEL_EXECUTION_EVENT(&context_, "[iteration = %lld] [Stage = %d] Start", task_info.iteration,
task_info.stage);
if (task_info.stage == 0) {
@ -97,9 +97,9 @@ Status StageExecutor::Start(const std::vector<TensorValue> &inputs, const std::v
auto sync_result = Synchronize();
if (sync_result != SUCCESS) {
GELOGE(sync_result,
"[Invoke][Synchronize][Executor: %d] Failed to sync result:%d. iteration = %d",
"[Invoke][Synchronize][Executor: %d] Failed to sync result:%d. iteration = %ld",
id_, sync_result, task_info.iteration);
REPORT_CALL_ERROR("E19999", "[Executor: %d] Failed to sync result:%d when StageExecutor %s. iteration = %d",
REPORT_CALL_ERROR("E19999", "[Executor: %d] Failed to sync result:%d when StageExecutor %s. iteration = %ld",
id_, sync_result, __FUNCTION__, task_info.iteration);
context_.profiler->Dump(std::cout);
context_.callback_manager->Destroy();
@ -107,11 +107,11 @@ Status StageExecutor::Start(const std::vector<TensorValue> &inputs, const std::v
return sync_result;
}
RECORD_MODEL_EXECUTION_EVENT(&context_, "[iteration = %d] [Stage = %d] End", task_info.iteration, task_info.stage);
RECORD_MODEL_EXECUTION_EVENT(&context_, "[iteration = %ld] [Stage = %d] End", task_info.iteration, task_info.stage);
// if not end stage
if (task_info.stage >= pipe_config_->num_stages - 1) {
RECORD_MODEL_EXECUTION_EVENT(&context_, "[iteration = %d] Schedule End", task_info.iteration);
RECORD_MODEL_EXECUTION_EVENT(&context_, "[iteration = %ld] Schedule End", task_info.iteration);
GELOGD("[Executor: %d] End of iteration [%ld]", id_, task_info.iteration);
context_.callback_manager->Destroy();
RuntimeInferenceContext::DestroyContext(std::to_string(context_.context_id));

@ -50,10 +50,10 @@ NodeStatePtr SubgraphContext::GetOrCreateNodeState(const NodeItem *node_item) {
Status SubgraphContext::SetInput(int index, const TensorValue &tensor) {
if (static_cast<size_t>(index) >= all_inputs_.size()) {
GELOGE(INTERNAL_ERROR,
"[Check][Param:index]output index output range. all input num = %zu, input index = %d",
"[Check][Param:index]input index out of range. all input num = %zu, input index = %d",
all_inputs_.size(), index);
REPORT_INNER_ERROR("E19999",
"input param index out range when SubgraphContext %s, all input num = %zu, input index = %d.",
"input param index out of range when SubgraphContext %s, all input num = %zu, input index = %d.",
__FUNCTION__, all_inputs_.size(), index);
return INTERNAL_ERROR;
}
@ -70,9 +70,9 @@ Status SubgraphContext::SetOutput(const NodeItem &node_item, int output_index, c
auto index = node_item.output_start + output_index;
if ((output_index >= node_item.num_outputs) || (static_cast<size_t>(index) >= all_outputs_.size())) {
GELOGE(INTERNAL_ERROR,
"[Check][Param:output_index]output index output range. all output num = %zu, node_item = %s,"
"[Check][Param:output_index]output index out of range. all output num = %zu, node_item = %s,"
"output index = %d.", all_outputs_.size(), node_item.DebugString().c_str(), output_index);
REPORT_INNER_ERROR("E19999", "output index output range when SubgraphContext %s. "
REPORT_INNER_ERROR("E19999", "output index out of range when SubgraphContext %s. "
"all output num = %zu, node_item = %s, output index = %d.",
__FUNCTION__, all_outputs_.size(), node_item.DebugString().c_str(), output_index);
return INTERNAL_ERROR;
@ -129,9 +129,10 @@ Status SubgraphContext::Await(const NodePtr &node) {
void SubgraphContext::OnError(Status error) {
if (error != END_OF_SEQUENCE) {
GELOGE(error, "[Check][Param:error][%s] Error occurred while executing graph.", graph_item_->GetName().c_str());
REPORT_INNER_ERROR("E19999", "[%s] Error occurred while executing graph when SubgraphContext %s.",
graph_item_->GetName().c_str(), __FUNCTION__);
GELOGE(error, "[Check][Param:error][%s] Error:%d occurred while executing graph.",
graph_item_->GetName().c_str(), error);
REPORT_INNER_ERROR("E19999", "[%s] Error:%d occurred while executing graph when SubgraphContext %s.",
graph_item_->GetName().c_str(), error, __FUNCTION__);
}
node_done_manager_.Destroy();
}

@ -72,7 +72,8 @@ Status SubgraphExecutor::InitInputsForUnknownShape(const std::vector<TensorValue
"[Check][Size][%s] Number of inputs [%zu] is not sufficient for subgraph which needs [%zu] inputs.",
graph_item_->GetName().c_str(), inputs.size(), input_nodes.size());
REPORT_INNER_ERROR("E19999",
"Number of inputs [%zu] is not sufficient for subgraph which needs [%zu] inputs when SubgraphExecutor %s.",
"[%s] Number of inputs [%zu] is not sufficient for subgraph which needs [%zu] inputs,"
"check invalid when SubgraphExecutor %s.",
graph_item_->GetName().c_str(), inputs.size(), input_nodes.size(), __FUNCTION__);
return INTERNAL_ERROR;
}
@ -118,7 +119,8 @@ Status SubgraphExecutor::InitInputsForKnownShape(const std::vector<TensorValue>
"[Check][Size][%s] Number of inputs [%zu] is not sufficient for subgraph which needs at lease [%d] inputs",
graph_item_->GetName().c_str(), inputs.size(), parent_input_index + 1);
REPORT_INNER_ERROR("E19999",
"[%s] Number of inputs [%zu] is not sufficient for subgraph which needs at lease [%d] inputs when %s.",
"[%s] Number of inputs [%zu] is not sufficient for subgraph which needs at lease [%d] inputs,"
"check invalid when %s.",
graph_item_->GetName().c_str(), inputs.size(), parent_input_index + 1, __FUNCTION__);
return INTERNAL_ERROR;
}
@ -387,9 +389,10 @@ Status SubgraphExecutor::GetOutputs(vector<TensorValue> &outputs, std::vector<Co
"[Invoke][GetOutputDescList][%s] Failed to get output tensor desc.", graph_item_->GetName().c_str());
if (outputs.size() != output_desc.size()) {
GELOGE(INTERNAL_ERROR,
"[Check][Size]Number of output tensors(%zu) mismatch number of output tensor desc(%zu).",
"[Check][Size]Number of outputs(%zu) mismatch number of output_desc(%zu).",
outputs.size(), output_desc.size());
REPORT_INNER_ERROR("E19999", "Number of output tensors(%zu) mismatch number of output tensor desc(%zu) when %s.",
REPORT_INNER_ERROR("E19999", "Number of outputs(%zu) mismatch number of output_desc(%zu),"
"check invlid when SubgraphExecutor %s.",
outputs.size(), output_desc.size(), __FUNCTION__);
return INTERNAL_ERROR;
}
@ -413,9 +416,11 @@ Status SubgraphExecutor::SetOutputsToParentNode(TaskContext &task_context) {
"[Invoke][GetOutputDescList][%s] Failed to get output tensor desc.", graph_item_->GetName().c_str());
if (outputs.size() != output_desc_list.size()) {
GELOGE(INTERNAL_ERROR, "[Check][Size][%s] num output tensors = %zu, num output tensor desc = %zu",
GELOGE(INTERNAL_ERROR, "[Check][Size][%s] num of output tensors = %zu, num of output tensor desc = %zu not equal",
graph_item_->GetName().c_str(), outputs.size(), output_desc_list.size());
REPORT_INNER_ERROR("E19999", "[%s] num output tensors = %zu, num output tensor desc = %zu when %s",
REPORT_INNER_ERROR("E19999",
"%s num of output tensors = %zu, num of output tensor desc = %zu not equal,"
"check invalid when SubgraphExecutor %s",
graph_item_->GetName().c_str(), outputs.size(), output_desc_list.size(), __FUNCTION__);
return INTERNAL_ERROR;
}

@ -300,22 +300,23 @@ Status ShapeInferenceEngine::CalcOutputTensorSizes(const NodeItem &node_item, bo
const auto &shape = tensor_desc->MutableShape();
// modify on copy
auto dims = shape.GetDims();
auto _status = CanonicalizeShape(*tensor_desc, dims, fallback_with_range);
if(_status != SUCCESS){
REPORT_CALL_ERROR("E19999", "Invoke CanonicalizeShape failed when ShapeInferenceEngine %s, node:%s, output:%zu.",
auto status_result = CanonicalizeShape(*tensor_desc, dims, fallback_with_range);
if (status_result != SUCCESS) {
REPORT_CALL_ERROR("E19999",
"Invoke CanonicalizeShape failed when ShapeInferenceEngine %s, node:%s, output:%zu.",
node_item.NodeName().c_str(), __FUNCTION__, output_index);
GELOGE(ge::FAILED, "[Canonicalize][Shape] failed for [%s], output %zu.",
node_item.NodeName().c_str(), output_index);
return _status;
return status_result;
}
int64_t tensor_size;
_status = CalcTensorSize(tensor_desc->GetDataType(), dims, tensor_size);
if(_status != SUCCESS){
status_result = CalcTensorSize(tensor_desc->GetDataType(), dims, tensor_size);
if (status_result != SUCCESS) {
REPORT_CALL_ERROR("E19999", "Invoke CalcTensorSize failed when ShapeInferenceEngine %s, node:%s, output:%zu.",
node_item.NodeName().c_str(), __FUNCTION__, output_index);
GELOGE(ge::FAILED, "[Calc][TensorSize] failed for [%s], output %zu.",
node_item.NodeName().c_str(), output_index);
return _status;
return status_result;
}
GELOGD("[%s] Tensor size of output %zu = %ld", node_item.NodeName().c_str(), output_index, tensor_size);
(void) TensorUtils::SetSize(*tensor_desc, tensor_size);

@ -96,7 +96,7 @@ Status GraphItem::GroupNodes() {
if (group != last_group) {
if (seen_groups.find(group) != seen_groups.end()) {
GELOGE(INTERNAL_ERROR,
"[Order][NodeGroup]Unordered node group found. node = %s, group = %d", node->NodeName().c_str(), group);
"[Find][Group]Unordered node group found. node = %s, group = %d", node->NodeName().c_str(), group);
return INTERNAL_ERROR;
} else {
last_group = group;

@ -71,7 +71,9 @@ Status SetOutputNameAttr(ComputeGraph &graph) {
}
}
GE_CHK_BOOL_EXEC(ge::AttrUtils::SetListStr(&graph, ATTR_MODEL_OUT_NODES_NAME, output_names),
GELOGE(FAILED, "[Invoke][SetListStr] of ATTR_MODEL_OUT_NODES_NAME failed.");
GELOGE(FAILED, "[Invoke][SetListStr] failed, name:%s.", ATTR_MODEL_OUT_NODES_NAME.c_str());
REPORT_CALL_ERROR("E19999", "SetListStr failed when %s, name:%s.",
__FUNCTION__, ATTR_MODEL_OUT_NODES_NAME.c_str());
return FAILED);
return SUCCESS;
}
@ -109,10 +111,11 @@ Status CollectDependenciesForFusedGraph(NodeItem &node_item, std::set<OpDesc *>
GE_CHECK_NOTNULL(src_op_desc);
if (src_node->GetType() != DATA_TYPE) {
GELOGE(UNSUPPORTED,
"[Check][NodeType][%s::%s] Node in fused subgraph can only depend on Data nodes, but depend on %s",
"[Check][NodeType][%s::%s] Node in fused subgraph can only depend on Data nodes,"
"but depend on %s actually",
node_item.NodeName().c_str(), node->GetName().c_str(), src_node->GetType().c_str());
REPORT_INNER_ERROR("E19999",
"[%s::%s] Node in fused subgraph can only depend on Data nodes, but depend on %s when %s.",
REPORT_INNER_ERROR("E19999", "[%s::%s] Node in fused subgraph can only depend on Data nodes,"
" but depend on %s actually, check invalid when %s.",
node_item.NodeName().c_str(), node->GetName().c_str(), src_node->GetType().c_str(), __FUNCTION__);
return UNSUPPORTED;
}
@ -134,7 +137,8 @@ Status HybridModelBuilder::Build() {
hybrid_model_.model_name_ = ge_root_model_->GetRootGraph()->GetName();
GELOGI("[%s] Start to build hybrid model.", GetGraphName());
GE_CHK_STATUS_RET(InitRuntimeParams(), "[Invoke][InitRuntimeParams] failed, model_name_:[%s]", GetGraphName());
GE_CHK_STATUS_RET(RecoverGraphUnknownFlag(), "[Invoke][RecoverGraphUnknownFlag] failed, model_name_:[%s]", GetGraphName());
GE_CHK_STATUS_RET(RecoverGraphUnknownFlag(),
"[Invoke][RecoverGraphUnknownFlag] failed, model_name_:[%s]", GetGraphName());
GE_CHK_STATUS_RET(IndexSpecialNodes(), "[Invoke][IndexSpecialNodes] failed, model_name_:[%s]", GetGraphName());
GE_CHK_STATUS_RET(IndexTaskDefs(), "[Invoke][IndexTaskDefs] failed, model_name_:[%s]", GetGraphName());
GE_CHK_STATUS_RET(InitWeights(), "[Invoke][InitWeights] failed, model_name_:[%s]", GetGraphName());
@ -335,6 +339,8 @@ Status HybridModelBuilder::ParseDependentInputNodes(NodeItem &node_item, const s
if (input_index < 0) {
GELOGE(INTERNAL_ERROR, "[Get][InputIndex]failed, node:[%s] inputname: %s.",
node_item.NodeName().c_str(), input_name.c_str());
REPORT_CALL_ERROR("E19999", "GetInputIndexByName failed when HybridModelBuilder %s, node:[%s] inputname: %s.",
__FUNCTION__, node_item.NodeName().c_str(), input_name.c_str());
return INTERNAL_ERROR;
}
@ -423,20 +429,24 @@ Status HybridModelBuilder::UpdateAnchorStatus(const NodePtr &node) {
auto peer_anchor = anchor->GetPeerOutAnchor();
if (peer_anchor == nullptr) {
if (AnchorUtils::SetStatus(anchor, ANCHOR_SUSPEND) != GRAPH_SUCCESS) {
GELOGE(INTERNAL_ERROR, "[Invoke][SetStatus] failed, node:[%s].", node->GetName().c_str());
REPORT_CALL_ERROR("E19999", "SetStatus failed, node:[%s] when %s.", node->GetName().c_str(), __FUNCTION__);
GELOGE(INTERNAL_ERROR, "[Invoke][SetStatus] failed to set ANCHOR_SUSPEND, node:[%s].",
node->GetName().c_str());
REPORT_CALL_ERROR("E19999", "SetStatus failed to set ANCHOR_SUSPEND, node:[%s] when HybridModelBuilder %s.",
node->GetName().c_str(), __FUNCTION__);
return INTERNAL_ERROR;
}
} else if (peer_anchor->GetOwnerNode()->GetType() == CONSTANT) {
if (AnchorUtils::SetStatus(anchor, ANCHOR_CONST) != GRAPH_SUCCESS) {
GELOGE(INTERNAL_ERROR, "[Invoke][SetStatus] failed, node:[%s].", node->GetName().c_str());
REPORT_CALL_ERROR("E19999", "SetStatus failed, node:[%s] when %s.", node->GetName().c_str(), __FUNCTION__);
GELOGE(INTERNAL_ERROR, "[Invoke][SetStatus] failed to set ANCHOR_CONST, node:[%s].", node->GetName().c_str());
REPORT_CALL_ERROR("E19999", "SetStatus failed to set ANCHOR_CONST, node:[%s] when HybridModelBuilder %s.",
node->GetName().c_str(), __FUNCTION__);
return INTERNAL_ERROR;
}
} else {
if (AnchorUtils::SetStatus(anchor, ANCHOR_DATA) != GRAPH_SUCCESS) {
GELOGE(INTERNAL_ERROR, "[Invoke][SetStatus] failed, node:[%s].", node->GetName().c_str());
REPORT_CALL_ERROR("E19999", "SetStatus failed, node:[%s] when %s.", node->GetName().c_str(), __FUNCTION__);
GELOGE(INTERNAL_ERROR, "[Invoke][SetStatus] failed to set ANCHOR_DATA, node:[%s].", node->GetName().c_str());
REPORT_CALL_ERROR("E19999", "SetStatus failed to set ANCHOR_DATA, node:[%s] when HybridModelBuilder %s.",
node->GetName().c_str(), __FUNCTION__);
return INTERNAL_ERROR;
}
}
@ -563,6 +573,8 @@ Status HybridModelBuilder::MergeNetOutputNode(ComputeGraph &graph) {
if (input_desc == nullptr) {
GELOGE(INTERNAL_ERROR, "[Invoke][MutableInputDesc][%s] Failed to get input desc[%d]",
net_output_desc->GetName().c_str(), index);
REPORT_CALL_ERROR("E19999", "[%s] Failed to get input desc[%d] when HybridModelBuilder %s.",
net_output_desc->GetName().c_str(), index, __FUNCTION__);
return INTERNAL_ERROR;
}
@ -941,7 +953,7 @@ Status HybridModelBuilder::InitConstantOps() {
auto op_desc = var_node->GetOpDesc();
auto v_weights = ModelUtils::GetWeights(op_desc);
if (v_weights.empty()) {
GELOGE(INTERNAL_ERROR, "[Check][Size][%s] Constant no not have value", var_node->GetName().c_str());
GELOGE(INTERNAL_ERROR, "[Check][Size][%s] Constant op has no weight", var_node->GetName().c_str());
return INTERNAL_ERROR;
}
auto *ge_tensor = const_cast<GeTensor *>(v_weights[0].get());
@ -955,7 +967,7 @@ Status HybridModelBuilder::InitConstantOps() {
GELOGD("Init tensor with host constant %s size = %zu", var_name.c_str(), aligned_tensor.MutableData().GetSize());
if (MemManager::Instance().HostMemInstance(RT_MEMORY_HBM).Malloc(aligned_tensor.GetAlignedPtr(),
aligned_tensor.GetData().size()) == nullptr) {
GELOGE(MEMALLOC_FAILED, "Malloc host memory for an existed GeTensor failed, model_name_:%s.", GetGraphName());
GELOGE(MEMALLOC_FAILED, "[Malloc][HostMemory] for an existed GeTensor failed, model_name_:%s.", GetGraphName());
return MEMALLOC_FAILED;
}
var_tensor.reset(new(std::nothrow)TensorValue(aligned_tensor.MutableData().data(),
@ -1006,6 +1018,8 @@ Status HybridModelBuilder::InitVariableTensors() {
int64_t tensor_size = 0;
if (TensorUtils::CalcTensorMemSize(output_tensor.GetShape(), output_tensor.GetFormat(), output_tensor.GetDataType(),
tensor_size) != SUCCESS) {
REPORT_CALL_ERROR("E19999", "CalcTensorMemSize failed when HybridModelBuilder %s, node name:%s",
__FUNCTION__, it.first.c_str());
GELOGE(INTERNAL_ERROR, "[Calculate][TensorMemSize] failed, node name:%s", it.first.c_str());
return INTERNAL_ERROR;
}
@ -1078,7 +1092,7 @@ Status HybridModelBuilder::InitWeights() {
const GeTensorDesc &tensor_desc = ge_tensor->GetTensorDesc();
int64_t tensor_size = 0;
GE_CHK_GRAPH_STATUS_RET(TensorUtils::GetSize(*op_desc->MutableOutputDesc(0), tensor_size),
"[Invoke][GetSize][%s] Failed to get tensor size",
"[Invoke][GetSize][%s] Failed to get output tensor size",
node->GetName().c_str());
int64_t data_offset = 0;
GE_CHK_GRAPH_STATUS_RET(TensorUtils::GetDataOffset(tensor_desc, data_offset),
@ -1333,16 +1347,18 @@ Status HybridModelBuilder::GetPeerNodeAcrossSubGraphs(const NodePtr &data_node,
GELOGD("To get peer node of %s::%s", sub_graph->GetName().c_str(), data_node->GetName().c_str());
auto wrapped_node = data_node->GetOwnerComputeGraph()->GetParentNode();
if (wrapped_node == nullptr) {
REPORT_INNER_ERROR("E19999", "[%s] Node is in root graph when HybridModelBuilder %s.",
data_node->GetName().c_str(), __FUNCTION__);
GELOGE(INTERNAL_ERROR, "[Invoke][GetParentNode][%s] Node is in root graph.", data_node->GetName().c_str());
return INTERNAL_ERROR;
}
auto data_op_desc = data_node->GetOpDesc();
uint32_t parent_index = 0;
if (!AttrUtils::GetInt(data_op_desc, ATTR_NAME_PARENT_NODE_INDEX, parent_index)) {
GELOGE(INTERNAL_ERROR,
"[Invoke][GetInt][%s] Failed to get attr [%s]",
data_op_desc->GetName().c_str(),
ATTR_NAME_PARENT_NODE_INDEX.c_str());
REPORT_CALL_ERROR("E19999", "[%s] Failed to get attr [%s] when HybridModelBuilder %s.",
data_op_desc->GetName().c_str(), ATTR_NAME_PARENT_NODE_INDEX.c_str(), __FUNCTION__);
GELOGE(INTERNAL_ERROR, "[Invoke][GetInt][%s] Failed to get attr [%s]",
data_op_desc->GetName().c_str(), ATTR_NAME_PARENT_NODE_INDEX.c_str());
return INTERNAL_ERROR;
}
@ -1350,6 +1366,8 @@ Status HybridModelBuilder::GetPeerNodeAcrossSubGraphs(const NodePtr &data_node,
GE_CHECK_NOTNULL(wrapped_node_in_anchor);
auto src_out_anchor = wrapped_node_in_anchor->GetPeerOutAnchor();
if (src_out_anchor == nullptr || src_out_anchor->GetOwnerNode() == nullptr) {
REPORT_INNER_ERROR("E19999", "[%s] Parent node do not have peer anchor when HybridModelBuilder %s.",
data_node->GetName().c_str(), __FUNCTION__);
GELOGE(INTERNAL_ERROR,
"[Check][ParentNode][%s] Parent node do not have peer anchor.", data_node->GetName().c_str());
return INTERNAL_ERROR;
@ -1374,10 +1392,13 @@ Status HybridModelBuilder::GetPeerNodeAcrossSubGraphs(const NodePtr &data_node,
auto src_graph = NodeUtils::GetSubgraph(*src_wrapped_node, kSubgraphIndex);
GE_CHECK_NOTNULL(src_graph);
auto src_net_output_node = src_graph->FindFirstNodeMatchType(NETOUTPUT);
GE_CHK_BOOL_TRUE_EXEC_WITH_LOG(src_net_output_node == nullptr,
return INTERNAL_ERROR,
"[Invoke][FindFirstNodeMatchType]Failed to find NetOutput in subgraph: %s",
if (src_net_output_node == nullptr) {
REPORT_INNER_ERROR("E19999", "Failed to find NetOutput in subgraph: %s when HybridModelBuilder %s",
src_graph->GetName().c_str(), __FUNCTION__);
GELOGE(INTERNAL_ERROR, "[Invoke][FindFirstNodeMatchType]Failed to find NetOutput in subgraph: %s",
src_graph->GetName().c_str());
return INTERNAL_ERROR;
}
auto net_output_desc = src_net_output_node->GetOpDesc();
GE_CHECK_NOTNULL(net_output_desc);
@ -1567,10 +1588,10 @@ Status HybridModelBuilder::GetParentNodeOutputIndex(const OpDesc &op_desc, int i
auto input_desc = op_desc.MutableInputDesc(index);
GE_CHECK_NOTNULL(input_desc);
if (!AttrUtils::GetInt(input_desc, ATTR_NAME_PARENT_NODE_INDEX, out_index)) {
GELOGE(INTERNAL_ERROR, "[Invoke][GetInt]NetOutput input tensor %d, attr %s not found.",
index, ATTR_NAME_PARENT_NODE_INDEX.c_str());
REPORT_CALL_ERROR("E19999", "NetOutput input tensor %d, attr %s not found when %s.",
index, ATTR_NAME_PARENT_NODE_INDEX.c_str(), __FUNCTION__);
GELOGE(INTERNAL_ERROR, "[Invoke][GetInt]NetOutput %s input tensor %d, attr %s not found.",
op_desc.GetName().c_str(), index, ATTR_NAME_PARENT_NODE_INDEX.c_str());
REPORT_CALL_ERROR("E19999", "NetOutput %s input tensor %d, attr %s not found when %s.",
op_desc.GetName().c_str(), index, ATTR_NAME_PARENT_NODE_INDEX.c_str(), __FUNCTION__);
return INTERNAL_ERROR;
}
return SUCCESS;
@ -2026,10 +2047,10 @@ Status HybridModelBuilder::BuildInputMapping(GraphItem &graph_item,
data_op_index++;
} else {
if (!AttrUtils::GetInt(node->GetOpDesc(), ATTR_NAME_PARENT_NODE_INDEX, data_index)) {
GELOGE(FAILED,
"[Invoke][GetInt][%s] Failed to get attr [%s]",
node->GetName().c_str(),
ATTR_NAME_PARENT_NODE_INDEX.c_str());
GELOGE(FAILED, "[Invoke][GetInt][%s] Failed to get attr [%s]",
node->GetName().c_str(), ATTR_NAME_PARENT_NODE_INDEX.c_str());
REPORT_CALL_ERROR("E19999", "call GetInt failed when HybridModelBuilder %s, [%s] Failed to get attr [%s]",
__FUNCTION__, node->GetName().c_str(), ATTR_NAME_PARENT_NODE_INDEX.c_str());
return FAILED;
}
}

Loading…
Cancel
Save