From d23603322e91ce1586ba2e67dce10680b07f223a Mon Sep 17 00:00:00 2001 From: chengduo <30176695+chengduoZH@users.noreply.github.com> Date: Fri, 9 Aug 2019 20:24:26 +0800 Subject: [PATCH] Remove compile from PE (#19080) * remove compile from PE test=develop --- python/paddle/fluid/compiler.py | 2 -- python/paddle/fluid/parallel_executor.py | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/python/paddle/fluid/compiler.py b/python/paddle/fluid/compiler.py index 14ca922a345..49c4c4f246c 100644 --- a/python/paddle/fluid/compiler.py +++ b/python/paddle/fluid/compiler.py @@ -240,8 +240,6 @@ class CompiledProgram(object): "share_vars_from is not compiled and run, so there is no " "var to share.") self._local_scopes = self._share_vars_from._executor.local_scopes() - # drop the local_exe_scopes of the previous parallel_executor - self._share_vars_from._executor.drop_local_exe_scopes() else: assert scope is not None, "" self._local_scopes = [] diff --git a/python/paddle/fluid/parallel_executor.py b/python/paddle/fluid/parallel_executor.py index 479894132f5..b1594ee2028 100644 --- a/python/paddle/fluid/parallel_executor.py +++ b/python/paddle/fluid/parallel_executor.py @@ -163,6 +163,7 @@ class ParallelExecutor(object): assert isinstance( share_vars_from, ParallelExecutor ), "The share_vars_from should be ParallelExecutor." + self._compiled_program.with_data_parallel( loss_name=loss_name, build_strategy=build_strategy, @@ -172,7 +173,6 @@ class ParallelExecutor(object): self._place = core.CUDAPlace(0) if use_cuda else core.CPUPlace() self._exe = executor.Executor(self._place) - self._compiled_program._compile(place=self._place, scope=self._scope) def run(self, fetch_list, feed=None, feed_dict=None, return_numpy=True): """ -- GitLab