Make UTs compatible for XPU (#27106)

This commit is contained in:
ANSHUMAN TRIPATHY
2026-07-15 12:35:56 +08:00
committed by GitHub
parent c00131ebaa
commit 23f2b77d82
4 changed files with 22 additions and 13 deletions
@@ -15,6 +15,7 @@ from typing import Callable, List, Optional
import torch
from sglang.srt.debug_utils.dumper import get_truncated_value
from sglang.srt.utils import get_device
def main(args):
@@ -259,7 +260,7 @@ def _load_object(path):
if not isinstance(x, torch.Tensor):
print(f"Skip load {path} since {type(x)=} is not a Tensor ({x=})")
return None
return x.cuda()
return x.to(get_device())
def _comparison_preprocessor(x_baseline, x_target, name):