From 06930531887547286f3c4ad096d1fd0794749867 Mon Sep 17 00:00:00 2001 From: dongdaxiang Date: Tue, 11 Dec 2018 14:43:52 +0800 Subject: [PATCH] add liscence --- python/paddle/fluid/async_executor.py | 3 ++- python/paddle/fluid/distributed/downpour.py | 13 ++++++++++ python/paddle/fluid/distributed/helper.py | 14 +++++++++++ python/paddle/fluid/distributed/node.py | 13 ++++++++++ .../paddle/fluid/distributed/ps_instance.py | 24 ++++++++++--------- 5 files changed, 55 insertions(+), 12 deletions(-) diff --git a/python/paddle/fluid/async_executor.py b/python/paddle/fluid/async_executor.py index 13d876e57be..099805ac1bd 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 c1762dd7688..9ef9e14ccc5 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 1244b4c0cad..986525e5d85 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 1f4aeeac738..87553230060 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 dce5dfc5bd6..b93da053a36 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() -- GitLab