!43037 code_docs_fix_parallel_api_master

Merge pull request !43037 from lichen/code_docs_fix_parallel_api_master
This commit is contained in:
i-robot 2022-09-28 01:14:01 +00:00 committed by Gitee
commit cdea00c067
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 7 additions and 5 deletions

View File

@ -18,7 +18,7 @@ mindspore.communication
.. py:function:: mindspore.communication.init(backend_name=None) .. py:function:: mindspore.communication.init(backend_name=None)
初始化通信服务需要的分布式后端,例如 `HCCL``NCCL` 服务。 初始化通信服务需要的分布式后端,例如 `HCCL``NCCL` 服务。通常在分布式并行场景下使用,并在使用通信服务前设置。
.. note:: .. note::
- HCCL的全称是华为集合通信库Huawei Collective Communication Library - HCCL的全称是华为集合通信库Huawei Collective Communication Library
@ -27,7 +27,7 @@ mindspore.communication
- 在运行以下示例之前用户需要预设通信环境变量请查看mindspore.communication的文档注释。 - 在运行以下示例之前用户需要预设通信环境变量请查看mindspore.communication的文档注释。
参数: 参数:
- **backend_name** (str) - 分布式后端的名称可选HCCL或NCCL。如果未设置则根据硬件平台类型device_target进行推断默认值为None。 - **backend_name** (str) - 分布式后端的名称可选HCCL或NCCL。在Ascend硬件平台下应使用HCCL在GPU硬件平台下应使用NCCL。如果未设置则根据硬件平台类型device_target自动进行推断默认值为None。
异常: 异常:
- **TypeError** - 参数 `backend_name` 不是字符串。 - **TypeError** - 参数 `backend_name` 不是字符串。

View File

@ -83,7 +83,8 @@ def _check_parallel_envs():
def init(backend_name=None): def init(backend_name=None):
""" """
Initialize distributed backend, e.g. HCCL/NCCL, it is required before using the communication service. Initialize distributed backends required by communication services, e.g. HCCL/NCCL. It is usually used in
distributed parallel scenarios and set before using communication services.
Note: Note:
- The full name of HCCL is Huawei Collective Communication Library. - The full name of HCCL is Huawei Collective Communication Library.
@ -93,8 +94,9 @@ def init(backend_name=None):
before running the following example, please see the docstring of the mindspore.communication. before running the following example, please see the docstring of the mindspore.communication.
Args: Args:
backend_name (str): Backend, using HCCL/NCCL/MCCL. If the `backend_name` is None, system will recognize backend_name (str): Backend, using HCCL/NCCL/MCCL. HCCL should be used for Ascend hardware platforms and
`device_target` by devices. Default: None. NCCL for GPU hardware platforms. If not set, inference is automatically made based on the
hardware platform type (device_target). Default: None.
Raises: Raises:
TypeError: If `backend_name` is not a string. TypeError: If `backend_name` is not a string.