From ade9337486de4a25dcebd951c1f64b9754f10b56 Mon Sep 17 00:00:00 2001 From: dongdaxiang Date: Fri, 29 Mar 2019 13:17:57 +0800 Subject: [PATCH] fix API.spec test=develop --- p2p_role_maker.py | 17 ----------------- paddle/fluid/API.spec | 2 +- paddle/fluid/framework/executor.h | 1 - python/paddle/fluid/async_executor.py | 2 +- python/paddle/fluid/executor.py | 6 ++++++ 5 files changed, 8 insertions(+), 20 deletions(-) delete mode 100644 p2p_role_maker.py diff --git a/p2p_role_maker.py b/p2p_role_maker.py deleted file mode 100644 index 0876f09fccb..00000000000 --- a/p2p_role_maker.py +++ /dev/null @@ -1,17 +0,0 @@ - - -class P2PRoleMakers(object): - def __init__(self): - from mpi4py import MPI - self.comm = MPI.COMM_WORLD - self.MPI = MPI - - def get_endpoints(self, port_start): - rank = self.comm.Get_rank() - size = self.comm.Get_size() - import socket - local_ip = socket.gethostbyname(socket.gethostname()) - hostname = socket.gethostname() - all_ips = self.comm.allgather(local_ip) - all_ports = [str(port_start + rank) for ] - return all_ports diff --git a/paddle/fluid/API.spec b/paddle/fluid/API.spec index 8e1801d8aa4..a128ef562bf 100644 --- a/paddle/fluid/API.spec +++ b/paddle/fluid/API.spec @@ -497,7 +497,7 @@ paddle.fluid.LoDTensor.__init__ 1. __init__(self: paddle.fluid.core.LoDTensor, a paddle.fluid.LoDTensor.has_valid_recursive_sequence_lengths has_valid_recursive_sequence_lengths(self: paddle.fluid.core.LoDTensor) -> bool paddle.fluid.LoDTensor.lod lod(self: paddle.fluid.core.LoDTensor) -> List[List[int]] paddle.fluid.LoDTensor.recursive_sequence_lengths recursive_sequence_lengths(self: paddle.fluid.core.LoDTensor) -> List[List[int]] -paddle.fluid.LoDTensor.set 1. set(self: paddle.fluid.core.Tensor, arg0: numpy.ndarray[float32], arg1: paddle::platform::CPUPlace) -> None 2. set(self: paddle.fluid.core.Tensor, arg0: numpy.ndarray[int32], arg1: paddle::platform::CPUPlace) -> None 3. set(self: paddle.fluid.core.Tensor, arg0: numpy.ndarray[float64], arg1: paddle::platform::CPUPlace) -> None 4. set(self: paddle.fluid.core.Tensor, arg0: numpy.ndarray[int64], arg1: paddle::platform::CPUPlace) -> None 5. set(self: paddle.fluid.core.Tensor, arg0: numpy.ndarray[bool], arg1: paddle::platform::CPUPlace) -> None 6. set(self: paddle.fluid.core.Tensor, arg0: numpy.ndarray[uint16], arg1: paddle::platform::CPUPlace) -> None 7. set(self: paddle.fluid.core.Tensor, arg0: numpy.ndarray[uint8], arg1: paddle::platform::CPUPlace) -> None 8. set(self: paddle.fluid.core.Tensor, arg0: numpy.ndarray[int8], arg1: paddle::platform::CPUPlace) -> None +paddle.fluid.LoDTensor.set 1. set(self: paddle.fluid.core.Tensor, arg0: numpy.ndarray[float32], arg1: paddle::platform::CPUPlace) -> None 2. set(self: paddle.fluid.core.Tensor, arg0: numpy.ndarray[int32], arg1: paddle::platform::CPUPlace) -> None 3. set(self: paddle.fluid.core.Tensor, arg0: numpy.ndarray[float64], arg1: paddle::platform::CPUPlace) -> None 4. set(self: paddle.fluid.core.Tensor, arg0: numpy.ndarray[int64], arg1: paddle::platform::CPUPlace) -> None 5. set(self: paddle.fluid.core.Tensor, arg0: numpy.ndarray[bool], arg1: paddle::platform::CPUPlace) -> None 6. set(self: paddle.fluid.core.Tensor, arg0: numpy.ndarray[uint16], arg1: paddle::platform::CPUPlace) -> None 7. set(self: paddle.fluid.core.Tensor, arg0: numpy.ndarray[uint8], arg1: paddle::platform::CPUPlace) -> None 8. set(self: paddle.fluid.core.Tensor, arg0: numpy.ndarray[int8], arg1: paddle::platform::CPUPlace) -> None 9. set(self: paddle.fluid.core.Tensor, arg0: numpy.ndarray[float32], arg1: paddle::platform::CUDAPlace) -> None 10. set(self: paddle.fluid.core.Tensor, arg0: numpy.ndarray[int32], arg1: paddle::platform::CUDAPlace) -> None 11. set(self: paddle.fluid.core.Tensor, arg0: numpy.ndarray[float64], arg1: paddle::platform::CUDAPlace) -> None 12. set(self: paddle.fluid.core.Tensor, arg0: numpy.ndarray[int64], arg1: paddle::platform::CUDAPlace) -> None 13. set(self: paddle.fluid.core.Tensor, arg0: numpy.ndarray[bool], arg1: paddle::platform::CUDAPlace) -> None 14. set(self: paddle.fluid.core.Tensor, arg0: numpy.ndarray[uint16], arg1: paddle::platform::CUDAPlace) -> None 15. set(self: paddle.fluid.core.Tensor, arg0: numpy.ndarray[uint8], arg1: paddle::platform::CUDAPlace) -> None 16. set(self: paddle.fluid.core.Tensor, arg0: numpy.ndarray[int8], arg1: paddle::platform::CUDAPlace) -> None 17. set(self: paddle.fluid.core.Tensor, arg0: numpy.ndarray[float32], arg1: paddle::platform::CUDAPinnedPlace) -> None 18. set(self: paddle.fluid.core.Tensor, arg0: numpy.ndarray[int32], arg1: paddle::platform::CUDAPinnedPlace) -> None 19. set(self: paddle.fluid.core.Tensor, arg0: numpy.ndarray[float64], arg1: paddle::platform::CUDAPinnedPlace) -> None 20. set(self: paddle.fluid.core.Tensor, arg0: numpy.ndarray[int64], arg1: paddle::platform::CUDAPinnedPlace) -> None 21. set(self: paddle.fluid.core.Tensor, arg0: numpy.ndarray[bool], arg1: paddle::platform::CUDAPinnedPlace) -> None 22. set(self: paddle.fluid.core.Tensor, arg0: numpy.ndarray[uint16], arg1: paddle::platform::CUDAPinnedPlace) -> None 23. set(self: paddle.fluid.core.Tensor, arg0: numpy.ndarray[uint8], arg1: paddle::platform::CUDAPinnedPlace) -> None 24. set(self: paddle.fluid.core.Tensor, arg0: numpy.ndarray[int8], arg1: paddle::platform::CUDAPinnedPlace) -> None paddle.fluid.LoDTensor.set_lod set_lod(self: paddle.fluid.core.LoDTensor, lod: List[List[int]]) -> None paddle.fluid.LoDTensor.set_recursive_sequence_lengths set_recursive_sequence_lengths(self: paddle.fluid.core.LoDTensor, recursive_sequence_lengths: List[List[int]]) -> None paddle.fluid.LoDTensor.shape shape(self: paddle.fluid.core.Tensor) -> List[int] diff --git a/paddle/fluid/framework/executor.h b/paddle/fluid/framework/executor.h index d3909def013..6eeeb1efc61 100644 --- a/paddle/fluid/framework/executor.h +++ b/paddle/fluid/framework/executor.h @@ -56,7 +56,6 @@ class Executor { explicit Executor(const platform::Place& place); - explicit Executor(Scope* scope, const platform::Place& place); /* * Close this Executor. * Calling this method will send complete messages to all pserver instances. diff --git a/python/paddle/fluid/async_executor.py b/python/paddle/fluid/async_executor.py index f645564ef4d..2442d26d3c8 100644 --- a/python/paddle/fluid/async_executor.py +++ b/python/paddle/fluid/async_executor.py @@ -86,7 +86,7 @@ class AsyncExecutor(object): >>> async_executor = fluid.AsyncExecutor(place) Args: - place(Place): CPUPlace or GPUPlace. + place(Place): CPUPlace only run_mode(str): default is empty string. """ if place is None: diff --git a/python/paddle/fluid/executor.py b/python/paddle/fluid/executor.py index c75a613d9a7..c9e87d9206f 100644 --- a/python/paddle/fluid/executor.py +++ b/python/paddle/fluid/executor.py @@ -703,6 +703,9 @@ class Executor(object): exe.infer_from_dataset(program=fluid.default_main_program(), dataset=dataset) """ + if self.place == paddle.fluid.CUDAPlace(): + raise RuntimeError("infer_from_dataset is verified on CPUPlace" + "We will open CUDAPlace in the future") scope, trainer = self._prepare_trainer( program=program, @@ -776,6 +779,9 @@ class Executor(object): dataset=dataset) """ + if self.place == paddle.fluid.CUDAPlace(): + raise RuntimeError("train_from_dataset is verified on CPUPlace" + "We will open CUDAPlace in the future") scope, trainer = self._prepare_trainer( program=program, -- GitLab