Unverified Commit bd45912b authored by Robert Shaw's avatar Robert Shaw Committed by GitHub
Browse files

[TPU] Lazy Import (#15656)


Signed-off-by: default avatarrshaw@neuralmagic.com <robertgshaw2@gmail.com>
parent 15dac210
......@@ -15,7 +15,6 @@ import torch
from torch.distributed import ProcessGroup, TCPStore
from torch.distributed.distributed_c10d import (Backend, PrefixStore,
_get_default_timeout,
_shutdown_backend,
_unregister_process_group,
is_nccl_available)
from torch.distributed.rendezvous import rendezvous
......@@ -343,5 +342,7 @@ def stateless_destroy_torch_distributed_process_group(
Destroy ProcessGroup returned by
stateless_init_torch_distributed_process_group().
"""
# Lazy import for non-CUDA backends.
from torch.distributed.distributed_c10d import _shutdown_backend
_shutdown_backend(pg)
_unregister_process_group(pg.group_name)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment