mindspore.set_ps_context
- mindspore.set_ps_context(**kwargs)[source]
- Set parameter server training mode context, this api will be deprecated and removed in future versions. - Note - Parameter server mode is only supported in graph mode. Some other environment variables should also be set for parameter server training mode. These environment variables are listed below: - MS_SERVER_NUM: Server number 
- MS_WORKER_NUM: Worker number 
- MS_SCHED_HOST: Scheduler IP address 
- MS_SCHED_PORT: Scheduler port 
- MS_ROLE: The role of this process: - MS_SCHED: represents the scheduler, 
- MS_WORKER: represents the worker, 
- MS_PSERVER/MS_SERVER: represents the Server 
 
 - Parameters
- enable_ps (bool) – Whether to enable parameter server training mode. Only after enable_ps is set True, the environment variables will be effective. Default: - False.
- config_file_path (str) – Configuration file path used by recovery, parameter server training mode only supports Server disaster recovery currently. Default: - ''.
- enable_ssl (bool) – 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.
- client_password (str) – Password to decrypt the secret key stored in the client certificate. Default: - ''.
- server_password (str) – Password to decrypt the secret key stored in the server certificate. Default: - ''.
 
- Raises
- ValueError – If input key is not the attribute in parameter server training mode context. 
 - Examples - >>> import mindspore as ms >>> ms.set_ps_context(enable_ps=True, enable_ssl=True, client_password='', server_password='')