dgl.distributed.initialize๏ƒ

dgl.distributed.initialize(ip_config, max_queue_size=21474836480, net_type=None, num_worker_threads=1, use_graphbolt=False)[source]๏ƒ

Initialize DGLโ€™s distributed module

This function initializes DGLโ€™s distributed module. It acts differently in server or client modes. In the server mode, it runs the server code and never returns. In the client mode, it builds connections with servers for communication and creates worker processes for distributed sampling.

Parameters:
  • ip_config (str) โ€“ File path of ip_config file

  • max_queue_size (int) โ€“

    Maximal size (bytes) of client queue buffer (~20 GB on default).

    Note that the 20 GB is just an upper-bound and DGL uses zero-copy and it will not allocate 20GB memory at once.

  • net_type (str, optional) โ€“ [Deprecated] Networking type, can be โ€˜socketโ€™ only.

  • num_worker_threads (int) โ€“ The number of OMP threads in each sampler process.

  • use_graphbolt (bool, optional) โ€“ Whether to use GraphBolt for distributed train.

Note

Users have to invoke this API before any DGLโ€™s distributed API and framework-specific distributed API. For example, when used with Pytorch, users have to invoke this function before Pytorchโ€™s pytorch.distributed.init_process_group.