Skip to content

Commit 2a48d90

Browse files
robertgshaw2-redhatlulmer
authored andcommitted
[TPU] Lazy Import (vllm-project#15656)
Signed-off-by: [email protected] <[email protected]> Signed-off-by: Louis Ulmer <[email protected]>
1 parent 2f4bbe3 commit 2a48d90

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

vllm/distributed/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
from torch.distributed import ProcessGroup, TCPStore
1616
from torch.distributed.distributed_c10d import (Backend, PrefixStore,
1717
_get_default_timeout,
18-
_shutdown_backend,
1918
_unregister_process_group,
2019
is_nccl_available)
2120
from torch.distributed.rendezvous import rendezvous
@@ -343,5 +342,7 @@ def stateless_destroy_torch_distributed_process_group(
343342
Destroy ProcessGroup returned by
344343
stateless_init_torch_distributed_process_group().
345344
"""
345+
# Lazy import for non-CUDA backends.
346+
from torch.distributed.distributed_c10d import _shutdown_backend
346347
_shutdown_backend(pg)
347348
_unregister_process_group(pg.group_name)

0 commit comments

Comments
 (0)