From 2010bdc3c8b4c5a65bafdad5c241807e14d47cad Mon Sep 17 00:00:00 2001 From: Wen Sun <35923278+HermitSun@users.noreply.github.com> Date: Fri, 14 Oct 2022 20:02:38 +0800 Subject: [PATCH] Fix collective APIs cannot be recognized when building docs (#46962) --- python/paddle/distributed/__init__.py | 6 +++--- .../distributed/communication/stream/__init__.py | 6 +++--- .../communication_stream_reduce_scatter_api_dygraph.py | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/python/paddle/distributed/__init__.py b/python/paddle/distributed/__init__.py index 1790e874889..6cad4678463 100644 --- a/python/paddle/distributed/__init__.py +++ b/python/paddle/distributed/__init__.py @@ -76,7 +76,7 @@ __all__ = [ # noqa "gloo_release", "QueueDataset", "split", "CountFilterEntry", "ShowClickEntry", "get_world_size", "get_group", "all_gather", "all_gather_object", "InMemoryDataset", "barrier", "all_reduce", "alltoall", - "send", "reduce", "recv", "ReduceOp", "wait", "get_rank", - "ProbabilityEntry", "ParallelMode", "is_initialized", "isend", "irecv", - "reduce_scatter", "rpc" + "alltoall_single", "send", "reduce", "recv", "ReduceOp", "wait", "get_rank", + "ProbabilityEntry", "ParallelMode", "is_initialized", + "destroy_process_group", "isend", "irecv", "reduce_scatter", "rpc", "stream" ] diff --git a/python/paddle/distributed/communication/stream/__init__.py b/python/paddle/distributed/communication/stream/__init__.py index a1844decf94..43952ce5541 100644 --- a/python/paddle/distributed/communication/stream/__init__.py +++ b/python/paddle/distributed/communication/stream/__init__.py @@ -18,12 +18,12 @@ from .alltoall import alltoall from .alltoall_single import alltoall_single from .broadcast import broadcast from .reduce import reduce -from .reduce_scatter import _reduce_scatter_base, reduce_scatter +from .reduce_scatter import reduce_scatter from .recv import recv from .scatter import scatter from .send import send __all__ = [ - "_reduce_scatter_base", "all_reduce", "alltoall", "alltoall_single", - "broadcast", "reduce", "reduce_scatter", "recv", "scatter", "send" + "all_gather", "all_reduce", "alltoall", "alltoall_single", "broadcast", + "reduce", "reduce_scatter", "recv", "scatter", "send" ] diff --git a/python/paddle/fluid/tests/unittests/collective/communication_stream_reduce_scatter_api_dygraph.py b/python/paddle/fluid/tests/unittests/collective/communication_stream_reduce_scatter_api_dygraph.py index 8f66d67e0d5..effaf1cb6c9 100644 --- a/python/paddle/fluid/tests/unittests/collective/communication_stream_reduce_scatter_api_dygraph.py +++ b/python/paddle/fluid/tests/unittests/collective/communication_stream_reduce_scatter_api_dygraph.py @@ -17,6 +17,7 @@ import numpy as np import paddle import paddle.distributed as dist import test_collective_api_base as test_collective_base +from paddle.distributed.communication.stream.reduce_scatter import _reduce_scatter_base class StreamReduceScatterTestCase(): @@ -77,11 +78,10 @@ class StreamReduceScatterTestCase(): # case 3: test the legacy API result_tensor = paddle.empty_like(t1) - task = dist.stream._reduce_scatter_base( - result_tensor, - tensor, - sync_op=self._sync_op, - use_calc_stream=self._use_calc_stream) + task = _reduce_scatter_base(result_tensor, + tensor, + sync_op=self._sync_op, + use_calc_stream=self._use_calc_stream) if not self._sync_op: task.wait() if rank == 0: -- GitLab