Skip to content

Commit d4afa07

Browse files
committed
docs(distributed/collective): add alltoall_single
1 parent d334bd9 commit d4afa07

File tree

2 files changed

+30
-4
lines changed

2 files changed

+30
-4
lines changed

docs/api/paddle/distributed/Overview_cn.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,13 @@ paddle.distributed.fleet 是分布式训练的统一入口 API,用于配置分
8686
" :ref:`all_gather <cn_api_distributed_all_gather>` ", "组聚合,聚合进程组内的 tensor,结果广播至每个进程"
8787
" :ref:`all_gather_object <cn_api_distributed_all_gather_object>` ", "组聚合,聚合进程组内的 object,结果广播至每个进程"
8888
" :ref:`alltoall <cn_api_distributed_alltoall>` ", "分发 tensor 列表到每个进程并进行聚合"
89+
" :ref:`alltoall_single <cn_api_distributed_alltoall_single>` ", "分发单个 tensor 到每个进程并聚合至目标 tensor"
8990
" :ref:`broadcast <cn_api_distributed_broadcast>` ", "广播一个 tensor 到每个进程"
9091
" :ref:`scatter <cn_api_distributed_scatter>` ", "分发 tensor 到每个进程"
9192
" :ref:`split <cn_api_distributed_split>` ", "切分参数到多个设备"
9293
" :ref:`barrier <cn_api_distributed_barrier>` ", "同步路障,进行阻塞操作,实现组内所有进程的同步"
93-
" :ref:`send <cn_api_distributed_send>` ", "发送一个 tensor 到指定的接收者"
94-
" :ref:`recv <cn_api_distributed_recv>` ", "接收一个来自指定发送者的 tensor"
95-
" :ref:`isend <cn_api_distributed_isend>` ", "异步发送一个 tensor 到指定的接收者"
96-
" :ref:`irecv <cn_api_distributed_irecv>` ", "异步接收一个来自指定发送者的 tensor"
94+
" :ref:`send <cn_api_distributed_send>` ", "发送一个 tensor 到指定的进程"
95+
" :ref:`recv <cn_api_distributed_recv>` ", "接收一个来自指定进程的 tensor"
96+
" :ref:`isend <cn_api_paddle_distributed_isend>` ", "异步发送一个 tensor 到指定的进程"
97+
" :ref:`irecv <cn_api_paddle_distributed_irecv>` ", "异步接收一个来自指定进程的 tensor"
9798
" :ref:`reduce_scatter <cn_api_paddle_distributed_reduce_scatter>` ", "规约,然后将 tensor 列表分散到组中的所有进程上"
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
.. _cn_api_distributed_alltoall_single:
2+
3+
alltoall_single
4+
-------------------------------
5+
6+
7+
.. py:function:: alltoall_single(in_tensor, out_tensor, in_split_sizes=None, out_split_sizes=None, group=None, use_calc_stream=True)
8+
9+
将输入的 tensor 分发到所有进程,并将接收到的 tensor 聚合到 out_tensor 中。
10+
11+
参数
12+
:::::::::
13+
- in_tensor (Tensor): 输入的 tensor,其数据类型必须是 float16、float32、float64、int32、int64、int8、uint8、bool。
14+
- out_tensor (Tensor): 输出的 tensor,其数据类型与输入的 tensor 一致。
15+
- in_split_sizes (list[int],可选): 对 in_tensor 的 dim[0] 进行切分的大小。若该参数未指定,in_tensor 将被均匀切分到各个进程中(需要确保 in_tensor 的大小能够被组中的进程数整除)。默认值:None。
16+
- out_split_sizes (list[int],可选): 对 out_tensor 的 dim[0] 进行切分的大小。若该参数未指定,out_tensor 将均匀地聚合来自各个进程的数据(需要确保 out_tensor 的大小能够被组中的进程数整除)。默认值:None。
17+
- use_calc_stream (bool,可选) - 标识使用计算流(若为 True)还是通信流。默认值:True。
18+
19+
返回
20+
:::::::::
21+
若 use_calc_stream=True,无返回值;若 use_calc_stream=False,返回一个 Task。
22+
23+
代码示例
24+
:::::::::
25+
COPY-FROM: paddle.distributed.alltoall_single

0 commit comments

Comments
 (0)