[AMD] Add 4-GPU test suite for MI325 runners (#20294)
This commit is contained in:
@@ -28,7 +28,7 @@ pytestmark = pytest.mark.filterwarnings(
|
||||
)
|
||||
|
||||
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.test_utils import (
|
||||
DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH,
|
||||
DEFAULT_URL_FOR_TEST,
|
||||
@@ -36,6 +36,12 @@ from sglang.test.test_utils import (
|
||||
)
|
||||
|
||||
register_cuda_ci(est_time=300, suite="nightly-4-gpu", nightly=True)
|
||||
register_amd_ci(
|
||||
est_time=300,
|
||||
suite="nightly-amd-4-gpu",
|
||||
nightly=True,
|
||||
disabled="TP=2 vs TP=4 numerical mismatch on AMD (comparator fails tolerance check)",
|
||||
)
|
||||
|
||||
MODEL = "Qwen/Qwen3-30B-A3B"
|
||||
BASELINE_TP = 2
|
||||
|
||||
@@ -5,7 +5,7 @@ import requests
|
||||
|
||||
from sglang.lang.chat_template import get_chat_template_by_model_path
|
||||
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.kits.ebnf_constrained_kit import EBNFConstrainedMixin
|
||||
from sglang.test.kits.json_constrained_kit import JSONConstrainedMixin
|
||||
@@ -24,8 +24,13 @@ from sglang.test.test_utils import (
|
||||
)
|
||||
|
||||
register_cuda_ci(est_time=350, suite="stage-c-test-4-gpu-h100")
|
||||
register_amd_ci(est_time=350, suite="stage-c-test-4-gpu-amd")
|
||||
|
||||
|
||||
@unittest.skipIf(
|
||||
is_in_amd_ci(),
|
||||
"DeepSeek MLA forward_mla NameError on AMD (batched_gemm not defined)",
|
||||
)
|
||||
class TestDPAttentionDP2TP4(
|
||||
CustomTestCase,
|
||||
JSONConstrainedMixin,
|
||||
@@ -66,6 +71,10 @@ class TestDPAttentionDP2TP4(
|
||||
self.assertGreater(metrics["score"], 0.8)
|
||||
|
||||
|
||||
@unittest.skipIf(
|
||||
is_in_amd_ci(),
|
||||
"DeepSeek MTP forward_mla NameError on AMD + needs 8 GPUs",
|
||||
)
|
||||
class TestDPAttentionDP2TP2DeepseekV3MTP(
|
||||
CustomTestCase,
|
||||
JSONConstrainedMixin,
|
||||
@@ -131,6 +140,10 @@ class TestDPAttentionDP2TP2DeepseekV3MTP(
|
||||
self.assertGreater(avg_spec_accept_length, 2.5)
|
||||
|
||||
|
||||
@unittest.skipIf(
|
||||
is_in_amd_ci(),
|
||||
"Qwen3-VL-30B-A3B-Instruct OOMs at TP=4 DP=2 on MI325 4-GPU runners",
|
||||
)
|
||||
class TestDPAttentionDP2TP4VLM(CustomTestCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
|
||||
@@ -15,7 +15,7 @@ import requests
|
||||
from sglang.bench_one_batch_server import BenchArgs as OneBatchBenchArgs
|
||||
from sglang.srt.server_args import ServerArgs
|
||||
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.run_eval import run_eval
|
||||
from sglang.test.test_utils import (
|
||||
@@ -26,12 +26,14 @@ 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,
|
||||
run_bench_one_batch_server,
|
||||
)
|
||||
|
||||
register_cuda_ci(est_time=650, suite="stage-c-test-4-gpu-h100")
|
||||
register_amd_ci(est_time=650, suite="stage-c-test-4-gpu-amd")
|
||||
|
||||
|
||||
class TestPPAccuracy(unittest.TestCase):
|
||||
@@ -69,7 +71,11 @@ class TestPPAccuracy(unittest.TestCase):
|
||||
metrics = run_eval_few_shot_gsm8k(args)
|
||||
print(f"{metrics=}")
|
||||
|
||||
self.assertGreater(metrics["accuracy"], 0.74)
|
||||
if is_in_amd_ci():
|
||||
# AMD triton backend produces slightly lower accuracy than FA3 on NVIDIA
|
||||
self.assertGreater(metrics["accuracy"], 0.70)
|
||||
else:
|
||||
self.assertGreater(metrics["accuracy"], 0.74)
|
||||
# Wait a little bit so that the memory check happens.
|
||||
time.sleep(4)
|
||||
|
||||
@@ -97,6 +103,7 @@ class TestPPAccuracy(unittest.TestCase):
|
||||
assert len(output_top_logprobs) == 16
|
||||
|
||||
|
||||
@unittest.skipIf(is_in_amd_ci(), "MLA model with DP attention not yet supported on AMD")
|
||||
class TestDPAttentionDP2PP2(CustomTestCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
@@ -136,6 +143,10 @@ class TestDPAttentionDP2PP2(CustomTestCase):
|
||||
self.assertGreater(metrics["score"], 0.8)
|
||||
|
||||
|
||||
@unittest.skipIf(
|
||||
is_in_amd_ci(),
|
||||
"VLM PP accuracy too low on AMD (0.48-0.50 with both aiter and triton)",
|
||||
)
|
||||
class TestQwenVLPPAccuracy(unittest.TestCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
@@ -244,6 +255,7 @@ class TestQwenPPAccuracy(unittest.TestCase):
|
||||
)
|
||||
|
||||
|
||||
@unittest.skipIf(is_in_amd_ci(), "PP consistency too flaky on AMD 4-GPU runners")
|
||||
class TestQwenPPTieWeightsAccuracy(unittest.TestCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
@@ -350,6 +362,7 @@ class TestQwenMoePPAccuracy(unittest.TestCase):
|
||||
)
|
||||
|
||||
|
||||
@unittest.skipIf(is_in_amd_ci(), "PP consistency too flaky on AMD 4-GPU runners")
|
||||
class TestQwen35PPAccuracy(unittest.TestCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
|
||||
@@ -12,7 +12,7 @@ from torch.distributed.device_mesh import init_device_mesh
|
||||
from transformers import AutoModelForCausalLM
|
||||
|
||||
from sglang.srt.entrypoints.engine import Engine as SglangEngine
|
||||
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 (
|
||||
DEFAULT_SMALL_MODEL_NAME_FOR_TEST,
|
||||
DEFAULT_SMALL_MODEL_NAME_FOR_TEST_BASE,
|
||||
@@ -21,6 +21,11 @@ from sglang.test.test_utils import (
|
||||
)
|
||||
|
||||
register_cuda_ci(est_time=64, suite="stage-c-test-4-gpu-h100")
|
||||
register_amd_ci(
|
||||
est_time=64,
|
||||
suite="stage-c-test-4-gpu-amd",
|
||||
disabled="torch_memory_saver incompatible with ROCm (libcuda.so.1 not found)",
|
||||
)
|
||||
|
||||
TEST_SUITE = dict(
|
||||
model_path=DEFAULT_SMALL_MODEL_NAME_FOR_TEST,
|
||||
|
||||
@@ -12,7 +12,7 @@ from sglang.srt.layers.moe.routed_experts_capturer import (
|
||||
extract_routed_experts_from_meta_info,
|
||||
)
|
||||
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.test_utils import (
|
||||
DEFAULT_ENABLE_ROUTED_EXPERTS_MODEL_NAME_FOR_TEST,
|
||||
DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH,
|
||||
@@ -22,6 +22,11 @@ from sglang.test.test_utils import (
|
||||
)
|
||||
|
||||
register_cuda_ci(est_time=360, suite="stage-c-test-4-gpu-h100")
|
||||
register_amd_ci(
|
||||
est_time=360,
|
||||
suite="stage-c-test-4-gpu-amd",
|
||||
disabled="TP=4 DP=4 routed expert mismatch >15% on AMD; needs TP/DP tuning + concurrency reduction",
|
||||
)
|
||||
|
||||
SHAREGPT_URL = (
|
||||
"https://huggingface.co/datasets/anon8231489123/"
|
||||
|
||||
@@ -4,7 +4,7 @@ from types import SimpleNamespace
|
||||
import requests
|
||||
|
||||
from sglang.srt.environ import envs
|
||||
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.send_one import BenchArgs, send_one_prompt
|
||||
from sglang.test.test_utils import (
|
||||
@@ -22,6 +22,7 @@ from sglang.test.test_utils import (
|
||||
|
||||
# EAGLE3 with DP attention (tp=2, dp=2, requires 4 GPUs)
|
||||
register_cuda_ci(est_time=200, suite="stage-c-test-4-gpu-h100")
|
||||
register_amd_ci(est_time=200, suite="stage-c-test-4-gpu-amd")
|
||||
|
||||
|
||||
class TestEAGLE3EngineDPAttention(CustomTestCase):
|
||||
@@ -50,7 +51,7 @@ class TestEAGLE3EngineDPAttention(CustomTestCase):
|
||||
"--moe-dense-tp-size",
|
||||
"1",
|
||||
"--attention-backend",
|
||||
"fa3",
|
||||
"triton" if is_in_amd_ci() else "fa3",
|
||||
"--mem-fraction-static",
|
||||
"0.75",
|
||||
"--cuda-graph-max-bs",
|
||||
@@ -106,9 +107,17 @@ class TestEAGLE3EngineDPAttention(CustomTestCase):
|
||||
f'{metrics["accuracy"]=:.3f}\n'
|
||||
f"{avg_spec_accept_length=:.2f}\n"
|
||||
)
|
||||
self.assertGreater(metrics["accuracy"], 0.91)
|
||||
if is_in_amd_ci():
|
||||
# AMD triton backend produces slightly lower accuracy than FA3 on NVIDIA
|
||||
self.assertGreater(metrics["accuracy"], 0.88)
|
||||
else:
|
||||
self.assertGreater(metrics["accuracy"], 0.91)
|
||||
if avg_spec_accept_length is not None:
|
||||
self.assertGreater(avg_spec_accept_length, 2.5)
|
||||
if is_in_amd_ci():
|
||||
# AMD triton backend produces slightly lower accept length than FA3 on NVIDIA
|
||||
self.assertGreater(avg_spec_accept_length, 2.0)
|
||||
else:
|
||||
self.assertGreater(avg_spec_accept_length, 2.5)
|
||||
|
||||
def test_bs_1_speed(self):
|
||||
"""Test batch size 1 speed with EAGLE3 DP Attention"""
|
||||
|
||||
@@ -8,17 +8,19 @@ import unittest
|
||||
from types import SimpleNamespace
|
||||
|
||||
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.kits.mmmu_vlm_kit import _run_lmms_eval_with_retry
|
||||
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,
|
||||
)
|
||||
|
||||
register_cuda_ci(est_time=500, suite="nightly-4-gpu", nightly=True)
|
||||
register_amd_ci(est_time=500, suite="nightly-amd-4-gpu", nightly=True)
|
||||
|
||||
MODELS = [
|
||||
SimpleNamespace(model="Qwen/Qwen2.5-VL-72B-Instruct", mmmu_accuracy=0.55),
|
||||
@@ -127,8 +129,8 @@ class TestVLMEncoderDP(CustomTestCase):
|
||||
process_env = os.environ.copy()
|
||||
if custom_env:
|
||||
process_env.update(custom_env)
|
||||
# if test vlm with cuda_ipc feature, open this env_var
|
||||
process_env["SGLANG_USE_CUDA_IPC_TRANSPORT"] = "1"
|
||||
if not is_in_amd_ci():
|
||||
process_env["SGLANG_USE_CUDA_IPC_TRANSPORT"] = "1"
|
||||
|
||||
# Prepare stdout/stderr redirection if needed
|
||||
stdout_file = None
|
||||
|
||||
@@ -32,6 +32,7 @@ PER_COMMIT_SUITES = {
|
||||
"stage-b-test-large-8-gpu-35x-disaggregation-amd",
|
||||
"stage-b-test-1-gpu-large-amd",
|
||||
"stage-b-test-2-gpu-large-amd",
|
||||
"stage-c-test-4-gpu-amd",
|
||||
"stage-c-test-large-8-gpu-amd",
|
||||
"stage-c-test-large-8-gpu-amd-mi35x",
|
||||
],
|
||||
@@ -87,6 +88,7 @@ NIGHTLY_SUITES = {
|
||||
"nightly-amd-1-gpu",
|
||||
"nightly-amd-1-gpu-mi35x",
|
||||
"nightly-amd-1-gpu-zimage-turbo",
|
||||
"nightly-amd-4-gpu",
|
||||
"nightly-amd-8-gpu",
|
||||
"nightly-amd-vlm",
|
||||
# MI35x 8-GPU suite (different model configs)
|
||||
|
||||
Reference in New Issue
Block a user