diff --git a/python/sglang/test/glm53_flash_common.py b/python/sglang/test/glm53_flash_common.py new file mode 100644 index 0000000000..6c7a500401 --- /dev/null +++ b/python/sglang/test/glm53_flash_common.py @@ -0,0 +1,57 @@ +"""Shared server setup for the GLM-5.3-Flash H200 serving recipes.""" + +from sglang.srt.utils import kill_process_tree +from sglang.test.test_utils import ( + DEFAULT_URL_FOR_TEST, + CustomTestCase, + _wait_for_gpu_idle_in_ci, + popen_launch_server, + try_cached_model, +) + +MODEL_PATH = "zai-org/GLM-5.3-Flash" +SERVER_LAUNCH_TIMEOUT = 3600 +GPU_IDLE_TIMEOUT = 120 + +COMMON_SERVER_ARGS = [ + "--tp-size", + "8", + "--dsa-prefill-backend", + "tilelang", + "--dsa-decode-backend", + "tilelang", + "--kv-cache-dtype", + "bf16", + "--moe-runner-backend", + "deep_gemm", + "--reasoning-parser", + "auto", + "--tool-call-parser", + "auto", +] + + +def _stop_server(process): + if process: + kill_process_tree(process.pid) + _wait_for_gpu_idle_in_ci(timeout=GPU_IDLE_TIMEOUT) + + +class _GLM53FlashH200Base(CustomTestCase): + server_args: list[str] + + @classmethod + def setUpClass(cls): + cls.model = try_cached_model(MODEL_PATH) + cls.base_url = DEFAULT_URL_FOR_TEST + cls.process = None + cls.process = popen_launch_server( + cls.model, + cls.base_url, + timeout=SERVER_LAUNCH_TIMEOUT, + other_args=cls.server_args, + ) + + @classmethod + def tearDownClass(cls): + _stop_server(getattr(cls, "process", None)) diff --git a/test/registered/e2e/models/test_glm53_flash_h200.py b/test/registered/e2e/models/test_glm53_flash_h200.py deleted file mode 100644 index 10d7cab65b..0000000000 --- a/test/registered/e2e/models/test_glm53_flash_h200.py +++ /dev/null @@ -1,121 +0,0 @@ -"""H200 per-commit coverage for the GLM-5.3-Flash serving recipes. - -Runs the Low Latency and High Throughput TP8 recipes on eight H200 GPUs. -Both recipes must retain GSM8K accuracy; the Low Latency recipe also checks -EAGLE speculative acceptance and single-request decode performance. -""" - -import unittest - -from sglang.srt.utils import kill_process_tree -from sglang.test.ci.ci_register import register_cuda_ci -from sglang.test.kits.eval_accuracy_kit import GSM8KMixin -from sglang.test.kits.spec_decoding_kit import SpecDecodingMixin -from sglang.test.test_utils import ( - DEFAULT_URL_FOR_TEST, - CustomTestCase, - _wait_for_gpu_idle_in_ci, - popen_launch_server, - try_cached_model, -) - -register_cuda_ci(est_time=2400, stage="extra-b", runner_config="8-gpu-h200") - -MODEL_PATH = "zai-org/GLM-5.3-Flash" -SERVER_LAUNCH_TIMEOUT = 3600 -GPU_IDLE_TIMEOUT = 120 - -COMMON_SERVER_ARGS = [ - "--tp-size", - "8", - "--dsa-prefill-backend", - "tilelang", - "--dsa-decode-backend", - "tilelang", - "--kv-cache-dtype", - "bf16", - "--moe-runner-backend", - "deep_gemm", - "--reasoning-parser", - "auto", - "--tool-call-parser", - "auto", -] - - -def _stop_server(process): - if process: - kill_process_tree(process.pid) - _wait_for_gpu_idle_in_ci(timeout=GPU_IDLE_TIMEOUT) - - -class _GLM53FlashH200Base(CustomTestCase): - server_args: list[str] - - @classmethod - def setUpClass(cls): - cls.model = try_cached_model(MODEL_PATH) - cls.base_url = DEFAULT_URL_FOR_TEST - cls.process = None - cls.process = popen_launch_server( - cls.model, - cls.base_url, - timeout=SERVER_LAUNCH_TIMEOUT, - other_args=cls.server_args, - ) - - @classmethod - def tearDownClass(cls): - _stop_server(getattr(cls, "process", None)) - - -class TestGLM53FlashH200LowLatency( - SpecDecodingMixin, - GSM8KMixin, - _GLM53FlashH200Base, -): - gsm8k_score_threshold = 0.96 - gsm8k_num_examples = 1319 - gsm8k_num_threads = 256 - gsm8k_backend = "sgl_eval" - gsm8k_thinking = True - gsm8k_max_tokens = 8192 - gsm8k_temperature = 1.0 - gsm8k_top_p = 0.95 - accept_length_thres = 4.0 - bs_1_speed_thres = 200 - server_args = [ - *COMMON_SERVER_ARGS, - "--speculative-algorithm", - "EAGLE", - "--speculative-num-steps", - "5", - "--speculative-eagle-topk", - "1", - "--speculative-num-draft-tokens", - "6", - ] - - -class TestGLM53FlashH200HighThroughput( - GSM8KMixin, - _GLM53FlashH200Base, -): - gsm8k_score_threshold = 0.96 - gsm8k_num_examples = 1319 - gsm8k_num_threads = 256 - gsm8k_backend = "sgl_eval" - gsm8k_thinking = True - gsm8k_max_tokens = 8192 - gsm8k_temperature = 1.0 - gsm8k_top_p = 0.95 - server_args = [ - *COMMON_SERVER_ARGS, - "--attn-dp-size", - "8", - "--mm-enable-dp-encoder", - ] - - -if __name__ == "__main__": - unittest.main() diff --git a/test/registered/e2e/models/test_glm53_flash_h200_high_throughput.py b/test/registered/e2e/models/test_glm53_flash_h200_high_throughput.py new file mode 100644 index 0000000000..a082c2911b --- /dev/null +++ b/test/registered/e2e/models/test_glm53_flash_h200_high_throughput.py @@ -0,0 +1,33 @@ +"""H200 per-commit coverage for the GLM-5.3-Flash high throughput recipe.""" + +import unittest + +from sglang.test.ci.ci_register import register_cuda_ci +from sglang.test.glm53_flash_common import COMMON_SERVER_ARGS, _GLM53FlashH200Base +from sglang.test.kits.eval_accuracy_kit import GSM8KMixin + +register_cuda_ci(est_time=1200, stage="extra-b", runner_config="8-gpu-h200") + + +class TestGLM53FlashH200HighThroughput( + GSM8KMixin, + _GLM53FlashH200Base, +): + gsm8k_score_threshold = 0.96 + gsm8k_num_examples = 1319 + gsm8k_num_threads = 256 + gsm8k_backend = "sgl_eval" + gsm8k_thinking = True + gsm8k_max_tokens = 8192 + gsm8k_temperature = 1.0 + gsm8k_top_p = 0.95 + server_args = [ + *COMMON_SERVER_ARGS, + "--attn-dp-size", + "8", + "--mm-enable-dp-encoder", + ] + + +if __name__ == "__main__": + unittest.main() diff --git a/test/registered/e2e/models/test_glm53_flash_h200_low_latency.py b/test/registered/e2e/models/test_glm53_flash_h200_low_latency.py new file mode 100644 index 0000000000..434d3b13f7 --- /dev/null +++ b/test/registered/e2e/models/test_glm53_flash_h200_low_latency.py @@ -0,0 +1,42 @@ +"""H200 per-commit coverage for the GLM-5.3-Flash low latency recipe.""" + +import unittest + +from sglang.test.ci.ci_register import register_cuda_ci +from sglang.test.glm53_flash_common import COMMON_SERVER_ARGS, _GLM53FlashH200Base +from sglang.test.kits.eval_accuracy_kit import GSM8KMixin +from sglang.test.kits.spec_decoding_kit import SpecDecodingMixin + +register_cuda_ci(est_time=1200, stage="extra-b", runner_config="8-gpu-h200") + + +class TestGLM53FlashH200LowLatency( + SpecDecodingMixin, + GSM8KMixin, + _GLM53FlashH200Base, +): + gsm8k_score_threshold = 0.96 + gsm8k_num_examples = 1319 + gsm8k_num_threads = 256 + gsm8k_backend = "sgl_eval" + gsm8k_thinking = True + gsm8k_max_tokens = 8192 + gsm8k_temperature = 1.0 + gsm8k_top_p = 0.95 + accept_length_thres = 4.0 + bs_1_speed_thres = 200 + server_args = [ + *COMMON_SERVER_ARGS, + "--speculative-algorithm", + "EAGLE", + "--speculative-num-steps", + "5", + "--speculative-eagle-topk", + "1", + "--speculative-num-draft-tokens", + "6", + ] + + +if __name__ == "__main__": + unittest.main()