A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 14, 05:30 UTC
[Misc] Begin deprecation of `get_tensor_model_*_group` (#22494)
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Cyrus Leung committed
Aug 8, 2025 at 16:11 UTC
43c4f3d77c3c03f67385201e1b1725a6ba6bcc7a
3 files changed
+16
-10
tests/distributed/test_custom_all_reduce.py
+2
-3
@@ -10,8 +10,7 @@ import torch.distributed as dist
10
11
from vllm.distributed.communication_op import ( # noqa
12
tensor_model_parallel_all_reduce)
13
-from vllm.distributed.parallel_state import (get_tensor_model_parallel_group,
14
- get_tp_group, graph_capture)
13
+from vllm.distributed.parallel_state import get_tp_group, graph_capture
14
15
from ..utils import (ensure_model_parallel_initialized,
16
init_test_distributed_environment, multi_process_parallel)
@@ -37,7 +36,7 @@ def graph_allreduce(
36
init_test_distributed_environment(tp_size, pp_size, rank,
37
distributed_init_port)
38
ensure_model_parallel_initialized(tp_size, pp_size)
40
- group = get_tensor_model_parallel_group().device_group
39
+ group = get_tp_group().device_group
40
41
# A small all_reduce for warmup.
42
# this is needed because device communicators might be created lazily
tests/distributed/test_quick_all_reduce.py
+2
-3
@@ -10,8 +10,7 @@ import torch.distributed as dist
10
11
from vllm.distributed.communication_op import ( # noqa
12
tensor_model_parallel_all_reduce)
13
-from vllm.distributed.parallel_state import (get_tensor_model_parallel_group,
14
- get_tp_group, graph_capture)
13
+from vllm.distributed.parallel_state import get_tp_group, graph_capture
14
from vllm.platforms import current_platform
15
16
from ..utils import (ensure_model_parallel_initialized,
@@ -42,7 +41,7 @@ def graph_quickreduce(
41
init_test_distributed_environment(tp_size, pp_size, rank,
42
distributed_init_port)
43
ensure_model_parallel_initialized(tp_size, pp_size)
45
- group = get_tensor_model_parallel_group().device_group
44
+ group = get_tp_group().device_group
45
46
# A small all_reduce for warmup.
47
# this is needed because device communicators might be created lazily
vllm/distributed/parallel_state.py
+12
-4
@@ -36,6 +36,7 @@ from unittest.mock import patch
36
import torch
37
import torch.distributed
38
from torch.distributed import Backend, ProcessGroup
39
+from typing_extensions import deprecated
40
41
import vllm.envs as envs
42
from vllm.distributed.device_communicators.base_device_communicator import (
@@ -894,8 +895,12 @@ def get_tp_group() -> GroupCoordinator:
895
return _TP
896
897
897
-# kept for backward compatibility
898
-get_tensor_model_parallel_group = get_tp_group
898
+@deprecated("`get_tensor_model_parallel_group` has been replaced with "
899
+ "`get_tp_group` and may be removed after v0.12. Please use "
900
+ "`get_tp_group` instead.")
901
+def get_tensor_model_parallel_group():
902
+ return get_tp_group()
903
+
904
905
_PP: Optional[GroupCoordinator] = None
906
@@ -921,8 +926,11 @@ def get_pp_group() -> GroupCoordinator:
926
return _PP
927
928
924
-# kept for backward compatibility
925
-get_pipeline_model_parallel_group = get_pp_group
929
+@deprecated("`get_pipeline_model_parallel_group` has been replaced with "
930
+ "`get_pp_group` and may be removed in v0.12. Please use "
931
+ "`get_pp_group` instead.")
932
+def get_pipeline_model_parallel_group():
933
+ return get_pp_group()
934
935
936
@contextmanager