ci: tag-gated nightly migration — foundation + 40 whole-file moves (#24725)

Co-authored-by: hnyls2002 <lsyincs@gmail.com>
Co-authored-by: Liangsheng Yin <hnyls2002@gmail.com>
This commit is contained in:
Alison Shao
2026-05-14 16:11:15 -07:00
committed by GitHub
co-authored by hnyls2002 Liangsheng Yin
parent 67096f48bf
commit ba214ef3d3
78 changed files with 2254 additions and 2131 deletions
@@ -24,7 +24,7 @@ from sglang.test.test_utils import (
popen_launch_server,
)
register_cuda_ci(est_time=87, stage="stage-b", runner_config="1-gpu-large")
register_cuda_ci(est_time=87, stage="extra-a", runner_config="1-gpu-large")
def remove_prefix(text: str, prefix: str) -> str:
@@ -31,11 +31,7 @@ from sglang.test.test_utils import (
popen_launch_server,
)
register_cuda_ci(
est_time=122,
stage="stage-b",
runner_config="1-gpu-large",
)
register_cuda_ci(est_time=122, stage="extra-a", runner_config="1-gpu-large")
NUM_TURNS = 150
INPUT_LEN = 16
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,105 @@
import unittest
from sglang.test.ci.ci_register import register_cuda_ci
from sglang.test.kits.streaming_session_kit import StreamingSessionKitMixin
from sglang.test.server_fixtures.streaming_session_fixture import (
StreamingSessionServerBase,
)
from sglang.test.test_utils import (
DEFAULT_DRAFT_MODEL_EAGLE3,
DEFAULT_TARGET_MODEL_EAGLE3,
)
register_cuda_ci(est_time=691, stage="extra-a", runner_config="1-gpu-large")
class TestStreamingSessionRetractMixedChunk(
StreamingSessionServerBase, StreamingSessionKitMixin
):
"""Retract + --enable-mixed-chunk."""
extra_args = ["--chunked-prefill-size", "128", "--enable-mixed-chunk"]
env_overrides = [("SGLANG_TEST_RETRACT", True)]
class TestStreamingSessionRetractLargePage(
StreamingSessionServerBase, StreamingSessionKitMixin
):
"""Retract + page=256: exercises page-aligned `_free_tail`. Partial-page
free would corrupt pages still holding committed tokens."""
extra_args = ["--chunked-prefill-size", "4096", "--page-size", "256"]
env_overrides = [("SGLANG_TEST_RETRACT", True)]
# Common EAGLE3 spec args; reused by Eagle/EagleV2/EagleRetractLargePage variants.
_EAGLE3_SPEC_ARGS = [
"--dtype=float16",
"--speculative-algorithm",
"EAGLE3",
"--speculative-draft-model",
DEFAULT_DRAFT_MODEL_EAGLE3,
"--speculative-num-steps",
"3",
"--speculative-eagle-topk",
"1",
"--speculative-num-draft-tokens",
"4",
"--mem-fraction-static",
"0.7",
]
class TestStreamingSessionEagle(StreamingSessionServerBase, StreamingSessionKitMixin):
"""EAGLE3 spec v1 (overlap disabled); offset=-1 — see kit's note."""
kv_inherit_offset = -1
model = DEFAULT_TARGET_MODEL_EAGLE3
extra_args = [
"--disable-overlap-schedule",
"--chunked-prefill-size",
"512",
*_EAGLE3_SPEC_ARGS,
]
env_overrides = [("SGLANG_ALLOW_OVERWRITE_LONGER_CONTEXT_LEN", True)]
class TestStreamingSessionEagleV2(StreamingSessionServerBase, StreamingSessionKitMixin):
"""EAGLE3 spec v2 (overlap on)."""
model = DEFAULT_TARGET_MODEL_EAGLE3
extra_args = [
"--chunked-prefill-size",
"512",
*_EAGLE3_SPEC_ARGS,
]
env_overrides = [
("SGLANG_ENABLE_SPEC_V2", True),
("SGLANG_ALLOW_OVERWRITE_LONGER_CONTEXT_LEN", True),
]
class TestStreamingSessionEagleRetractLargePage(
StreamingSessionServerBase, StreamingSessionKitMixin
):
"""EAGLE3 spec v1 + retract + page=256: max-pressure on `_free_tail`
(spec tail + retract alloc-commit gap + page alignment)."""
kv_inherit_offset = -1
model = DEFAULT_TARGET_MODEL_EAGLE3
extra_args = [
"--disable-overlap-schedule",
"--chunked-prefill-size",
"4096",
*_EAGLE3_SPEC_ARGS,
"--page-size",
"256",
]
env_overrides = [
("SGLANG_TEST_RETRACT", True),
("SGLANG_ALLOW_OVERWRITE_LONGER_CONTEXT_LEN", True),
]
if __name__ == "__main__":
unittest.main()
@@ -1,27 +1,15 @@
import os
import sys
import unittest
from sglang.srt.environ import envs
from sglang.srt.utils import kill_process_tree
from sglang.srt.utils.hf_transformers_utils import get_tokenizer
from sglang.test.ci.ci_register import register_cuda_ci
from sglang.test.test_utils import (
DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH,
DEFAULT_URL_FOR_TEST,
popen_launch_server,
from sglang.test.kits.streaming_session_kit import (
AbortLeakReproKitMixin,
StreamingSessionKitMixin,
)
# test/ has no __init__.py; add sibling dir so sibling module is importable
# when this file is run as a script via `python3 <path>`.
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
from test_streaming_session import ( # noqa: E402
from sglang.test.server_fixtures.streaming_session_fixture import (
ABORT_REPRO_CHUNKED_PREFILL_SIZE,
ABORT_REPRO_CONTEXT_LEN,
ABORT_REPRO_PAGE_SIZE,
TestStreamingSession,
TestStreamingSessionAbortLeakRepro,
StreamingSessionServerBase,
)
register_cuda_ci(est_time=519, stage="stage-b", runner_config="1-gpu-large")
@@ -37,125 +25,63 @@ SWA_COMMON_ARGS = [
]
class TestStreamingSessionSWA(TestStreamingSession):
class TestStreamingSessionSWA(StreamingSessionServerBase, StreamingSessionKitMixin):
"""Baseline streaming session on a hybrid-SWA model."""
@classmethod
def setUpClass(cls):
cls.model = SWA_MODEL
cls.base_url = DEFAULT_URL_FOR_TEST
with envs.SGLANG_ENABLE_STRICT_MEM_CHECK_DURING_BUSY.override(2):
cls.process = popen_launch_server(
cls.model,
cls.base_url,
timeout=DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH,
other_args=[
"--enable-streaming-session",
"--chunked-prefill-size",
"512",
*SWA_COMMON_ARGS,
],
)
cls.tokenizer = get_tokenizer(cls.model)
@classmethod
def tearDownClass(cls):
kill_process_tree(cls.process.pid)
model = SWA_MODEL
extra_args = ["--chunked-prefill-size", "512", *SWA_COMMON_ARGS]
class TestStreamingSessionSWARetractLargePage(TestStreamingSession):
class TestStreamingSessionSWARetractLargePage(
StreamingSessionServerBase, StreamingSessionKitMixin
):
"""SWA under retract decode with page=256."""
@classmethod
def setUpClass(cls):
cls.model = SWA_MODEL
cls.base_url = DEFAULT_URL_FOR_TEST
with (
envs.SGLANG_TEST_RETRACT.override(True),
envs.SGLANG_ENABLE_STRICT_MEM_CHECK_DURING_BUSY.override(2),
):
cls.process = popen_launch_server(
cls.model,
cls.base_url,
timeout=DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH,
other_args=[
"--enable-streaming-session",
"--chunked-prefill-size",
"4096",
"--page-size",
"256",
*SWA_COMMON_ARGS,
],
)
cls.tokenizer = get_tokenizer(cls.model)
@classmethod
def tearDownClass(cls):
kill_process_tree(cls.process.pid)
model = SWA_MODEL
extra_args = [
"--chunked-prefill-size",
"4096",
"--page-size",
"256",
*SWA_COMMON_ARGS,
]
env_overrides = [("SGLANG_TEST_RETRACT", True)]
class TestStreamingSessionSWARetractMixedChunk(TestStreamingSession):
class TestStreamingSessionSWARetractMixedChunk(
StreamingSessionServerBase, StreamingSessionKitMixin
):
"""SWA under retract decode with --enable-mixed-chunk."""
@classmethod
def setUpClass(cls):
cls.model = SWA_MODEL
cls.base_url = DEFAULT_URL_FOR_TEST
with (
envs.SGLANG_TEST_RETRACT.override(True),
envs.SGLANG_ENABLE_STRICT_MEM_CHECK_DURING_BUSY.override(2),
):
cls.process = popen_launch_server(
cls.model,
cls.base_url,
timeout=DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH,
other_args=[
"--enable-streaming-session",
"--chunked-prefill-size",
"128",
"--enable-mixed-chunk",
*SWA_COMMON_ARGS,
],
)
cls.tokenizer = get_tokenizer(cls.model)
@classmethod
def tearDownClass(cls):
kill_process_tree(cls.process.pid)
model = SWA_MODEL
extra_args = [
"--chunked-prefill-size",
"128",
"--enable-mixed-chunk",
*SWA_COMMON_ARGS,
]
env_overrides = [("SGLANG_TEST_RETRACT", True)]
class TestStreamingSessionSWAAbortLeakRepro(TestStreamingSessionAbortLeakRepro):
class TestStreamingSessionSWAAbortLeakRepro(
StreamingSessionServerBase, AbortLeakReproKitMixin
):
"""SWA abort-heavy chunked prefill leak repro."""
@classmethod
def setUpClass(cls):
cls.model = SWA_MODEL
cls.base_url = DEFAULT_URL_FOR_TEST
with envs.SGLANG_ENABLE_STRICT_MEM_CHECK_DURING_BUSY.override(2):
cls.process = popen_launch_server(
cls.model,
cls.base_url,
timeout=DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH,
other_args=[
"--enable-streaming-session",
"--chunked-prefill-size",
str(ABORT_REPRO_CHUNKED_PREFILL_SIZE),
"--context-length",
str(ABORT_REPRO_CONTEXT_LEN),
"--page-size",
str(ABORT_REPRO_PAGE_SIZE),
"--max-running-requests",
"32",
"--log-level",
"info",
*SWA_COMMON_ARGS,
],
)
cls.tokenizer = get_tokenizer(cls.model)
@classmethod
def tearDownClass(cls):
kill_process_tree(cls.process.pid)
model = SWA_MODEL
extra_args = [
"--chunked-prefill-size",
str(ABORT_REPRO_CHUNKED_PREFILL_SIZE),
"--context-length",
str(ABORT_REPRO_CONTEXT_LEN),
"--page-size",
str(ABORT_REPRO_PAGE_SIZE),
"--max-running-requests",
"32",
"--log-level",
"info",
*SWA_COMMON_ARGS,
]
if __name__ == "__main__":