add liscence

revert-15207-remove_op_handle_lock_and_fix_var
dongdaxiang 6 years ago
parent 7bd16e3afa
commit 0693053188

@ -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.

@ -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

@ -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

@ -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):

@ -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()

Loading…
Cancel
Save