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/npu/basic_function/parameter/test_npu_log_level.py
.py
import os import unittest import requests from sglang.srt.utils import kill_process_tree from sglang.test.ascend.test_ascend_utils import LLAMA_3_2_1B_INSTRUCT_WEIGHTS_PATH from sglang.test.ci.ci_register import register_npu_ci from sglang.test.test_utils import ( DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH, DEFAULT_UR...
93
3,234
sglang
test/registered/npu/reward_models/test_npu_internlm2_7b_reward.py
.py
import os os.environ["PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION"] = "python" import multiprocessing as mp import unittest import torch from sglang.test.ascend.test_ascend_utils import INTERNLM2_7B_REWARD_WEIGHTS_PATH from sglang.test.ci.ci_register import register_npu_ci from sglang.test.runners import SRTRunner from s...
66
2,121
sglang
test/registered/npu/reward_models/test_npu_llama_3_1_8b_v0_2.py
.py
import multiprocessing as mp import unittest import torch from sglang.test.ascend.test_ascend_utils import ( SKYWORK_REWARD_LLAMA_3_1_8B_V0_2_WEIGHTS_PATH, ) from sglang.test.ci.ci_register import register_npu_ci from sglang.test.runners import HFRunner, SRTRunner from sglang.test.test_utils import CustomTestCase...
87
2,631
sglang
test/registered/npu/reward_models/test_npu_gemma_2_27b_v0_2.py
.py
import logging import multiprocessing as mp import os import unittest import torch from sglang.test.ci.ci_register import register_npu_ci from sglang.test.runners import HFRunner, SRTRunner from sglang.test.test_utils import CustomTestCase logger = logging.getLogger(__name__) register_npu_ci(est_time=400, suite="ful...
89
2,549
sglang
test/registered/npu/interface/test_npu_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.ascend.test_ascend_utils import LLAMA_3_2_1B_INSTRUCT_WEIGHTS_PATH from sglang.test.ci.ci_register import register_npu_ci from sglang.test.test_uti...
941
35,606
sglang
test/registered/npu/interface/test_npu_api_abort_request.py
.py
import threading import time import unittest import requests from sglang.srt.utils import kill_process_tree from sglang.test.ascend.test_ascend_utils import LLAMA_3_2_1B_INSTRUCT_WEIGHTS_PATH from sglang.test.ci.ci_register import register_npu_ci from sglang.test.test_utils import ( DEFAULT_TIMEOUT_FOR_SERVER_LAU...
79
2,174
sglang
test/registered/npu/interface/test_npu_api_encode.py
.py
import logging import unittest import requests from sglang.srt.utils import kill_process_tree from sglang.test.ascend.test_ascend_utils import QWEN3_VL_4B_INSTRUCT_WEIGHTS_PATH from sglang.test.ci.ci_register import register_npu_ci from sglang.test.test_utils import ( DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH, DEFAUL...
135
4,614
sglang
test/registered/npu/interface/test_npu_matched_stop.py
.py
import json import unittest import requests from sglang.srt.utils import kill_process_tree from sglang.test.ascend.test_ascend_utils import LLAMA_3_1_8B_INSTRUCT_WEIGHTS_PATH from sglang.test.ci.ci_register import register_npu_ci from sglang.test.test_utils import ( DEFAULT_URL_FOR_TEST, CustomTestCase, p...
164
5,751
sglang
test/registered/npu/interface/test_npu_api.py
.py
import json import logging import os import shutil import unittest import requests from transformers import AutoTokenizer from sglang.srt.environ import envs from sglang.srt.utils import kill_process_tree from sglang.test.ascend.test_ascend_utils import LLAMA_3_2_1B_INSTRUCT_WEIGHTS_PATH from sglang.test.ci.ci_regist...
736
28,491
sglang
test/registered/npu/interface/test_npu_enable_thinking.py
.py
import json import unittest import requests from sglang.srt.utils import kill_process_tree from sglang.test.ascend.test_ascend_utils import QWEN3_30B_A3B_WEIGHTS_PATH from sglang.test.ci.ci_register import register_npu_ci from sglang.test.test_utils import ( DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH, DEFAULT_URL_FOR_...
196
6,927
sglang
test/registered/npu/interface/test_npu_openai_server_ignore_eos.py
.py
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.ascend.test_ascend_utils import LLAMA_3_2_1B_INSTRUCT_WEIGHTS_PATH from sglang.test.ci.ci_register import register_npu_ci from sglang.test.test_utils import ( ...
102
3,382
sglang
test/registered/npu/interface/test_npu_penalty.py
.py
import json import random import unittest from concurrent.futures import ThreadPoolExecutor import requests from sglang.srt.utils import kill_process_tree from sglang.test.ascend.test_ascend_utils import LLAMA_3_2_1B_INSTRUCT_WEIGHTS_PATH from sglang.test.ci.ci_register import register_npu_ci from sglang.test.test_ut...
112
3,597
sglang
test/registered/npu/embedding_models/test_npu_bge_large_en_v1_5.py
.py
import multiprocessing as mp import unittest from typing import Optional import torch from transformers import AutoConfig, AutoTokenizer from sglang.test.ci.ci_register import register_npu_ci from sglang.test.runners import HFRunner, SRTRunner from sglang.test.test_utils import CustomTestCase, get_similarities regis...
113
3,538
sglang
test/registered/npu/llm_models/test_npu_smollm_1_7b.py
.py
import unittest from sglang.test.ascend.gsm8k_ascend_mixin import GSM8KAscendMixin from sglang.test.ascend.test_ascend_utils import SMOLLM_1_7B_WEIGHTS_PATH from sglang.test.ci.ci_register import register_npu_ci from sglang.test.test_utils import CustomTestCase register_npu_ci(est_time=400, suite="full-1-npu-a3", nig...
34
929
sglang
test/registered/npu/llm_models/test_npu_mistral_7b.py
.py
import unittest from sglang.test.ascend.gsm8k_ascend_mixin import GSM8KAscendMixin from sglang.test.ascend.test_ascend_utils import MISTRAL_7B_INSTRUCT_V0_2_WEIGHTS_PATH from sglang.test.ci.ci_register import register_npu_ci from sglang.test.test_utils import CustomTestCase register_npu_ci(est_time=400, suite="nightl...
24
757
sglang
test/registered/npu/llm_models/test_npu_c4ai_command_r_v01.py
.py
import unittest from sglang.test.ascend.gsm8k_ascend_mixin import GSM8KAscendMixin from sglang.test.ascend.test_ascend_utils import ( C4AI_COMMAND_R_V01_CHAT_TEMPLATE_PATH, C4AI_COMMAND_R_V01_WEIGHTS_PATH, ) from sglang.test.ci.ci_register import register_npu_ci from sglang.test.test_utils import CustomTestCas...
41
1,111
sglang
test/registered/npu/llm_models/test_npu_baichuan2_13b_chat.py
.py
import unittest from sglang.test.ascend.gsm8k_ascend_mixin import GSM8KAscendMixin from sglang.test.ascend.test_ascend_utils import BAICHUAN2_13B_CHAT_WEIGHTS_PATH from sglang.test.ci.ci_register import register_npu_ci from sglang.test.test_utils import CustomTestCase register_npu_ci(est_time=400, suite="nightly-1-np...
38
1,075
sglang
test/registered/npu/llm_models/test_npu_granite_3_1_8b.py
.py
import unittest from sglang.test.ascend.gsm8k_ascend_mixin import GSM8KAscendMixin from sglang.test.ascend.test_ascend_utils import GRANITE_3_1_8B_INSTRUCT_WEIGHTS_PATH from sglang.test.ci.ci_register import register_npu_ci from sglang.test.test_utils import CustomTestCase register_npu_ci(est_time=400, suite="full-1-...
24
752
sglang
test/registered/npu/llm_models/test_npu_qwen3_30b_attn_cp.py
.py
import os import unittest from sglang.test.ascend.gsm8k_ascend_mixin import GSM8KAscendMixin from sglang.test.ascend.test_ascend_utils import QWEN3_30B_A3B_WEIGHTS_PATH from sglang.test.ci.ci_register import register_npu_ci from sglang.test.test_utils import CustomTestCase register_npu_ci(est_time=500, suite="nightly...
56
1,407
sglang
test/registered/npu/llm_models/test_npu_stablelm_2_1_6b.py
.py
import unittest from sglang.test.ascend.gsm8k_ascend_mixin import GSM8KAscendMixin from sglang.test.ascend.test_ascend_utils import STABLELM_2_1_6B_WEIGHTS_PATH from sglang.test.ci.ci_register import register_npu_ci from sglang.test.test_utils import CustomTestCase register_npu_ci(est_time=400, suite="full-1-npu-a3",...
35
972
sglang
test/registered/npu/llm_models/test_ascend_dbrx_instruct.py
.py
import unittest from sglang.test.ascend.gsm8k_ascend_mixin import GSM8KAscendMixin from sglang.test.ci.ci_register import register_npu_ci from sglang.test.test_utils import CustomTestCase register_npu_ci(est_time=400, suite="nightly-8-npu-a3", nightly=True) class TestDbrx(GSM8KAscendMixin, CustomTestCase): mode...
27
678
sglang
test/registered/npu/llm_models/test_npu_qwq_32b_w8a8.py
.py
import os import unittest from sglang.test.ascend.gsm8k_ascend_mixin import GSM8KAscendMixin from sglang.test.ascend.test_ascend_utils import QWQ_32B_W8A8_WEIGHTS_PATH from sglang.test.ci.ci_register import register_npu_ci from sglang.test.test_utils import CustomTestCase register_npu_ci(est_time=400, suite="nightly-...
38
1,039
sglang
test/registered/npu/llm_models/test_npu_qwen3_coder_480b_a35b.py
.py
import unittest from sglang.test.ascend.gsm8k_ascend_mixin import GSM8KAscendMixin from sglang.test.ascend.test_ascend_utils import ( QWEN3_CODER_480B_A35B_INSTRUCT_W8A8_QUAROT_WEIGHTS_PATH, ) from sglang.test.ci.ci_register import register_npu_ci from sglang.test.test_utils import CustomTestCase register_npu_ci(...
43
1,145
sglang
test/registered/npu/llm_models/test_npu_internlm2_7b.py
.py
import os import unittest from sglang.test.ascend.gsm8k_ascend_mixin import GSM8KAscendMixin from sglang.test.ascend.test_ascend_utils import INTERNLM2_7B_WEIGHTS_PATH from sglang.test.ci.ci_register import register_npu_ci from sglang.test.test_utils import CustomTestCase register_npu_ci( est_time=400, suite=...
30
828
sglang
test/registered/npu/llm_models/test_npu_persimmon_8b_chat.py
.py
import os import unittest from sglang.test.ascend.gsm8k_ascend_mixin import GSM8KAscendMixin from sglang.test.ascend.test_ascend_utils import PERSIMMON_8B_CHAT_WEIGHTS_PATH from sglang.test.ci.ci_register import register_npu_ci from sglang.test.test_utils import CustomTestCase register_npu_ci( est_time=400, s...
30
817
sglang
test/registered/npu/llm_models/test_npu_afm_4_5b.py
.py
import unittest from sglang.test.ascend.gsm8k_ascend_mixin import GSM8KAscendMixin from sglang.test.ascend.test_ascend_utils import AFM_4_5B_BASE_WEIGHTS_PATH from sglang.test.ci.ci_register import register_npu_ci from sglang.test.test_utils import CustomTestCase register_npu_ci(est_time=400, suite="full-1-npu-a3", n...
24
702
sglang
test/registered/npu/llm_models/test_npu_qwen3_30b_fuseep.py
.py
import os import unittest from sglang.test.ascend.gsm8k_ascend_mixin import GSM8KAscendMixin from sglang.test.ascend.test_ascend_utils import QWEN3_30B_A3B_W8A8_WEIGHTS_PATH from sglang.test.ci.ci_register import register_npu_ci from sglang.test.test_utils import CustomTestCase register_npu_ci(est_time=400, suite="pe...
46
1,220
sglang
test/registered/npu/llm_models/test_npu_qwen3_0_6b.py
.py
import unittest from sglang.test.ascend.gsm8k_ascend_mixin import GSM8KAscendMixin from sglang.test.ascend.test_ascend_utils import QWEN3_0_6B_WEIGHTS_PATH from sglang.test.ci.ci_register import register_npu_ci from sglang.test.test_utils import CustomTestCase register_npu_ci(est_time=400, suite="nightly-1-npu-a3", n...
31
841
sglang
test/registered/npu/llm_models/test_npu_ling_lite.py
.py
import unittest from sglang.test.ascend.gsm8k_ascend_mixin import GSM8KAscendMixin from sglang.test.ascend.test_ascend_utils import LING_LITE_WEIGHTS_PATH from sglang.test.ci.ci_register import register_npu_ci from sglang.test.test_utils import CustomTestCase register_npu_ci(est_time=400, suite="full-2-npu-a3", night...
34
914
sglang
test/registered/npu/llm_models/test_npu_exaone_3.py
.py
import unittest from sglang.test.ascend.gsm8k_ascend_mixin import GSM8KAscendMixin from sglang.test.ascend.test_ascend_utils import EXAONE_3_5_7_8B_INSTRUCT_WEIGHTS_PATH from sglang.test.ci.ci_register import register_npu_ci from sglang.test.test_utils import CustomTestCase register_npu_ci(est_time=400, suite="full-1...
35
1,044
sglang
test/registered/npu/llm_models/test_npu_glm4_9b_chat.py
.py
import unittest from sglang.test.ascend.gsm8k_ascend_mixin import GSM8KAscendMixin from sglang.test.ascend.test_ascend_utils import GLM_4_9B_CHAT_WEIGHTS_PATH from sglang.test.ci.ci_register import register_npu_ci from sglang.test.test_utils import CustomTestCase register_npu_ci( est_time=400, suite="nightly-...
28
723
sglang
test/registered/npu/llm_models/test_npu_llama_2_7b_communications_compression.py
.py
import unittest from sglang.test.ascend.gsm8k_ascend_mixin import GSM8KAscendMixin from sglang.test.ascend.test_ascend_utils import LLAMA_2_7B_WEIGHTS_PATH from sglang.test.ci.ci_register import register_npu_ci from sglang.test.test_utils import CustomTestCase register_npu_ci(est_time=400, suite="nightly-2-npu-a3", n...
38
1,057
sglang
test/registered/npu/llm_models/test_ascend_trinity_mini.py
.py
import unittest from sglang.test.ascend.gsm8k_ascend_mixin import GSM8KAscendMixin from sglang.test.ascend.test_ascend_utils import TRINITY_MINI_WEIGHTS_PATH from sglang.test.ci.ci_register import register_npu_ci from sglang.test.test_utils import CustomTestCase register_npu_ci( est_time=400, suite="nightly-2...
48
1,220
sglang
test/registered/npu/llm_models/test_npu_gemma_3_4b_it_llm.py
.py
import unittest from sglang.test.ascend.gsm8k_ascend_mixin import GSM8KAscendMixin from sglang.test.ascend.test_ascend_utils import GEMMA_3_4B_IT_WEIGHTS_PATH from sglang.test.ci.ci_register import register_npu_ci from sglang.test.test_utils import CustomTestCase register_npu_ci( est_time=400, suite="nightly-...
39
983
sglang
test/registered/npu/llm_models/test_npu_mimo_7b_rl.py
.py
import unittest from sglang.test.ascend.gsm8k_ascend_mixin import GSM8KAscendMixin from sglang.test.ascend.test_ascend_utils import MIMO_7B_RL_WEIGHTS_PATH from sglang.test.ci.ci_register import register_npu_ci from sglang.test.test_utils import CustomTestCase register_npu_ci(est_time=400, suite="full-1-npu-a3", nigh...
24
697
sglang
test/registered/npu/llm_models/test_npu_qwen3_30b_w4a4.py
.py
import unittest from sglang.test.ascend.gsm8k_ascend_mixin import GSM8KAscendMixin from sglang.test.ascend.test_ascend_utils import ( ECO_TECH_QWEN3_30B_A3B_W4A4_LAOS_WEIGHTS_PATH, ) from sglang.test.ci.ci_register import register_npu_ci from sglang.test.test_utils import CustomTestCase register_npu_ci(est_time=4...
38
1,033
sglang
test/registered/npu/llm_models/test_ascend_minimax_m2.py
.py
import unittest from sglang.test.ascend.gsm8k_ascend_mixin import GSM8KAscendMixin from sglang.test.ascend.test_ascend_utils import MINIMAX_M2_WEIGHTS_PATH from sglang.test.ci.ci_register import register_npu_ci from sglang.test.test_utils import CustomTestCase register_npu_ci( est_time=400, suite="nightly-8-n...
45
1,143
sglang
test/registered/npu/llm_models/test_npu_chatglm2_6b.py
.py
import unittest from sglang.test.ascend.gsm8k_ascend_mixin import GSM8KAscendMixin from sglang.test.ascend.test_ascend_utils import CHATGLM2_6B_WEIGHTS_PATH from sglang.test.ci.ci_register import register_npu_ci from sglang.test.test_utils import CustomTestCase register_npu_ci(est_time=400, suite="nightly-1-npu-a3", ...
34
922
sglang
test/registered/npu/llm_models/test_npu_minicpm3_4b.py
.py
import unittest from sglang.test.ascend.gsm8k_ascend_mixin import GSM8KAscendMixin from sglang.test.ascend.test_ascend_utils import MINICPM3_4B_WEIGHTS_PATH from sglang.test.ci.ci_register import register_npu_ci from sglang.test.test_utils import CustomTestCase register_npu_ci(est_time=400, suite="nightly-1-npu-a3", ...
38
1,051
sglang
test/registered/npu/llm_models/test_npu_granite_3_0_3b_a800m.py
.py
import unittest from sglang.test.ascend.gsm8k_ascend_mixin import GSM8KAscendMixin from sglang.test.ascend.test_ascend_utils import ( GRANITE_3_0_3B_A800M_INSTRUCT_WEIGHTS_PATH, ) from sglang.test.ci.ci_register import register_npu_ci from sglang.test.test_utils import CustomTestCase register_npu_ci(est_time=400,...
26
783
sglang
test/registered/npu/llm_models/test_npu_deepseek_v3_2_exp_w8a8.py
.py
import unittest from sglang.test.ascend.gsm8k_ascend_mixin import GSM8KAscendMixin from sglang.test.ascend.test_ascend_utils import DEEPSEEK_V3_2_EXP_W8A8_WEIGHTS_PATH from sglang.test.ci.ci_register import register_npu_ci from sglang.test.test_utils import CustomTestCase register_npu_ci(est_time=400, suite="nightly-...
38
1,089
sglang
test/registered/npu/llm_models/test_npu_llama4_scount_17b_16e.py
.py
import unittest from sglang.test.ascend.gsm8k_ascend_mixin import GSM8KAscendMixin from sglang.test.ascend.test_ascend_utils import ( LLAMA_4_SCOUT_17B_16E_INSTRUCT_WEIGHTS_PATH, ) from sglang.test.ci.ci_register import register_npu_ci from sglang.test.test_utils import CustomTestCase register_npu_ci(est_time=400...
41
1,131
sglang
test/registered/npu/llm_models/test_npu_phi_4_multimodal_llm.py
.py
import unittest from sglang.test.ascend.gsm8k_ascend_mixin import GSM8KAscendMixin from sglang.test.ascend.test_ascend_utils import PHI_4_MULTIMODAL_INSTRUCT_WEIGHTS_PATH from sglang.test.ci.ci_register import register_npu_ci from sglang.test.test_utils import CustomTestCase register_npu_ci(est_time=400, suite="night...
24
752
sglang
test/registered/npu/llm_models/test_npu_llama_2_7b.py
.py
import unittest from sglang.test.ascend.gsm8k_ascend_mixin import GSM8KAscendMixin from sglang.test.ascend.test_ascend_utils import LLAMA_2_7B_WEIGHTS_PATH from sglang.test.ci.ci_register import register_npu_ci from sglang.test.test_utils import CustomTestCase register_npu_ci(est_time=400, suite="nightly-1-npu-a3", n...
24
701
sglang
test/registered/npu/llm_models/test_npu_qwen3_30b.py
.py
import unittest from sglang.test.ascend.gsm8k_ascend_mixin import GSM8KAscendMixin from sglang.test.ascend.test_ascend_utils import ( QWEN3_30B_A3B_INSTRUCT_2507_WEIGHTS_PATH, ) from sglang.test.ci.ci_register import register_npu_ci from sglang.test.test_utils import CustomTestCase register_npu_ci(est_time=400, s...
40
1,076
sglang
test/registered/npu/llm_models/test_npu_grok_2.py
.py
import unittest from sglang.test.ascend.gsm8k_ascend_mixin import GSM8KAscendMixin from sglang.test.ci.ci_register import register_npu_ci from sglang.test.test_utils import CustomTestCase register_npu_ci( est_time=400, suite="full-16-npu-a3", nightly=True, ) class TestGrok2(GSM8KAscendMixin, CustomTestC...
34
824
sglang
test/registered/npu/llm_models/test_npu_qwen3_235b_a22b_w8a8.py
.py
import unittest from sglang.test.ascend.gsm8k_ascend_mixin import GSM8KAscendMixin from sglang.test.ascend.test_ascend_utils import QWEN3_235B_A22B_W8A8_WEIGHTS_PATH from sglang.test.ci.ci_register import register_npu_ci from sglang.test.test_utils import CustomTestCase register_npu_ci(est_time=400, suite="nightly-8-...
37
1,056
sglang
test/registered/npu/llm_models/test_npu_qwen3_32b.py
.py
import unittest from sglang.test.ascend.gsm8k_ascend_mixin import GSM8KAscendMixin from sglang.test.ascend.test_ascend_utils import QWEN3_32B_WEIGHTS_PATH from sglang.test.ci.ci_register import register_npu_ci from sglang.test.test_utils import CustomTestCase register_npu_ci( est_time=400, suite="nightly-4-np...
38
918
sglang
test/registered/npu/llm_models/test_npu_qwen3_8b_communications_quantization.py
.py
import unittest from sglang.test.ascend.gsm8k_ascend_mixin import GSM8KAscendMixin from sglang.test.ascend.test_ascend_utils import QWEN3_8B_WEIGHTS_PATH from sglang.test.ci.ci_register import register_npu_ci from sglang.test.test_utils import CustomTestCase register_npu_ci(est_time=400, suite="nightly-2-npu-a3", nig...
38
1,051
sglang
test/registered/npu/llm_models/test_npu_qwen3_1_7b_gptq_int8.py
.py
import unittest from sglang.test.ascend.gsm8k_ascend_mixin import GSM8KAscendMixin from sglang.test.ascend.test_ascend_utils import QWEN3_1_7B_GPTQ_INT8_WEIGHTS_PATH from sglang.test.ci.ci_register import register_npu_ci from sglang.test.test_utils import CustomTestCase register_npu_ci(est_time=400, suite="per-commit...
33
920
sglang
test/registered/lora/test_lora_qwen3_vl_30b_a3b_instruct_logprob_diff.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...
151
4,993
sglang
test/registered/lora/test_lora_moe_tp_logprob_diff.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...
204
6,934
sglang
test/registered/lora/test_lora_nemotron_3_super_120b_a12b_logprob_diff.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...
152
5,223
sglang
test/registered/lora/test_multi_lora_backend.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...
60
2,044
sglang
test/registered/lora/test_lora_openai_compatible.py
.py
"""End-to-end negative-branch contracts for OpenAI-compatible LoRA routing.""" import unittest import openai 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_SERVE...
109
3,266
sglang
test/registered/lora/test_lora_deepseek_v3_base_logprob_diff.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...
154
5,202
sglang
test/registered/lora/test_fused_moe_lora_kernel.py
.py
# Temporarily adapted from https://github.com/vllm-project/vllm/blob/main/tests/lora/test_fused_moe_lora_kernel.py, will optimize in future refactor import random import sys import pytest import torch from sglang.kernels.ops.moe.fused_moe_lora_kernel import fused_moe_lora # ==========================================...
383
11,228
sglang
test/registered/lora/test_lora_openai_api.py
.py
""" Unit tests for OpenAI-compatible LoRA API support. Tests the model parameter parsing and LoRA adapter resolution logic that enables OpenAI-compatible LoRA adapter selection. """ import unittest from unittest.mock import MagicMock from sglang.srt.entrypoints.openai.serving_base import OpenAIServingBase from sglan...
258
10,351
sglang
test/registered/lora/test_lora_qwen3_5_4b_logprob_diff.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...
144
4,674
sglang
test/registered/lora/test_lora_hf_sgl_logprob_diff.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...
573
19,089
sglang
test/registered/lora/test_lora_overlap_loading.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...
290
11,961
sglang
test/registered/lora/test_moe_lora_info.py
.py
import sys import pytest import torch from sglang.srt.lora.backend.base_backend import _compute_moe_lora_info from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci register_cuda_ci(est_time=5, stage="base-b", runner_config="1-gpu-small") register_amd_ci(est_time=5, stage="stage-b", runner_config="...
89
2,876
sglang
test/registered/lora/test_lora_qwen3_8b_logprob_diff.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...
202
6,458
sglang
test/registered/lora/test_lora_gpt_oss_20b_logprob_diff.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...
147
4,884
sglang
test/registered/lora/test_lora_update.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...
1,559
57,071
sglang
test/registered/lora/test_lora_eviction.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...
149
5,906
sglang
test/registered/lora/test_lora_tp.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...
101
3,294
sglang
test/registered/lora/test_lora_drainer.py
.py
import unittest from types import SimpleNamespace from typing import cast from unittest import mock from sglang.srt.lora.lora_drainer import LoRADrainer from sglang.srt.managers.schedule_batch import Req from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci from sglang.test.lora_utils import ( C...
132
5,311
sglang
test/registered/lora/test_lora_qwen3_30b_a3b_instruct_2507_logprob_diff.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...
148
5,105
sglang
test/registered/lora/test_lora_moe_vllm_sgl_logprob_diff.py
.py
""" Regression test for MoE LoRA parity between SGLang and vLLM. This test compares SGLang's logprobs and output strings against a hardcoded baseline (VLLM_CACHED_RESULTS) generated using vLLM. It enforces strict numerical accuracy by asserting that the maximum and mean logprob divergences do not exceed the reference ...
369
11,420
sglang
test/registered/lora/test_lora_kimi_k25_logprob_diff.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...
148
4,932
sglang
test/registered/lora/test_lora_qwen3_5_35b_a3b_logprob_diff.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...
159
5,306
sglang
test/registered/lora/test_virtual_experts_kernels.py
.py
"""Unit tests for the LoRA virtual-experts kernels under post-EP-dispatch sentinel `topk_ids` (-1) and out-of-range expert IDs. Covers two regression bugs that surface only with `--lora-use-virtual-experts` + `ep_size > 1`: - `_fused_virtual_topk_ids` must preserve negative sentinel topk_ids. After EP dispatch, non...
281
10,458
sglang
test/registered/lora/test_lora_qwen3.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...
44
1,358
sglang
test/registered/lora/test_embedding_lora_support.py
.py
# Copyright 2023-2026 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...
126
4,619
sglang
test/registered/gemm/test_linear_bf16_fp32_hpc.py
.py
"""Numerical tests for the HPC-Ops bf16xfp32 router GEMM path. Validates sglang.kernels.ops.attention.dsv4.linear_bf16_fp32's HPC-Ops branch against the fp32 reference on the LongCat-Flash router shapes. Skipped when HPC-Ops (https://github.com/Tencent/hpc-ops) is not installed or the GPU is not Hopper (the kernels sh...
121
4,803
sglang
test/registered/attention/test_kda_prefill_flashkda.py
.py
"""Correctness test for the FlashKDA prefill backend (safe-gate KDA). Validates ``FlashKDAKernel`` (the external ``flash_kda`` fused CUTLASS kernel) against the production Triton ``chunk_kda`` safe-gate reference. FlashKDA only implements the safe/bounded gate, so this exercises ``lower_bound=-5``. Requires an SM90+ ...
202
7,037
sglang
test/registered/attention/test_triton_sliding_window.py
.py
import unittest from types import SimpleNamespace 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.run_eval import run_eval from sglang.test.test_utils import ( DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH, DEFAULT_UR...
134
4,362
sglang
test/registered/attention/test_trtllm_mha_page_table.py
.py
"""Unit test for the device-side page-table build used by trtllm_mha. trtllm_mha builds its CUDA-graph block table on-device from ``seq_lens`` (via ``create_trtllm_mha_kv_indices_triton``) instead of a host-max PyTorch gather, so it never reads a runtime max (no D2H sync). This test checks the device build is bit-iden...
231
9,224
sglang
test/registered/attention/test_chunk_gated_delta_rule.py
.py
import unittest import torch from sglang.kernels.ops.attention.fla.chunk import chunk_gated_delta_rule from sglang.kernels.ops.attention.fla.fused_recurrent import ( fused_recurrent_gated_delta_rule, ) from sglang.srt.utils import get_device, is_hip from sglang.test.ci.ci_register import ( register_amd_ci, ...
300
10,606
sglang
test/registered/attention/test_create_kvindices.py
.py
import unittest import numpy as np import torch from sglang.kernels.ops.attention.utils import create_flashinfer_kv_indices_triton from sglang.srt.utils import get_device from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci from sglang.test.test_utils import CustomTestCase # Triton kernel unit te...
81
2,594
sglang
test/registered/attention/test_triton_attention_kernels.py
.py
import random import unittest import torch import torch.nn.functional as F from sglang.kernels.ops.attention.decode_attention import ( decode_attention_fwd, decode_attention_fwd_grouped, decode_attention_fwd_normal, ) from sglang.kernels.ops.attention.extend_attention import ( _compact_extend_q_tiles_...
1,135
41,975
sglang
test/registered/attention/test_torch_native_attention_backend.py
.py
""" Usage: python3 -m unittest test_torch_native_attention_backend.TestTorchNativeAttnBackend.test_mmlu """ import unittest from types import SimpleNamespace from sglang.srt.utils import kill_process_tree from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci from sglang.test.run_eval import run_eva...
53
1,520
sglang
test/registered/attention/test_fused_fp8_kv_write.py
.py
"""Accuracy and dispatch tests for the fused bf16->fp8 KV-cache write on the standard aiter FP8 path. Skipped on CPU (Triton requires a GPU).""" import unittest import torch from sglang.test.ci.ci_register import register_amd_ci register_amd_ci(est_time=30, suite="stage-b-test-1-gpu-small-amd") _HAS_CUDA = torch.c...
438
16,089
sglang
test/registered/attention/test_normal_decode_set_metadata.py
.py
""" Unit tests for the fused Triton kernel in normal_decode_set_metadata. This test suite verifies: 1. Correctness against reference PyTorch implementation 2. Different page sizes (1, 16, 64) 3. With and without Sliding Window Attention (SWA) 4. Various batch sizes and sequence lengths 5. Edge cases """ import unitte...
459
16,727
sglang
test/registered/attention/test_qwen35_deterministic.py
.py
""" Usage: cd test/srt python3 -m unittest test_qwen35_deterministic.TestQwen35Fa3Deterministic """ import unittest from sglang.test.ci.ci_register import register_cuda_ci from sglang.test.test_deterministic_utils import ( COMMON_SERVER_ARGS, TestDeterministicBase, ) register_cuda_ci(est_time=360, stage="ext...
45
1,021
sglang
test/registered/attention/test_deepseek_v3_deterministic.py
.py
""" Usage: cd test/srt python3 -m unittest test_deepseek_v3_deterministic.TestFa3Deterministic """ import unittest from sglang.test.ci.ci_register import register_cuda_ci from sglang.test.test_deterministic_utils import ( COMMON_SERVER_ARGS, TestDeterministicBase, ) register_cuda_ci(est_time=240, stage="nigh...
58
1,229
sglang
test/registered/attention/test_deterministic.py
.py
""" Usage: cd test/srt python3 -m unittest test_deterministic.TestDeterministic.TESTCASE Note that there is also `python/sglang/test/test_deterministic.py` as an interactive test. We are converting that test into unit tests so that's easily reproducible in CI. """ import unittest from sglang.test.ci.ci_register impo...
69
1,778
sglang
test/registered/attention/test_glm4_moe_lite_deterministic.py
.py
"""Deterministic inference for GLM-4.7-Flash (Glm4MoeLiteForCausalLM) on Blackwell. Two entry paths matter. The fa4 backend is what this model needs for deterministic absorbed MLA, and the unspecified-backend path has to reach triton through the absorbed-MLA arch probe instead of the flashinfer default that every non-...
69
2,055
sglang
test/registered/attention/test_verify_shared_kv.py
.py
"""Correctness tests for grouped-head target-verify attention.""" import unittest from types import SimpleNamespace from unittest.mock import patch import torch from sglang.kernels.ops.attention.extend_attention import extend_attention_fwd from sglang.kernels.ops.attention.verify_mla import verify_shared_kv_fwd from...
236
7,245
sglang
test/registered/attention/test_unified_memory_deterministic.py
.py
"""Deterministic inference on the unified memory pool (virtual-id KV). `--enable-deterministic-inference` routes Triton extend through `TritonAttnBackend._forward_extend_unified`, a 1-stage kernel that reads BOTH the prefix and the extend half of the KV out of the pool -- unlike the default 2-stage path, which takes t...
119
4,038
sglang
test/registered/attention/test_kda_kernels.py
.py
import unittest import torch from sglang.kernels.ops.attention.fla.cumsum import chunk_local_cumsum from sglang.kernels.ops.attention.fla.fused_recurrent import ( fused_recurrent_kda_packed_decode, ) from sglang.kernels.ops.attention.fla.fused_sigmoid_gating_recurrent import ( fused_sigmoid_gating_delta_rule_...
592
21,860
sglang
test/registered/attention/test_trtllm_mha_encoder_only.py
.py
"""Verify-window semantics of trtllm-gen for ENCODER_ONLY layers. Two pins against a paged SDPA reference: the spec-decode call (``q_len_per_req = L``) is causal inside the window (wrong for ENCODER_ONLY layers, which need bidirectional attention), and the expanded formulation (bs*L single-token rows, kv length = pref...
150
5,677
sglang
test/registered/attention/test_gdn_prefill_cutedsl.py
.py
"""Correctness test for the SM100 CuTe DSL GDN prefill kernel. Ported from vLLM PR https://github.com/vllm-project/vllm/pull/43273. Validates ``chunk_gated_delta_rule_cutedsl`` against the ``fused_recurrent_gated_delta_rule`` Triton reference. """ import math import pytest import torch import torch.nn.functional as ...
290
9,859
sglang
test/registered/attention/test_gdn_noncontiguous_stride.py
.py
""" Tests that fused_gdn_gating and fused_sigmoid_gating_delta_rule_update produce correct results when a/b inputs are non-contiguous, as happens with Qwen3.5-27B (v_per_group=3) via mixed_ba.split(). """ import unittest import torch from sglang.kernels.ops.attention.fla.fused_gdn_gating import fused_gdn_gating from...
257
9,512
sglang
test/registered/attention/test_trtllm_mha_graph_metadata.py
.py
"""Correctness tests for the fused TRTLLM-MHA cuda-graph metadata kernel. Validates the single-launch triton kernel against a pure-aten reference that mirrors the exact semantics of the triton port: cache_seqlens / cu_seqlens_k / cu_seqlens_q (all 3 q-modes) / page_table / swa_page_table / swa_out_cache_loc, with the ...
563
20,875
sglang
test/registered/attention/test_hybrid_attn_backend.py
.py
import unittest from sglang.test.ci.ci_register import register_cuda_ci from sglang.test.server_fixtures.hybrid_attn_backend_fixture import ( TestHybridAttnBackendBase, ) from sglang.test.test_utils import ( DEFAULT_DRAFT_MODEL_EAGLE, DEFAULT_MODEL_NAME_FOR_TEST_MLA, ) # Hybrid attention backend tests (FA...
69
2,020
sglang
test/registered/attention/test_gemma4_swa_triton_oob_regression.py
.py
"""Regression test for issue #24394. `--enable-deterministic-inference` with `--attention-backend triton` on a hybrid `SWAKVPool` model (Gemma4 family) used to crash with `CUDA error: an illegal memory access` inside `_fwd_kernel_unified`: the unified extend kernel read the new tokens at `out_cache_loc` (full-pool ind...
125
3,991
sglang
test/registered/attention/test_kda_prefill_cutedsl.py
.py
"""Correctness test for the SM100 CuTe DSL KDA prefill pipeline. Validates ``chunk_kda_cutedsl`` (the ``kda_blackwell`` package: fused Triton prologue -> kkt_inv_uw -> h -> o) against the token-by-token ``fused_recurrent_kda`` Triton reference. Mirrors ``test_gdn_prefill_cutedsl.py``. KDA differs from GDN by a PER-CH...
300
11,508
sglang
test/registered/attention/test_kda_decode_flashinfer.py
.py
"""Correctness tests for the FlashInfer SM100 KDA decode + MTP backend. Compares ``FlashInferKDAKernel`` with the Triton KDA reference for decode output, state updates, and topk=1 target_verify checkpoints. ``recurrent_kda`` is SM100-only and requires a FlashInfer build that exposes it. """ import pytest import torch...
287
11,004