From b5ccf9c8348ebf347f0952f75b98e520a81381e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E7=AC=91=E5=A4=A9?= Date: Mon, 28 Dec 2020 09:11:42 +0800 Subject: [PATCH] !706 subgraph optimize multi thread env add * subgraph optimize multi thread env --- ge/graph/manager/graph_manager.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ge/graph/manager/graph_manager.cc b/ge/graph/manager/graph_manager.cc index 6a13e285..117b243f 100755 --- a/ge/graph/manager/graph_manager.cc +++ b/ge/graph/manager/graph_manager.cc @@ -526,7 +526,15 @@ Status GraphManager::OptimizeSubGraphWithMultiThreads(ComputeGraphPtr compute_gr Graph2SubGraphInfoList &sub_graph_map, uint64_t session_id) { GE_CHECK_NOTNULL(compute_graph); // use default 16 multi thread - const uint32_t thread_num = 16; + uint32_t thread_num = 16; + + char *env = std::getenv("THREAD_MULTI_NUM"); + if (env != nullptr) { + thread_num = atoi(env); + GEEVENT("OptimizeSubGraphWithMultiThreads thread num: %u", thread_num); + } + + ThreadPool executor(thread_num); std::vector> vector_future; const auto &root_subgraph_list = sub_graph_map[compute_graph];