[Perf] Fork-safe import: no CUDA context at import time, lighter argument parsing (#40201)
This commit is contained in:
@@ -20,6 +20,7 @@ from sglang.srt.parser.reasoning_parser import (
|
||||
Qwen3Detector,
|
||||
ReasoningParser,
|
||||
)
|
||||
from sglang.srt.parser.reasoning_parser_names import REASONING_PARSER_NAMES
|
||||
from sglang.test.ci.ci_register import register_cpu_ci
|
||||
from sglang.test.test_utils import CustomTestCase
|
||||
|
||||
@@ -1726,5 +1727,14 @@ class TestGraniteThinkingDetector(CustomTestCase):
|
||||
self.assertEqual(normal, "truncated")
|
||||
|
||||
|
||||
class TestReasoningParserNames(CustomTestCase):
|
||||
def test_matches_registry(self):
|
||||
# `server_args` builds the --reasoning-parser choices from this list to
|
||||
# keep the registry, and its dependencies, out of argument parsing.
|
||||
self.assertEqual(
|
||||
sorted(REASONING_PARSER_NAMES), sorted(ReasoningParser.DetectorMap)
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user