Browse Source

Pre Merge pull request !289 from 陈华/development

pull/289/MERGE
陈华 Gitee 4 years ago
parent
commit
480edc09b0
3 changed files with 18 additions and 4 deletions
  1. +7
    -3
      ge/graph/manager/graph_manager.cc
  2. +2
    -1
      ge/graph/manager/graph_manager.h
  3. +9
    -0
      ge/ir_build/ge_ir_build.cc

+ 7
- 3
ge/graph/manager/graph_manager.cc View File

@@ -29,6 +29,7 @@
#include "common/math/math_util.h" #include "common/math/math_util.h"
#include "common/thread_pool.h" #include "common/thread_pool.h"
#include "common/util.h" #include "common/util.h"
#include "common/util/error_manager/error_manager.h"
#include "external/graph/types.h" #include "external/graph/types.h"
#include "framework/common/debug/ge_log.h" #include "framework/common/debug/ge_log.h"
#include "framework/common/ge_inner_error_codes.h" #include "framework/common/ge_inner_error_codes.h"
@@ -433,7 +434,8 @@ Status GraphManager::OptimizeSubGraphWithMultiThreads(ComputeGraphPtr compute_gr
(void) AttrUtils::SetStr(subgraph->GetSubGraph(), ATTR_NAME_OP_COMPILE_STRATEGY, op_compile_strategy); (void) AttrUtils::SetStr(subgraph->GetSubGraph(), ATTR_NAME_OP_COMPILE_STRATEGY, op_compile_strategy);
} }
std::future<Status> f = executor.commit(GraphManager::ProcessSubGraphWithMultiThreads, this, std::future<Status> f = executor.commit(GraphManager::ProcessSubGraphWithMultiThreads, this,
compute_graph->GetGraphID(), subgraph, session_id, GetThreadLocalContext());
compute_graph->GetGraphID(), subgraph, session_id,
GetThreadLocalContext(), GetInnerErrMsg());
if (!f.valid()) { if (!f.valid()) {
GELOGE(FAILED, "Future is invalid"); GELOGE(FAILED, "Future is invalid");
return FAILED; return FAILED;
@@ -449,7 +451,7 @@ Status GraphManager::OptimizeSubGraphWithMultiThreads(ComputeGraphPtr compute_gr
} }
std::future<Status> f = executor.commit(GraphManager::ProcessSubGraphWithMultiThreads, this, std::future<Status> f = executor.commit(GraphManager::ProcessSubGraphWithMultiThreads, this,
compute_graph->GetGraphID(), subgraph, session_id, compute_graph->GetGraphID(), subgraph, session_id,
GetThreadLocalContext());
GetThreadLocalContext(), GetInnerErrMsg());
if (!f.valid()) { if (!f.valid()) {
GELOGE(FAILED, "Future is invalid"); GELOGE(FAILED, "Future is invalid");
return FAILED; return FAILED;
@@ -2366,10 +2368,12 @@ Status GraphManager::CheckAndReleaseMemory(const GeModelPtr &ge_model, const Gra


Status GraphManager::ProcessSubGraphWithMultiThreads(GraphManager *graph_manager, GraphId root_graph_id, Status GraphManager::ProcessSubGraphWithMultiThreads(GraphManager *graph_manager, GraphId root_graph_id,
const SubGraphInfoPtr &sub_graph_info_ptr, uint64_t session_id, const SubGraphInfoPtr &sub_graph_info_ptr, uint64_t session_id,
const GEThreadLocalContext &ge_context) {
const GEThreadLocalContext &ge_context,
const std::map<std::string, std::vector<std::string>> &err_ma=sg_map) {
if (sub_graph_info_ptr != nullptr && graph_manager != nullptr) { if (sub_graph_info_ptr != nullptr && graph_manager != nullptr) {
GetContext().SetSessionId(session_id); GetContext().SetSessionId(session_id);
GetThreadLocalContext() = ge_context; GetThreadLocalContext() = ge_context;
GetInnerErrMsgMap() = err_msg_map;
graph_manager->UpdateLocalOmgContext(root_graph_id); graph_manager->UpdateLocalOmgContext(root_graph_id);


ComputeGraphPtr compute_graph_tmp = sub_graph_info_ptr->GetSubGraph(); ComputeGraphPtr compute_graph_tmp = sub_graph_info_ptr->GetSubGraph();


+ 2
- 1
ge/graph/manager/graph_manager.h View File

@@ -204,7 +204,8 @@ class GraphManager {


static Status ProcessSubGraphWithMultiThreads(GraphManager *graph_manager, GraphId root_graph_id, static Status ProcessSubGraphWithMultiThreads(GraphManager *graph_manager, GraphId root_graph_id,
const SubGraphInfoPtr &sub_graph_info_ptr, uint64_t session_id, const SubGraphInfoPtr &sub_graph_info_ptr, uint64_t session_id,
const GEThreadLocalContext &ge_context);
const GEThreadLocalContext &ge_context,
const std::map<std::string, std::vector<std::string>> &err_msg_map);
Status PreRun(const GraphNodePtr &graph_node, const std::vector<GeTensor> &inputs, GeRootModelPtr &ge_root_model, Status PreRun(const GraphNodePtr &graph_node, const std::vector<GeTensor> &inputs, GeRootModelPtr &ge_root_model,
uint64_t session_id = INVALID_SESSION_ID); uint64_t session_id = INVALID_SESSION_ID);




+ 9
- 0
ge/ir_build/ge_ir_build.cc View File

@@ -35,6 +35,7 @@
#include "ir_build/atc_ir_common.h" #include "ir_build/atc_ir_common.h"
#include "model/ge_model.h" #include "model/ge_model.h"
#include "graph/shape_refiner.h" #include "graph/shape_refiner.h"
#include "common/util/error_manager/error_manager.h"


using std::string; using std::string;
using namespace std; using namespace std;
@@ -129,6 +130,14 @@ graphStatus aclgrphBuildInitialize(std::map<std::string, std::string> global_opt
} }
} }
GELOGW("gelib has been initialized!"); GELOGW("gelib has been initialized!");

std::string path_base = ge::GELib::GetPath();
int ret = ErrorManager::GetInstance().Init(path_base);
if (ret != 0) {
GELOGE(ret, "ErrorManager init fail !");
return ret;
}

return GRAPH_SUCCESS; return GRAPH_SUCCESS;
} }




Loading…
Cancel
Save