Skip to content

Commit 5e6c3fb

Browse files
mrshenlifacebook-github-bot
authored andcommitted
Add more details to explain rpc_backend_options arg in init_rpc
Summary: Pull Request resolved: pytorch#30855 Test Plan: Imported from OSS Differential Revision: D18847529 Pulled By: mrshenli fbshipit-source-id: b4f0d5797f3b41cce155b7821d6bd34b268bd24e
1 parent 6d06b92 commit 5e6c3fb

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

torch/distributed/rpc/__init__.py

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,25 @@ def init_rpc(
3939
collective communication.
4040
4141
Arguments:
42-
backend (Enum): type of RPC backend implementation.
43-
Currently, process group backend is the only
44-
available backend implementation. (default:
45-
``RpcBackend.PROCESS_GROUP``).
42+
backend (Enum): type of RPC backend implementation. Currently,
43+
process group backend is the only available backend
44+
implementation. (default: ``RpcBackend.PROCESS_GROUP``).
4645
name (str): a globally unique name of this node. (e.g.,
47-
``Trainer3``, ``ParameterServer2``, ``Master``,
48-
``Worker1``) Name can only contain number, alphabet,
49-
underscore, and/or dash, and must be shorter than
50-
128 characters.
46+
``Trainer3``, ``ParameterServer2``, ``Master``, ``Worker1``)
47+
Name can only contain number, alphabet, underscore, and/or dash,
48+
and must be shorter than 128 characters.
5149
rank (int): a globally unique id/rank of this node.
5250
world_size (int): The number of workers in the group.
53-
rpc_backend_options (RpcBackendOptions): The options passed to RpcAgent
54-
consturctor.
51+
rpc_backend_options (RpcBackendOptions): The options passed to
52+
RpcAgent consturctor. It contains RpcAgent specific
53+
initialization configurations. By default, it contains
54+
``rpc_timeout = timedelta(seconds=60)``,
55+
``init_method = "env://"``, ``num_send_recv_threads = 4`` for
56+
process group agent. If using the default
57+
``rpc_backend_options``, RPC would initialize the underlying
58+
process group backend using ``init_method = "env://"``,
59+
meaning that environment variables ``MASTER_ADDRESS`` and
60+
``MASTER_PORT`` needs to be set properly.
5561
"""
5662

5763
if not rpc_backend_options:

0 commit comments

Comments
 (0)