[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:
@@ -9,6 +9,7 @@ import numpy as np
|
|||||||
import torch
|
import torch
|
||||||
|
|
||||||
from vllm.distributed.parallel_state import get_pp_group
|
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.buffer_utils import async_copy_to_gpu
|
||||||
from vllm.v1.worker.gpu.input_batch import InputBatch
|
from vllm.v1.worker.gpu.input_batch import InputBatch
|
||||||
|
|
||||||
@@ -179,6 +180,10 @@ class PPHandler:
|
|||||||
return
|
return
|
||||||
|
|
||||||
assert sampled_token_ids.dtype == torch.int64
|
assert sampled_token_ids.dtype == torch.int64
|
||||||
|
|
||||||
|
if current_platform.is_xpu():
|
||||||
|
self.main_stream.synchronize()
|
||||||
|
|
||||||
with torch.cuda.stream(self.broadcast_stream):
|
with torch.cuda.stream(self.broadcast_stream):
|
||||||
self.broadcast_stream.wait_stream(self.main_stream)
|
self.broadcast_stream.wait_stream(self.main_stream)
|
||||||
torch.distributed.broadcast(
|
torch.distributed.broadcast(
|
||||||
|
|||||||
Reference in New Issue
Block a user