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 15, 09:45 UTC
[BugFix][CPU] Fix x86 SHM distributed module initialization (#18536)
Signed-off-by: jiang.li <jiang1.li@intel.com>
Li, Jiang committed
May 22, 2025 at 22:35 UTC
93f71673ce1a6cd4ac6217c6ca8f7a74c920bcc0
1 file changed
+6
-2
vllm/distributed/device_communicators/cpu_communicator.py
+6
-2
@@ -22,8 +22,10 @@ class CpuCommunicator(DeviceCommunicatorBase):
22
super().__init__(cpu_group, device, device_group, unique_name)
23
self.dist_module = torch.distributed
24
25
- if (current_platform.get_cpu_architecture() == CpuArchEnum.X86) \
26
- and hasattr(torch.ops._C, "init_shm_manager"):
25
+ if (current_platform.get_cpu_architecture()
26
+ == CpuArchEnum.X86) and hasattr(
27
+ torch.ops._C,
28
+ "init_shm_manager") and unique_name.startswith("tp"):
29
self.dist_module = _CPUSHMDistributed(self)
30
31
def all_reduce(self, input_):
@@ -96,6 +98,8 @@ class _CPUSHMDistributed:
98
99
def __init__(self, communicator: CpuCommunicator):
100
instance_identifier = os.environ["VLLM_DIST_IDENT"]
101
+ unique_name = communicator.unique_name
102
+ instance_identifier = f"{instance_identifier}-{unique_name}"
103
self.communicator = communicator
104
105
group_ranks = [str(rank) for rank in self.communicator.ranks]