mindspore.communication.release

View Source On Gitee
mindspore.communication.release()[source]

Release distributed resource. e.g. HCCL/NCCL/MCCL.

Note

This method should be used after init(). If not, resource will be released when program ends.

Raises

RuntimeError – If failed to release distributed resource.

Supported Platforms:

Ascend GPU CPU

Examples

Note

Before running the following examples, you need to configure the communication environment variables.

For Ascend/GPU/CPU devices, it is recommended to use the msrun startup method without any third-party or configuration file dependencies. Please see the msrun start up for more details.

>>> from mindspore.communication import init, release
>>> init()
>>> release()