[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>
This commit is contained in:
YiSheng5
2026-07-07 09:17:27 +08:00
committed by GitHub
co-authored by Kunshang Ji
parent 86db6c3070
commit 69f3150981
+5
View File
@@ -9,6 +9,7 @@ import numpy as np
import torch
from vllm.distributed.parallel_state import get_pp_group
from vllm.platforms import current_platform
from vllm.v1.worker.gpu.buffer_utils import async_copy_to_gpu
from vllm.v1.worker.gpu.input_batch import InputBatch
@@ -179,6 +180,10 @@ class PPHandler:
return
assert sampled_token_ids.dtype == torch.int64
if current_platform.is_xpu():
self.main_stream.synchronize()
with torch.cuda.stream(self.broadcast_stream):
self.broadcast_stream.wait_stream(self.main_stream)
torch.distributed.broadcast(