From 04d17e7a39dcb58e528dd2b9a6391023380446cf Mon Sep 17 00:00:00 2001 From: wangxiaotian22 Date: Mon, 29 Mar 2021 19:02:06 +0800 Subject: [PATCH] modify INNER error to CALL error when new --- ge/graph/build/memory/graph_mem_assigner.cc | 14 ++++----- ge/graph/execute/graph_execute.cc | 4 +-- ge/graph/load/model_manager/davinci_model.cc | 36 +++++++++++----------- .../model_manager/task_info/kernel_task_info.cc | 8 ++--- ge/graph/manager/graph_manager.cc | 16 +++++----- 5 files changed, 39 insertions(+), 39 deletions(-) diff --git a/ge/graph/build/memory/graph_mem_assigner.cc b/ge/graph/build/memory/graph_mem_assigner.cc index df3efcbb..44ba780d 100755 --- a/ge/graph/build/memory/graph_mem_assigner.cc +++ b/ge/graph/build/memory/graph_mem_assigner.cc @@ -118,8 +118,8 @@ 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_INNER_ERROR("E19999", "New Object:VariableMemoryAssigner failed when assign graph memory, " - "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, " + "graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); return ge::FAILED; } @@ -140,8 +140,8 @@ 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_INNER_ERROR("E19999", "New Object:VariableMemoryAssigner failed when assign graph memory, " - "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, " + "graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); return ge::FAILED; } if (variable_assigner->AssignVarAttr2Nodes() != ge::SUCCESS) { @@ -156,8 +156,8 @@ 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_INNER_ERROR("E19999", "New Object:VariableMemoryAssigner failed when assign graph memory, " - "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, " + "graph_id:%u, graph_name:%s", compute_graph_->GetGraphID(), compute_graph_->GetName().c_str()); } if (variable_assigner->AssignMemory2HasRefAttrNode() != ge::SUCCESS) { return ge::FAILED; @@ -171,7 +171,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", "New Object:VariableMemoryAssigner failed when assign graph memory"); + REPORT_INNER_ERROR("E19999", "Get tensor size failed when %s", __FUNCTION__); return FAILED; } diff --git a/ge/graph/execute/graph_execute.cc b/ge/graph/execute/graph_execute.cc index d56eb3d8..847374cc 100755 --- a/ge/graph/execute/graph_execute.cc +++ b/ge/graph/execute/graph_execute.cc @@ -301,8 +301,8 @@ Status GraphExecutor::SyncExecuteModel(uint32_t model_id, const std::vector outBufTmp(new (std::nothrow) uint8_t[outputDataTmp.length]); if (outBufTmp == nullptr) { - REPORT_INNER_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, when %s", + outputDataTmp.length, model_id, __FUNCTION__); GELOGE(FAILED, "Failed to allocate memory."); return FAILED; } diff --git a/ge/graph/load/model_manager/davinci_model.cc b/ge/graph/load/model_manager/davinci_model.cc index 715acfaf..5b5f1ed6 100755 --- a/ge/graph/load/model_manager/davinci_model.cc +++ b/ge/graph/load/model_manager/davinci_model.cc @@ -1627,8 +1627,8 @@ Status DavinciModel::CpuModelDequeue(uint32_t queue_id) { GELOGI("Set CpuKernel model dequeue task enter."); std::shared_ptr dequeue_task = MakeShared(rt_entry_stream_); if (dequeue_task == nullptr) { - REPORT_INNER_ERROR("E19999", "New CpuTaskModelDequeue failed, model_id:%u, when DavinciModel %s", - model_id_, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "New CpuTaskModelDequeue failed, model_id:%u, when DavinciModel %s", + model_id_, __FUNCTION__); GELOGE(MEMALLOC_FAILED, "Make CpuTaskModelDequeue task failed."); return MEMALLOC_FAILED; } @@ -1651,8 +1651,8 @@ Status DavinciModel::CpuTaskModelZeroCopy(std::vector &mbuf_list, GELOGI("Set CpuKernel model zero_copy task enter."); std::shared_ptr zero_copy = MakeShared(rt_entry_stream_); if (zero_copy == nullptr) { - REPORT_INNER_ERROR("E19999", "New CpuTaskZeroCopy failed, model_id:%u, when DavinciModel %s", - model_id_, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "New CpuTaskZeroCopy failed, model_id:%u, when DavinciModel %s", + model_id_, __FUNCTION__); GELOGE(MEMALLOC_FAILED, "Make CpuTaskZeroCopy task failed."); return MEMALLOC_FAILED; } @@ -1726,8 +1726,8 @@ Status DavinciModel::CpuModelPrepareOutput(uintptr_t addr, uint32_t size) { std::shared_ptr prepare_output = MakeShared(rt_entry_stream_); if (prepare_output == nullptr) { - REPORT_INNER_ERROR("E19999", "New CpuTaskPrepareOutput failed, model_id:%u, when DavinciModel %s", - model_id_, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "New CpuTaskPrepareOutput failed, model_id:%u, when DavinciModel %s", + model_id_, __FUNCTION__); GELOGE(MEMALLOC_FAILED, "Make CpuTaskPrepareOutput task failed."); return MEMALLOC_FAILED; } @@ -1752,8 +1752,8 @@ Status DavinciModel::CpuActiveStream() { GELOGI("Set CpuKernel active stream task enter."); std::shared_ptr active_entry = MakeShared(rt_entry_stream_); if (active_entry == nullptr) { - REPORT_INNER_ERROR("E19999", "New CpuTaskActiveEntry failed, model_id:%u, when DavinciModel %s", - model_id_, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "New CpuTaskActiveEntry failed, model_id:%u, when DavinciModel %s", + model_id_, __FUNCTION__); GELOGE(MEMALLOC_FAILED, "Make CpuTaskActiveEntry task failed."); return MEMALLOC_FAILED; } @@ -1775,8 +1775,8 @@ Status DavinciModel::CpuWaitEndGraph() { GELOGI("Set CpuKernel wait end graph task enter."); std::shared_ptr wait_endgraph = MakeShared(rt_entry_stream_); if (wait_endgraph == nullptr) { - REPORT_INNER_ERROR("E19999", "New CpuTaskWaitEndGraph failed, model_id:%u, when DavinciModel %s", - model_id_, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "New CpuTaskWaitEndGraph failed, model_id:%u, when DavinciModel %s", + model_id_, __FUNCTION__); GELOGE(MEMALLOC_FAILED, "Make CpuTaskWaitEndGraph task failed."); return MEMALLOC_FAILED; } @@ -1813,8 +1813,8 @@ Status DavinciModel::CpuModelEnqueue(uint32_t queue_id, uintptr_t out_mbuf) { GELOGI("Set CpuKernel model enqueue task enter."); std::shared_ptr model_enqueue = MakeShared(rt_entry_stream_); if (model_enqueue == nullptr) { - REPORT_INNER_ERROR("E19999", "New CpuTaskModelEnqueue failed, model_id:%u, when DavinciModel %s", - model_id_, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "New CpuTaskModelEnqueue failed, model_id:%u, when DavinciModel %s", + model_id_, __FUNCTION__); GELOGE(MEMALLOC_FAILED, "Make CpuTaskModelEnqueue task failed."); return MEMALLOC_FAILED; } @@ -1835,8 +1835,8 @@ Status DavinciModel::CpuModelRepeat() { GELOGI("Set CpuKernel repeat task enter."); std::shared_ptr model_repeat = MakeShared(rt_entry_stream_); if (model_repeat == nullptr) { - REPORT_INNER_ERROR("E19999", "New CpuTaskModelRepeat failed, model_id:%u, when DavinciModel %s", - model_id_, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "New CpuTaskModelRepeat failed, model_id:%u, when DavinciModel %s", + model_id_, __FUNCTION__); GELOGE(MEMALLOC_FAILED, "Make CpuTaskModelRepeat task failed."); return MEMALLOC_FAILED; } @@ -2608,8 +2608,8 @@ Status DavinciModel::GenOutputTensorInfo(OutputData *output_data, vector data_buf(new (std::nothrow) uint8_t[output_buffer_size[i]]); if (data_buf == nullptr) { - REPORT_INNER_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 when DavinciModel %s", + output_buffer_size[i], model_id_, __FUNCTION__); GELOGE(GE_GRAPH_MALLOC_FAILED, "Malloc buffer failed."); return GE_GRAPH_MALLOC_FAILED; } @@ -3926,8 +3926,8 @@ Status DavinciModel::AddHeadStream() { for (auto s : active_stream_list_) { std::shared_ptr active_entry = MakeShared(rt_head_stream_); if (active_entry == nullptr) { - REPORT_INNER_ERROR("E19999", "New CpuTaskActiveEntry failed, model_id:%u, when DavinciModel %s", - model_id_, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "New CpuTaskActiveEntry failed, model_id:%u, when DavinciModel %s", + model_id_, __FUNCTION__); GELOGE(MEMALLOC_FAILED, "Make CpuTaskActiveEntry task failed."); return MEMALLOC_FAILED; } diff --git a/ge/graph/load/model_manager/task_info/kernel_task_info.cc b/ge/graph/load/model_manager/task_info/kernel_task_info.cc index 91d88068..9d56c3bc 100755 --- a/ge/graph/load/model_manager/task_info/kernel_task_info.cc +++ b/ge/graph/load/model_manager/task_info/kernel_task_info.cc @@ -782,8 +782,8 @@ 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_INNER_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), when KernelTaskInfo %s", + kCustomAicpuArgsLen, op_desc->GetName().c_str(), op_desc->GetType().c_str(), __FUNCTION__); GELOGE(PARAM_INVALID, "ctx_.argsOffset is null!"); return PARAM_INVALID; } @@ -1273,8 +1273,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_INNER_ERROR("E19999", "New ctx_.argsOffset fail, size:%u, when KernelTaskInfo %s", - ctx_.argsCount, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "New ctx_.argsOffset fail, size:%u, when KernelTaskInfo %s", + ctx_.argsCount, __FUNCTION__); GELOGE(PARAM_INVALID, "(param [ctx_.argsOffset] must not be null."); return PARAM_INVALID; } diff --git a/ge/graph/manager/graph_manager.cc b/ge/graph/manager/graph_manager.cc index 3cc27b88..5252796f 100755 --- a/ge/graph/manager/graph_manager.cc +++ b/ge/graph/manager/graph_manager.cc @@ -166,14 +166,14 @@ Status GraphManager::Initialize(const std::map &options) { // malloc graph_run_listener_ = MakeShared(sync_run_mutex_, condition_); if (graph_run_listener_ == nullptr) { - REPORT_INNER_ERROR("E19999", "New GraphModelListener fail when GraphManager %s", __FUNCTION__); + REPORT_CALL_ERROR("E19999", "New GraphModelListener fail when GraphManager %s", __FUNCTION__); GELOGE(MEMALLOC_FAILED, "Make shared failed"); return MEMALLOC_FAILED; } // graph context graph_context_ = MakeShared(); if (graph_context_ == nullptr) { - REPORT_INNER_ERROR("E19999", "New GraphModelListener fail when GraphManager %s", __FUNCTION__); + REPORT_CALL_ERROR("E19999", "New GraphModelListener fail when GraphManager %s", __FUNCTION__); GELOGE(MEMALLOC_FAILED, "Make shared failed."); return MEMALLOC_FAILED; } @@ -366,14 +366,14 @@ Status GraphManager::AddGraph(const GraphId &graph_id, const Graph &graph, GraphNodePtr graph_node = MakeShared(graph_id); GE_IF_BOOL_EXEC(graph_node == nullptr, - REPORT_INNER_ERROR("E19999", "New GraphNode fail, graph_id:%u, when GraphManager %s", - graph_id, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "New GraphNode fail, graph_id:%u, when GraphManager %s", + graph_id, __FUNCTION__); GELOGE(FAILED, "GraphNode make shared failed"); return FAILED); std::shared_ptr graph_ptr = MakeShared(graph); GE_IF_BOOL_EXEC(graph_ptr == nullptr, - REPORT_INNER_ERROR("E19999", "New Graph fail, graph_id:%u, when GraphManager %s", - graph_id, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "New Graph fail, graph_id:%u, when GraphManager %s", + graph_id, __FUNCTION__); GELOGE(FAILED, "GraphPtr make shared failed"); return FAILED); // update option about tuning graph @@ -457,8 +457,8 @@ Status GraphManager::AddGraphWithCopy(const GraphId &graph_id, const Graph &grap } std::shared_ptr graph_ptr = GraphUtils::CreateGraphPtrFromComputeGraph(new_compute_graph); if (graph_ptr == nullptr) { - REPORT_INNER_ERROR("E19999", "New Graph fail, graph_id:%u, when GraphManager %s", - graph_id, __FUNCTION__); + REPORT_CALL_ERROR("E19999", "New Graph fail, graph_id:%u, when GraphManager %s", + graph_id, __FUNCTION__); GELOGE(FAILED, "GraphPtr make shared failed"); return FAILED; }