[AMD CI] Migrate and Add More Testcases (#17116)
Co-authored-by: yctseng0211 <yctseng@amd.com>
This commit is contained in:
@@ -19,7 +19,7 @@ from sglang.test.test_utils import (
|
||||
register_amd_ci(est_time=3600, suite="stage-c-test-large-8-gpu-amd-mi35x")
|
||||
|
||||
DEEPSEEK_R1_MODEL_PATH = "amd/DeepSeek-R1-MXFP4-Preview"
|
||||
SERVER_LAUNCH_TIMEOUT = 1200
|
||||
SERVER_LAUNCH_TIMEOUT = 1800
|
||||
|
||||
|
||||
class TestDeepseekR1MXFP4(CustomTestCase):
|
||||
|
||||
84
test/registered/amd/test_deepseek_v3_basic.py
Normal file
84
test/registered/amd/test_deepseek_v3_basic.py
Normal file
@@ -0,0 +1,84 @@
|
||||
import unittest
|
||||
from types import SimpleNamespace
|
||||
|
||||
from sglang.srt.utils import kill_process_tree
|
||||
from sglang.test.ci.ci_register import register_amd_ci
|
||||
from sglang.test.few_shot_gsm8k import run_eval as run_eval_few_shot_gsm8k
|
||||
from sglang.test.send_one import BenchArgs, send_one_prompt
|
||||
from sglang.test.test_utils import (
|
||||
DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH,
|
||||
DEFAULT_URL_FOR_TEST,
|
||||
CustomTestCase,
|
||||
is_in_amd_ci,
|
||||
is_in_ci,
|
||||
popen_launch_server,
|
||||
write_github_step_summary,
|
||||
)
|
||||
|
||||
register_amd_ci(est_time=952, suite="stage-c-test-large-8-gpu-amd")
|
||||
|
||||
FULL_DEEPSEEK_V3_MODEL_PATH = "deepseek-ai/DeepSeek-V3-0324"
|
||||
|
||||
|
||||
class TestDeepseekV3Basic(CustomTestCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
cls.model = FULL_DEEPSEEK_V3_MODEL_PATH
|
||||
cls.base_url = DEFAULT_URL_FOR_TEST
|
||||
other_args = [
|
||||
"--trust-remote-code",
|
||||
"--tp",
|
||||
"8",
|
||||
"--model-loader-extra-config",
|
||||
'{"enable_multithread_load": true, "num_threads": 64}',
|
||||
]
|
||||
cls.process = popen_launch_server(
|
||||
cls.model,
|
||||
cls.base_url,
|
||||
timeout=DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH * 5,
|
||||
other_args=other_args,
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def tearDownClass(cls):
|
||||
kill_process_tree(cls.process.pid)
|
||||
|
||||
def test_a_gsm8k(
|
||||
self,
|
||||
): # Append an "a" to make this test run first (alphabetically) to warm up the server
|
||||
args = SimpleNamespace(
|
||||
num_shots=8,
|
||||
data_path=None,
|
||||
num_questions=1400,
|
||||
parallel=1400,
|
||||
max_new_tokens=512,
|
||||
host="http://127.0.0.1",
|
||||
port=int(self.base_url.split(":")[-1]),
|
||||
)
|
||||
metrics = run_eval_few_shot_gsm8k(args)
|
||||
print(f"{metrics=}")
|
||||
|
||||
if is_in_ci():
|
||||
write_github_step_summary(
|
||||
f"### test_gsm8k (deepseek-v3)\n" f'{metrics["accuracy"]=:.3f}\n'
|
||||
)
|
||||
self.assertGreater(metrics["accuracy"], 0.935)
|
||||
|
||||
def test_bs_1_speed(self):
|
||||
args = BenchArgs(port=int(self.base_url.split(":")[-1]), max_new_tokens=2048)
|
||||
acc_length, speed = send_one_prompt(args)
|
||||
|
||||
print(f"{speed=:.2f}")
|
||||
|
||||
if is_in_ci():
|
||||
write_github_step_summary(
|
||||
f"### test_bs_1_speed (deepseek-v3)\n" f"{speed=:.2f} token/s\n"
|
||||
)
|
||||
if is_in_amd_ci():
|
||||
self.assertGreater(speed, 12)
|
||||
else:
|
||||
self.assertGreater(speed, 75)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
116
test/registered/amd/test_deepseek_v3_mtp.py
Normal file
116
test/registered/amd/test_deepseek_v3_mtp.py
Normal file
@@ -0,0 +1,116 @@
|
||||
import unittest
|
||||
from types import SimpleNamespace
|
||||
|
||||
import requests
|
||||
|
||||
from sglang.srt.utils import kill_process_tree
|
||||
from sglang.test.ci.ci_register import register_amd_ci
|
||||
from sglang.test.few_shot_gsm8k import run_eval as run_eval_few_shot_gsm8k
|
||||
from sglang.test.send_one import BenchArgs, send_one_prompt
|
||||
from sglang.test.test_utils import (
|
||||
DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH,
|
||||
DEFAULT_URL_FOR_TEST,
|
||||
CustomTestCase,
|
||||
is_in_amd_ci,
|
||||
is_in_ci,
|
||||
popen_launch_server,
|
||||
write_github_step_summary,
|
||||
)
|
||||
|
||||
register_amd_ci(est_time=980, suite="stage-c-test-large-8-gpu-amd")
|
||||
|
||||
FULL_DEEPSEEK_V3_MODEL_PATH = "deepseek-ai/DeepSeek-V3-0324"
|
||||
|
||||
|
||||
class TestDeepseekV3MTP(CustomTestCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
cls.model = FULL_DEEPSEEK_V3_MODEL_PATH
|
||||
cls.base_url = DEFAULT_URL_FOR_TEST
|
||||
other_args = [
|
||||
"--tp",
|
||||
"8",
|
||||
"--trust-remote-code",
|
||||
"--speculative-algorithm",
|
||||
"EAGLE",
|
||||
"--speculative-num-steps",
|
||||
"3",
|
||||
"--speculative-eagle-topk",
|
||||
"1",
|
||||
"--speculative-num-draft-tokens",
|
||||
"4",
|
||||
"--model-loader-extra-config",
|
||||
'{"enable_multithread_load": true, "num_threads": 64}',
|
||||
]
|
||||
if not is_in_amd_ci():
|
||||
other_args += ["--mem-frac", "0.7"]
|
||||
cls.process = popen_launch_server(
|
||||
cls.model,
|
||||
cls.base_url,
|
||||
timeout=DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH * 5,
|
||||
other_args=other_args,
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def tearDownClass(cls):
|
||||
kill_process_tree(cls.process.pid)
|
||||
|
||||
def test_a_gsm8k(
|
||||
self,
|
||||
): # Append an "a" to make this test run first (alphabetically) to warm up the server
|
||||
requests.get(self.base_url + "/flush_cache")
|
||||
|
||||
args = SimpleNamespace(
|
||||
num_shots=5,
|
||||
data_path=None,
|
||||
num_questions=200,
|
||||
max_new_tokens=512,
|
||||
parallel=128,
|
||||
host="http://127.0.0.1",
|
||||
port=int(self.base_url.split(":")[-1]),
|
||||
)
|
||||
metrics = run_eval_few_shot_gsm8k(args)
|
||||
print(f"{metrics=}")
|
||||
|
||||
server_info = requests.get(self.base_url + "/get_server_info")
|
||||
avg_spec_accept_length = server_info.json()["internal_states"][0][
|
||||
"avg_spec_accept_length"
|
||||
]
|
||||
print(f"{avg_spec_accept_length=}")
|
||||
|
||||
if is_in_ci():
|
||||
write_github_step_summary(
|
||||
f"### test_gsm8k (deepseek-v3 mtp)\n"
|
||||
f'{metrics["accuracy"]=:.3f}\n'
|
||||
f"{avg_spec_accept_length=:.2f}\n"
|
||||
)
|
||||
self.assertGreater(metrics["accuracy"], 0.935)
|
||||
if is_in_amd_ci():
|
||||
self.assertGreater(avg_spec_accept_length, 2.8)
|
||||
else:
|
||||
self.assertGreater(avg_spec_accept_length, 2.9)
|
||||
|
||||
def test_bs_1_speed(self):
|
||||
args = BenchArgs(port=int(self.base_url.split(":")[-1]), max_new_tokens=2048)
|
||||
acc_length, speed = send_one_prompt(args)
|
||||
|
||||
print(f"{acc_length=:.2f} {speed=:.2f}")
|
||||
|
||||
if is_in_ci():
|
||||
write_github_step_summary(
|
||||
f"### test_bs_1_speed (deepseek-v3 mtp)\n"
|
||||
f"{acc_length=:.2f}\n"
|
||||
f"{speed=:.2f} token/s\n"
|
||||
)
|
||||
if is_in_amd_ci():
|
||||
self.assertGreater(acc_length, 2.8)
|
||||
else:
|
||||
self.assertGreater(acc_length, 2.9)
|
||||
if is_in_amd_ci():
|
||||
self.assertGreater(speed, 15)
|
||||
else:
|
||||
self.assertGreater(speed, 130)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
@@ -24,7 +24,7 @@ from sglang.srt.layers.attention.wave_ops.prefill_attention import (
|
||||
from sglang.test.ci.ci_register import register_amd_ci
|
||||
|
||||
# Wave attention kernel unit tests (AMD only - requires wave_lang)
|
||||
register_amd_ci(est_time=60, suite="stage-a-test-1")
|
||||
register_amd_ci(est_time=60, suite="stage-a-test-1-amd")
|
||||
|
||||
|
||||
class TestWaveAttention(unittest.TestCase):
|
||||
|
||||
@@ -9,15 +9,18 @@ test into unit tests so that's easily reproducible in CI.
|
||||
|
||||
import unittest
|
||||
|
||||
from sglang.test.ci.ci_register import register_cuda_ci
|
||||
from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci
|
||||
from sglang.test.test_deterministic_utils import (
|
||||
COMMON_SERVER_ARGS,
|
||||
TestDeterministicBase,
|
||||
)
|
||||
from sglang.test.test_utils import is_in_amd_ci
|
||||
|
||||
register_cuda_ci(est_time=278, suite="stage-b-test-large-1-gpu")
|
||||
register_amd_ci(est_time=278, suite="stage-b-test-small-1-gpu-amd")
|
||||
|
||||
|
||||
@unittest.skipIf(is_in_amd_ci(), "Skip for AMD CI.")
|
||||
class TestFlashinferDeterministic(TestDeterministicBase):
|
||||
# Test with flashinfer attention backend
|
||||
@classmethod
|
||||
@@ -32,6 +35,7 @@ class TestFlashinferDeterministic(TestDeterministicBase):
|
||||
return args
|
||||
|
||||
|
||||
@unittest.skipIf(is_in_amd_ci(), "Skip for AMD CI.")
|
||||
class TestFa3Deterministic(TestDeterministicBase):
|
||||
# Test with fa3 attention backend
|
||||
@classmethod
|
||||
|
||||
@@ -10,10 +10,11 @@ import unittest
|
||||
|
||||
from test_hicache_storage_file_backend import HiCacheStorageBaseMixin
|
||||
|
||||
from sglang.test.ci.ci_register import register_cuda_ci
|
||||
from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci
|
||||
from sglang.test.test_utils import CustomTestCase
|
||||
|
||||
register_cuda_ci(est_time=200, suite="stage-b-test-large-2-gpu")
|
||||
register_amd_ci(est_time=300, suite="stage-b-test-large-2-gpu")
|
||||
|
||||
|
||||
class HiCacheStorage3FSBackendBaseMixin(HiCacheStorageBaseMixin):
|
||||
|
||||
@@ -18,7 +18,7 @@ import requests
|
||||
|
||||
from sglang.bench_serving import get_tokenizer
|
||||
from sglang.srt.utils import kill_process_tree
|
||||
from sglang.test.ci.ci_register import register_cuda_ci
|
||||
from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci
|
||||
from sglang.test.few_shot_gsm8k import run_eval as run_eval_few_shot_gsm8k
|
||||
from sglang.test.test_utils import (
|
||||
DEFAULT_MLA_MODEL_NAME_FOR_TEST,
|
||||
@@ -31,6 +31,7 @@ from sglang.test.test_utils import (
|
||||
)
|
||||
|
||||
register_cuda_ci(est_time=200, suite="stage-b-test-large-2-gpu")
|
||||
register_amd_ci(est_time=526, suite="stage-b-test-large-2-gpu-amd")
|
||||
|
||||
|
||||
class HiCacheStorageBaseMixin:
|
||||
|
||||
@@ -7,7 +7,7 @@ from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci
|
||||
|
||||
# Keep consistent with other openai_server/basic unit tests.
|
||||
register_cuda_ci(est_time=10, suite="stage-b-test-large-1-gpu")
|
||||
register_amd_ci(est_time=10, suite="stage-b-test-small-1-gpu")
|
||||
register_amd_ci(est_time=10, suite="stage-b-test-small-1-gpu-amd")
|
||||
|
||||
try:
|
||||
from sglang.srt.entrypoints.openai.serving_rerank import (
|
||||
|
||||
@@ -19,7 +19,7 @@ from sglang.srt.layers.quantization.awq_triton import (
|
||||
from sglang.test.ci.ci_register import register_amd_ci
|
||||
from sglang.test.test_utils import CustomTestCase
|
||||
|
||||
register_amd_ci(est_time=2, suite="stage-a-test-1")
|
||||
register_amd_ci(est_time=2, suite="stage-a-test-1-amd")
|
||||
|
||||
device = "cuda"
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import torch.nn.functional as F
|
||||
from sglang.test.ci.ci_register import register_amd_ci
|
||||
from sglang.test.test_utils import CustomTestCase
|
||||
|
||||
register_amd_ci(est_time=10, suite="stage-a-test-1")
|
||||
register_amd_ci(est_time=10, suite="stage-a-test-1-amd")
|
||||
|
||||
|
||||
def _fp8_available() -> bool:
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
from types import SimpleNamespace
|
||||
|
||||
from sglang.srt.utils import kill_process_tree
|
||||
from sglang.test.ci.ci_register import register_amd_ci
|
||||
from sglang.test.few_shot_gsm8k import run_eval
|
||||
from sglang.test.test_utils import (
|
||||
DEFAULT_URL_FOR_TEST,
|
||||
@@ -8,6 +9,8 @@ from sglang.test.test_utils import (
|
||||
popen_launch_server,
|
||||
)
|
||||
|
||||
register_amd_ci(est_time=313, suite="stage-b-test-small-1-gpu-amd")
|
||||
|
||||
|
||||
class TestMixtralAccuracy(CustomTestCase):
|
||||
@classmethod
|
||||
@@ -11,7 +11,7 @@ from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci
|
||||
from sglang.test.test_utils import CustomTestCase
|
||||
|
||||
register_cuda_ci(est_time=90, suite="stage-b-test-small-1-gpu")
|
||||
register_amd_ci(est_time=90, suite="stage-b-test-small-1-gpu")
|
||||
register_amd_ci(est_time=90, suite="stage-b-test-small-1-gpu-amd")
|
||||
|
||||
MODEL_PATH = "Qwen/Qwen3-0.6B"
|
||||
LORA_REPO = "charent/self_cognition_Alice"
|
||||
|
||||
@@ -4,8 +4,11 @@ import torch
|
||||
|
||||
from sglang.srt.layers.rotary_embedding import RotaryEmbedding
|
||||
from sglang.srt.utils import get_bool_env_var, is_hip
|
||||
from sglang.test.ci.ci_register import register_amd_ci
|
||||
from sglang.test.test_utils import CustomTestCase
|
||||
|
||||
register_amd_ci(est_time=3, suite="stage-b-test-small-1-gpu-amd")
|
||||
|
||||
torch.manual_seed(0)
|
||||
|
||||
_is_hip = is_hip()
|
||||
@@ -20,7 +20,7 @@ from sglang.test.test_programs import (
|
||||
from sglang.test.test_utils import DEFAULT_MODEL_NAME_FOR_TEST, CustomTestCase
|
||||
|
||||
register_cuda_ci(est_time=80, suite="stage-a-test-1")
|
||||
register_amd_ci(est_time=120, suite="stage-a-test-1")
|
||||
register_amd_ci(est_time=120, suite="stage-a-test-1-amd")
|
||||
|
||||
|
||||
class TestSRTBackend(CustomTestCase):
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
import timeit
|
||||
from typing import Any, Callable, List, Tuple, Type
|
||||
|
||||
from sglang.test.ci.ci_register import register_amd_ci
|
||||
from sglang.utils import TypeBasedDispatcher
|
||||
|
||||
register_amd_ci(est_time=10, suite="stage-b-test-small-1-gpu-amd")
|
||||
|
||||
|
||||
class TypeBasedDispatcherList:
|
||||
def __init__(self, mapping: List[Tuple[Type, Callable]]):
|
||||
@@ -8,8 +8,11 @@ import timeit
|
||||
import unittest
|
||||
|
||||
from sglang.srt.managers.io_struct import SamplingParams
|
||||
from sglang.test.ci.ci_register import register_amd_ci
|
||||
from sglang.utils import TypeBasedDispatcher
|
||||
|
||||
register_amd_ci(est_time=10, suite="stage-b-test-small-1-gpu-amd")
|
||||
|
||||
|
||||
class TestTypeBasedDispatcher(unittest.TestCase):
|
||||
"""Unit tests for TypeBasedDispatcher e2e performance."""
|
||||
@@ -19,7 +19,7 @@ HW_MAPPING = {
|
||||
PER_COMMIT_SUITES = {
|
||||
HWBackend.CPU: ["default", "stage-a-cpu-only"],
|
||||
HWBackend.AMD: [
|
||||
"stage-a-test-1",
|
||||
"stage-a-test-1-amd",
|
||||
"stage-b-test-small-1-gpu-amd",
|
||||
"stage-b-test-small-1-gpu-amd-mi35x",
|
||||
"stage-b-test-large-2-gpu-amd",
|
||||
|
||||
@@ -80,10 +80,7 @@ suite_amd = {
|
||||
# TestFile("lora/test_lora_backend.py", 99), # Disabled temporarily, see https://github.com/sgl-project/sglang/issues/13107
|
||||
# TestFile("lora/test_lora_cuda_graph.py", 250), # Disabled temporarily, see https://github.com/sgl-project/sglang/issues/13107
|
||||
# TestFile("lora/test_lora_qwen3.py", 97), # Disabled temporarily, see https://github.com/sgl-project/sglang/issues/13107
|
||||
TestFile("test_bench_typebaseddispatcher.py", 10),
|
||||
TestFile("test_rope_rocm.py", 3),
|
||||
# TestFile("test_torch_compile_moe.py", 210), # Disabled temporarily, see https://github.com/sgl-project/sglang/issues/13107
|
||||
TestFile("test_type_based_dispatcher.py", 10),
|
||||
# Disabled temporarily
|
||||
# TestFile("test_vlm_input_format.py", 300),
|
||||
# TestFile("openai_server/features/test_openai_server_hidden_states.py", 240),
|
||||
@@ -92,15 +89,10 @@ suite_amd = {
|
||||
# TestFile("test_vision_chunked_prefill.py", 175), # Disabled temporarily and track in #7701
|
||||
# TestFile("test_wave_attention_backend.py", 150), # Disabled temporarily, see https://github.com/sgl-project/sglang/issues/11127
|
||||
# The time estimation for `test_int4fp8_moe.py` assumes `mistralai/Mixtral-8x7B-Instruct-v0.1` is already cached (running on 1xMI300X).
|
||||
TestFile("test_int4fp8_moe.py", 313),
|
||||
],
|
||||
"per-commit-4-gpu-amd": [
|
||||
TestFile("test_pp_single_node.py", 150),
|
||||
],
|
||||
"per-commit-8-gpu-amd": [
|
||||
TestFile("test_deepseek_v3_basic.py", 275),
|
||||
TestFile("test_deepseek_v3_mtp.py", 275),
|
||||
],
|
||||
# NOTE: AMD nightly suites (nightly-amd, nightly-amd-vlm, nightly-amd-8-gpu)
|
||||
# have been migrated to test/registered/amd/nightly/ and are now managed
|
||||
# by test/run_suite.py using the registry system.
|
||||
|
||||
Reference in New Issue
Block a user