Skip to content
This repository has been archived by the owner on Nov 25, 2024. It is now read-only.

Commit

Permalink
Merge pull request #120 from rapidsai/branch-24.02
Browse files Browse the repository at this point in the history
Forward-merge branch-24.02 to branch-24.04
  • Loading branch information
GPUtester authored Jan 22, 2024
2 parents cf1b7e3 + c592185 commit 5ba377a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
13 changes: 13 additions & 0 deletions python/pylibwholegraph/pylibwholegraph/torch/comm.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,19 @@
all_comm_local_size = 1


def reset_communicators():
global all_comm_world_rank, all_comm_world_size, all_comm_local_rank, all_comm_local_size
global global_communicators, local_node_communicator, local_device_communicator
global_communicators = {}
local_node_communicator = None
local_device_communicator = None

all_comm_world_rank = 0
all_comm_world_size = 1
all_comm_local_rank = 0
all_comm_local_size = 1


def set_world_info(world_rank: int, world_size: int, local_rank: int, local_size: int):
"""
Set the global world's information. This is used for create common used communicators, like local node communicator,
Expand Down
4 changes: 3 additions & 1 deletion python/pylibwholegraph/pylibwholegraph/torch/initialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import torch
import torch.utils.dlpack
import pylibwholegraph.binding.wholememory_binding as wmb
from .comm import set_world_info, get_global_communicator, get_local_node_communicator
from .comm import set_world_info, get_global_communicator, get_local_node_communicator, reset_communicators


def init(world_rank: int, world_size: int, local_rank: int, local_size: int):
Expand Down Expand Up @@ -73,3 +73,5 @@ def finalize():
:return: None
"""
wmb.finalize()
reset_communicators()
torch.distributed.destroy_process_group() if torch.distributed.is_initialized() else None

0 comments on commit 5ba377a

Please sign in to comment.