[XPU] Fix Event init failure w/ blocking (#47868)
Signed-off-by: zhenwei-intel <zhenwei.liu@intel.com>
liuzhenwei committed
Jul 7, 2026 at 22:54 UTC
bdaf27519f3d40f3d696979586d49b22c9886a71
1 file changed
+7
-1
vllm/v1/worker/xpu_model_runner.py
+7
-1
@@ -49,7 +49,13 @@ def _torch_cuda_wrapper():
49
torch.cuda.current_stream = partial(torch.xpu.current_stream)
50
torch.cuda.stream = partial(torch.xpu.stream)
51
torch.cuda.set_stream = partial(torch.xpu.set_stream)
52
- torch.cuda.Event = partial(torch.xpu.Event)
52
+
53
+ # torch.xpu.Event does not accept the ``blocking`` kwarg that
54
+ # torch.cuda.Event supports, so drop it here.
55
+ def _xpu_event(*args, blocking=None, **kwargs):
56
+ return torch.xpu.Event(*args, **kwargs)
57
+
58
+ torch.cuda.Event = _xpu_event
59
if supports_xpu_graph():
60
torch.cuda.graph = partial(torch.xpu.graph)
61
torch.cuda.CUDAGraph = torch.xpu.XPUGraph