-
Notifications
You must be signed in to change notification settings - Fork 762
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
[IPU] add paddle.static.set_ipu_shard #4855
Merged
Merged
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
.. _cn_api_fluid_set_ipu_shard: | ||
|
||
set_ipu_shard | ||
------------------------------- | ||
|
||
.. py:function:: paddle.static.set_ipu_shard(call_func, index=-1, stage=-1) | ||
|
||
|
||
该接口通过设置输入的函数或计算层内每个算子的流水线属性实现对模型的切分。 | ||
|
||
.. note: | ||
|
||
仅支持当enable_manual_shard=True,index设置才有效。请参阅 :ref:`cn_api_fluid_IpuStrategy` 。 | ||
仅支持当enable_pipelining=True,stage设置才有效。请参阅 :ref:`cn_api_fluid_IpuStrategy` 。 | ||
一个index支持对应None stage或一个stage,一个stage仅支持对应一个新的index或者一个重复的index。 | ||
|
||
参数 | ||
::::::::: | ||
- **call_func** (Layer|function) - 静态图下的函数或者计算层。 | ||
- **index** (int,可选) - 指定Op在哪个ipu上计算,(如‘0, 1, 2, 3’),默认值-1,表示不指定ipu。 | ||
- **stage** (int,可选) – 指定被切分的模型的计算顺序,(如‘0, 1, 2, 3’),按照数值大小顺序对被切分的模型进行计算,默认值-1,表示没有数据流水计算顺序并按照计算图顺序计算Op。 | ||
|
||
返回 | ||
::::::::: | ||
无。 | ||
|
||
代码示例 | ||
:::::::::: | ||
|
||
COPY-FROM: paddle.static.set_ipu_shard | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里代码没有正确生成,建议这行代码之后再加一行空格试试
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里似乎是因为构建使用的 paddle 代码还没有合并 PaddlePaddle/Paddle#43164
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已添加空行