def METHOD_NAME(self) -> None:
    os.environ["RANK"] = "0"
    os.environ["WORLD_SIZE"] = "1"
    os.environ["LOCAL_WORLD_SIZE"] = "1"
    os.environ["MASTER_ADDR"] = str("localhost")
    os.environ["MASTER_PORT"] = str(get_free_port())
    os.environ["NCCL_SOCKET_IFNAME"] = "lo"
    if torch.cuda.is_available():
        self.curr_device = torch.device("cuda:0")
        torch.cuda.set_device(self.curr_device)
        backend = "nccl"
    else:
        self.curr_device = torch.device("cpu")
        backend = "gloo"
    dist.init_process_group(backend=backend)