Skip to content

Commit b88443b

Browse files
authored
[dist] fix communicator patch (vllm-project#58)
### What this PR does / why we need it? fix communicator patch so parallel could work. see vllm-project#52 Signed-off-by: MengqingCao <[email protected]>
1 parent e264987 commit b88443b

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def _read_requirements(filename: str) -> List[str]:
9595
"Topic :: Scientific/Engineering :: Artificial Intelligence",
9696
"Topic :: Scientific/Engineering :: Information Analysis",
9797
],
98-
packages=find_packages(exclude=("docs", "examples", "tests*", "patch")),
98+
packages=find_packages(exclude=("docs", "examples", "tests*")),
9999
python_requires=">=3.9",
100100
install_requires=get_requirements(),
101101
extras_require={},

vllm_ascend/patch/patch_commnicator.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919
# https://github.com/vllm-project/vllm/pull/11324.
2020

2121
import torch
22-
from vllm.distributed.parallel_state import GroupCoordinator
22+
import vllm
2323
from vllm.utils import resolve_obj_by_qualname
2424

2525

26-
class GroupCoordinatorPatch(GroupCoordinator):
26+
class GroupCoordinatorPatch(vllm.distributed.parallel_state.GroupCoordinator):
2727

2828
def __init__(self, *args, **kwargs):
2929
super().__init__(*args, **kwargs)
@@ -66,4 +66,4 @@ def all_gather(self, input_, dim=-1):
6666
return self.communicator.all_gather(input_, dim)
6767

6868

69-
GroupCoordinator = GroupCoordinatorPatch
69+
vllm.distributed.parallel_state.GroupCoordinator = GroupCoordinatorPatch

vllm_ascend/platform.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,8 @@ def mem_get_info(cls) -> Tuple[int, int]:
8888

8989
@classmethod
9090
def check_and_update_config(cls, vllm_config: VllmConfig) -> None:
91-
# Register ops and patch when setup.
91+
# Register ops when setup.
9292
from vllm_ascend import ops # noqa: F401
93-
from vllm_ascend import patch # noqa: F401
9493

9594
parallel_config = vllm_config.parallel_config
9695
if parallel_config.worker_cls == "auto":

vllm_ascend/worker.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,8 @@ def init_worker_distributed_environment(
457457
backend: str = "hccl") -> None:
458458
"""Initialize the distributed environment."""
459459
set_custom_all_reduce(not parallel_config.disable_custom_all_reduce)
460+
# register communicator patch before init dist env
461+
from vllm_ascend import patch # noqa: F401
460462

461463
init_distributed_environment(parallel_config.world_size, rank,
462464
distributed_init_method, local_rank, backend)

0 commit comments

Comments
 (0)