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/kernels/ops/attention/test_kda_prefill.py
.py
import unittest import torch import torch.nn.functional as F from sglang.kernels.ops.attention.fla.kda import chunk_kda from sglang.kernels.ops.attention.linear.kda_nvidia_prefill import ( chunk_kda_fwd as nvidia_chunk_kda_fwd, ) from sglang.kernels.ops.attention.linear.kda_ptx_prefill import ( chunk_kda_fwd ...
167
5,155
sglang
test/registered/kernels/ops/attention/test_inkling_row_scale.py
.py
"""The vectorized row-scale kernel must be BIT-identical to the triton apply_log_scaling_tau kernel it replaces (same fp32 multiply + bf16 round), including on the row-strided qkvr-slice layouts.""" import pytest import torch from sglang.kernels.ops.attention.inkling_row_scale import row_scale_bf16 from sglang.kernel...
83
3,063
sglang
test/registered/kernels/ops/attention/test_inkling_rel_proj.py
.py
"""rel_proj_small_t: the single-launch small-t rel projection (optional tau prescale folded in registers) must match the reference chains it replaces -- {r*tau -> bf16 round -> projection} -- within bf16 GEMM rounding, on both the production strided-r layout and contiguous inputs.""" import pytest import torch from s...
70
2,647
sglang
test/registered/kernels/ops/attention/test_flash_attention_4_sm120.py
.py
"""Focused SM120 FlashAttention-4 regression tests.""" import math import cutlass.cute as cute import pytest import torch from sglang.kernels.ops.attention.fa4_sm120.policy import ( low_hd_paged_decode_tile_m, visible_decode_seqlen_k, ) from sglang.kernels.ops.attention.fa4_sm120.runtime import ( Sm120Fo...
2,161
60,607
sglang
test/registered/kernels/ops/attention/test_fused_store_index_cache.py
.py
""" Test for fused_store_index_k_cache kernel. Design Notes: 1. torch.cuda.synchronize() needed after TVM FFI kernel call. 2. _split_buffer used buf[:, :vb].reshape(-1) which COPIES data for non-contiguous slices → reference buffer stayed all-zeros. Fix: use flat byte-offset indexing. 3. act_quant may ...
460
15,094
sglang
test/registered/kernels/ops/attention/test_fp8_wo_a.py
.py
"""DeepSeek-V4 wo_a FP8 activation quant for DeepGEMM fp8_einsum. Covers the dedicated DSV4 wo_a quant helper: bit-exact FP8/scales against the ordinary flat UE8M0 quant values, group-major scale storage, large / DSV4-shaped token axes, and the DeepGEMM fp8_einsum consumer contract. """ import unittest import torch ...
213
7,957
sglang
test/registered/kernels/ops/attention/test_rope.py
.py
import sys import pytest import torch import triton from sglang.kernels.jit.utils import get_ci_test_range from sglang.srt.utils import is_hip from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci register_cuda_ci(est_time=64, stage="base-b-kernel-unit", runner_config="1-gpu-large") # Nightly is n...
391
14,434
sglang
test/registered/kernels/ops/attention/test_clamp_position.py
.py
import sys import pytest import torch from sglang.kernels.ops.attention.clamp_position import clamp_position_cuda from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci register_cuda_ci(est_time=12, stage="base-b-kernel-unit", runner_config="1-gpu-large") register_amd_ci(est_time=12, stage="jit-ker...
47
1,839
sglang
test/registered/kernels/ops/attention/test_fp4_indexer.py
.py
from __future__ import annotations import sys import pytest import torch from sglang.kernels.ops.attention.deepseek_v4_rope import ( apply_rotary_emb_triton, precompute_freqs_cis, ) from sglang.kernels.ops.attention.dsv4 import ( CompressorDecodePlan, compress_norm_rope_store, fused_q_indexer_rop...
242
8,384
sglang
test/registered/kernels/ops/attention/test_c4_v2.py
.py
from __future__ import annotations import sys from typing import Tuple, Union import pytest import torch import triton from sglang.kernels.ops.attention.dsv4 import compress_forward from sglang.srt.utils import get_device from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci from sglang.test.kerne...
367
12,543
sglang
test/registered/kernels/ops/attention/test_mla_kv_pack_quantize_fp8.py
.py
import sys import pytest import torch from sglang.kernels.jit.utils import get_ci_test_range from sglang.kernels.ops.attention.mla_kv_pack_quantize_fp8 import ( mla_kv_pack_quantize_fp8, ) from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci register_cuda_ci(est_time=60, stage="base-b-kernel-...
108
3,717
sglang
test/registered/kernels/ops/attention/test_sm120_paged_mqa_logits.py
.py
"""SM120 fp8_paged_mqa_logits_torch_sm120 vectorized PyTorch fallback tests. Validates that the vectorized SM120-specific implementation matches the loopy reference (`fp8_paged_mqa_logits_torch`) and is CUDA-graph compatible. Coverage: - Numeric equivalence vs reference at small shapes - Both KV-cache dtype views (ui...
315
11,081
sglang
test/registered/kernels/ops/attention/test_flash_mla_backends.py
.py
"""SM120 FlashMLA sparse decode unit tests. Validates the SM120-specific FlashMLA implementation that replaces the upstream `flash_mla` CUDA kernel (unavailable on SM120 / RTX PRO 6000): - ``_gather_and_dequant``: byte-precise dequant of paged FP8 + BF16 + UE8M0 KV cache. Covers the dtype-reinterpretation surface t...
636
24,192
sglang
test/registered/kernels/ops/attention/test_flash_attention_4.py
.py
# Adapted from https://github.com/Dao-AILab/flash-attention/blob/8ecf128f683266735ba68e3c106ff67a2611886e/tests/cute/test_flash_attn.py # Copyright (c) 2025, Jay Shah, Ganesh Bikshandi, Ying Zhang, Vijay Thakkar, Pradeep Ramani, Tri Dao. import itertools import math import sys import pytest import torch import torch...
1,800
68,331
sglang
test/registered/kernels/ops/attention/test_deepseek_v4_compress_state_runtime_shapes.py
.py
# DeepSeek V4 compress-state test and benchmark entry. # # What this covers: # - Synthetic Flash/Pro C4/C128 decode/prefill shapes for broad operator # performance coverage. # - Replays 84 compress shapes captured from zc01 DeepSeek-V4-Flash serving. # - The capture used EAGLE, so runtime compress plans were prefill-...
1,084
38,078
sglang
test/registered/kernels/ops/attention/test_dsa_indexer.py
.py
import unittest from typing import List, Optional, Tuple from unittest.mock import MagicMock, patch import torch from sglang.srt.environ import envs from sglang.srt.runtime_context import get_parallel from sglang.test.ci.ci_register import register_cuda_ci _parallel_override = get_parallel().override(attn_tp_size=1)...
1,185
47,155
sglang
test/registered/kernels/ops/attention/test_minimax_m3_qk_norm_rope.py
.py
# SPDX-License-Identifier: Apache-2.0 """Reference tests for MiniMax-M3 fused Q/K Gemma RMSNorm + RoPE.""" import pytest import torch from sglang.srt.utils import is_hip if not is_hip(): pytest.skip( "MiniMax-M3 fused Q/K norm + RoPE kernel is ROCm-only.", allow_module_level=True, ) if not to...
335
10,026
sglang
test/registered/kernels/ops/attention/test_pos_enc.py
.py
import sys import time from typing import Optional, Tuple, Union import pytest import torch import triton import triton.language as tl from sglang.kernels.ops.attention.rope import rotary_embedding from sglang.test.ci.ci_register import register_cuda_ci register_cuda_ci(est_time=18, stage="base-b-kernel-unit", runne...
494
15,836
sglang
test/registered/kernels/ops/attention/test_fused_metadata_copy.py
.py
""" Comprehensive tests for JIT-compiled fused metadata copy kernels. This test suite verifies: 1. Single-backend fused kernel (fused_metadata_copy_cuda) - all forward modes 2. Multi-backend fused kernel (fused_metadata_copy_multi_cuda) - 3 backends at once 3. Correctness against reference implementations 4. Performan...
1,086
39,333
sglang
test/registered/kernels/ops/attention/test_qprep_bf16_fp8_sm90.py
.py
"""Tests for the SM90 Q8KV8 born-fp8 q-prep JIT kernel. Gates (mirroring benchmark/kernels/deepseek/benchmark_q8kv8_q_prep.py conventions): (a) vs the Triton absorbed_bmm_concat_cast_q_fp8 "two_dot" variant with atol/rtol=2e-2 on the fp32 view (the accumulation order matches, so the output is empirically...
121
4,434
sglang
test/registered/kernels/ops/attention/test_minimax_decode_topk_page_table.py
.py
"""Fused decode top-k + page-table transform. `minimax_decode_topk_page_table` selects the top-k blocks (same as the block-id `minimax_decode_topk`) and emits the per-query paged page table consumed by the dense backend (trtllm_mha), instead of block ids. This checks the fused output end-to-end: trtllm decode over the...
179
7,111
sglang
test/registered/kernels/ops/attention/test_dsv32_indexer_fusion.py
.py
"""Correctness tests for the DeepSeek-V3.2 DSA indexer fused kernels. Covers: - fused_q_indexer_rope_first_quant (Q: rope-first + fp8 quant + head-gate fold) - fused_k_indexer_norm_rope (K: LayerNorm + rope-first -> bf16) - fused_k_indexer_norm_rope_store (K: the above + fp8 quant + paged ...
270
10,504
sglang
test/registered/kernels/ops/attention/test_deepgemm_paged_mqa_logits.py
.py
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 import sys import pytest import torch from sglang.kernels.ops.attention.dsa import ( deepgemm_paged_mqa_logits_native, deepgemm_paged_mqa_logits_split, ) from sglang.srt.la...
234
7,716
sglang
test/registered/kernels/ops/attention/test_inkling_attn_prologue_tau.py
.py
"""The fused attn prologue's conditional log-scaling-tau fold on the q path: q_out must equal {per-head RMSNorm -> bf16 -> * tau -> bf16} (the unfused {prologue -> apply_log_scaling_tau} rounding, exactly), and the k/v outputs must be untouched by tau. """ import pytest import torch from sglang.kernels.ops.attention....
206
8,036
sglang
test/registered/kernels/ops/kv_canary/test_verify_hand.py
.py
from __future__ import annotations import random import struct from dataclasses import dataclass from typing import Callable import pytest import torch from sglang.kernels.ops.kv_canary import consts from sglang.kernels.ops.kv_canary.consts import splitmix64, splitmix64_mix3 from sglang.kernels.ops.kv_canary.verify ...
1,929
73,682
sglang
test/registered/kernels/ops/kv_canary/test_kernel_config.py
.py
from __future__ import annotations import pytest import torch from sglang.kernels.ops.kv_canary import consts from sglang.kernels.ops.kv_canary.verify import ( CanaryLaunchTag, VerifyOrWriteContext, VerifyPlan, launch_canary_verify_kernel, ) from sglang.kernels.ops.kv_canary.write import WritePlan fro...
442
15,894
sglang
test/registered/kernels/ops/kv_canary/test_plan_hand.py
.py
from __future__ import annotations import random import pytest import torch from sglang.kernels.ops.kv_canary.plan import launch_canary_plan_kernels from sglang.kernels.ops.kv_canary.plan_ref import ( launch_canary_plan_kernels_torch_reference, ) from sglang.kernels.ops.kv_canary.verify import VerifyPlan from sg...
1,373
55,364
sglang
test/registered/kernels/ops/kv_canary/test_write_hand.py
.py
from __future__ import annotations from dataclasses import dataclass from typing import Callable from unittest.mock import patch import pytest import torch from sglang.kernels.ops.kv_canary import consts from sglang.kernels.ops.kv_canary import write as write_module from sglang.kernels.ops.kv_canary.consts import sp...
1,225
46,934
sglang
test/registered/kernels/ops/kv_canary/test_const_sync.py
.py
from __future__ import annotations import re from pathlib import Path import sglang.kernels.jit from sglang.kernels.ops.kv_canary import consts from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci register_cuda_ci(est_time=5, stage="base-b-kernel-unit", runner_config="1-gpu-large") register_amd_c...
78
2,475
sglang
test/registered/kernels/ops/kv_canary/test_scatter_req_token_ids.py
.py
from __future__ import annotations import random import unittest import torch from sglang.kernels.ops.kv_canary.scatter_req_token_ids import ( _SCATTER_BATCH_BLOCK, launch_scatter_req_token_ids_kernel, scatter_req_token_ids_torch_reference, ) from sglang.test.ci.ci_register import register_amd_ci, regist...
280
11,009
sglang
test/registered/kernels/ops/kv_canary/test_plan_fuzz.py
.py
from __future__ import annotations import random from dataclasses import dataclass from typing import Optional import pytest import torch from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci from sglang.test.kernels.kv_canary._differential import _run_both_plan from sglang.test.kernels.kv_canary....
224
7,515
sglang
test/registered/kernels/ops/kv_canary/test_write_fuzz.py
.py
from __future__ import annotations import random from dataclasses import dataclass import pytest import torch from sglang.kernels.ops.kv_canary import consts from sglang.kernels.ops.kv_canary.verify import ( CanaryLaunchTag, RealKvSource, ) from sglang.kernels.ops.kv_canary.write import WritePlan from sglang...
258
8,974
sglang
test/registered/kernels/ops/kv_canary/test_verify_fuzz.py
.py
from __future__ import annotations import random from dataclasses import dataclass import pytest import torch from sglang.kernels.ops.kv_canary import consts from sglang.kernels.ops.kv_canary.verify import ( CanaryLaunchTag, RealKvSource, VerifyPlan, ) from sglang.test.ci.ci_register import register_amd_...
216
7,167
sglang
test/registered/kernels/ops/kv_canary/test_utils.py
.py
from __future__ import annotations from sglang.kernels.jit.benchmark.kv_canary.utils import ( MAX_EXTEND_TOKENS_PER_FORWARD, build_fast_matrix_cases, build_full_matrix_cases, cases_to_x_vals, ) from sglang.test.ci.ci_register import register_cpu_ci register_cpu_ci(est_time=3, stage="base-a", runner_co...
65
1,552
sglang
test/registered/kernels/ops/kv_canary/test_pipeline_e2e.py
.py
from __future__ import annotations from typing import Any, Optional import pytest import torch from sglang.kernels.ops.kv_canary import consts from sglang.kernels.ops.kv_canary.plan import launch_canary_plan_kernels from sglang.kernels.ops.kv_canary.plan_ref import ( launch_canary_plan_kernels_torch_reference, )...
844
31,074
sglang
test/registered/model_loading/test_load_weights_from_remote_instance_npu.py
.py
"""Test loading weights from remote instance. This test suite simulates loading weights from a remote instance. Rank 0 represents the seed instance, while ranks 1 represents the new instance that needs to loading weights from the seed instance. Seed instance must be started in `Server` mode, while the dst instance ca...
444
13,104
sglang
test/registered/model_loading/test_weight_cache_daemon.py
.py
import os import subprocess import sys import time import unittest import requests import torch from sglang.srt.utils import kill_process_tree 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, CustomTestCas...
339
12,775
sglang
test/registered/model_loading/test_external_models.py
.py
import unittest import sglang as sgl from sglang.srt.environ import envs from sglang.test.ci.ci_register import ( register_amd_ci, register_cpu_ci, register_cuda_ci, ) from sglang.test.test_utils import CustomTestCase register_cuda_ci(est_time=29, stage="base-b", runner_config="1-gpu-small") register_amd_...
38
1,117
sglang
test/registered/model_loading/test_utils_update_weights.py
.py
import asyncio import os import unittest import torch import torch.distributed as dist from torch.distributed.device_mesh import init_device_mesh from transformers import AutoModelForCausalLM from sglang.srt.entrypoints.engine import Engine from sglang.srt.weight_sync.utils import update_weights from sglang.test.ci.c...
174
5,762
sglang
test/registered/model_loading/test_runai_model_loader.py
.py
import unittest import sglang as sgl from sglang.srt.utils.common import temp_set_env from sglang.test.ci.ci_register import register_cuda_ci from sglang.test.test_utils import CustomTestCase register_cuda_ci(est_time=50, stage="nightly", runner_config="1-gpu-large") TEST_GCS_MODEL = "gs://vertex-model-garden-public...
51
1,564
sglang
test/registered/model_loading/test_prefetch_checkpoints_multi_gpu.py
.py
import unittest import sglang as sgl from sglang.test.ci.ci_register import register_cuda_ci from sglang.test.test_utils import CustomTestCase register_cuda_ci(est_time=300, stage="nightly", runner_config="4-gpu-h100") PROMPTS = [ "Hello, my name is", "The president of the United States is", "The capital...
50
1,496
sglang
test/registered/model_loading/test_load_weights_from_remote_instance.py
.py
"""Test loading weights from remote instance. This test suite simulates loading weights from a remote instance. Rank 0 represents the seed instance, while ranks 1 represents the new instance that needs to loading weights from the seed instance. Seed instance must be started in `Server` mode, while the dst instance ca...
437
13,355
sglang
test/registered/model_loading/test_weight_loader_v2_e2e.py
.py
# Copyright 2023-2025 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...
87
2,867
sglang
test/registered/model_loading/test_startup_weight_load.py
.py
"""End-to-end parity test for post-capture startup weight loading.""" import unittest import sglang as sgl from sglang.test.ci.ci_register import register_cuda_ci from sglang.test.test_utils import ( DEFAULT_SMALL_MODEL_NAME_FOR_TEST, CustomTestCase, ) register_cuda_ci(est_time=120, stage="base-b", runner_co...
70
2,357
sglang
test/registered/openai_server/basic/test_http2_server.py
.py
""" Test HTTP/2 server (Granian) with basic OpenAI-compatible endpoints. Verifies that --enable-http2 launches successfully and serves requests via both HTTP/1.1 and HTTP/2 (h2c). """ import subprocess import unittest import requests from sglang.srt.utils import kill_process_tree from sglang.test.ci.ci_register imp...
145
4,406
sglang
test/registered/openai_server/basic/test_openai_completion_rust.py
.py
import math 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.test_utils import ( DEFAULT_SMALL_MODEL_NAME_FOR_TEST, DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH, DEFAULT_URL_FOR_TEST, CustomTestCase, is_rus...
111
3,856
sglang
test/registered/openai_server/basic/test_serving_transcription.py
.py
""" Test the OpenAI-compatible /v1/audio/transcriptions endpoint with Whisper. Usage: python3 test_serving_transcription.py -v """ import io import json import unittest from typing import List, Optional import numpy as np import requests import soundfile as sf from sglang.srt.utils import kill_process_tree, loa...
305
12,059
sglang
test/registered/openai_server/basic/test_openai_server.py
.py
""" python3 -m unittest openai_server.basic.test_openai_server.TestOpenAIServer.test_completion python3 -m unittest openai_server.basic.test_openai_server.TestOpenAIServer.test_completion_stream python3 -m unittest openai_server.basic.test_openai_server.TestOpenAIServer.test_chat_completion python3 -m unittest openai_s...
1,299
49,877
sglang
test/registered/openai_server/function_call/test_anthropic_tool_use.py
.py
""" Tests for Anthropic-compatible tool use via the /v1/messages endpoint. python3 -m unittest openai_server.function_call.test_anthropic_tool_use.TestAnthropicToolUse.test_tool_use_format python3 -m unittest openai_server.function_call.test_anthropic_tool_use.TestAnthropicToolUse.test_tool_use_streaming python3 -m un...
556
20,256
sglang
test/registered/openai_server/function_call/test_openai_function_calling.py
.py
import json import unittest import openai 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_amd_ci, register_cuda_ci from sglang.test.test_utils import ( DEFAULT_SMALL_MODEL_NAME_FOR_TEST, DEFAULT_TIM...
1,007
37,890
sglang
test/registered/openai_server/validation/test_request_length_validation.py
.py
import unittest import openai 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.test_utils import ( DEFAULT_SMALL_MODEL_NAME_FOR_TEST, DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH, DEFAULT_URL_FOR_TEST, CustomT...
175
6,281
sglang
test/registered/openai_server/validation/test_matched_stop.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.matched_stop_kit import MatchedStopMixin from sglang.test.test_utils import ( DEFAULT_MODEL_NAME_FOR_TEST, DEFAULT_URL_FOR_TEST, CustomTestCase, ...
36
1,001
sglang
test/registered/openai_server/validation/test_large_max_new_tokens.py
.py
""" python3 -m unittest openai_server.validation.test_large_max_new_tokens.TestLargeMaxNewTokens.test_chat_completion """ import os import time import unittest from concurrent.futures import ThreadPoolExecutor import openai from sglang.srt.utils import kill_process_tree from sglang.srt.utils.hf_transformers_utils im...
108
3,370
sglang
test/registered/openai_server/features/test_openai_server_hidden_states.py
.py
import unittest from abc import ABC import openai 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_amd_ci, register_cuda_ci from sglang.test.test_utils import ( DEFAULT_DRAFT_MODEL_EAGLE, DEFAULT_SMA...
312
11,053
sglang
test/registered/mla/test_mla_int8_deepseek_v3.py
.py
import unittest from types import SimpleNamespace import requests import torch 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_FO...
86
2,642
sglang
test/registered/mla/test_mla_fp8.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.eval_accuracy_kit import MGSMEnMixin from sglang.test.test_utils import ( DEFAULT_MLA_FP8_MODEL_NAME_FOR_TEST, DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH, DEF...
56
2,030
sglang
test/registered/constrained_decoding/test_constrained_decoding.py
.py
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.kits.ebnf_constrained_kit import EBNFConstrainedMixin from sglang.test.kits.json_constrained_kit import JSONConstrainedMixin from sglang.test.kits.json...
84
2,240
sglang
test/registered/page_major/test_page_major_gpt_oss.py
.py
""" End-to-end accuracy test for the page-major KV layout on a hybrid-SWA MoE model. Launches gpt-oss-20b with ``--enable-page-major-kv-layout`` on the Triton attention backend and checks that GSM8K accuracy holds. This exercises the SWA + full-attention KV pools under the page-granularity envelope layout (SWAKVPool r...
70
2,300
sglang
test/registered/page_major/test_page_major_qwen_hybrid.py
.py
""" End-to-end accuracy test for the page-major KV layout on a GDN-hybrid model. Launches Qwen3.5-4B (a gated-delta-net / linear-attention hybrid) with ``--enable-page-major-kv-layout`` on the Triton attention + linear-attn + Mamba backends and checks that GSM8K accuracy holds. This exercises the page-major path most ...
80
2,827
sglang
test/registered/mock_model/test_e2e_pp.py
.py
from __future__ import annotations import unittest from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci from sglang.test.mock_model.utils import run_mock_model_bench_serving from sglang.test.test_utils import CustomTestCase register_cuda_ci(est_time=600, stage="extra-a", runner_config="2-gpu-larg...
22
650
sglang
test/registered/mock_model/test_self_unit_install.py
.py
from __future__ import annotations import os import unittest from types import SimpleNamespace os.environ["SGLANG_KV_CANARY_ENABLE_TOKEN_ORACLE"] = "1" from sglang.srt.kv_canary.token_oracle.install import install_token_oracle_from_env from sglang.srt.kv_canary.token_oracle.oracle import HashOracle from sglang.srt.l...
52
2,298
sglang
test/registered/mock_model/test_self_unit_oracle.py
.py
from __future__ import annotations import random import unittest import torch from sglang.kernels.ops.kv_canary.consts import splitmix64 from sglang.srt.kv_canary.token_oracle.oracle import ( HashOracle, _splitmix64_tensor, ) from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci from sglan...
129
4,601
sglang
test/registered/mock_model/test_e2e_pd.py
.py
from __future__ import annotations import time import unittest from concurrent.futures import ThreadPoolExecutor, as_completed from typing import ClassVar, Dict, List import requests from sglang.srt.utils import is_hip from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci from sglang.test.kv_canar...
181
6,293
sglang
test/registered/mock_model/test_self_unit_canary_mock_wiring.py
.py
from __future__ import annotations import dataclasses import unittest import torch from sglang.srt.kv_canary.expected_inputs import ExpectedInputs from sglang.srt.kv_canary.token_oracle.oracle import HashOracle from sglang.srt.kv_canary.token_oracle.sampler import install_oracle_sampler from sglang.srt.model_executo...
240
9,082
sglang
test/registered/mock_model/test_e2e_tp.py
.py
from __future__ import annotations import unittest from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci from sglang.test.mock_model.utils import run_mock_model_bench_serving from sglang.test.test_utils import CustomTestCase register_cuda_ci(est_time=600, stage="extra-a", runner_config="2-gpu-larg...
22
677
sglang
test/registered/mock_model/test_e2e_spec_eagle.py
.py
from __future__ import annotations import unittest from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci from sglang.test.mock_model.utils import MOCK_MODEL_PATH, run_mock_model_bench_serving from sglang.test.test_utils import CustomTestCase register_cuda_ci(est_time=600, stage="extra-a", runner_c...
36
1,127
sglang
test/registered/mock_model/test_self_e2e_perturb_next_token_swap.py
.py
from __future__ import annotations import unittest from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci from sglang.test.mock_model.perturb_e2e_base import MockModelPerturbE2EBase register_cuda_ci(est_time=60, stage="extra-a", runner_config="1-gpu-small") register_amd_ci(est_time=131, stage="extr...
38
1,614
sglang
test/registered/mock_model/test_self_unit_oracle_torch_vs_ref.py
.py
from __future__ import annotations import random import unittest import torch from sglang.kernels.ops.kv_canary.verify_ref import splitmix64 from sglang.srt.kv_canary.token_oracle.oracle import HashOracle from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci from sglang.test.test_utils import Cust...
87
3,242
sglang
test/registered/mock_model/test_self_unit_canary_perturb.py
.py
import logging import unittest from unittest.mock import Mock from sglang.srt.kv_canary.perturb import real_kv_used from sglang.srt.kv_canary.perturb.config import PerturbConfig, TargetGroupKind from sglang.test.ci.ci_register import register_cpu_ci from sglang.test.test_utils import CustomTestCase register_cpu_ci(es...
48
1,714
sglang
test/registered/mock_model/test_self_unit_sampler_hookpoint.py
.py
"""install_oracle_sampler registration into sglang's sampler-backend registry. Instantiating the registered _OracleSampler factory requires a live distributed (TP) group plus a populated global ServerArgs, so the forward-path behavior of _OracleSampler is covered by the e2e harness rather than this unit file. Here we ...
51
2,096
sglang
test/registered/npu/test_npu_memory_consumption.py
.py
""" Usage: python3 -m unittest test_ascend_memory_consumption.TestMemoryConsumptionAscend.test_memory_consumption """ import os import unittest import torch from sglang.srt.utils import kill_process_tree from sglang.test.ci.ci_register import register_npu_ci from sglang.test.test_utils import ( DEFAULT_TIMEOUT_F...
84
2,370
sglang
test/registered/npu/performance/qwen3-8b/test_npu_qwen3_8b_w8a8_1p_in6k_out1k5_bs16.py
.py
import unittest from sglang.test.ascend.e2e.test_npu_performance_utils import ( QWEN3_8B_EAGLE_MODEL_PATH, QWEN3_8B_W8A8_MODEL_PATH, TestNpuPerformanceTestCaseBase, ) from sglang.test.ci.ci_register import register_npu_ci register_npu_ci( est_time=3600, suite="", nightly=True, disabled="pe...
95
1,983
sglang
test/registered/npu/performance/qwen3-8b/test_npu_qwen3_8b_w8a8_1p_in3k5_out1k5_50ms.py
.py
import unittest from sglang.test.ascend.e2e.test_npu_performance_utils import ( AISBENCHMARK_DATASET_DEFAULT, BENCHMARK_TOOL_DEFAULT, QWEN3_8B_EAGLE_MODEL_PATH, QWEN3_8B_W8A8_MODEL_PATH, TestNpuPerformanceTestCaseBase, ) from sglang.test.ci.ci_register import register_npu_ci register_npu_ci(est_ti...
105
2,262
sglang
test/registered/npu/performance/deepseek_v4_flash/test_npu_deepseek_v4_flash_w8a8_8p_in8k_out1k_50ms.py
.py
import unittest from sglang.test.ascend.e2e.test_npu_performance_utils import ( AISBENCHMARK_DATASET_DEFAULT, BENCHMARK_TOOL_DEFAULT, DEEPSEEK_V4_FLASH_W8A8_MTP_MODEL_PATH, TestNpuPerformanceTestCaseBase, ) from sglang.test.ci.ci_register import register_npu_ci register_npu_ci(est_time=3600, suite="ba...
123
3,388
sglang
test/registered/npu/performance/glm5_1/test_npu_glm5_1_w4a8_1p1d_32p_in64k_out1k_50ms.py
.py
import unittest from sglang.test.ascend.e2e.test_npu_multi_node_utils import NIC_NAME from sglang.test.ascend.e2e.test_npu_performance_utils import ( AISBENCHMARK_DATASET_DEFAULT, BENCHMARK_TOOL_DEFAULT, GLM_5_1_W4A8_MODEL_PATH, TestNpuPerfMultiNodePdSepTestCaseBase, ) from sglang.test.ci.ci_register i...
190
4,698
sglang
test/registered/npu/performance/kimi_k2_6/test_npu_kimi_k2_6_w4a8_16p_in64k_out1k_100ms.py
.py
import unittest from sglang.test.ascend.e2e.test_npu_multi_node_utils import NIC_NAME from sglang.test.ascend.e2e.test_npu_performance_utils import ( AISBENCHMARK_DATASET_DEFAULT, BENCHMARK_TOOL_DEFAULT, KIMI_K2_6_EAGLE3_MODEL_PATH, KIMI_K2_6_W4A8_MODEL_PATH, TestNpuPerfMultiNodePdMixTestCaseBase, ...
114
2,683
sglang
test/registered/npu/performance/kimi_k2_6/test_npu_kimi_k2_6_w4a8_8p_in3k5_out1k5_20ms.py
.py
import unittest from sglang.test.ascend.e2e.test_npu_multi_node_utils import NIC_NAME from sglang.test.ascend.e2e.test_npu_performance_utils import ( AISBENCHMARK_DATASET_DEFAULT, BENCHMARK_TOOL_DEFAULT, KIMI_K2_6_EAGLE3_MODEL_PATH, KIMI_K2_6_W4A8_MODEL_PATH, TestNpuPerformanceTestCaseBase, ) from ...
125
3,039
sglang
test/registered/npu/performance/qwen3_5_397b/test_npu_qwen3_5_397b_w4a8_8p_in3k5_out1k5_50ms.py
.py
import unittest from sglang.test.ascend.e2e.test_npu_performance_utils import ( AISBENCHMARK_DATASET_DEFAULT, BENCHMARK_TOOL_DEFAULT, QWEN3_5_397B_W4A8_MODEL_PATH, TestNpuPerformanceTestCaseBase, ) from sglang.test.ci.ci_register import register_npu_ci register_npu_ci(est_time=3600, suite="base-c-test...
136
3,283
sglang
test/registered/npu/performance/qwen3_next_80b_a3b_instruct/test_npu_qwen3_next_80b_w8a8_2p_in6k_out1k5_bs16.py
.py
import unittest from sglang.test.ascend.e2e.test_npu_performance_utils import ( QWEN3_NEXT_80B_A3B_MODEL_PATH, QWEN3_NEXT_80B_A3B_W8A8_MODEL_PATH, TestNpuPerformanceTestCaseBase, ) from sglang.test.ci.ci_register import register_npu_ci register_npu_ci(est_time=3600, suite="base-c-test-perf-4-npu-a3") QWE...
111
2,785
sglang
test/registered/npu/performance/qwen3_6_35b_a3b/test_npu_qwen3_6_35b_a3b_1p_in128k_out1k_prefix90_50ms.py
.py
import unittest from sglang.test.ascend.e2e.test_npu_performance_utils import ( BENCHMARK_TOOL_DEFAULT, QWEN3_6_35B_A3B_MODEL_PATH, TestNpuPerformanceTestCaseBase, ) from sglang.test.ci.ci_register import register_npu_ci register_npu_ci( est_time=3600, suite="", nightly=True, disabled="per...
114
2,625
sglang
test/registered/npu/performance/qwen3_6_35b_a3b/test_npu_qwen3_6_35b_a3b_1p_in3k5_out1k5_50ms.py
.py
import unittest from sglang.test.ascend.e2e.test_npu_performance_utils import ( AISBENCHMARK_DATASET_DEFAULT, BENCHMARK_TOOL_DEFAULT, QWEN3_6_35B_A3B_MODEL_PATH, TestNpuPerformanceTestCaseBase, ) from sglang.test.ci.ci_register import register_npu_ci register_npu_ci( est_time=3600, suite="full...
111
2,542
sglang
test/registered/npu/performance/qwen3_6_35b_a3b/test_npu_qwen3_6_35b_a3b_1p_in64k_out1k_prefix90_50ms.py
.py
import unittest from sglang.test.ascend.e2e.test_npu_performance_utils import ( BENCHMARK_TOOL_DEFAULT, DEFAULT_URL_FOR_TEST, QWEN3_6_35B_A3B_MODEL_PATH, TestNpuPerformanceTestCaseBase, ) from sglang.test.ci.ci_register import register_npu_ci register_npu_ci(est_time=3600, suite="base-c-test-perf-2-np...
110
2,629
sglang
test/registered/npu/performance/qwen3_6_35b_a3b/test_npu_qwen3_6_35b_a3b_1p_in128k_out1k_50ms.py
.py
import unittest from sglang.test.ascend.e2e.test_npu_performance_utils import ( AISBENCHMARK_DATASET_DEFAULT, BENCHMARK_TOOL_DEFAULT, QWEN3_6_35B_A3B_MODEL_PATH, TestNpuPerformanceTestCaseBase, ) from sglang.test.ci.ci_register import register_npu_ci register_npu_ci( est_time=3600, suite="", ...
106
2,534
sglang
test/registered/npu/performance/qwen3_6_35b_a3b/test_npu_qwen3_6_35b_a3b_1p_in64k_out1k_50ms.py
.py
import unittest from sglang.test.ascend.e2e.test_npu_performance_utils import ( AISBENCHMARK_DATASET_DEFAULT, BENCHMARK_TOOL_DEFAULT, QWEN3_6_35B_A3B_MODEL_PATH, TestNpuPerformanceTestCaseBase, ) from sglang.test.ci.ci_register import register_npu_ci register_npu_ci( est_time=3600, suite="full...
108
2,526
sglang
test/registered/npu/performance/qwen3_235b_a22b/test_npu_qwen3_235b_w8a8_8p_in3k5_out1k5_50ms.py
.py
import unittest from sglang.test.ascend.e2e.test_npu_performance_utils import ( AISBENCHMARK_DATASET_DEFAULT, BENCHMARK_TOOL_DEFAULT, QWEN3_235B_A22B_EAGLE_MODEL_PATH, QWEN3_235B_W8A8_MODEL_PATH, TestNpuPerformanceTestCaseBase, ) from sglang.test.ci.ci_register import register_npu_ci register_npu_...
121
2,899
sglang
test/registered/npu/performance/qwen3_6_27b/test_npu_qwen3_6_27b_w8a8_2p_in64k_out1k_50ms.py
.py
import unittest from sglang.test.ascend.e2e.test_npu_performance_utils import ( AISBENCHMARK_DATASET_DEFAULT, BENCHMARK_TOOL_DEFAULT, QWEN3_6_27B_W8A8_MODEL_PATH, TestNpuPerformanceTestCaseBase, ) from sglang.test.ci.ci_register import register_npu_ci register_npu_ci( est_time=3600, suite="", ...
101
2,404
sglang
test/registered/npu/performance/qwen3_6_27b/test_npu_qwen3_6_27b_2p_in64k_out1k_prefix90_50ms.py
.py
import unittest from sglang.test.ascend.e2e.test_npu_performance_utils import ( BENCHMARK_TOOL_DEFAULT, QWEN3_6_27B_MODEL_PATH, TestNpuPerformanceTestCaseBase, ) from sglang.test.ci.ci_register import register_npu_ci register_npu_ci( est_time=3600, suite="", nightly=True, disabled="perform...
112
2,590
sglang
test/registered/npu/performance/qwen3_6_27b/test_npu_qwen3_6_27b_w8a8_2p_in128k_out1k_50ms.py
.py
import unittest from sglang.test.ascend.e2e.test_npu_performance_utils import ( AISBENCHMARK_DATASET_DEFAULT, BENCHMARK_TOOL_DEFAULT, QWEN3_6_27B_W8A8_MODEL_PATH, TestNpuPerformanceTestCaseBase, ) from sglang.test.ci.ci_register import register_npu_ci register_npu_ci( est_time=3600, suite="", ...
99
2,323
sglang
test/registered/npu/performance/qwen3_6_27b/test_npu_qwen3_6_27b_1p_in1080p_30_out256_50ms.py
.py
import unittest from sglang.test.ascend.e2e.test_npu_performance_utils import ( AISBENCHMARK_DATASET_MM_CUSTOM_GEN, BENCHMARK_TOOL_DEFAULT, QWEN3_6_27B_MODEL_PATH, TestNpuPerformanceTestCaseBase, ) from sglang.test.ci.ci_register import register_npu_ci register_npu_ci( est_time=3600, suite="fu...
124
2,811
sglang
test/registered/npu/performance/qwen3_6_27b/test_npu_qwen3_6_27b_w8a8_1p_in64k_out1k_50ms.py
.py
import unittest from sglang.test.ascend.e2e.test_npu_performance_utils import ( AISBENCHMARK_DATASET_DEFAULT, BENCHMARK_TOOL_DEFAULT, QWEN3_6_27B_W8A8_MODEL_PATH, TestNpuPerformanceTestCaseBase, ) from sglang.test.ci.ci_register import register_npu_ci register_npu_ci(est_time=3600, suite="base-c-test-...
94
2,173
sglang
test/registered/npu/performance/qwen3_6_27b/test_npu_qwen3_6_27b_w8a8_1p_in3k5_out1k5_50ms.py
.py
import unittest from sglang.test.ascend.e2e.test_npu_performance_utils import ( AISBENCHMARK_DATASET_DEFAULT, BENCHMARK_TOOL_DEFAULT, QWEN3_6_27B_W8A8_MODEL_PATH, TestNpuPerformanceTestCaseBase, ) from sglang.test.ci.ci_register import register_npu_ci register_npu_ci( est_time=3600, suite="ful...
110
2,544
sglang
test/registered/npu/performance/qwen3_6_27b/test_npu_qwen3_6_27b_1p_in1024x1024_30_out1024_50ms.py
.py
import unittest from sglang.test.ascend.e2e.test_npu_performance_utils import ( AISBENCHMARK_DATASET_MM_CUSTOM_GEN, BENCHMARK_TOOL_DEFAULT, QWEN3_6_27B_MODEL_PATH, TestNpuPerformanceTestCaseBase, ) from sglang.test.ci.ci_register import register_npu_ci register_npu_ci(est_time=3600, suite="base-c-test...
113
2,727
sglang
test/registered/npu/performance/qwen3_6_27b/test_npu_qwen3_6_27b_w8a8_2p_in16k_out1k_50ms.py
.py
import unittest from sglang.test.ascend.e2e.test_npu_performance_utils import ( AISBENCHMARK_DATASET_DEFAULT, BENCHMARK_TOOL_DEFAULT, QWEN3_6_27B_W8A8_MODEL_PATH, TestNpuPerformanceTestCaseBase, ) from sglang.test.ci.ci_register import register_npu_ci register_npu_ci( est_time=3600, suite="", ...
126
2,614
sglang
test/registered/npu/performance/qwen3_30b_a3b/test_npu_qwen3_30b_w8a8_1p_in3k5_out1k5_50ms.py
.py
import unittest from sglang.test.ascend.e2e.test_npu_performance_utils import ( AISBENCHMARK_DATASET_DEFAULT, BENCHMARK_TOOL_DEFAULT, QWEN3_30B_A3B_W8A8_VLLM_MODEL_PATH, QWEN3_A3B_EAGLE_MODEL_PATH, TestNpuPerformanceTestCaseBase, ) from sglang.test.ci.ci_register import register_npu_ci register_np...
110
2,431
sglang
test/registered/npu/performance/mimo_v2_flash/test_npu_mimo_v2_flash_1p1d_12p_in16k_out1k_tpot_20ms.py
.py
import unittest from sglang.test.ascend.e2e.test_npu_performance_utils import ( AISBENCHMARK_DATASET_DEFAULT, BENCHMARK_TOOL_DEFAULT, MIMO_V2_FLASH_MODEL_PATH, TestNpuPerfMultiNodePdSepTestCaseBase, ) from sglang.test.ci.ci_register import register_npu_ci register_npu_ci( est_time=3600, suite=...
188
4,750
sglang
test/registered/npu/performance/mimo_v2_flash/test_npu_mimo_v2_flash_1p1d_12p_in16k_out1_ttft_5s.py
.py
import unittest from sglang.test.ascend.e2e.test_npu_performance_utils import ( AISBENCHMARK_DATASET_DEFAULT, BENCHMARK_TOOL_DEFAULT, MIMO_V2_FLASH_MODEL_PATH, TestNpuPerfMultiNodePdSepTestCaseBase, ) from sglang.test.ci.ci_register import register_npu_ci register_npu_ci( est_time=3600, suite=...
192
4,760
sglang
test/registered/npu/performance/qwen3_32b/test_npu_qwen3_32b_w8a8_2p_in3k5_out1k5_50ms.py
.py
import unittest from sglang.test.ascend.e2e.test_npu_performance_utils import ( AISBENCHMARK_DATASET_DEFAULT, BENCHMARK_TOOL_DEFAULT, QWEN3_32B_EAGLE_MODEL_PATH, QWEN3_32B_W8A8_MODEL_PATH, TestNpuPerformanceTestCaseBase, ) from sglang.test.ci.ci_register import register_npu_ci register_npu_ci(est_...
107
2,320
sglang
test/registered/npu/performance/qwen3_32b/test_npu_qwen3_32b_w8a8_2p_in3k5_out1k5_50ms_a2.py
.py
import unittest from sglang.test.ascend.e2e.test_npu_performance_utils import ( AISBENCHMARK_DATASET_DEFAULT, DEFAULT_URL_FOR_TEST, QWEN3_32B_EAGLE_MODEL_PATH, QWEN3_32B_W8A8_MODEL_PATH, TestNpuPerformanceTestCaseBase, ) from sglang.test.ci.ci_register import register_npu_ci register_npu_ci( e...
112
2,351
sglang
test/registered/npu/performance/qwen3_32b/test_npu_qwen3_32b_bf16_8p_in18k_out4k_6ms.py
.py
import unittest from sglang.test.ascend.e2e.test_npu_performance_utils import ( AISBENCHMARK_DATASET_DEFAULT, BENCHMARK_TOOL_DEFAULT, QWEN3_32B_EAGLE_MODEL_PATH, QWEN3_32B_MODEL_PATH, TestNpuPerformanceTestCaseBase, ) from sglang.test.ci.ci_register import register_npu_ci register_npu_ci( est_...
96
2,162
sglang
test/registered/npu/performance/minimax_m2_5/test_npu_minimax_m2_5_w8a8_8p_in3k5_out1k5_50ms.py
.py
import os import unittest from sglang.test.ascend.e2e.test_npu_performance_utils import ( AISBENCHMARK_DATASET_DEFAULT, BENCHMARK_TOOL_DEFAULT, MINIMAX_M2_5_EAGLE3_MODEL_PATH, MINIMAX_M2_5_W8A8_MODEL_PATH, TestNpuPerformanceTestCaseBase, ) from sglang.test.ci.ci_register import register_npu_ci reg...
119
3,006