From 3c358736d13440444a6e60f73f3a71245bfda341 Mon Sep 17 00:00:00 2001 From: Liangsheng Yin Date: Sat, 10 Jan 2026 16:49:10 +0800 Subject: [PATCH] Enhance test for dp-attention + constrained decoding. (#16849) --- .../distributed/test_dp_attention.py | 24 ++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/test/registered/distributed/test_dp_attention.py b/test/registered/distributed/test_dp_attention.py index 2a3d6b608..a158b53ce 100644 --- a/test/registered/distributed/test_dp_attention.py +++ b/test/registered/distributed/test_dp_attention.py @@ -7,7 +7,10 @@ from sglang.srt.environ import envs from sglang.srt.utils import kill_process_tree from sglang.test.ci.ci_register import 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 TestEBNFConstrainedMinxin +from sglang.test.kits.json_constrained_kit import TestJSONConstrainedMixin from sglang.test.kits.radix_cache_server_kit import run_radix_attention_test +from sglang.test.kits.regex_constrained_kit import TestRegexConstrainedMixin from sglang.test.run_eval import run_eval from sglang.test.test_utils import ( DEFAULT_MLA_MODEL_NAME_FOR_TEST, @@ -23,7 +26,12 @@ from sglang.test.test_utils import ( register_cuda_ci(est_time=350, suite="stage-b-test-large-2-gpu") -class TestDPAttentionDP2TP2(CustomTestCase): +class TestDPAttentionDP2TP2( + CustomTestCase, + TestJSONConstrainedMixin, + TestEBNFConstrainedMinxin, + TestRegexConstrainedMixin, +): @classmethod def setUpClass(cls): cls.model = DEFAULT_MLA_MODEL_NAME_FOR_TEST @@ -63,7 +71,12 @@ class TestDPAttentionDP2TP2(CustomTestCase): self.assertGreater(metrics["score"], 0.8) -class TestDPRetract(CustomTestCase): +class TestDPRetract( + CustomTestCase, + TestJSONConstrainedMixin, + TestEBNFConstrainedMinxin, + TestRegexConstrainedMixin, +): @classmethod def setUpClass(cls): cls.model = DEFAULT_MLA_MODEL_NAME_FOR_TEST @@ -98,7 +111,12 @@ class TestDPRetract(CustomTestCase): self.assertIsNone(self.process.poll()) -class TestDPAttentionDP2TP2DeepseekV3MTP(CustomTestCase): +class TestDPAttentionDP2TP2DeepseekV3MTP( + CustomTestCase, + TestJSONConstrainedMixin, + TestEBNFConstrainedMinxin, + TestRegexConstrainedMixin, +): @classmethod def setUpClass(cls): cls.model = DEFAULT_MODEL_NAME_FOR_TEST_MLA