Replace torch.cuda.Event with torch.Event for better hardware compatibility (#26985)

Signed-off-by: Kunshang Ji <kunshang.ji@intel.com>
This commit is contained in:
Kunshang Ji
2025-11-18 11:34:36 -08:00
committed by GitHub
parent c3e2978620
commit 2a2d5d2780
15 changed files with 41 additions and 48 deletions
+2 -2
View File
@@ -265,7 +265,7 @@ class InputBatch:
# ids from prior step, if required by current sampling params
# (e.g. penalties).
self.sampled_token_ids_cpu: torch.Tensor | None = None
self.async_copy_ready_event: torch.cuda.Event | None = None
self.async_copy_ready_event: torch.Event | None = None
@property
def req_ids(self) -> list[str]:
@@ -891,7 +891,7 @@ class InputBatch:
def set_async_sampled_token_ids(
self,
sampled_token_ids_cpu: torch.Tensor,
async_copy_ready_event: torch.cuda.Event,
async_copy_ready_event: torch.Event,
) -> None:
"""
In async scheduling case, store ref to sampled_token_ids_cpu