[Spec] Refactor NaN/OOB checks to async maybe_detect_* with env-var control (#19899)

Co-authored-by: hnyls2002 <lsyincs@gmail.com>
This commit is contained in:
kpham-sgl
2026-03-05 13:51:05 -08:00
committed by GitHub
co-authored by hnyls2002
parent 1c1712d8e5
commit 346a4131cf
17 changed files with 171 additions and 68 deletions
@@ -3,6 +3,7 @@ import unittest
import openai
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.test_utils import (
@@ -50,12 +51,15 @@ class ServerWithGrammar(CustomTestCase):
"--speculative-num-draft-tokens=8",
]
cls.process = popen_launch_server(
cls.model,
cls.base_url,
timeout=DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH,
other_args=launch_args,
)
with envs.SGLANG_SPEC_NAN_DETECTION.override(
True
), envs.SGLANG_SPEC_OOB_DETECTION.override(True):
cls.process = popen_launch_server(
cls.model,
cls.base_url,
timeout=DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH,
other_args=launch_args,
)
@classmethod
def tearDownClass(cls):