mindspore.get_ps_context

View Source On Gitee
mindspore.get_ps_context(attr_key)[source]

Get parameter server training mode context attribute value according to the key, this api will be deprecated and removed in future versions.

Parameters

attr_key (str) –

The key of the attribute:

  • enable_ps (bool, optional): Whether to enable parameter server training mode. Default: False .

  • config_file_path (str, optional): Configuration file path used by recovery, parameter server training mode only supports Server disaster recovery currently. Default: '' .

  • enable_ssl (bool, optional): Set PS SSL mode enabled or disabled. Default: False . When set to False, users need to review and confirm the security of network environment where the distributed job is located.

Returns

Returns attribute value according to the key.

Raises

ValueError – If input key is not attribute in auto parallel context.

Examples

>>> import mindspore as ms
>>> ms.get_ps_context("enable_ps")