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/disaggregation/test_disaggregation_dwdp_gpt_oss.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.server_fixtures.disaggregation_fixture import ( PDDisaggregationServerBase, ) from sglang.test.test_utils import ( DEFAULT_TIMEOUT_FOR_SERVER_LAUN...
114
3,375
sglang
test/registered/disaggregation/test_disaggregation_unified_memory.py
.py
"""PD disaggregation with --enable-unified-memory (MLA hybrid-Mamba). Guards the unified-memory PD transfer scheme end to end: whole page-envelope KV registration (`UnifiedMLATokenToKVPool.get_contiguous_buf_infos`), whole slot-envelope KDA/mamba state transfer, virtual->physical index translation at the prefill send ...
153
5,578
sglang
test/registered/disaggregation/test_disaggregation_rust_server.py
.py
"""PD disaggregation with the embedded Rust server on both sides. Same 2-GPU layout as test_disaggregation_basic (prefill GPU 0, decode GPU 1, mini_lb in front), but prefill and decode run with ``SGLANG_RUST_SERVER=1`` — covering the Rust `/generate` bootstrap-field intake (scalar form via the gsm8k eval's single-prom...
185
8,305
sglang
test/registered/disaggregation/test_disaggregation_kimi_linear.py
.py
import time import unittest import requests from sglang.srt.utils import kill_process_tree from sglang.test.ci.ci_register import register_cuda_ci from sglang.test.server_fixtures.disaggregation_fixture import ( PDDisaggregationServerBase, assert_process_healthy, ) from sglang.test.test_utils import ( DEF...
117
3,648
sglang
test/registered/disaggregation/test_disaggregation_aarch64.py
.py
import os 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.server_fixtures.disaggregation_fixture import ( PDDisaggregationServerBase, ) from sglang.test.test_utils import ( DEFAULT_PORT_FOR_SRT_...
110
3,204
sglang
test/registered/disaggregation/test_kimi_linear_pd_dcp4.py
.py
import math import os import time import unittest import requests import torch from transformers import AutoTokenizer 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.server_fixtures.disagg...
491
16,392
sglang
test/registered/disaggregation/test_disaggregation_hisparse.py
.py
import unittest from sglang.test.ci.ci_register import register_cuda_ci from sglang.test.kits.eval_accuracy_kit import GSM8KMixin from sglang.test.server_fixtures.disaggregation_fixture import ( PDDisaggregationServerBase, ) from sglang.test.test_utils import ( DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH, is_in_ci, ...
163
4,713
sglang
test/registered/disaggregation/test_disaggregation_decode_offload.py
.py
import os import shutil 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.server_fixtures.disaggregation_fixture import ( PDDisaggregationServerBase, ) f...
178
5,673
sglang
test/registered/disaggregation/test_disaggregation_hybrid_attention.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.server_fixtures.disaggregation_fixture import ( PDDisaggregationServerBase, ) from sglang.test.test_utils import ( DEFAULT_TIMEOUT_FOR_SERVER_LAUN...
397
11,878
sglang
test/registered/disaggregation/test_disaggregation_dsv4.py
.py
import unittest from sglang.test.ci.ci_register import register_cuda_ci from sglang.test.kits.eval_accuracy_kit import GSM8KMixin from sglang.test.kits.spec_decoding_kit import SpecDecodingMixin from sglang.test.server_fixtures.disaggregation_fixture import ( PDDisaggregationServerBase, ) from sglang.test.test_uti...
134
3,691
sglang
test/registered/disaggregation/test_disaggregation_pp.py
.py
import time 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.server_fixtures.disaggregation_fixture import ( PDDisaggregationServerBase, ) from sglang.test.test_utils import ( DEFAULT_MODEL_NAME_...
256
7,455
sglang
test/registered/disaggregation/test_disaggregation_basic.py
.py
import asyncio import json import os import threading import time import unittest import uuid from types import SimpleNamespace from typing import Any import aiohttp import openai import requests from transformers import AutoTokenizer from sglang.test.ci.ci_register import register_cuda_ci from sglang.test.kits.json_...
712
26,024
sglang
test/registered/disaggregation/test_disaggregation_different_tp.py
.py
import os import unittest from types import SimpleNamespace from sglang.srt.environ import envs from sglang.test.ci.ci_register import register_cuda_ci from sglang.test.run_eval import run_eval from sglang.test.server_fixtures.disaggregation_fixture import ( PDDisaggregationServerBase, ) from sglang.test.test_util...
699
21,889
sglang
test/registered/disaggregation/test_epd_disaggregation.py
.py
import io import os import re import subprocess import threading import time import unittest import grpc import openai import zmq from grpc_health.v1 import health_pb2, health_pb2_grpc from sglang.srt.utils import kill_process_tree from sglang.srt.utils.network import get_zmq_socket_on_host from sglang.test.ci.ci_reg...
1,695
57,556
sglang
test/registered/disaggregation/test_disaggregation_decode_radix_cache.py
.py
import asyncio import os import shutil import tempfile import time import unittest from types import SimpleNamespace import requests from sglang.benchmark.datasets.random import sample_random_requests from sglang.benchmark.utils import get_tokenizer from sglang.test.ci.ci_register import register_cuda_ci from sglang....
270
8,547
sglang
test/registered/tokenizer/test_skip_tokenizer_init.py
.py
""" python3 -m unittest test_skip_tokenizer_init.TestSkipTokenizerInit.test_parallel_sample python3 -m unittest test_skip_tokenizer_init.TestSkipTokenizerInit.run_decode_stream """ import json import unittest import requests from transformers import AutoProcessor, AutoTokenizer from sglang.srt.utils import kill_proc...
260
8,728
sglang
test/registered/tokenizer/test_multi_tokenizer.py
.py
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_SERVER_LAUNCH, ...
122
4,216
sglang
test/registered/cpu/test_decode.py
.py
import unittest import torch from torch.nn.functional import scaled_dot_product_attention from sglang.test.ci.ci_register import register_cpu_ci from sglang.test.test_utils import CustomTestCase register_cpu_ci(est_time=10, suite="base-b-test-cpu") register_cpu_ci(est_time=10, suite="base-b-test-cpu-arm64") torch.m...
313
11,738
sglang
test/registered/cpu/test_intel_amx_attention_backend_b.py
.py
""" For intel_amx attention backend FP8 tests Usage: python3 -m unittest test_intel_amx_attention_backend_1.TestIntelAMXAttnBackendQuant.test_latency_fp8_qwen """ import unittest from sglang.test.ci.ci_register import register_cpu_ci from sglang.test.test_utils import ( DEFAULT_MODEL_NAME_FOR_TEST_FP8_WITH_MOE, ...
39
1,022
sglang
test/registered/cpu/test_spec_eagle_topk_cpu.py
.py
"""EAGLE topk > 1 tree drafting on CPU (Llama-2 topk=4, synchronous path). Split from test_spec_eagle_cpu.py, mirroring the CUDA test_spec_eagle.py / test_spec_eagle_topk.py layout, so each file stays under the per-file CI timeout. """ import unittest from sglang.srt.environ import envs from sglang.test.ci.ci_regist...
69
1,880
sglang
test/registered/cpu/test_qkv_proj_with_rope.py
.py
import unittest import torch from sglang.srt.layers.quantization.fp8_utils import input_to_float8 from sglang.srt.layers.rotary_embedding.utils import apply_rotary_emb from sglang.test.ci.ci_register import register_cpu_ci from sglang.test.cpu_test_utils import ( convert_weight, native_w8a8_per_token_matmul, ...
444
15,051
sglang
test/registered/cpu/test_shared_expert.py
.py
import itertools import math import unittest import torch from sglang.test.ci.ci_register import register_cpu_ci from sglang.test.cpu_test_utils import ( BLOCK_K, BLOCK_N, factor_for_scale, fp8_max, fp8_min, per_token_quant_int8, precision, scaled_weight, torch_naive_moe, torch...
236
6,824
sglang
test/registered/cpu/test_mla.py
.py
import unittest import torch from torch.nn.functional import scaled_dot_product_attention from sglang.test.ci.ci_register import register_cpu_ci from sglang.test.cpu_test_utils import precision from sglang.test.test_utils import CustomTestCase register_cpu_ci(est_time=10, suite="base-b-test-cpu") torch.manual_seed(...
163
5,069
sglang
test/registered/cpu/test_moe.py
.py
import math import pytest # TODO: use interface in cpu.py import torch from sglang.srt.layers.amx_utils import CPUQuantMethod kernel = torch.ops.sgl_kernel torch.manual_seed(1183) dtype = torch.bfloat16 prepack = True alpha = 1.702 limit = 7.0 from sglang.test.ci.ci_register import register_cpu_ci from sglang.te...
527
16,509
sglang
test/registered/cpu/test_comm.py
.py
import copy import multiprocessing import os import traceback import unittest from multiprocessing import Process import torch import torch.distributed as dist import torch.multiprocessing as mp from sglang.test.ci.ci_register import register_cpu_ci from sglang.test.test_utils import CustomTestCase, find_available_po...
162
5,071
sglang
test/registered/cpu/test_cpu_graph.py
.py
""" Usage: python3 -m unittest test_cpu_graph.TestCPUGraph.test_mmlu_torch_compile_cpu """ import copy import os import unittest from types import SimpleNamespace from sglang.srt.utils import get_cpu_ids_by_node, kill_process_tree from sglang.test.ci.ci_register import register_cpu_ci from sglang.test.run_eval import...
92
2,464
sglang
test/registered/cpu/test_store_cache.py
.py
import sys import pytest import torch from sglang.test.ci.ci_register import register_cpu_ci register_cpu_ci(est_time=25, suite="base-b-test-cpu") torch.manual_seed(42) DEVICE = "cpu" CACHE_SIZE = 4096 # for fp8 KV stored as uint8, e.g. float8_e4m3fn and float8_e5m2 DTYPES = [torch.float16, torch.bfloat16, torch....
84
2,743
sglang
test/registered/cpu/test_spec_eagle_cpu.py
.py
"""EAGLE spec-decoding core on CPU: the standard config (topk=1, page_size=1) on the synchronous (non-overlap) path. topk > 1 tree drafting is covered in test_spec_eagle_topk_cpu.py (split to stay under the per-file CI timeout). """ import unittest from sglang.srt.environ import envs from sglang.test.ci.ci_register i...
72
2,139
sglang
test/registered/cpu/test_qwen3.py
.py
import sys import pytest import torch from sglang.srt.utils import is_host_cpu_arm64 from sglang.test.ci.ci_register import register_cpu_ci from sglang.test.cpu_test_utils import precision register_cpu_ci(est_time=10, suite="base-b-test-cpu") register_cpu_ci(est_time=10, suite="base-b-test-cpu-arm64") torch.manual_...
178
6,171
sglang
test/registered/cpu/test_spec_eagle_parity_cpu.py
.py
import unittest from sglang.srt.environ import envs from sglang.test.ci.ci_register import register_cpu_ci from sglang.test.kits.spec_server_kits import SpecParityKit from sglang.test.server_fixtures.spec_eagle_fixture import Eagle3Base # Estimated: 2 sequential 8B server launches + one 4-prompt greedy method # (CUDA...
30
957
sglang
test/registered/cpu/test_mamba.py
.py
import sys import pytest import torch import torch.nn.functional as F from torch.nn.functional import softplus from sglang.test.ci.ci_register import register_cpu_ci from sglang.test.cpu_test_utils import precision register_cpu_ci(est_time=10, suite="base-b-test-cpu") torch.manual_seed(1234) # [NB]: State-layout c...
450
15,823
sglang
test/registered/cpu/test_extend.py
.py
import unittest import torch from torch.nn.functional import scaled_dot_product_attention from sglang.test.ci.ci_register import register_cpu_ci from sglang.test.test_utils import CustomTestCase register_cpu_ci(est_time=10, suite="base-b-test-cpu") torch.manual_seed(1234) class TestExtendAttention(CustomTestCase)...
404
15,449
sglang
test/registered/cpu/test_server_args_backend.py
.py
import json import os import tempfile import unittest from unittest.mock import patch from sglang.srt.server_args import ServerArgs from sglang.test.ci.ci_register import register_cpu_ci register_cpu_ci(est_time=10, suite="base-b-test-cpu") register_cpu_ci(est_time=10, suite="base-b-test-cpu-arm64") class TestServe...
101
3,361
sglang
test/registered/cpu/test_causal_conv1d.py
.py
import unittest from typing import Optional import sgl_kernel # noqa: F401 import torch import torch.nn.functional as F from sglang.test.ci.ci_register import register_cpu_ci from sglang.test.cpu_test_utils import parametrize, precision from sglang.test.test_utils import CustomTestCase register_cpu_ci(est_time=10, ...
331
10,343
sglang
test/registered/cpu/test_topk.py
.py
import itertools import unittest import torch from sglang.srt.eplb.expert_location_dispatch import ExpertLocationDispatchInfo from sglang.srt.layers.moe.topk import ( biased_grouped_topk_impl as native_biased_grouped_topk, ) from sglang.srt.layers.moe.topk import biased_topk_impl as native_biased_topk from sglang...
414
16,012
sglang
test/registered/cpu/test_rope.py
.py
import unittest import torch from sglang.srt.layers.rotary_embedding import ( MRotaryEmbedding, RotaryEmbedding, ) from sglang.srt.layers.rotary_embedding.rope_variant import ( DeepseekScalingRotaryEmbedding, apply_rotary_pos_emb_native, ) from sglang.srt.layers.rotary_embedding.utils import apply_rot...
292
10,717
sglang
test/registered/cpu/test_binding.py
.py
import re import unittest import torch kernel = torch.ops.sgl_kernel from sglang.test.ci.ci_register import register_cpu_ci from sglang.test.test_utils import CustomTestCase register_cpu_ci(est_time=10, suite="base-b-test-cpu") class TestBinding(CustomTestCase): def test_binding(self): start_id = 1 ...
31
725
sglang
test/registered/cpu/test_bmm.py
.py
import itertools import unittest # TODO: use interface in cpu.py import torch import torch.nn as nn from sglang.srt.layers.quantization.fp8_utils import input_to_float8 from sglang.test.ci.ci_register import register_cpu_ci from sglang.test.cpu_test_utils import precision from sglang.test.test_utils import CustomTest...
99
3,375
sglang
test/registered/cpu/test_norm.py
.py
import sys from typing import Optional, Tuple, Union import pytest import torch from sglang.test.ci.ci_register import register_cpu_ci from sglang.test.cpu_test_utils import make_non_contiguous, precision register_cpu_ci(est_time=10, suite="base-b-test-cpu") register_cpu_ci(est_time=10, suite="base-b-test-cpu-arm64"...
480
18,198
sglang
test/registered/cpu/test_intel_amx_attention_backend_c.py
.py
""" For intel_amx attention backend w8a8 tests Usage: python3 -m unittest test_intel_amx_attention_backend_2.TestIntelAMXAttnBackendQuant.test_latency_w8a8_default_model """ import unittest from sglang.test.ci.ci_register import register_cpu_ci from sglang.test.test_utils import ( DEFAULT_MODEL_NAME_FOR_TEST_W8A8...
57
1,359
sglang
test/registered/cpu/test_intel_amx_attention_backend_a.py
.py
""" Usage: python3 -m unittest test_intel_amx_attention_backend.TestIntelAMXAttnBackend.test_latency_default_model """ import unittest from types import SimpleNamespace from sglang.srt.utils import kill_process_tree from sglang.test.ci.ci_register import register_cpu_ci from sglang.test.run_eval import run_eval from ...
77
2,125
sglang
test/registered/cpu/test_spec_kernels.py
.py
import unittest import sgl_kernel # noqa: F401 import torch import torch.nn.functional as F from sglang.srt.speculative.eagle_utils import TreeMaskMode, organize_draft_results from sglang.test.ci.ci_register import register_cpu_ci from sglang.test.cpu_test_utils import precision from sglang.test.test_utils import Cu...
1,382
55,177
sglang
test/registered/cpu/test_gemm.py
.py
import unittest # TODO: use interface in cpu.py import torch import torch.nn as nn from sglang.test.ci.ci_register import register_cpu_ci from sglang.test.cpu_test_utils import ( MXFP4QuantizeUtil, convert_weight, native_w8a8_per_token_matmul, parametrize, per_token_quant_int8, precision, ...
289
10,009
sglang
test/registered/cpu/test_activation.py
.py
import sys import pytest import torch from sglang.srt.server_args import ServerArgs, set_global_server_args_for_scheduler from sglang.test.ci.ci_register import register_cpu_ci from sglang.test.cpu_test_utils import GeluAndMul, SiluAndMul, precision register_cpu_ci(est_time=10, suite="base-b-test-cpu") register_cpu_...
75
2,365
sglang
test/registered/cpu/test_request_decompression.py
.py
import asyncio import unittest import zstandard from sglang.srt.entrypoints.http_request_decompression import ( RequestDecompressionMiddleware, ) from sglang.test.ci.ci_register import register_cpu_ci register_cpu_ci(est_time=10, suite="base-b-test-cpu") PAYLOAD = b'{"text":"hello world","n":7}' COMPRESSED = zs...
117
4,106
sglang
test/registered/cpu/test_flash_attn.py
.py
import unittest import sgl_kernel # noqa: F401 import torch import torch.nn.functional as F from sglang.test.ci.ci_register import register_cpu_ci from sglang.test.cpu_test_utils import parametrize, precision from sglang.test.test_utils import CustomTestCase register_cpu_ci(est_time=10, suite="base-b-test-cpu") fl...
246
7,177
sglang
test/registered/cpu/test_request_headers.py
.py
import unittest from types import SimpleNamespace from fastapi import HTTPException from starlette.datastructures import Headers from sglang.srt.entrypoints.request_headers import apply_header_overrides from sglang.test.ci.ci_register import register_cpu_ci register_cpu_ci(est_time=10, suite="base-b-test-cpu") def...
110
3,822
sglang
test/registered/cpu/arm64/test_moe.py
.py
"""Arm64 MoE test. Tests fused_experts_cpu with W8A8 INT8 quantization, which is supported on Arm64 via aarch64/moe.cpp (PR #16045). Additional quantization paths (BF16, INT4) will be added here as Arm kernels land. """ from sglang.test.ci.ci_register import register_cpu_ci register_cpu_ci(est_time=10, suite="base-b...
114
3,239
sglang
test/registered/cpu/quant/test_autoround.py
.py
""" Usage: SGLANG_USE_CPU_ENGINE=1 python3 -m unittest test_autoround CPU accuracy test for AutoRound INT4 checkpoints. Covers both AutoRound packing formats (auto_round:auto_gptq / auto_round:auto_awq) by launching a server and running an MMLU eval. AutoRound INT4 CPU inference uses the Intel AMX backend, so the test...
102
3,416
sglang
test/registered/layers/test_fla_layernorm_guard.py
.py
from __future__ import annotations import socket import sys from dataclasses import dataclass import pytest import torch import torch.nn.functional as F from sglang.kernels.ops.attention.fla.layernorm_gated import ( _layer_norm_fwd as layer_norm_fwd, ) from sglang.kernels.ops.attention.fla.layernorm_gated import...
397
11,827
sglang
test/registered/layers/test_layernorm_fusion.py
.py
import itertools import unittest import torch from sglang.srt.layers.layernorm import RMSNorm from sglang.test.ci.ci_register import register_cuda_ci from sglang.test.test_utils import CustomTestCase register_cuda_ci(est_time=15, stage="base-b", runner_config="1-gpu-large") class TestRMSNormFp8QuantFusion(CustomTe...
143
5,392
sglang
test/registered/layers/mamba/test_mamba_ssm_ssd.py
.py
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci register_cuda_ci(est_time=10, stage="base-b", runner_config="1-gpu-small") register_amd_ci(est_time=34, suite="stage-b-test-1-gpu-small-amd...
702
23,974
sglang
test/registered/layers/mamba/test_mamba_slot_fused.py
.py
"""Unit tests for the fused conv-slot clear/copy kernels (srt/mem_cache/mamba_slot_fused.py), checked bit-exact against the per-tensor reference loop that MambaPool.clear_slots / copy_from fall back to. Covers heterogeneous conv shapes, single- and multi-layer pools, single / partial / full index sets, int32 indices, ...
198
7,641
sglang
test/registered/layers/mamba/test_causal_conv1d.py
.py
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci register_cuda_ci(est_time=11, stage="base-b", runner_config="1-gpu-small") register_amd_ci(est_time=25, suite="stage-b-test-1-gpu-small-amd...
385
13,671
sglang
test/registered/layers/mamba/test_mamba2_mixer.py
.py
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project # Adapted from https://github.com/vllm-project/vllm/blob/2c58742dff8613a3bd7496f2008ce927e18d38d1/tests/kernels/mamba/test_mamba_mixer2.py import pytest import torch from sglang.srt.distributed.device_communica...
151
4,695
sglang
test/registered/layers/mamba/test_mamba_ssm.py
.py
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci register_cuda_ci(est_time=10, stage="base-b", runner_config="1-gpu-small") register_amd_ci(est_time=20, suite="stage-b-test-1-gpu-small-amd...
365
13,215
sglang
test/registered/layers/mamba/conftest.py
.py
import pytest from sglang.kernels.ops.mamba.triton_ops import ssu_dispatch from sglang.kernels.ops.mamba.triton_ops.ssu_dispatch import ( initialize_mamba_selective_state_update_backend, ) from sglang.srt.server_args import ServerArgs @pytest.fixture(scope="session", autouse=True) def _init_mamba_ssu_backend(): ...
20
674
sglang
test/registered/xpu/test_deepseek_ocr_triton.py
.py
""" python3 -m unittest test_deepseek_ocr_triton.py """ import os import unittest from pathlib import Path from test_deepseek_ocr import TestDeepSeekOCR from sglang.srt.utils.hf_transformers import get_tokenizer from sglang.test.ci.ci_register import register_xpu_ci from sglang.test.test_utils import ( DEFAULT_T...
61
1,720
sglang
test/registered/xpu/test_xpu_flux2_dev.py
.py
"""FLUX.2-dev text-to-image on Intel XPU (4-GPU nightly). Mirrors ``test/registered/amd/test_zimage_turbo.py`` but targets FLUX.2-dev with ``num_gpus=4`` and registers to the XPU 4-GPU nightly suite. The diffusion server harness is device-agnostic; XPU dispatch is picked up by ``current_platform`` inside multimodal_ge...
189
5,866
sglang
test/registered/xpu/test_intel_xpu_backend.py
.py
""" Usage: python3 -m unittest test_intel_xpu_backend.TestIntelXPUBackend.test_latency_qwen_model """ import unittest from functools import wraps from sglang.test.ci.ci_register import register_xpu_ci from sglang.test.test_utils import ( DEFAULT_MODEL_NAME_FOR_TEST_FP8_WITH_MOE, DEFAULT_SMALL_MODEL_NAME_FOR_T...
87
2,457
sglang
test/registered/xpu/test_breakable_cuda_graph.py
.py
"""Tests for the breakable CUDA graph (BCG) runner on XPU. Two test classes: - TestBreakableCUDAGraphBasic / TestCopyOutput / TestBreakGraphHelper: unit tests for the core capture / replay mechanism (simple tensor ops). - TestXPUBreakableGraph: integration test — run a small Qwen model with the breakable prefill C...
340
11,724
sglang
test/registered/xpu/test_gemma_4_e2b.py
.py
""" Gemma 4 E2B-it: simple text Q&A on XPU (OpenAI /v1), same shape as ``test_deepseek_coder_v2_lite_instruct.py``. Model card: https://huggingface.co/google/gemma-4-E2B-it - XPU test runs when Intel XPU is available. Run from test/srt:: python3 -m unittest xpu.test_gemma_4_e2b.TestGemma4E2BXPU.test_simple_qa ...
141
3,884
sglang
test/registered/xpu/test_triton_attention_backend.py
.py
""" Usage: python3 -m unittest test_triton_attention_backend.TestTritonAttentionBackend.test_mla_triton_attention_backend """ import unittest from functools import wraps from sglang.test.ci.ci_register import register_xpu_ci from sglang.test.test_utils import ( DEFAULT_MODEL_NAME_FOR_TEST_FP8_WITH_MOE, Custom...
67
1,724
sglang
test/registered/xpu/test_xpu_basic.py
.py
""" Basic XPU test: verifies the server starts and produces a non-empty response on Intel XPU with the default attention backend. Assigned to stage-a so it gates stage-b before the heavier tests run. Usage: python3 -m unittest test_xpu_basic.TestXPUBasic.test_basic_generation """ import unittest from sglang.test.ci...
48
1,256
sglang
test/registered/xpu/test_xpu_embedding.py
.py
""" XPU embedding server test: validates the OpenAI-compatible /v1/embeddings endpoint on Intel XPU using a small embedding model. Lives in its own file because embedding models load with --is-embedding and use a different model than the chat fixtures in test_xpu_serving_features.py. Usage: python3 -m unittest test_xp...
71
2,207
sglang
test/registered/xpu/test_xpu_zimage_turbo.py
.py
"""Z-Image-Turbo text-to-image on Intel XPU (1-GPU nightly). Mirrors ``test/registered/amd/test_zimage_turbo.py`` but registers to the XPU 1-GPU nightly suite. The diffusion server harness is device-agnostic; XPU dispatch is picked up by ``current_platform`` inside multimodal_gen at server launch. """ from __future__...
180
5,550
sglang
test/registered/xpu/test_lmcache_radix_cache.py
.py
""" XPU integration tests for LMCRadixCache (IP mode). Unlike test_lmcache_connector.py, which drives LMCacheLayerwiseConnector directly, this test builds a real ReqToTokenPool + MHATokenToKVPool + TokenToKVPoolAllocator and drives LMCRadixCache itself through the request lifecycle (match_prefix -> cache_finished_req,...
233
9,213
sglang
test/registered/xpu/test_deepseek_ocr_2_olmbench.py
.py
"""DeepSeek-OCR-2 olmOCR-bench accuracy on Intel XPU (1-GPU nightly). Launches the server with the OCR serving config, runs the full olmOCR-bench via ``benchmark/ocr/bench_sglang.py``, asserts the aggregate score >= 0.80, and writes the per-split breakdown to the GitHub step summary. The olmOCR-bench dataset is downl...
172
6,019
sglang
test/registered/xpu/test_topk.py
.py
import unittest import torch from sglang.srt.layers.moe.topk import ( biased_grouped_topk_gpu, ) from sglang.srt.layers.moe.topk import ( biased_grouped_topk_impl as native_biased_grouped_topk, ) from sglang.srt.layers.moe.topk import grouped_topk_gpu as native_grouped_topk from sglang.srt.layers.moe.topk imp...
243
7,975
sglang
test/registered/xpu/test_moe_ld_padding.py
.py
""" python3 -m unittest test_moe_ld_padding.py """ import unittest import unittest.mock import torch from sglang.srt.layers.moe.utils import ( XPU_MOE_LD_PADDING_BYTES, xpu_moe_ld_padding_elems, ) from sglang.srt.layers.quantization.unquant import _empty_xpu_moe_expert_weight from sglang.test.ci.ci_register ...
181
7,730
sglang
test/registered/xpu/test_deepseek_ocr.py
.py
""" python3 -m unittest test_deepseek_ocr.py """ import json import os import unittest from pathlib import Path from unittest.mock import patch import requests import torch from sglang.srt.managers.schedule_batch import Modality, MultimodalDataItem from sglang.srt.models.deepseek_ocr import DeepseekOCRForCausalLM fr...
206
7,160
sglang
test/registered/xpu/test_encoder_attention_backend.py
.py
""" python3 -m unittest test_encoder_attention_backend.py """ import json import os import unittest from pathlib import Path import requests from sglang.srt.utils import kill_process_tree from sglang.srt.utils.hf_transformers import get_tokenizer from sglang.test.ci.ci_register import register_xpu_ci from sglang.tes...
144
4,462
sglang
test/registered/xpu/test_lmcache_connector.py
.py
""" XPU integration tests for LMCache connector in SGLang. Tests store/retrieve round-trip on Intel XPU using pure PyTorch ops (index_copy_, index_select) instead of CUDA lmc_ops kernels. Uses a single shared connector to avoid LMCacheEngineBuilder singleton issues (close() does not remove from _instances, so re-crea...
362
12,750
sglang
test/registered/xpu/test_xpu_graph.py
.py
""" XPU graph tests: verifies decode full-graph and prefill tc_piecewise graph on Intel XPU produce valid outputs. - TestXPUGraph : decode full-graph and prefill tc_piecewise graph enabled together in a single bench_one_batch invocation. Usage: python3 -m unittest test_xpu_graph.TestXPUGraph """ import uni...
72
1,847
sglang
test/registered/xpu/test_xpu_serving_features.py
.py
""" XPU serving-features test: covers OpenAI API, constrained decoding, sampling penalties, radix cache, and reasoning parsing in a single server fixture so each feature gets one canonical assertion on Intel XPU without paying the cost of N separate model launches. Usage: python3 -m unittest test_xpu_serving_features....
168
5,932
sglang
test/registered/xpu/llm_models/test_xpu_qwen3_5_35b_a3b.py
.py
"""Qwen3.5-35B-A3B GSM8K accuracy on Intel XPU (TP=4). Scored by ``simple_eval_gsm8k.GSM8KEval``. """ import unittest import torch from sglang.test.ci.ci_register import register_xpu_ci from sglang.test.test_utils import CustomTestCase from sglang.test.xpu.simple_eval_gsm8k_xpu_mixin import SimpleEvalGSM8KXPUMixin ...
44
1,096
sglang
test/registered/xpu/llm_models/test_xpu_gemma_4_26b_a4b.py
.py
"""gemma-4-26B-A4B GSM8K accuracy on Intel XPU (TP=4). Scored by ``simple_eval_gsm8k.GSM8KEval``. """ import unittest import torch from sglang.test.ci.ci_register import register_xpu_ci from sglang.test.test_utils import CustomTestCase from sglang.test.xpu.simple_eval_gsm8k_xpu_mixin import SimpleEvalGSM8KXPUMixin ...
43
1,109
sglang
test/registered/xpu/llm_models/test_xpu_llama_3_1_8b.py
.py
"""Llama-3.1-8B-Instruct GSM8K accuracy on Intel XPU (TP=2). TP=4 wedges the Level Zero driver during the first prefill batch on Arc/BMG; TP=2 runs cleanly with the same model and serves at ~18 tok/s. Scored by ``simple_eval_gsm8k.GSM8KEval``. """ import unittest import torch from sglang.test.ci.ci_register import...
39
1,033
sglang
test/registered/xpu/llm_models/test_xpu_nemotron_3_nano_30b_a3b.py
.py
"""NVIDIA-Nemotron-3-Nano-30B-A3B GSM8K accuracy on Intel XPU (TP=4). Scored by ``simple_eval_gsm8k.GSM8KEval``. """ import unittest import torch from sglang.test.ci.ci_register import register_xpu_ci from sglang.test.test_utils import CustomTestCase from sglang.test.xpu.simple_eval_gsm8k_xpu_mixin import SimpleEva...
60
1,663
sglang
test/registered/xpu/llm_models/test_xpu_qwen3_5_9b.py
.py
"""Qwen3.5-9B GSM8K accuracy on Intel XPU (TP=4). Scored by ``simple_eval_gsm8k.GSM8KEval``. """ import unittest import torch from sglang.test.ci.ci_register import register_xpu_ci from sglang.test.test_utils import CustomTestCase from sglang.test.xpu.simple_eval_gsm8k_xpu_mixin import SimpleEvalGSM8KXPUMixin regi...
42
1,030
sglang
test/registered/xpu/llm_models/test_xpu_qwen3_30b_a3b.py
.py
"""Qwen3-30B-A3B GSM8K accuracy on Intel XPU (TP=4). Scored by ``simple_eval_gsm8k.GSM8KEval``. """ import unittest import torch from sglang.test.ci.ci_register import register_xpu_ci from sglang.test.test_utils import CustomTestCase from sglang.test.xpu.simple_eval_gsm8k_xpu_mixin import SimpleEvalGSM8KXPUMixin r...
42
1,051
sglang
test/registered/debug_utils/test_nightly_precision_regression.py
.py
"""Nightly precision regression CI test: dump per-layer hidden states and compare day-over-day against a rolling baseline. Env knobs: SGLANG_PRECISION_MODELS comma-separated model ids (default GLM-5.2-FP8) SGLANG_PRECISION_BASELINE_DIR local baseline dir SGLANG_PRECISION_DIFF_THRESHOLD per-tensor rel_d...
761
26,565
sglang
test/registered/debug_utils/test_soft_watchdog.py
.py
import io import unittest import requests from sglang.srt.environ import envs from sglang.srt.utils import kill_process_tree from sglang.test.ci.ci_register import ( register_amd_ci, register_cpu_ci, register_cuda_ci, ) from sglang.test.test_utils import ( DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH, DEFAUL...
89
2,791
sglang
test/registered/debug_utils/test_dump_loader.py
.py
import sys import polars as pl import pytest import torch from sglang.srt.debug_utils.dump_loader import ( LOAD_FAILED, ValueWithMeta, _add_duplicate_index, _cast_to_polars_dtype, find_row, parse_meta_from_filename, read_meta, ) from sglang.test.ci.ci_register import register_cpu_ci regis...
129
4,002
sglang
test/registered/debug_utils/test_tensor_dump_forward_hook.py
.py
import unittest import torch from torch import nn from sglang.srt.debug_utils.tensor_dump_forward_hook import ( register_forward_hook_for_model, ) from sglang.srt.distributed.parallel_state import get_default_distributed_backend from sglang.srt.layers.layernorm import RMSNorm from sglang.srt.layers.linear import ...
101
3,128
sglang
test/registered/debug_utils/test_dump_comparator.py
.py
import pytest import torch from sglang.srt.debug_utils.dump_comparator import ( _argmax_coord, _calc_rel_diff, _compute_smaller_dtype, _try_unify_shape, ) from sglang.test.ci.ci_register import register_cpu_ci register_cpu_ci(est_time=30, suite="base-a-test-cpu", nightly=True) # --------------------...
61
1,893
sglang
test/registered/debug_utils/test_dumper.py
.py
import io import multiprocessing import os import re import sys import threading import time from contextlib import contextmanager from pathlib import Path from typing import Optional import pytest import requests import torch import torch.distributed as dist from sglang.srt.debug_utils.dumper import ( DumperConf...
4,408
162,663
sglang
test/registered/debug_utils/test_schedule_simulator.py
.py
import json import subprocess import sys import tempfile import unittest from sglang.srt.debug_utils.schedule_simulator import ( AttentionComputeBalancednessRecorder, BatchSizeBalancednessRecorder, FIFOScheduler, GPUState, RandomRouter, RoundRobinRouter, SimRequest, SimulationResult, ...
843
28,763
sglang
test/registered/debug_utils/test_crash_dump.py
.py
import glob import os import pickle import tempfile import time import unittest import requests from sglang.srt.environ import envs from sglang.srt.utils import kill_process_tree from sglang.test.ci.ci_register import ( register_amd_ci, register_cpu_ci, register_cuda_ci, ) from sglang.test.test_utils impo...
123
3,957
sglang
test/registered/debug_utils/test_engine_dumper_comparator_e2e.py
.py
"""E2E test: source patcher + dumper + comparator on SGLang server. Patches Qwen3MoeDecoderLayer.forward (and related methods) to insert dumper.dump() calls at 7 points, launches servers with Qwen3-30B-A3B (MOE model), runs inference, verifies patched dump fields exist, then runs comparator to verify numerical consist...
380
13,774
sglang
test/registered/debug_utils/source_patcher/test_dumper_integration.py
.py
"""Test dumper.apply_source_patches() integration with source_patcher.""" from pathlib import Path from types import ModuleType import yaml from sglang.srt.debug_utils.dumper import DumperConfig, _Dumper from sglang.test.ci.ci_register import register_cpu_ci register_cpu_ci(est_time=10, suite="base-a-test-cpu", nig...
67
1,923
sglang
test/registered/debug_utils/source_patcher/test_source_editor.py
.py
import pytest from pydantic import ValidationError from sglang.srt.debug_utils.source_patcher.source_editor import apply_edits from sglang.srt.debug_utils.source_patcher.types import EditSpec, PatchApplicationError from sglang.test.ci.ci_register import register_cpu_ci register_cpu_ci(est_time=10, suite="base-a-test-...
418
15,749
sglang
test/registered/debug_utils/source_patcher/test_code_patcher.py
.py
from types import ModuleType import pytest from sglang.srt.debug_utils.source_patcher.code_patcher import ( CodePatcher, _resolve_target, patch_function, ) from sglang.srt.debug_utils.source_patcher.types import EditSpec, PatchSpec from sglang.test.ci.ci_register import register_cpu_ci register_cpu_ci(es...
264
8,244
sglang
test/registered/debug_utils/source_patcher/conftest.py
.py
"""Shared fixtures for source_patcher tests. The sample module is defined as an inline string and written to a temp file at test time, avoiding CI complaints about fixture files without test registration. """ import importlib.util import sys import tempfile from pathlib import Path from types import ModuleType impor...
67
1,789
sglang
test/registered/debug_utils/comparator/test_entrypoint.py
.py
import subprocess import sys import textwrap from argparse import Namespace from pathlib import Path import pytest import torch import sglang.srt.debug_utils.comparator.entrypoint as _entrypoint_module import sglang.srt.debug_utils.dumper as _dumper_module from sglang.srt.debug_utils.comparator.entrypoint import ( ...
5,266
186,976
sglang
test/registered/debug_utils/comparator/testing_helpers.py
.py
"""Shared test helpers for comparator tests.""" from __future__ import annotations import re from io import StringIO from typing import Optional from rich.console import Console from sglang.test.ci.ci_register import register_cpu_ci register_cpu_ci( est_time=0, suite="base-a-test-cpu", nightly=True, ...
128
3,165
sglang
test/registered/debug_utils/comparator/test_display.py
.py
import sys from io import StringIO from pathlib import Path from typing import Any, Optional import polars as pl import pytest import torch from rich.console import Console from sglang.srt.debug_utils.comparator.display import ( _collect_input_ids_and_positions, _collect_rank_info, _extract_parallel_info,...
501
14,899
sglang
test/registered/debug_utils/comparator/test_bundle_comparator.py
.py
import sys from pathlib import Path from unittest.mock import patch import pytest import torch from sglang.srt.debug_utils.comparator.bundle_comparator import ( _build_skip_from_one_empty_side, _load_all_values, ) from sglang.srt.debug_utils.comparator.log_sink import LogSink from sglang.srt.debug_utils.compa...
211
8,271
sglang
test/registered/debug_utils/comparator/test_dump_loader.py
.py
import sys from pathlib import Path import pytest import torch from sglang.srt.debug_utils.dump_loader import read_tokenizer_path from sglang.test.ci.ci_register import register_cpu_ci register_cpu_ci(est_time=10, suite="base-a-test-cpu", nightly=True) def _save_pt( directory: Path, filename: str, *, value: to...
63
1,903
sglang
test/registered/debug_utils/comparator/test_e2e_demo.py
.py
"""Minimal demo: run the comparator on synthetic data and print its output. This is NOT a correctness test suite. The sole purpose is to let a new user run ``pytest -s test_e2e_demo.py`` and immediately see what comparator text output looks like (passed, failed, skipped in one shot). Correctness is verified via the J...
250
7,905