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 5, 01:00 UTC
[XPU] fix all_reduce all-zero accuracy issue under torch.compile (#39844)
Signed-off-by: Chaojun Zhang <chaojun.zhang@intel.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Chaojun Zhang committed
Apr 18, 2026 at 10:33 UTC
993859ceb0f4897c423d9fa160fcd80a7a2c890b
1 file changed
+4
-3
vllm/distributed/device_communicators/xpu_communicator.py
+4
-3
@@ -47,9 +47,10 @@ class XpuCommunicator(DeviceCommunicatorBase):
47
self.all2all_manager = AgRsAll2AllManager(self.cpu_group)
48
logger.info("Using AgRs manager on XPU device.")
49
50
- def all_reduce(self, input_) -> torch.Tensor:
51
- dist.all_reduce(input_, group=self.device_group)
52
- return input_
50
+ def all_reduce(self, input_: torch.Tensor) -> torch.Tensor:
51
+ output = input_.clone() if torch.compiler.is_compiling() else input_
52
+ dist.all_reduce(output, group=self.device_group)
53
+ return output
54
55
def reduce_scatter(self, input_: torch.Tensor, dim: int = -1):
56
world_size = self.world_size