Unify spec v2's naming manner. (#15990)

This commit is contained in:
Liangsheng Yin
2025-12-28 14:14:52 +08:00
committed by GitHub
parent 26c5091217
commit bf90ea9c5b
8 changed files with 31 additions and 35 deletions
@@ -1,9 +1,9 @@
import os
import unittest
from types import SimpleNamespace
import requests
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
@@ -26,7 +26,6 @@ SERVER_LAUNCH_TIMEOUT = 1200
class TestDeepseekV3FP4MTP(CustomTestCase):
@classmethod
def setUpClass(cls):
os.environ["SGLANG_ENABLE_SPEC_V2"] = "1"
cls.model = FULL_DEEPSEEK_V3_FP4_MODEL_PATH
cls.base_url = DEFAULT_URL_FOR_TEST
other_args = [
@@ -51,18 +50,17 @@ class TestDeepseekV3FP4MTP(CustomTestCase):
"--model-loader-extra-config",
'{"enable_multithread_load": true,"num_threads": 64}',
]
cls.process = popen_launch_server(
cls.model,
cls.base_url,
timeout=SERVER_LAUNCH_TIMEOUT,
other_args=other_args,
)
with envs.SGLANG_ENABLE_SPEC_V2.override(True):
cls.process = popen_launch_server(
cls.model,
cls.base_url,
timeout=SERVER_LAUNCH_TIMEOUT,
other_args=other_args,
)
@classmethod
def tearDownClass(cls):
kill_process_tree(cls.process.pid)
if "SGLANG_ENABLE_SPEC_V2" in os.environ:
del os.environ["SGLANG_ENABLE_SPEC_V2"]
def test_a_gsm8k(
self,
@@ -30,7 +30,7 @@ class TestEagleConstrainedDecoding(
model = DEFAULT_TARGET_MODEL_EAGLE
draft_model = DEFAULT_DRAFT_MODEL_EAGLE
grammar_backend = "xgrammar"
eagle_v2 = False
spec_v2 = False
@classmethod
def setUpClass(cls):
@@ -59,7 +59,7 @@ class TestEagleConstrainedDecoding(
cls.grammar_backend,
]
launch_args.extend(cls.other_launch_args)
with envs.SGLANG_ENABLE_SPEC_V2.override(cls.eagle_v2):
with envs.SGLANG_ENABLE_SPEC_V2.override(cls.spec_v2):
cls.process = popen_launch_server(
cls.model,
cls.base_url,
@@ -73,7 +73,7 @@ class TestEagleConstrainedDecoding(
class TestEagleConstrainedDecodingV2(TestEagleConstrainedDecoding):
eagle_v2 = True
spec_v2 = True
if __name__ == "__main__":
+4 -7
View File
@@ -1,8 +1,8 @@
import os
import unittest
from types import SimpleNamespace
from urllib.parse import urlparse
from sglang.srt.environ import envs
from sglang.srt.utils import kill_process_tree
from sglang.test.few_shot_gsm8k import run_eval as run_eval_few_shot_gsm8k
from sglang.test.test_utils import (
@@ -54,12 +54,9 @@ class TestAscendDeepSeekMTP(CustomTestCase):
2,
]
cls.extra_envs = {
"SGLANG_NPU_USE_MLAPO": "1",
"SGLANG_ENABLE_SPEC_V2": "1",
"SGLANG_ENABLE_OVERLAP_PLAN_STREAM": "1",
}
os.environ.update(cls.extra_envs)
envs.SGLANG_NPU_USE_MLAPO.set(True)
envs.SGLANG_ENABLE_SPEC_V2.set(True)
envs.SGLANG_ENABLE_OVERLAP_PLAN_STREAM.set(True)
def test_a_gsm8k(self):
for model in self.models: