From c775c31cb30f0f6c32e742fb4d5fbed5be384573 Mon Sep 17 00:00:00 2001 From: Liangsheng Yin Date: Sun, 12 Apr 2026 20:26:54 -0700 Subject: [PATCH] Simplify test_chunked_prefill; remove redundant tests (#22652) --- .../scheduler/test_chunked_prefill.py | 35 ------------ .../scheduler/test_mixed_chunked_prefill.py | 55 +++++++++++++++++++ 2 files changed, 55 insertions(+), 35 deletions(-) delete mode 100644 test/registered/scheduler/test_chunked_prefill.py create mode 100644 test/registered/scheduler/test_mixed_chunked_prefill.py diff --git a/test/registered/scheduler/test_chunked_prefill.py b/test/registered/scheduler/test_chunked_prefill.py deleted file mode 100644 index a4257dedb..000000000 --- a/test/registered/scheduler/test_chunked_prefill.py +++ /dev/null @@ -1,35 +0,0 @@ -""" -python3 -m unittest test_chunked_prefill.TestChunkedPrefill.test_mixed_chunked_prefill_without_radix_cache -""" - -import unittest - -from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci -from sglang.test.test_utils import CustomTestCase, run_mmlu_test, run_mulit_request_test - -register_cuda_ci(est_time=360, suite="stage-b-test-1-gpu-small") -register_amd_ci(est_time=312, suite="stage-b-test-1-gpu-small-amd") - - -class TestChunkedPrefill(CustomTestCase): - def test_chunked_prefill(self): - run_mmlu_test(disable_radix_cache=False, enable_mixed_chunk=False) - - def test_mixed_chunked_prefill(self): - run_mmlu_test(disable_radix_cache=False, enable_mixed_chunk=True) - - def test_chunked_prefill_without_radix_cache(self): - run_mmlu_test(disable_radix_cache=True, enable_mixed_chunk=False) - - def test_mixed_chunked_prefill_without_radix_cache(self): - run_mmlu_test(disable_radix_cache=True, enable_mixed_chunk=True) - - def test_mixed_chunked_prefill_multi_requests(self): - run_mulit_request_test( - enable_mixed_chunk=True, - chunked_prefill_size=2048, - ) - - -if __name__ == "__main__": - unittest.main() diff --git a/test/registered/scheduler/test_mixed_chunked_prefill.py b/test/registered/scheduler/test_mixed_chunked_prefill.py new file mode 100644 index 000000000..895943394 --- /dev/null +++ b/test/registered/scheduler/test_mixed_chunked_prefill.py @@ -0,0 +1,55 @@ +import unittest + +from sglang.srt.environ import envs +from sglang.srt.utils import kill_process_tree +from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci +from sglang.test.kits.eval_accuracy_kit import GSM8KMixin +from sglang.test.test_utils import ( + DEFAULT_MODEL_NAME_FOR_TEST, + DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH, + DEFAULT_URL_FOR_TEST, + CustomTestCase, + popen_launch_server, +) + +register_cuda_ci(est_time=180, suite="stage-b-test-1-gpu-small") +register_amd_ci(est_time=180, suite="stage-b-test-1-gpu-small-amd") + + +class TestMixedChunkedPrefill(GSM8KMixin, CustomTestCase): + model = DEFAULT_MODEL_NAME_FOR_TEST + base_url = DEFAULT_URL_FOR_TEST + gsm8k_accuracy_thres = 0.62 + + extra_args = [ + "--enable-mixed-chunk", + "--chunked-prefill-size", + "32", + ] + + @classmethod + def setUpClass(cls): + with envs.SGLANG_ENABLE_STRICT_MEM_CHECK_DURING_BUSY.override(2): + cls.process = popen_launch_server( + cls.model, + cls.base_url, + timeout=DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH, + other_args=cls.extra_args, + ) + + @classmethod + def tearDownClass(cls): + kill_process_tree(cls.process.pid) + + +class TestMixedChunkedPrefillNoRadixCache(TestMixedChunkedPrefill): + extra_args = [ + "--enable-mixed-chunk", + "--chunked-prefill-size", + "32", + "--disable-radix-cache", + ] + + +if __name__ == "__main__": + unittest.main()