@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / c910eeb125
Fork 0

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 6, 21:45 UTC

[XPU]Bug fix for some unexpected error when use AgRs backend on XPU device. (#36593)

Signed-off-by: yisheng <yi.sheng@intel.com>

YiSheng5 committed Mar 11, 2026 at 17:17 UTC c910eeb125003ebe19e0f4e6d27d335061597e81
2 files changed +8 -5
vllm/distributed/device_communicators/xpu_communicator.py
+5 -5
@@ -70,7 +70,7 @@ class XpuCommunicator(DeviceCommunicatorBase):
70 output_shape, dtype=input_tensor.dtype, device=input_tensor.device
71 )
72
73 - dist.reduce_scatter_tensor(output, input_tensor)
73 + dist.reduce_scatter_tensor(output, input_tensor, group=self.device_group)
74
75 # Reshape before returning
76 return output.movedim(0, dim).contiguous()
@@ -103,9 +103,9 @@ class XpuCommunicator(DeviceCommunicatorBase):
103 if sizes is not None and sizes.count(sizes[0]) != len(sizes):
104 # if inputs shape in different ranks is not the same using reduce_scatter
105 input_splits = list(input_tensor.split(sizes, dim=0))
106 - dist.reduce_scatter(output, input_splits)
106 + dist.reduce_scatter(output, input_splits, group=self.device_group)
107 else:
108 - dist.reduce_scatter_tensor(output, input_tensor)
108 + dist.reduce_scatter_tensor(output, input_tensor, group=self.device_group)
109 # Reshape before returning
110 return output.movedim(0, dim).contiguous()
111
@@ -149,10 +149,10 @@ class XpuCommunicator(DeviceCommunicatorBase):
149 device=input_.device,
150 )
151 )
152 - dist.all_gather(all_gather_list, input_)
152 + dist.all_gather(all_gather_list, input_, group=self.device_group)
153 output_tensor = torch.cat(all_gather_list, dim=0)
154 else:
155 - dist.all_gather([output_tensor], input_)
155 + dist.all_gather([output_tensor], input_, group=self.device_group)
156 return output_tensor
157
158 if isinstance(input_, torch.Tensor):
vllm/v1/worker/xpu_worker.py
+3
@@ -85,6 +85,9 @@ class XPUWorker(Worker):
85 current_platform.dist_backend,
86 )
87
88 + # global all_reduce needed for overall oneccl warm up
89 + torch.distributed.all_reduce(torch.zeros(1).xpu())
90 +
91 # Set random seed.
92 set_random_seed(self.model_config.seed)
93