From 799557be2c5c7650a69ba7260d97d2e93153dbaa Mon Sep 17 00:00:00 2001 From: baker Date: Thu, 12 Nov 2020 20:10:05 +0800 Subject: [PATCH 1/3] save and get err msg --- ge/ir_build/ge_ir_build.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ge/ir_build/ge_ir_build.cc b/ge/ir_build/ge_ir_build.cc index b845bd75..ff8cd37d 100644 --- a/ge/ir_build/ge_ir_build.cc +++ b/ge/ir_build/ge_ir_build.cc @@ -35,6 +35,7 @@ #include "ir_build/atc_ir_common.h" #include "model/ge_model.h" #include "graph/shape_refiner.h" +#include "common/util/error_manager/error_manager.h" using std::string; using namespace std; @@ -129,6 +130,14 @@ graphStatus aclgrphBuildInitialize(std::map global_opt } } GELOGW("gelib has been initialized!"); + + std::string path_base = ge::GELib::GetPath(); + int ret = ErrorManager::GetInstance().Init(path_base); + if (ret != 0) { + DOMI_LOGE("ErrorManager init fail !"); + return ret; + } + return GRAPH_SUCCESS; } From 7ecb4ea7948a7d8ca877868f580cfcff0e5d27d0 Mon Sep 17 00:00:00 2001 From: baker Date: Mon, 16 Nov 2020 11:36:46 +0800 Subject: [PATCH 2/3] save and get err msg --- ge/graph/manager/graph_manager.cc | 10 +++++++--- ge/graph/manager/graph_manager.h | 3 ++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ge/graph/manager/graph_manager.cc b/ge/graph/manager/graph_manager.cc index 282cd7a6..547aa030 100755 --- a/ge/graph/manager/graph_manager.cc +++ b/ge/graph/manager/graph_manager.cc @@ -29,6 +29,7 @@ #include "common/math/math_util.h" #include "common/thread_pool.h" #include "common/util.h" +#include "common/util/error_manager/error_manager.h" #include "external/graph/types.h" #include "framework/common/debug/ge_log.h" #include "framework/common/ge_inner_error_codes.h" @@ -411,7 +412,8 @@ Status GraphManager::OptimizeSubGraphWithMultiThreads(ComputeGraphPtr compute_gr (void) AttrUtils::SetStr(subgraph->GetSubGraph(), ATTR_NAME_OP_COMPILE_STRATEGY, op_compile_strategy); } std::future f = executor.commit(GraphManager::ProcessSubGraphWithMultiThreads, this, - compute_graph->GetGraphID(), subgraph, session_id, GetThreadLocalContext()); + compute_graph->GetGraphID(), subgraph, session_id, + GetThreadLocalContext(), GetInnerErrMsg()); if (!f.valid()) { GELOGE(FAILED, "Future is invalid"); return FAILED; @@ -427,7 +429,7 @@ Status GraphManager::OptimizeSubGraphWithMultiThreads(ComputeGraphPtr compute_gr } std::future f = executor.commit(GraphManager::ProcessSubGraphWithMultiThreads, this, compute_graph->GetGraphID(), subgraph, session_id, - GetThreadLocalContext()); + GetThreadLocalContext(), GetInnerErrMsg()); if (!f.valid()) { GELOGE(FAILED, "Future is invalid"); return FAILED; @@ -2344,10 +2346,12 @@ Status GraphManager::CheckAndReleaseMemory(const GeModelPtr &ge_model, const Gra Status GraphManager::ProcessSubGraphWithMultiThreads(GraphManager *graph_manager, GraphId root_graph_id, const SubGraphInfoPtr &sub_graph_info_ptr, uint64_t session_id, - const GEThreadLocalContext &ge_context) { + const GEThreadLocalContext &ge_context, + const std::map> &err_ma=sg_map) { if (sub_graph_info_ptr != nullptr && graph_manager != nullptr) { GetContext().SetSessionId(session_id); GetThreadLocalContext() = ge_context; + GetInnerErrMsgMap() = err_msg_map; graph_manager->UpdateLocalOmgContext(root_graph_id); ComputeGraphPtr compute_graph_tmp = sub_graph_info_ptr->GetSubGraph(); diff --git a/ge/graph/manager/graph_manager.h b/ge/graph/manager/graph_manager.h index fc3601af..5cc6e94b 100644 --- a/ge/graph/manager/graph_manager.h +++ b/ge/graph/manager/graph_manager.h @@ -204,7 +204,8 @@ class GraphManager { static Status ProcessSubGraphWithMultiThreads(GraphManager *graph_manager, GraphId root_graph_id, const SubGraphInfoPtr &sub_graph_info_ptr, uint64_t session_id, - const GEThreadLocalContext &ge_context); + const GEThreadLocalContext &ge_context, + const std::map> &err_msg_map); Status PreRun(const GraphNodePtr &graph_node, const std::vector &inputs, GeRootModelPtr &ge_root_model, uint64_t session_id = INVALID_SESSION_ID); From af5b53338a71577d943f4c8c2746fca0ba17a0f6 Mon Sep 17 00:00:00 2001 From: baker Date: Mon, 16 Nov 2020 11:53:22 +0800 Subject: [PATCH 3/3] save and get err msg --- ge/ir_build/ge_ir_build.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ge/ir_build/ge_ir_build.cc b/ge/ir_build/ge_ir_build.cc index ff8cd37d..6224241d 100644 --- a/ge/ir_build/ge_ir_build.cc +++ b/ge/ir_build/ge_ir_build.cc @@ -134,7 +134,7 @@ graphStatus aclgrphBuildInitialize(std::map global_opt std::string path_base = ge::GELib::GetPath(); int ret = ErrorManager::GetInstance().Init(path_base); if (ret != 0) { - DOMI_LOGE("ErrorManager init fail !"); + GELOGE(ret, "ErrorManager init fail !"); return ret; }