gigl.distributed.utils.rpc_init#
init_rpc for sampling workers, with the TensorPipe channels taken from an environment variable.
init_rpc_with_options is a copy of GLT’s graphlearn_torch.distributed.rpc.init_rpc.
Differences from GLT’s init_rpc (each one is marked # GiGL change: in the code):
The TensorPipe channels come from the
channelsargument, which defaults to("basic",). GLT always uses["mpt_uv", "basic"].There is no
is_dynamicargument. No caller here needs it; the graph-storeinit_serverandinit_client, which do, call GLT’sinit_rpc.Module state is written as
glt_rpc._rpc_inited = ...instead of withglobal, because this code lives in another module. GLT’s helpers (all_gather,barrier,rpc_is_initialized) read that state.
With channels=("mpt_uv", "basic"), the TensorPipe options, the module state and the side effects are the same
as GLT’s.
GltInitRpcDriftTest hashes the source of GLT’s init_rpc, shutdown_rpc and rpc_is_initialized.
A GLT upgrade that changes any of them fails the test; compare the copy with the new source when it does.
The channels come from SAMPLING_RPC_CHANNELS_ENV in gigl/distributed/constants.py, which describes
each value.
Call sites that read the variable, through init_rpc_from_env:
The colocated loader worker (
init_neighbor_loader_worker).The dataset-building process (
dataset_factory).The colocated sampling producer (
DistSamplingProducer).The graph-store sampling worker subprocesses (
shared_dist_sampling_producer).
Call sites that ignore the variable and call GLT’s init_rpc with GLT’s channels, mpt_uv and basic:
The graph-store
init_serverandinit_client(dist_serverandcompute), which acceptis_dynamic.GLT’s own
init_serverandinit_client.
Processes that read the variable, whose default is basic, and processes that do not, which use mpt_uv
and basic, share basic, so a mixed deployment connects. Set GIGL_SAMPLING_RPC_CHANNELS=mpt_uv,basic
to use GLT’s channels in the processes that read the variable.
Where an invalid value fails:
Before any worker is spawned, in
DistSamplingProducer.initandSharedDistSamplingBackend.init_backend. Both read the variable in the parent process first.In the
mp.spawnchild of the dataset-building process;mp.spawnre-raises its error.At startup of each colocated loader worker.
Attributes#
Functions#
|
Calls |
|
Initializes RPC on the current process like GLT's |
Returns the channels from the environment, defaulting to |
Module Contents#
- gigl.distributed.utils.rpc_init.init_rpc_from_env(master_addr, master_port, num_rpc_threads=16, rpc_timeout=180)[source]#
Calls
init_rpc_with_optionswith the channels from the environment.- Parameters:
master_addr (str)
master_port (int)
num_rpc_threads (int)
rpc_timeout (float)
- Return type:
None
- gigl.distributed.utils.rpc_init.init_rpc_with_options(master_addr, master_port, num_rpc_threads=16, rpc_timeout=180, channels=DEFAULT_CHANNELS)[source]#
Initializes RPC on the current process like GLT’s
init_rpc, with chosen channels.- Parameters:
master_addr (str) – Address of the rendezvous master.
master_port (int) – Port of the rendezvous master.
num_rpc_threads (int) – Size of the RPC worker thread pool.
rpc_timeout (float) – RPC timeout in seconds, also used for the bring-up gather and barrier.
channels (Sequence[str]) – TensorPipe channels in priority order; any of
basic,mpt_uv,cmawithout repeats, andbasicis required.
- Return type:
None