mindspore/docs/api/api_python/parallel/mindspore.parallel.nn.Pipel...

22 lines
1.1 KiB
ReStructuredText
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

mindspore.parallel.nn.Pipeline
============================================================================
.. py:class:: mindspore.parallel.nn.Pipeline(network, micro_size, stage_config=None, segment_config=None)
指定流水线并行的micro_batch个数、stage和segment的划分规则。
.. note::
`micro_size` 必须大于等于 `pipeline_stages`
参数:
- **network** (Cell) - 将进行pp并行的网络。
- **micro_size** (int) - MicroBatchsize。
- **stage_config** (dict可选) - 流水线并行对于每个cell的stage配置。默认值 ``None``
- **segment_config** (dict可选) - 流水线并行对于每个cell的segment配置。默认值 ``None``
异常:
- **TypeError** - `network` 不是cell类型输入。
- **TypeError** - `micro_size` 不是整数类型。
- **ValueError** - `micro_size` 值异常为0或者负数。
- **KeyError** - `dict` cell名称匹配异常遍历当前 `network` 下所有 `cell` 仍有剩余的配置项。