init_rpc

paddle.distributed.rpc. init_rpc ( name: str, rank: Optional[int] = None, world_size: Optional[int] = None, master_endpoint: Optional[str] = None ) None [source]

init rpc. Warning: All RPC API should only be used internally within a secure network environment and must not be accessible via the public internet.

Parameters
  • name (str) – worker name.

  • rank (int, optional) – worker id, default is None.

  • world_size (int, optional) – number of workers, default is None.

  • master_endpoint (str, optional) – id address of master, other nodes communicate with the master to get the information of all worker nodes, default is None.

Returns

None.

Examples

>>> 
>>> import paddle.distributed.rpc as rpc

>>> rpc.init_rpc("worker0", rank=0, world_size=1,
...             master_endpoint="127.0.0.1:8001")

>>> rpc.shutdown()