[XPU][Tests] Make tests device-agnostic (#51968)

Signed-off-by: pmanczak <pawel.manczak@intel.com>
This commit is contained in:
pmanczak
2026-08-20 02:25:41 -07:00
committed by GitHub
parent 38e9cefdef
commit 44cf3f0466
12 changed files with 148 additions and 111 deletions
@@ -37,9 +37,10 @@ from vllm.triton_utils.allocation import set_triton_allocator
def _is_capturing_or_compiling() -> bool:
# torch.cuda.is_current_stream_capturing() is unavailable on non-CUDA (XPU) torch.
return torch.compiler.is_compiling() or (
current_platform.is_cuda_alike() and torch.cuda.is_current_stream_capturing()
# The accelerator API dispatches to the active backend.
return (
torch.compiler.is_compiling()
or torch.accelerator.current_stream().is_capturing()
)