[XPU] Fix Event init failure w/ external (#61743)

Signed-off-by: zhenwei-intel <zhenwei.liu@intel.com>
Co-authored-by: Kunshang Ji <kunshang.ji@intel.com>
This commit is contained in:
liuzhenwei
2026-10-17 19:10:39 +08:00
committed by GitHub
co-authored by Kunshang Ji
parent ec8b20fbf0
commit 4e964b2623
+3 -3
View File
@@ -61,9 +61,9 @@ def _torch_cuda_wrapper():
torch.cuda.stream = partial(torch.xpu.stream) torch.cuda.stream = partial(torch.xpu.stream)
torch.cuda.set_stream = partial(torch.xpu.set_stream) torch.cuda.set_stream = partial(torch.xpu.set_stream)
# torch.xpu.Event does not accept the ``blocking`` kwarg that # torch.xpu.Event does not accept the ``blocking`` or ``external`` kwargs
# torch.cuda.Event supports, so drop it here. # that torch.cuda.Event supports, so drop them here.
def _xpu_event(*args, blocking=None, **kwargs): def _xpu_event(*args, blocking=None, external=None, **kwargs):
return torch.xpu.Event(*args, **kwargs) return torch.xpu.Event(*args, **kwargs)
torch.cuda.Event = _xpu_event torch.cuda.Event = _xpu_event