Skip to content

Commit 68b80fa

Browse files
authored
[IPU] add paddle.static.set_ipu_shard (#4855)
* add paddle.static.set_ipu_shard * up 0 * rename file * use full-width comma * add final newline
1 parent 2d5e865 commit 68b80fa

File tree

2 files changed

+36
-6
lines changed

2 files changed

+36
-6
lines changed

docs/api/paddle/static/ipu_shard_guard_cn.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,21 @@
33
ipu_shard_guard
44
-------------------------------
55

6-
.. py:function:: paddle.static.ipu_shard_guard(index=None, stage=None)
6+
.. py:function:: paddle.static.ipu_shard_guard(index=-1, stage=-1)
77
88
99
该接口用于对模型进行切分。用于指定Op在哪个ipu上进行计算以及模型被切分之后的计算顺序。
1010

1111
.. note:
1212
13-
仅支持当enable_manual_shard=True, index才能被置为非None。请参阅 :ref:`cn_api_fluid_IpuStrategy` 。
14-
仅支持当enable_pipelining=True, stage才能被置为非None。请参阅 :ref:`cn_api_fluid_IpuStrategy` 。
13+
仅支持当enable_manual_shard=True,index设置才有效。请参阅 :ref:`cn_api_fluid_IpuStrategy` 。
14+
仅支持当enable_pipelining=True,stage设置才有效。请参阅 :ref:`cn_api_fluid_IpuStrategy` 。
1515
一个index支持对应None stage或一个stage,一个stage仅支持对应一个新的index或者一个重复的index。
1616

1717
参数
1818
:::::::::
19-
- **index** (int, 可选) - 指定Op在哪个ipu上计算,(如‘0, 1, 2, 3’),默认值None,表示Op默认跑在IPU 0
20-
- **stage** (int, 可选) – 指定被切分的模型的计算顺序,(如‘0, 1, 2, 3’),按照数值大小顺序对被切分的模型进行计算,默认值None,表示没有数据流水计算顺序并按照计算图顺序计算Op。
19+
- **index** (int可选) - 指定Op在哪个ipu上计算,(如‘0, 1, 2, 3’),默认值-1,表示Op没有指定ipu
20+
- **stage** (int可选) – 指定被切分的模型的计算顺序,(如‘0, 1, 2, 3’),按照数值大小顺序对被切分的模型进行计算,默认值-1,表示没有数据流水计算顺序并按照计算图顺序计算Op。
2121

2222
返回
2323
:::::::::
@@ -26,4 +26,4 @@ ipu_shard_guard
2626
代码示例
2727
::::::::::
2828

29-
COPY-FROM: paddle.static.ipu_shard_guard
29+
COPY-FROM: paddle.static.ipu_shard_guard
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
.. _cn_api_fluid_set_ipu_shard:
2+
3+
set_ipu_shard
4+
-------------------------------
5+
6+
.. py:function:: paddle.static.set_ipu_shard(call_func, index=-1, stage=-1)
7+
8+
9+
该接口通过设置输入的函数或计算层内每个算子的流水线属性实现对模型的切分。
10+
11+
.. note:
12+
13+
仅支持当enable_manual_shard=True,index设置才有效。请参阅 :ref:`cn_api_fluid_IpuStrategy` 。
14+
仅支持当enable_pipelining=True,stage设置才有效。请参阅 :ref:`cn_api_fluid_IpuStrategy` 。
15+
一个index支持对应None stage或一个stage,一个stage仅支持对应一个新的index或者一个重复的index。
16+
17+
参数
18+
:::::::::
19+
- **call_func** (Layer|function) - 静态图下的函数或者计算层。
20+
- **index** (int,可选) - 指定Op在哪个ipu上计算,(如‘0, 1, 2, 3’),默认值-1,表示不指定ipu。
21+
- **stage** (int,可选) – 指定被切分的模型的计算顺序,(如‘0, 1, 2, 3’),按照数值大小顺序对被切分的模型进行计算,默认值-1,表示没有数据流水计算顺序并按照计算图顺序计算Op。
22+
23+
返回
24+
:::::::::
25+
无。
26+
27+
代码示例
28+
::::::::::
29+
30+
COPY-FROM: paddle.static.set_ipu_shard

0 commit comments

Comments
 (0)