From 754fd57ed73fdda3fa92f532407092b23f45d136 Mon Sep 17 00:00:00 2001 From: Zeng Jinle <32832641+sneaxiy@users.noreply.github.com> Date: Tue, 17 Sep 2019 10:13:44 +0800 Subject: [PATCH] disable memory optimization passes when FLAGS_use_ngraph=True, test=develop (#19778) --- paddle/fluid/framework/parallel_executor.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/paddle/fluid/framework/parallel_executor.cc b/paddle/fluid/framework/parallel_executor.cc index 101141284ba..7b83f87d5d8 100644 --- a/paddle/fluid/framework/parallel_executor.cc +++ b/paddle/fluid/framework/parallel_executor.cc @@ -32,6 +32,8 @@ limitations under the License. */ #include "paddle/fluid/framework/ir/memory_optimize_pass/reference_count_pass_helper.h" #include "paddle/fluid/platform/profiler.h" +DECLARE_bool(use_ngraph); + #ifdef WITH_GPERFTOOLS #include "gperftools/profiler.h" #endif @@ -233,6 +235,13 @@ class ParallelExecutorPrivate { }; ir::Graph *ParallelExecutorPrivate::ApplyMemoryOptimizePass(ir::Graph *graph) { + if (FLAGS_use_ngraph) { + LOG_FIRST_N(WARNING, 1) + << "FLAGS_use_ngraph=True, memory optimization strategy is " + "disabled in ParallelExecutor"; + return graph; + } + std::vector last_live_ops_of_vars; auto ref_cnt_pass = ir::PassRegistry::Instance().Get("reference_count_pass"); -- GitLab