Skip to content

[AutoParallel] Add document for paddle.distributed.reshard #6192

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

Merged
merged 4 commits into from
Sep 21, 2023
Merged
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
27 changes: 27 additions & 0 deletions docs/api/paddle/distributed/reshard_cn.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
.. _cn_api_paddle_distributed_reshard:

reshard
-------------------------------

.. py:function:: paddle.distributed.reshard(dist_tensor, dist_attr)

根据新的分布式信息 ``dist_attr`` ,对一个带有分布式信息的 Tensor 进行 reshard 操作,重新进行 Tensor 的分布/切片,返回一个新的分布式 Tensor 。

``dist_tensor`` 需要是一个具有分布式信息的 paddle\.Tensor。


参数
:::::::::

- **dist_tensor** (Tensor) - 具有分布式信息的 Tensor ,为 paddle\.Tensor 类型。
- **dist_attr** (paddle.distributed.DistAttr) - Tensor 在 ProcessMesh 上的新的分布/切片方式。

返回
:::::::::
将输入的 dist_tensor 按照新的方式进行分布/切分的分布式 Tensor。


代码示例
:::::::::

COPY-FROM: paddle.distributed.reshard