repo
stringclasses
454 values
file_path
stringlengths
5
201
extension
stringclasses
1 value
content
stringlengths
8
509k
num_lines
int64
3
16.9k
size_bytes
int64
8
511k
sglang
test/registered/spec/utils/test_build_eagle_tree.py
.py
import unittest import torch from sglang.srt.speculative.eagle_utils import ( build_tree_kernel_efficient, organize_draft_results, ) from sglang.srt.utils import get_device from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci register_cuda_ci(est_time=8, stage="base-b", runner_config="1-g...
406
14,165
sglang
test/registered/spec/dflash/test_muse_glimmer_dflash_assistant_gsm8k.py
.py
import unittest from sglang.srt.utils import kill_process_tree from sglang.test.ci.ci_register import register_cuda_ci from sglang.test.kits.eval_accuracy_kit import GSM8KMixin from sglang.test.test_utils import ( DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH, DEFAULT_URL_FOR_TEST, CustomTestCase, popen_launch_ser...
95
3,759
sglang
test/registered/spec/dflash/test_dflash.py
.py
import unittest import openai from sglang.srt.environ import envs from sglang.srt.utils import is_hip, kill_process_tree from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci from sglang.test.kits.eval_accuracy_kit import GSM8KMixin from sglang.test.kits.json_constrained_kit import JSONConstrainedM...
178
6,058
sglang
test/registered/hicache/test_qwen35_hicache.py
.py
import shutil import tempfile import time import unittest from types import SimpleNamespace import requests import zmq from msgspec.msgpack import Decoder from sglang.srt.disaggregation.kv_events import BlockStored, KVEventBatch from sglang.srt.utils import kill_process_tree from sglang.test.ci.ci_register import reg...
183
5,847
sglang
test/registered/hicache/test_hicache_spec_mooncake_storage.py
.py
""" E2E test for HiCache mooncake storage with EAGLE3 speculative decoding. Verifies that after a server restart, both target and draft KV cache for a long deterministic prompt are reloaded from the mooncake_master process and the spec accept length does not regress. Mooncake_master + http metadata server lifecycle i...
188
7,053
sglang
test/registered/hicache/test_hicache_storage_runtime_attach_detach.py
.py
""" E2E check for HiCache storage runtime attach/detach. This test launches an SGLang server with hierarchical cache enabled but WITHOUT any storage backend at startup, then attaches/detaches a storage backend via the HTTP endpoints. Usage: python3 -m pytest test/registered/hicache/test_hicache_storage_runtime_at...
368
14,050
sglang
test/registered/hicache/test_hicache_spec_file_storage.py
.py
""" E2E test for HiCache file storage with EAGLE3 speculative decoding. Usage: python3 -m pytest test/registered/hicache/test_hicache_spec_file_storage.py -v """ import os import shutil import tempfile import time import unittest from sglang.srt.mem_cache.hicache_storage import PoolName from sglang.srt.utils imp...
90
2,893
sglang
test/registered/hicache/test_hicache_storage_mooncake_backend.py
.py
""" Benchmark tests for HiCache Storage with Mooncake backend. Usage: python3.10 -m pytest test/registered/hicache/test_hicache_storage_mooncake_backend.py -v """ import os import subprocess import time import unittest import requests from test_hicache_storage_file_backend import HiCacheStorageBaseMixin from sgl...
321
12,232
sglang
test/registered/hicache/test_hicache_storage_3fs_backend.py
.py
""" Benchmark tests for HiCache Storage with 3FS backend. Usage: python3 -m pytest test/registered/hicache/test_hicache_storage_3fs_backend.py -v """ import json import os import unittest from test_hicache_storage_file_backend import HiCacheStorageBaseMixin from sglang.test.ci.ci_register import register_amd_ci,...
93
3,307
sglang
test/registered/hicache/test_hicache_storage_umbp_backend.py
.py
"""E2E test for DeepSeek-V4 HiCache storage with the UMBP backend. The first request writes the hybrid HostPoolGroup side pools to UMBP. After flushing the device and host radix caches, the same prompt must be restored from UMBP and report a storage-tier cache hit. Usage: python3 -m pytest \ test/register...
215
6,691
sglang
test/registered/hicache/test_hicache_storage_file_backend.py
.py
""" E2E tests for HiCache Storage functionality. Usage: python3 -m pytest test/registered/hicache/test_hicache_storage_file_backend.py -v """ import json import os import random import tempfile import time import unittest from types import SimpleNamespace from typing import Dict from urllib.parse import urlparse ...
336
11,538
sglang
test/registered/hicache/test_hicache_storage.py
.py
from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci register_cuda_ci(est_time=99, stage="base-b", runner_config="1-gpu-small") register_amd_ci(est_time=300, suite="stage-b-test-1-gpu-small-amd") import subprocess import time import unittest from sglang.srt.utils import is_hip, kill_process_tree ...
65
1,895
sglang
test/registered/hicache/test_hicache_variants.py
.py
from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci register_cuda_ci(est_time=450, stage="base-b", runner_config="1-gpu-large") register_amd_ci(est_time=524, suite="stage-b-test-1-gpu-small-amd") """ Consolidated HiCache variant tests. Tests HiCache with different configurations: standard, MLA, EA...
137
3,777
sglang
test/registered/input_embedding/test_input_embeds_chunked.py
.py
"""Regression tests for input_embeds shape-mismatch bugs. Covers two bugs with the same crash signature (RuntimeError: shape mismatch in set_kv_buffer) but opposite polarity: - Chunked prefill truncation (#20376): PrefillAdder shrinks fill_len and extend_input_len on chunk overflow but not input_embeds, so the full...
190
6,948
sglang
test/registered/input_embedding/test_input_embeddings.py
.py
import json import os import tempfile import unittest import requests from transformers import AutoModelForCausalLM, AutoTokenizer from sglang.srt.utils import kill_process_tree from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci from sglang.test.test_utils import ( DEFAULT_SMALL_MODEL_NAME_F...
156
6,041
sglang
test/registered/prefill_only/test_embedding_models.py
.py
# Copyright 2023-2024 SGLang Team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
163
5,725
sglang
test/registered/prefill_only/test_openai_embedding.py
.py
import json import unittest import openai from sglang.srt.utils import kill_process_tree from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci from sglang.test.test_utils import ( DEFAULT_SMALL_EMBEDDING_MODEL_NAME_FOR_TEST, DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH, DEFAULT_URL_FOR_TEST, C...
201
7,660
sglang
test/registered/prefill_only/test_multi_item_scoring.py
.py
"""Tests for the Multi-Item Scoring (MIS) optimization. MIS is a server-side optimization enabled via --enable-mis that batches multiple items into a single forward pass using delimiter tokens (token ID 9999). This is different from batch scoring (multiple items in one API call) which processes items as separate reque...
518
19,394
sglang
test/registered/prefill_only/test_reward_models.py
.py
import multiprocessing as mp import unittest import torch from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci from sglang.test.runners import HFRunner, SRTRunner from sglang.test.test_utils import CustomTestCase # Reward model tests # Copyright 2023-2024 SGLang Team # Licensed under the Apache ...
104
4,020
sglang
test/registered/prefill_only/test_serving_rerank.py
.py
import asyncio import unittest from unittest.mock import Mock from sglang.srt.entrypoints.openai.protocol import V1RerankReqInput from sglang.srt.managers.tokenizer_manager_score_mixin import ScoreResult from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci # Keep consistent with other openai_serve...
311
12,501
sglang
test/registered/prefill_only/test_score_api.py
.py
"""HTTP layer tests for the /v1/score endpoint. Two test classes, each with its own server instance: TestCausalLMScoringHTTP — basic endpoint: schema defaults, response structure, error rejection (no MIS) TestCausalLMMISScoringHTTP — MIS mode: validates --enable-mis CLI flag ...
235
8,519
sglang
test/registered/prefill_only/test_pooled_hidden_states.py
.py
"""Tests for the return_pooled_hidden_states feature on the scoring API. Covers both Engine-level (Python API) and HTTP-level (/v1/score) integration: TestPooledHiddenStatesEngine — SeqCls model, single-item scoring TestPooledHiddenStatesMISEngine — SeqCls model, MIS delimiter mode TestPooledHiddenStatesHT...
434
15,967
sglang
test/registered/prefill_only/test_score_engine.py
.py
"""Engine API tests for the /v1/score scoring pipeline. Two model types, two scoring modes: TestCausalLMScoring — CausalLM, single-item and batched multi-item TestSeqClsScoring — SequenceClassification, single-item mode TestSeqClsMISScoring — SequenceClassification, MIS mode (--enable-mis)...
492
18,985
sglang
test/registered/rotary/test_rope_cache_invalidation.py
.py
import unittest from unittest.mock import patch import torch from sglang.srt.layers.rotary_embedding import get_rope from sglang.srt.layers.rotary_embedding.factory import _ROPE_DICT from sglang.srt.server_args import ServerArgs, set_global_server_args_for_scheduler from sglang.test.ci.ci_register import register_cpu...
82
2,884
sglang
test/registered/rotary/test_rope_rocm.py
.py
import unittest import torch from sglang.srt.layers.rotary_embedding import RotaryEmbedding from sglang.srt.utils import get_bool_env_var, is_hip from sglang.test.ci.ci_register import register_amd_ci from sglang.test.test_utils import CustomTestCase register_amd_ci(est_time=3, suite="stage-b-test-1-gpu-small-amd") ...
124
4,245
sglang
test/registered/8-gpu-models/test_glm_46.py
.py
import unittest from sglang.test.accuracy_test_runner import AccuracyTestParams from sglang.test.ci.ci_register import register_cuda_ci from sglang.test.performance_test_runner import PerformanceTestParams from sglang.test.run_combined_tests import run_combined_tests from sglang.test.test_utils import ModelLaunchSetti...
54
1,654
sglang
test/registered/8-gpu-models/test_inkling_nvfp4_nightly.py
.py
import unittest from sglang.srt.environ import envs from sglang.test.accuracy_test_runner import AccuracyTestParams from sglang.test.cache_consistency_jitter import get_jitter_engine, run_jitter_test from sglang.test.ci.ci_register import register_cuda_ci from sglang.test.performance_test_runner import PerformanceTest...
113
4,361
sglang
test/registered/8-gpu-models/test_qwen35.py
.py
import unittest from sglang.test.accuracy_test_runner import AccuracyTestParams from sglang.test.ci.ci_register import register_cuda_ci from sglang.test.performance_test_runner import PerformanceTestParams from sglang.test.run_combined_tests import run_combined_tests from sglang.test.test_utils import ModelLaunchSetti...
82
2,710
sglang
test/registered/8-gpu-models/test_kimi_k25.py
.py
import unittest from sglang.test.accuracy_test_runner import AccuracyTestParams from sglang.test.ci.ci_register import register_cuda_ci from sglang.test.performance_test_runner import PerformanceTestParams from sglang.test.run_combined_tests import run_combined_tests from sglang.test.test_utils import ModelLaunchSetti...
65
2,051
sglang
test/registered/8-gpu-models/test_glm52_fp8.py
.py
import unittest from sglang.test.accuracy_test_runner import AccuracyTestParams from sglang.test.ci.ci_register import register_cuda_ci from sglang.test.performance_test_runner import PerformanceTestParams from sglang.test.run_combined_tests import run_combined_tests from sglang.test.test_utils import ModelLaunchSetti...
70
2,102
sglang
test/registered/8-gpu-models/test_deepseek_v32_indexcache.py
.py
import unittest from types import SimpleNamespace 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.test_utils import ( DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH, DEFAULT_URL...
118
3,627
sglang
test/registered/8-gpu-models/test_ring_2_5_1t.py
.py
import unittest from sglang.test.accuracy_test_runner import AccuracyTestParams from sglang.test.ci.ci_register import register_cuda_ci from sglang.test.run_combined_tests import run_combined_tests from sglang.test.test_utils import ModelLaunchSettings register_cuda_ci(est_time=1680, stage="nightly", runner_config="8...
58
1,646
sglang
test/registered/8-gpu-models/test_mistral_large3.py
.py
import os import unittest from sglang.srt.environ import envs from sglang.test.accuracy_test_runner import AccuracyTestParams from sglang.test.ci.ci_register import register_cuda_ci from sglang.test.performance_test_runner import PerformanceTestParams from sglang.test.run_combined_tests import run_combined_tests from ...
111
4,442
sglang
test/registered/8-gpu-models/test_ling_2_6_flash.py
.py
"""GSM8K accuracy test for Ling-2.6-flash (BailingMoELinearForCausalLM). Guards the hybrid linear / full attention dispatcher: Ling-2.5/2.6 has 32 layers with `layer_group_size=8`, so layers {7, 15, 23, 31} are full attention (MLA) and the rest are linear (Lightning seg_la). Runs nightly on the 8-GPU H200 runner with ...
56
1,853
sglang
test/registered/8-gpu-models/test_nvidia_nemotron_3_super_nightly.py
.py
import unittest from sglang.srt.environ import envs from sglang.test.accuracy_test_runner import AccuracyTestParams from sglang.test.ci.ci_register import register_cuda_ci from sglang.test.performance_test_runner import PerformanceTestParams from sglang.test.run_combined_tests import run_combined_tests from sglang.tes...
140
4,607
sglang
test/registered/8-gpu-models/test_minimax_m25.py
.py
import unittest from sglang.test.accuracy_test_runner import AccuracyTestParams from sglang.test.ci.ci_register import register_cuda_ci from sglang.test.performance_test_runner import PerformanceTestParams from sglang.test.run_combined_tests import run_combined_tests from sglang.test.test_utils import ModelLaunchSetti...
65
2,094
sglang
test/registered/8-gpu-models/test_longcat_flash_lite_fp8.py
.py
import unittest from sglang.test.accuracy_test_runner import AccuracyTestParams from sglang.test.ci.ci_register import register_cuda_ci from sglang.test.performance_test_runner import PerformanceTestParams from sglang.test.run_combined_tests import run_combined_tests from sglang.test.test_utils import ModelLaunchSetti...
92
3,626
sglang
test/registered/8-gpu-models/test_gpt_oss_120b.py
.py
import unittest from sglang.test.ci.ci_register import register_cuda_ci from sglang.test.performance_test_runner import PerformanceTestParams from sglang.test.run_combined_tests import run_combined_tests from sglang.test.test_utils import ModelLaunchSettings # Runs on both H200 and B200: registered once per runner_co...
85
2,935
sglang
test/registered/perf/test_bench_serving_1gpu_part1.py
.py
""" Performance tests for single GPU - LLM throughput/latency and LoRA tests. Works on 5090 (32GB). """ import asyncio import itertools import unittest import requests from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci from sglang.test.test_utils import ( DEFAULT_MODEL_NAME_FOR_TEST, Cu...
268
9,483
sglang
test/registered/perf/test_vlm_perf_5090.py
.py
""" VLM Performance tests that work on 5090 (32GB) - VLM offline throughput and online latency tests. """ import os import unittest from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci from sglang.test.test_utils import ( DEFAULT_SMALL_VLM_MODEL_NAME_FOR_TEST, DEFAULT_URL_FOR_TEST, Cus...
84
2,848
sglang
test/registered/perf/test_vlms_perf.py
.py
import os import unittest import warnings from sglang.test.ci.ci_register import register_cuda_ci from sglang.test.nightly_utils import NightlyBenchmarkRunner from sglang.test.test_utils import ( DEFAULT_URL_FOR_TEST, ModelLaunchSettings, _parse_int_list_env, parse_models, ) register_cuda_ci(est_time=...
91
3,035
sglang
test/registered/perf/test_text_models_perf.py
.py
import unittest from sglang.test.ci.ci_register import register_cuda_ci from sglang.test.nightly_utils import NightlyBenchmarkRunner from sglang.test.test_utils import ( DEFAULT_URL_FOR_TEST, ModelLaunchSettings, _parse_int_list_env, parse_models, ) register_cuda_ci(est_time=450, stage="nightly", runn...
63
2,463
sglang
test/registered/perf/test_bench_one_batch_2gpu.py
.py
import unittest from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci from sglang.test.test_utils import ( DEFAULT_MODEL_NAME_FOR_TEST, DEFAULT_MOE_MODEL_NAME_FOR_TEST, CustomTestCase, is_in_amd_ci, is_in_ci, run_bench_offline_throughput, write_github_step_summary, ) reg...
55
1,761
sglang
test/registered/perf/test_bench_serving_1gpu_large.py
.py
""" Performance tests for single GPU that need H200 (80GB) - FP8 and EAGLE tests. """ import unittest from sglang.srt.utils import is_hip from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci from sglang.test.test_utils import ( DEFAULT_DRAFT_MODEL_EAGLE, DEFAULT_MODEL_NAME_FOR_TEST_FP8, ...
85
2,751
sglang
test/registered/perf/test_bench_serving_2gpu.py
.py
""" Performance tests for 2-GPU that need large GPUs (H200 80GB) - MoE and Pipeline Parallel tests. """ import unittest from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci from sglang.test.test_utils import ( DEFAULT_MOE_MODEL_NAME_FOR_TEST, CustomTestCase, is_in_amd_ci, is_in_ci,...
109
3,648
sglang
test/registered/perf/test_bench_serving_1gpu_part2.py
.py
""" Performance tests for single GPU - VLM, Score API, and Embeddings API tests. Works on 5090 (32GB). """ import unittest from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci from sglang.test.test_utils import ( DEFAULT_SMALL_EMBEDDING_MODEL_NAME_FOR_TEST, DEFAULT_SMALL_MODEL_NAME_FOR_TES...
206
7,964
sglang
test/registered/cp/test_deepseek_v4_flash_fp4_b200_cp.py
.py
"""B200 extra CI: DeepSeek-V4-Flash FP4 with attn-CP. Balanced recipe (TP=4, DeepEP, EAGLE) plus --attn-cp-size=4 with the DSA prefill-CP interleave strategy. Split out of models_e2e/test_deepseek_v4_flash_fp4_b200.py so the `cp` group covers all context-parallel tests. Registry: extra-b-test-4-gpu-b200 (label-gated ...
247
7,324
sglang
test/registered/cp/test_cp_strategy_unit.py
.py
import unittest from contextlib import contextmanager from types import SimpleNamespace from unittest.mock import patch import torch from sglang.srt.layers.cp.base import ( ContextParallelStrategyKind, get_cp_strategy, get_cp_strategy_kind, init_cp_strategy, is_cp_enabled, is_interleave, i...
1,155
43,070
sglang
test/registered/cp/test_deepseek_v3_cp_single_node.py
.py
import unittest from types import SimpleNamespace from sglang.srt.utils import kill_process_tree from sglang.test.ci.ci_register import register_cuda_ci from sglang.test.run_eval import run_eval from sglang.test.test_utils import ( DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH, DEFAULT_URL_FOR_TEST, CustomTestCase, ...
90
2,734
sglang
test/registered/cp/test_gpt_oss_4gpu_mxfp4_cp.py
.py
import unittest from sglang.test.ci.ci_register import register_cuda_ci from sglang.test.gpt_oss_common import BaseTestGptOss register_cuda_ci(est_time=220, stage="extra-b", runner_config="4-gpu-b200") class TestGptOss4GpuMxfp4CP(BaseTestGptOss): def test_mxfp4_120b(self): self.run_test( mod...
35
909
sglang
test/registered/cp/test_dsa_prefill_cp_legacy.py
.py
import unittest from types import SimpleNamespace from sglang.srt.utils import kill_process_tree from sglang.test.ci.ci_register import register_cuda_ci from sglang.test.run_eval import run_eval from sglang.test.test_utils import ( DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH, DEFAULT_URL_FOR_TEST, CustomTestCase, ...
158
4,622
sglang
test/registered/cp/test_dsa_prefill_cp.py
.py
import unittest from types import SimpleNamespace from sglang.srt.utils import kill_process_tree from sglang.test.ci.ci_register import register_cuda_ci from sglang.test.run_eval import run_eval from sglang.test.test_utils import ( DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH, DEFAULT_URL_FOR_TEST, CustomTestCase, ...
90
2,565
sglang
test/registered/cp/test_gqa_prefill_cp.py
.py
import unittest from types import SimpleNamespace from sglang.test.ci.ci_register import register_cuda_ci from sglang.test.run_eval import run_eval from sglang.test.test_utils import ( DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH, DEFAULT_URL_FOR_TEST, CustomTestCase, kill_process_tree, popen_launch_server, )...
201
5,946
sglang
test/registered/bench_fn/test_benchmark_datasets_api.py
.py
import argparse import asyncio import base64 import io import json import pickle import random import subprocess import sys import tempfile import threading import unittest from collections import Counter from concurrent.futures import ThreadPoolExecutor from http.server import BaseHTTPRequestHandler, HTTPServer from p...
1,495
56,608
sglang
test/registered/bench_fn/test_bench_serving_reasoning_stream.py
.py
"""Unit tests for bench_serving streaming with reasoning chunks. Reasoning models (DeepSeek-R1, MiMo, Qwen3 reasoning, Kimi-K2, ...) stream their chain-of-thought via fields such as OpenAI's `delta.reasoning_content` and vLLM Kimi's `delta.reasoning`. Without explicit support, bench_serving only inspects `delta.conten...
355
12,309
sglang
test/registered/vlm/test_unlimited_ocr_server.py
.py
import base64 import io import unittest import openai from PIL import Image, ImageDraw, ImageFont from sglang.test.ci.ci_register import register_cuda_ci from sglang.test.vlm_utils import TestOpenAIMLLMServerBase register_cuda_ci(est_time=240, stage="base-b", runner_config="1-gpu-large") class TestUnlimitedOCRServ...
89
2,891
sglang
test/registered/vlm/test_vision_openai_server_extra.py
.py
"""Label-gated vision/omni server launches too expensive for the per-commit budget; the per-commit set lives in test_vision_openai_server_a.py.""" import unittest from sglang.test.ci.ci_register import register_cuda_ci from sglang.test.vlm_utils import OmniOpenAITestMixin register_cuda_ci(est_time=180, stage="extra-...
28
801
sglang
test/registered/vlm/test_token_id_retokenize_e2e.py
.py
"""E2E test for SGLANG_MM_AVOID_RETOKENIZE on the pre-tokenized VLM path. A client may send a multimodal request as input_ids (list[int]) instead of text. On that path the server decodes the ids back to text and the HF processor re-tokenizes them. If the original ids were non-canonical (decode -> re-encode is not iden...
114
4,091
sglang
test/registered/vlm/test_vision_openai_server_a.py
.py
""" Usage: python3 -m unittest test_vision_openai_server.TestOpenAIVisionServer.test_mixed_batch python3 -m unittest test_vision_openai_server.TestOpenAIVisionServer.test_multi_images_chat_completion """ import unittest import openai from sglang.srt.environ import envs from sglang.test.ci.ci_register import register...
249
7,642
sglang
test/registered/vlm/test_rust_native_mm_mmmu.py
.py
"""MMMU accuracy gate for the Rust tokenizer manager's native multimodal path. ``test_rust_native_mm_e2e.py`` checks that the output is *valid*; this checks that native Rust preprocessing yields *equally good* model inputs. A systematic skew (wrong resample filter, channel order, normalization, patch layout) still rea...
169
6,102
sglang
test/registered/vlm/test_vlm_tp4.py
.py
""" VLM TP=4 per-commit test using Qwen3.5-27B with MMMU evaluation. """ import unittest from types import SimpleNamespace from sglang.srt.utils import kill_process_tree from sglang.test.ci.ci_register import register_cuda_ci from sglang.test.run_eval import run_eval from sglang.test.test_utils import ( DEFAULT_T...
83
2,409
sglang
test/registered/vlm/test_video_utils.py
.py
from dataclasses import dataclass import pytest from sglang.srt.utils import sample_video_frames from sglang.test.ci.ci_register import register_cpu_ci register_cpu_ci(est_time=7, suite="base-a-test-cpu") register_cpu_ci(est_time=7, suite="base-c-test-cpu") class DummyVideo: def __init__(self, total_frames: in...
67
1,814
sglang
test/registered/vlm/test_vision_chunked_prefill.py
.py
from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci register_cuda_ci(est_time=156, stage="base-b", runner_config="1-gpu-large") register_amd_ci(est_time=270, suite="stage-b-test-1-gpu-small-amd") """ Usage: python3 -m unittest test_vision_chunked_prefill.TestVisionChunkedPrefill.test_chunked_prefi...
250
9,772
sglang
test/registered/vlm/test_vlm_input_format.py
.py
import json import unittest from io import BytesIO from typing import Optional import requests import torch # Compatibility shim: Kimi-VL dynamic module expects PytorchGELUTanh which may # be missing in transformers==4.57.1. Inject a lightweight implementation so # the model can import successfully without downgradin...
727
28,424
sglang
test/registered/vlm/test_encoder_dp.py
.py
import random import tempfile import unittest from types import SimpleNamespace from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci from sglang.test.kits.mmmu_vlm_kit import MMMUMultiModelTestBase from sglang.test.test_utils import is_in_ci register_cuda_ci(est_time=510, stage="nightly", runner_c...
46
1,496
sglang
test/registered/vlm/test_rust_native_mm_e2e.py
.py
"""E2E: Rust tokenizer-manager native multimodal path (``SGLANG_RUST_SERVER=1``). Covers what the CPU parity units structurally cannot: the sidecar handoff, the drain ordering, Rust-side tokenization of multimodal prompts, and the rejection of inputs outside the native pipeline's scope (there is no Python fallback). "...
130
4,604
sglang
test/registered/observability/test_metrics.py
.py
import json import os import tempfile import unittest from typing import Dict, List import requests from prometheus_client.parser import text_string_to_metric_families from prometheus_client.samples import Sample from sglang.srt.environ import envs from sglang.srt.observability.metrics_collector import ( ROUTING_...
630
23,931
sglang
test/registered/observability/test_tracing_disaggregation.py
.py
"""Test tracing in PD disaggregation mode.""" import os # Configure OTLP exporter for faster test execution # Must be set before importing sglang trace module os.environ.setdefault("SGLANG_OTLP_EXPORTER_SCHEDULE_DELAY_MILLIS", "50") os.environ.setdefault("SGLANG_OTLP_EXPORTER_MAX_EXPORT_BATCH_SIZE", "4") import logg...
238
7,952
sglang
test/registered/observability/test_tracing.py
.py
"""Integration tests for tracing with a lightweight in-process OTLP collector. This module implements a minimal OTLP collector that receives traces via gRPC and stores them in memory for test assertions, eliminating the need for Docker-based opentelemetry-collector and file I/O. """ import os # Configure OTLP export...
592
19,356
sglang
test/registered/observability/test_priority_metrics.py
.py
import unittest from typing import Dict, List from unittest.mock import Mock import requests from prometheus_client.parser import text_string_to_metric_families from prometheus_client.samples import Sample from sglang.srt.observability.metrics_collector import QueueCount from sglang.srt.utils import kill_process_tree...
228
8,555
sglang
test/registered/observability/test_encoder_server_metrics.py
.py
"""Integration test: the EPD encoder server exports sglang:encoder_* metrics.""" import unittest import uuid from typing import Dict, List from urllib.parse import urlparse import requests import zmq from prometheus_client.parser import text_string_to_metric_families from prometheus_client.samples import Sample from...
103
3,707
sglang
test/registered/radix_cache/test_mamba2_extra_buffer_kl.py
.py
"""Regression test: Mamba2 (NemotronH) ``extra_buffer`` state tracking stays consistent under CUDA-graph decode. The decode-cache-hit KL check guards the graph-replay track-save path: a decode that crosses ``--mamba-track-interval`` donates its tracked state to the mamba radix tree, the second turn hits that decode-se...
64
2,573
sglang
test/registered/radix_cache/test_swa_radix_cache_kl.py
.py
import unittest from sglang.test.ci.ci_register import register_cuda_ci from sglang.test.kits.kl_divergence_kit import KLDivergenceMixin from sglang.test.server_fixtures.default_fixture import DefaultServerBase MODEL = "openai/gpt-oss-20b" register_cuda_ci(est_time=151, stage="base-b", runner_config="1-gpu-large") ...
27
690
sglang
test/registered/radix_cache/test_radix_cache_hit.py
.py
import unittest from sglang.srt.utils import kill_process_tree from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci from sglang.test.kits.cache_hit_kit import run_multiturn_cache_hit_test from sglang.test.test_utils import ( DEFAULT_SMALL_MODEL_NAME_FOR_TEST, DEFAULT_TIMEOUT_FOR_SERVER_LAUN...
48
1,309
sglang
test/registered/radix_cache/test_radix_attention.py
.py
import unittest from sglang.srt.environ import envs from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci from sglang.test.kits.radix_cache_server_kit import run_radix_attention_test from sglang.test.test_utils import ( DEFAULT_SMALL_MODEL_NAME_FOR_TEST, DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH, ...
94
2,771
sglang
test/registered/radix_cache/test_int8_mamba_checkpoint_e2e.py
.py
""" End-to-end test for the int8 mamba checkpoint pool on a real GDN-hybrid model. Launches Qwen3-Next-80B-A3B (a gated-delta-net / linear-attention hybrid) with ``--enable-int8-mamba-checkpoint`` and checks two things while the int8 dequant path is exercised: * KLDivergenceMixin — on a prefix/decode cache HIT the ...
124
4,346
sglang
test/registered/radix_cache/unified_radix_tree/test_unified_radix_cache_kl_swa.py
.py
import unittest from sglang.srt.utils import kill_process_tree from sglang.test.ci.ci_register import register_cuda_ci from sglang.test.kits.unified_radix_cache_kit import UnifiedRadixTreeTestMixin from sglang.test.kl_multiturn_utils import get_input_ids from sglang.test.test_utils import ( DEFAULT_TIMEOUT_FOR_SER...
51
1,426
sglang
test/registered/radix_cache/unified_radix_tree/test_unified_radix_cache_kl_nightly.py
.py
"""UnifiedRadixTree + HiCache KL divergence tests. Tests Mamba hybrid, DeepSeek V4 Flash, and GLM-5 models with HiCache L2 offloading under UnifiedRadixTree, verifying multi-turn cache correctness via KL divergence. """ import os import random import shutil import tempfile import unittest from types import SimpleName...
259
8,468
sglang
test/registered/radix_cache/unified_radix_tree/test_unified_radix_cache_kl_mimo.py
.py
"""MiMo V2.5 HiCache host load-back accuracy regression test.""" import random import unittest from sglang.srt.utils import kill_process_tree from sglang.test.ci.ci_register import register_cuda_ci from sglang.test.kl_test_utils import ( _extract_output_logprobs, _flush_cache, _generate, _get_input_lo...
166
5,598
sglang
test/registered/radix_cache/unified_radix_tree/test_unified_radix_cache_kl_full.py
.py
import unittest from sglang.srt.utils import kill_process_tree from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci from sglang.test.kits.unified_radix_cache_kit import UnifiedRadixTreeTestMixin from sglang.test.kl_multiturn_utils import get_input_ids from sglang.test.test_utils import ( DEFAUL...
52
1,474
sglang
test/registered/radix_cache/unified_radix_tree/test_unified_radix_cache_kl_dsv4_pp.py
.py
import unittest import test_unified_radix_cache_kl_dsv4 as dsv4_kl from sglang.test.ci.ci_register import register_cuda_ci register_cuda_ci(est_time=900, stage="extra-b", runner_config="8-gpu-h200") class TestUnifiedDeepSeekV4FlashHiCachePP4TP2( dsv4_kl.TestUnifiedDeepSeekV4FlashHiCache ): """DeepSeek V4 F...
25
594
sglang
test/registered/radix_cache/unified_radix_tree/test_unified_radix_cache_hicache_pp_kl.py
.py
import unittest from types import SimpleNamespace from urllib.parse import urlparse from sglang.srt.utils import kill_process_tree from sglang.test.ci.ci_register import register_cuda_ci from sglang.test.kits.unified_radix_cache_kit import UnifiedRadixTreeTestMixin from sglang.test.kl_multiturn_utils import get_input_...
107
3,545
sglang
test/registered/radix_cache/unified_radix_tree/test_unified_radix_cache_kl_cp.py
.py
import unittest from sglang.srt.utils import kill_process_tree from sglang.test.ci.ci_register import register_cuda_ci from sglang.test.kits.unified_radix_cache_kit import UnifiedRadixTreeTestMixin from sglang.test.kl_multiturn_utils import get_input_ids from sglang.test.test_utils import ( DEFAULT_TIMEOUT_FOR_SER...
75
2,396
sglang
test/registered/radix_cache/unified_radix_tree/test_unified_radix_cache_kl_dcp.py
.py
"""HiCache L2 under decode context parallelism (DCP) + UnifiedRadixCache. Under DCP the radix layer allocates widened logical indices while each rank's buffers hold only its 1/dcp_size shard, so a missing translation makes cache hits return another rank's KV. The KL cases catch that as a large divergence. Blackwell-o...
112
3,605
sglang
test/registered/radix_cache/unified_radix_tree/test_unified_radix_cache_kl_dsv4.py
.py
import os import shutil import tempfile import time import unittest import requests from test_unified_radix_cache_kl_nightly import AccuracyTwoPassMixin from sglang.srt.utils import kill_process_tree from sglang.test.ci.ci_register import register_cuda_ci from sglang.test.kits.unified_radix_cache_kit import UnifiedRa...
395
12,728
sglang
test/registered/radix_cache/unified_radix_tree/test_unified_radix_cache_kl_mamba.py
.py
import os import shutil import tempfile import unittest from test_unified_radix_cache_kl_nightly import AccuracyTwoPassMixin from sglang.test.ci.ci_register import register_cuda_ci from sglang.test.kits.unified_radix_cache_kit import UnifiedRadixTreeTestMixin from sglang.test.kl_multiturn_utils import ( get_input...
206
7,077
sglang
test/registered/radix_cache/unified_radix_tree/test_unified_radix_cache_kl_hybrid_bitexact.py
.py
"""Bit-exact KL guards for the unified radix cache on a hybrid SWA + mamba model. The other KL tests in this directory gate on a loose threshold because their models cannot score a token identically twice: Qwen3-Next's chunkwise prefill scan and its decode recurrence are different algorithms and land an ulp apart, so ...
265
10,296
sglang
test/registered/backends/test_flashinfer_nvfp4_online_moe_backend.py
.py
import os import unittest from types import SimpleNamespace import requests from sglang.srt.utils import kill_process_tree from sglang.test.ci.ci_register import register_cuda_ci from sglang.test.run_eval import run_eval from sglang.test.test_utils import ( DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH, DEFAULT_URL_FOR_T...
137
4,289
sglang
test/registered/backends/test_flashinfer_trtllm_gen_moe_backend.py
.py
import os import unittest from types import SimpleNamespace from sglang.srt.utils import kill_process_tree from sglang.test.ci.ci_register import register_cuda_ci from sglang.test.run_eval import run_eval from sglang.test.test_utils import ( DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH, DEFAULT_URL_FOR_TEST, CustomTe...
291
8,213
sglang
test/registered/backends/test_flashinfer_fusion_preflight.py
.py
"""Distributed tests for FlashInfer allreduce-fusion workspace preflight.""" import multiprocessing as mp import os import socket import unittest import torch from sglang.srt.utils import get_cuda_driver_bindings, is_flashinfer_available from sglang.test.ci.ci_register import register_cuda_ci from sglang.test.test_u...
164
5,371
sglang
test/registered/backends/test_torch_compile.py
.py
import time import unittest import requests from sglang.srt.utils import kill_process_tree from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci from sglang.test.kits.eval_accuracy_kit import MMLUMixin from sglang.test.test_utils import ( DEFAULT_MODEL_NAME_FOR_TEST, DEFAULT_TIMEOUT_FOR_SER...
76
2,148
sglang
test/registered/backends/test_deepseek_v3_fp4_cutedsl_moe.py
.py
"""CuteDSL MoE e2e with EP=TP=4 (moe_a2a=none): each GPU holds 1/4 of the experts at full intermediate width, partial results combined via all-reduce. Kept for the distributed-EP dimension; single-GPU backend numerics live in unit/layers/quantization/test_nvfp4_moe_backends.py.""" import unittest from types import Sim...
84
2,590
sglang
test/registered/dllm/test_dllm_fdfo_joint_threshold.py
.py
from sglang.test.ci.ci_register import register_cuda_ci register_cuda_ci(est_time=300, stage="base-b", runner_config="1-gpu-large") import unittest import requests from sglang.srt.utils import kill_process_tree from sglang.test.test_utils import ( DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH, DEFAULT_URL_FOR_TEST, ...
90
2,744
sglang
test/registered/dllm/test_llada2_mini_amd.py
.py
""" Test LLaDA2 (Diffusion Language Model) on AMD GPUs. This test verifies that DLLM works on AMD with triton attention backend. """ import unittest from types import SimpleNamespace from sglang.srt.utils import kill_process_tree from sglang.test.ci.ci_register import register_amd_ci from sglang.test.run_eval import...
89
2,533
sglang
test/registered/dllm/test_dllm_batching_fdfo.py
.py
from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci register_cuda_ci(est_time=139, stage="base-b", runner_config="1-gpu-large") register_amd_ci(est_time=330, suite="stage-b-test-1-gpu-small-amd") import unittest from types import SimpleNamespace from sglang.srt.utils import kill_process_tree fro...
100
2,790
sglang
test/registered/sessions/test_session_latency.py
.py
""" Benchmark: Streaming Session Inter-Turn Latency Tests: 1. Stability (bs=8): streaming only, assert tail_avg / head_avg <= 1.15 2. Correctness (bs=1): regular vs streaming, assert output equal 3. Random lengths (bs=8): streaming only, random input/output lens, no crash """ import random import time import u...
401
12,436
sglang
test/registered/sessions/test_streaming_session_swa_extra.py
.py
"""Label-gated SWA streaming-session variants. CUDA-only: gpt-oss-20b is not part of the AMD streaming-session coverage. """ 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_s...
36
920
sglang
test/registered/sessions/test_streaming_session.py
.py
"""Per-commit streaming-session tests. Default config + EagleV2RetractLargePage + abort-leak repro stay per-commit. Other variants (Retract / Eagle / EagleV2 / EagleRetractLargePage) live in test_streaming_session_extra.py. """ import unittest from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci ...
84
2,307
sglang
test/registered/sessions/test_streaming_session_swa.py
.py
"""Per-commit streaming-session tests on a hybrid-SWA model. Baseline + large-page retract + abort-leak repro stay per-commit; the mixed-chunk retract variant lives in test_streaming_session_swa_extra.py. """ import unittest from sglang.test.ci.ci_register import register_cuda_ci from sglang.test.kits.streaming_sess...
72
1,893
sglang
test/registered/sessions/test_streaming_session_extra.py
.py
import unittest from sglang.test.ci.ci_register import register_amd_ci, 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_DRA...
107
3,167