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

22 lines
800 B
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.PipelineGradReducer
============================================================================
.. py:class:: mindspore.parallel.nn.PipelineGradReducer(parameters, scale_sense=1.0, opt_shard=None)
函数式训练场景下,实现流水线并行的梯度归约及累加。
参数:
- **parameters** (list) - 将进行pp并行的网络参数。
- **scale_sense** (float可选) - 梯度的尺度感知。默认值: ``1.0``
- **opt_shard** (bool可选) - 如果使用优化器需要配置为True。默认值 ``None``
异常:
- **RuntimeError** - `mode` 不是图模式。
样例:
.. note::
.. include:: ../mint/mindspore.mint.comm_note.rst
该样例需要在多设备上运行。