[XPU] Fix PP accuracy on XPU device (#47253)
Signed-off-by: yisheng <yi.sheng@intel.com> Co-authored-by: Kunshang Ji <kunshang.ji@intel.com>
YiSheng5 committed
Jul 7, 2026 at 09:17 UTC
69f3150981e4bc8a09439eb7cae0095605b964b4
1 file changed
+5
vllm/v1/worker/gpu/pp_utils.py
+5
@@ -9,6 +9,7 @@ import numpy as np
9
import torch
10
11
from vllm.distributed.parallel_state import get_pp_group
12
+from vllm.platforms import current_platform
13
from vllm.v1.worker.gpu.buffer_utils import async_copy_to_gpu
14
from vllm.v1.worker.gpu.input_batch import InputBatch
15
@@ -179,6 +180,10 @@ class PPHandler:
180
return
181
182
assert sampled_token_ids.dtype == torch.int64
183
+
184
+ if current_platform.is_xpu():
185
+ self.main_stream.synchronize()
186
+
187
with torch.cuda.stream(self.broadcast_stream):
188
self.broadcast_stream.wait_stream(self.main_stream)
189
torch.distributed.broadcast(