Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add cn docs for all_gather_object, modified docs for all_gather, split #5087

Merged
merged 4 commits into from
Jul 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/api/paddle/distributed/Overview_cn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ paddle.distributed.fleet是分布式训练的统一入口API,用于配置分
集合通信算法API
::::::::::::::::::::::

在集群上,对多设备的进程组的参数数据tensor进行计算处理
在集群上,对多设备的进程组的参数数据tensor或object进行计算处理

.. csv-table::
:header: "API名称", "API功能"
Expand All @@ -82,6 +82,7 @@ paddle.distributed.fleet是分布式训练的统一入口API,用于配置分
" :ref:`ReduceOP <cn_api_distributed_ReduceOp>` ", "规约,指定逐元素规约操作"
" :ref:`all_reduce <cn_api_distributed_all_reduce>` ", "组规约,规约进程组内的tensor,结果广播至每个进程"
" :ref:`all_gather <cn_api_distributed_all_gather>` ", "组聚合,聚合进程组内的tensor,结果广播至每个进程"
" :ref:`all_gather_object <cn_api_distributed_all_gather_object>` ", "组聚合,聚合进程组内的object,结果广播至每个进程"
" :ref:`broadcast <cn_api_distributed_broadcast>` ", "广播一个tensor到每个进程"
" :ref:`scatter <cn_api_distributed_scatter>` ", "分发tensor到每个进程"
" :ref:`split <cn_api_distributed_split>` ", "切分参数到多个设备"
Expand Down
6 changes: 3 additions & 3 deletions docs/api/paddle/distributed/all_gather_cn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ all_gather

参数
:::::::::
- tensor_list (list) - 操作的输出Tensor列表。列表中的每个元素均为Tensor,每个Tensor的数据类型为:float16、float32、float64、int32、int64。
- tensor (Tensor) - 操作的输入Tensor。Tensor的数据类型为:float16、float32、float64、int32、int64。
- tensor_list (list) - 操作的输出Tensor列表。列表中的每个元素均为Tensor,每个Tensor的数据类型为:float16、float32、float64、int32、int64、int8、uint8、bool、complex64、complex128
- tensor (Tensor) - 操作的输入Tensor。Tensor的数据类型为:float16、float32、float64、int32、int64、int8、uint8、bool、complex64、complex128
- group (int,可选) - 工作的进程组编号,默认为0。

返回
Expand All @@ -27,4 +27,4 @@ all_gather

代码示例
:::::::::
COPY-FROM: paddle.distributed.all_gather
COPY-FROM: paddle.distributed.all_gather
26 changes: 26 additions & 0 deletions docs/api/paddle/distributed/all_gather_object_cn.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
.. _cn_api_distributed_all_gather_object:

all_gather_object
-------------------------------


.. py:function:: paddle.distributed.all_gather_object(object_list, object, group=0)

进程组内所有进程指定的picklable对象进行聚合操作,并返回给所有进程聚合的结果。和all_gather类似,但可以传入自定义的python对象。

.. warning::
该API只支持动态图模式。

参数
:::::::::
- object_list (list) - 操作的输出Object列表。
- object (Any) - 操作的输入Object,需要保证输入自定义的Object是picklable的。
- group (int,可选) - 工作的进程组编号,默认为0。

返回
:::::::::

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为什么英文里有个warning,中文没有呀?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已添加

代码示例
:::::::::
COPY-FROM: paddle.distributed.all_gather_object
4 changes: 2 additions & 2 deletions docs/api/paddle/split_cn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ split

参数
:::::::::
- **x** (Tensor) - 输入变量,数据类型为bool、float16、float32、float64、int32、int64的多维Tensor。
- **x** (Tensor) - 输入变量,数据类型为bool、float16、float32、float64、uint8、int8、int32、int64的多维Tensor。
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

中英文数据类型不一致?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是英文注释写错了,已在代码里修改

- **num_or_sections** (int|list|tuple) - 如果 ``num_or_sections`` 是一个整数,则表示 Tensor 平均划分为相同大小子 Tensor 的数量。如果 ``num_or_sections`` 是一个 list 或 tuple,那么它的长度代表子 Tensor 的数量,它的元素可以是整数或者形状为[1]的 Tensor,依次代表子 Tensor 需要分割成的维度的大小。list 或 tuple 的长度不能超过输入 Tensor 待分割的维度的大小。在 list 或 tuple 中,至多有一个元素值为-1,表示该值是由 ``x`` 的维度和其他 ``num_or_sections`` 中元素推断出来的。例如对一个维度为[4, 6, 6] Tensor 的第三维进行分割时,指定 ``num_or_sections=[2,-1,1]``,输出的三个 Tensor 维度分别为:[4, 6, 2],[4, 6, 3],[4, 6, 1]。
- **axis** (int|Tensor,可选) - 整数或者形状为[1]的 Tensor,数据类型为 int32 或 int64。表示需要分割的维度。如果 ``axis < 0``,则划分的维度为 ``rank(x) + axis``。默认值为0。
- **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。
Expand All @@ -24,4 +24,4 @@ split
代码示例
:::::::::

COPY-FROM: paddle.split
COPY-FROM: paddle.split