[Test] Consolidate eval accuracy test mixins into eval_accuracy_kit (#21047)

This commit is contained in:
Liangsheng Yin
2026-03-26 14:26:46 -07:00
committed by GitHub
parent e5dd411f64
commit fb90c9d298
25 changed files with 276 additions and 377 deletions
@@ -1,9 +1,8 @@
import unittest
from types import SimpleNamespace
from sglang.srt.utils import kill_process_tree
from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci
from sglang.test.run_eval import run_eval
from sglang.test.kits.eval_accuracy_kit import MMLUMixin
from sglang.test.test_utils import (
DEFAULT_MODEL_NAME_FOR_TEST,
DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH,
@@ -21,8 +20,11 @@ register_cuda_ci(est_time=230, suite="stage-b-test-1-gpu-large")
register_amd_ci(est_time=345, suite="stage-b-test-1-gpu-small-amd")
class TestMultiTokenizer(CustomTestCase):
# from test_hicache.py
class TestMultiTokenizer(CustomTestCase, MMLUMixin):
mmlu_score_threshold = 0.65
mmlu_num_examples = 64
mmlu_num_threads = 32
@classmethod
def setUpClass(cls):
cls.model = DEFAULT_MODEL_NAME_FOR_TEST
@@ -43,17 +45,6 @@ class TestMultiTokenizer(CustomTestCase):
def tearDownClass(cls):
kill_process_tree(cls.process.pid)
def test_mmlu(self):
args = SimpleNamespace(
base_url=self.base_url,
model=self.model,
eval_name="mmlu",
num_examples=64,
num_threads=32,
)
metrics = run_eval(args)
self.assertGreaterEqual(metrics["score"], 0.65)
def test_multi_tokenizer_ttft(self):
# from test_bench_serving.py run_bench_serving
args = get_benchmark_args(