enable ut test for xpu devices (#11712)
Co-authored-by: jundu <jun.du@intel.com> Co-authored-by: Gao, Pengfei <pengfei.gao@intel.com>
This commit is contained in:
co-authored by
jundu
Gao, Pengfei
parent
0a6925639b
commit
495290aefd
@@ -6,6 +6,7 @@ from sglang.srt.speculative.eagle_utils import (
|
||||
build_tree_kernel_efficient,
|
||||
organize_draft_results,
|
||||
)
|
||||
from sglang.srt.utils import get_device
|
||||
from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci
|
||||
|
||||
register_cuda_ci(est_time=3, suite="stage-b-test-small-1-gpu")
|
||||
@@ -17,7 +18,7 @@ class TestBuildEagleTree(unittest.TestCase):
|
||||
|
||||
def test_build_tree_kernel_efficient(self):
|
||||
"""Test the build_tree_kernel_efficient function with known inputs and expected outputs."""
|
||||
verified_id = torch.tensor([29974, 13], device="cuda", dtype=torch.int32)
|
||||
verified_id = torch.tensor([29974, 13], device=get_device(), dtype=torch.int32)
|
||||
score_list = [
|
||||
torch.tensor(
|
||||
[
|
||||
@@ -25,7 +26,7 @@ class TestBuildEagleTree(unittest.TestCase):
|
||||
[[9.7476e-01, 2.2219e-02, 6.5031e-04, 1.3212e-04]],
|
||||
],
|
||||
dtype=torch.float32,
|
||||
device="cuda",
|
||||
device=get_device(),
|
||||
),
|
||||
torch.tensor(
|
||||
[
|
||||
@@ -43,7 +44,7 @@ class TestBuildEagleTree(unittest.TestCase):
|
||||
],
|
||||
],
|
||||
dtype=torch.float32,
|
||||
device="cuda",
|
||||
device=get_device(),
|
||||
),
|
||||
torch.tensor(
|
||||
[
|
||||
@@ -61,7 +62,7 @@ class TestBuildEagleTree(unittest.TestCase):
|
||||
],
|
||||
],
|
||||
dtype=torch.float32,
|
||||
device="cuda",
|
||||
device=get_device(),
|
||||
),
|
||||
torch.tensor(
|
||||
[
|
||||
@@ -79,14 +80,14 @@ class TestBuildEagleTree(unittest.TestCase):
|
||||
],
|
||||
],
|
||||
dtype=torch.float32,
|
||||
device="cuda",
|
||||
device=get_device(),
|
||||
),
|
||||
]
|
||||
token_list = [
|
||||
torch.tensor(
|
||||
[[29896, 29906, 29900, 29945], [13, 2, 29871, 28956]],
|
||||
dtype=torch.int64,
|
||||
device="cuda",
|
||||
device=get_device(),
|
||||
),
|
||||
torch.tensor(
|
||||
[
|
||||
@@ -127,7 +128,7 @@ class TestBuildEagleTree(unittest.TestCase):
|
||||
259,
|
||||
],
|
||||
],
|
||||
device="cuda",
|
||||
device=get_device(),
|
||||
),
|
||||
torch.tensor(
|
||||
[
|
||||
@@ -168,7 +169,7 @@ class TestBuildEagleTree(unittest.TestCase):
|
||||
2186,
|
||||
],
|
||||
],
|
||||
device="cuda",
|
||||
device=get_device(),
|
||||
),
|
||||
torch.tensor(
|
||||
[
|
||||
@@ -209,7 +210,7 @@ class TestBuildEagleTree(unittest.TestCase):
|
||||
13,
|
||||
],
|
||||
],
|
||||
device="cuda",
|
||||
device=get_device(),
|
||||
),
|
||||
]
|
||||
parents_list = [
|
||||
|
||||
Reference in New Issue
Block a user