diff --git a/python/paddle/fluid/async_executor.py b/python/paddle/fluid/async_executor.py index 13d876e57beec94d13e3f0c03e3f3820962d443f..099805ac1bdb8658ed3833653db13be8c19fa479 100644 --- a/python/paddle/fluid/async_executor.py +++ b/python/paddle/fluid/async_executor.py @@ -76,7 +76,7 @@ class AsyncExecutor(object): Note: Only running on CPUPlace supported. """ - def __init__(self, place=None): + def __init__(self, place=None, run_mode=""): if place is None: place = core.CPUPlace() if not isinstance(place, core.CPUPlace): @@ -89,6 +89,7 @@ class AsyncExecutor(object): self.executor = core.AsyncExecutor(scope, p) self.instance = None + def run(self, program, data_feed, filelist, thread_num, fetch, mode="", debug=False): """ Run program by this AsyncExecutor. Training dataset will be in filelist. diff --git a/python/paddle/fluid/distributed/downpour.py b/python/paddle/fluid/distributed/downpour.py index c1762dd7688d658f95f66cac50d147dff853d5d3..9ef9e14ccc5d46e7915df1b26305181c9676c13a 100644 --- a/python/paddle/fluid/distributed/downpour.py +++ b/python/paddle/fluid/distributed/downpour.py @@ -1,3 +1,16 @@ +# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and + from .node import DownpourServer from .node import DownpourWorker from ..backward import append_backward diff --git a/python/paddle/fluid/distributed/helper.py b/python/paddle/fluid/distributed/helper.py index 1244b4c0cad6a9fc4a5b2f097ef7e712872721bb..986525e5d85883d7194b6413c50d6cbbd7b95f9b 100644 --- a/python/paddle/fluid/distributed/helper.py +++ b/python/paddle/fluid/distributed/helper.py @@ -1,3 +1,17 @@ +# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from mpi4py import MPI import ps_pb2 as pslib diff --git a/python/paddle/fluid/distributed/node.py b/python/paddle/fluid/distributed/node.py index 1f4aeeac73818ad181677cbcdabe8c83eeeab4fd..87553230060d114599434ffa7cc2691b4605614f 100644 --- a/python/paddle/fluid/distributed/node.py +++ b/python/paddle/fluid/distributed/node.py @@ -1,3 +1,16 @@ +# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and + import ps_pb2 as pslib class Server(object): diff --git a/python/paddle/fluid/distributed/ps_instance.py b/python/paddle/fluid/distributed/ps_instance.py index dce5dfc5bd66d36320b41064d7df2dc8649fc762..b93da053a36ac55d47b9cc1522bbefc40dc70d89 100644 --- a/python/paddle/fluid/distributed/ps_instance.py +++ b/python/paddle/fluid/distributed/ps_instance.py @@ -1,8 +1,18 @@ -#import paddle.fluid.distributed.helper as dist_helper +# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and + import helper as dist_helper import sys -#from mpi4py import MPI - class PaddlePSInstance(object): def __init__(self, server_worker_mode, proc_per_node): @@ -83,17 +93,11 @@ class PaddlePSInstance(object): return self._nodes def barrier_all(self): - #print self._rankid, "begin" - #sys.stdout.flush() self.dh.comm.barrier() - #print self._rankid, "end" def barrier_worker(self): if self.is_worker(): - #print "worker: ", self._rankid, "begin" - #sys.stdout.flush() self._comm.barrier() - #print "worker: ", self._rankid, "end" pass def finalize(self): @@ -104,5 +108,3 @@ class PaddlePSInstance(object): if __name__ == "__main__": instance = PaddlePSInstance(1, 1, 2, 50) instance.barrier_all() - #print "-----" - #instance.barrier_worker()