|
|
|
@@ -533,11 +533,19 @@ Status GraphManager::CopySubGraphAndMarkFusion(const ComputeGraphPtr &compute_gr |
|
|
|
return SUCCESS; |
|
|
|
} |
|
|
|
|
|
|
|
Status GraphManager::OptimizeSubGraphWithMultiThreads(ComputeGraphPtr compute_graph, |
|
|
|
Status GraphManager::OptimizeSubGraphWithMultiThreads(ComputeGraphPtr compute_graph, |
|
|
|
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; |
|
|
|
|
|
|
|
const 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<std::future<Status>> vector_future; |
|
|
|
const auto &root_subgraph_list = sub_graph_map[compute_graph]; |
|
|
|
@@ -2111,6 +2119,8 @@ Status GraphManager::OptimizeStage1(ge::ComputeGraphPtr &compute_graph) { |
|
|
|
new (std::nothrow) TransOpWithoutReshapeFusionPass)) |
|
|
|
GE_CHK_STATUS_RET(after_merge_passes.AddPass("OptimizeStage1_1::TransOpBreadthFusionPass", |
|
|
|
new (std::nothrow) TransOpBreadthFusionPass)) |
|
|
|
GE_CHK_STATUS_RET( |
|
|
|
after_merge_passes.AddPass("OptimizeStage1_1::HcclMemcpyPass", new (std::nothrow) HcclMemcpyPass)); |
|
|
|
|
|
|
|
GE_TIMESTAMP_START(after_merge_passes); |
|
|
|
auto ret = after_merge_passes.Run(compute_graph); |
|
|
|
|