run_suite.py 3.64 KB
Newer Older
1
2
3
4
5
6
import argparse
import glob

from sglang.test.test_utils import run_unittest_files

suites = {
7
    "per-commit": [
8
9
10
        "models/lora/test_lora.py",
        "models/lora/test_lora_backend.py",
        "models/lora/test_multi_lora_backend.py",
11
        "models/test_embedding_models.py",
Mingyi's avatar
Mingyi committed
12
        "models/test_generation_models.py",
Ke Bao's avatar
Ke Bao committed
13
        "models/test_qwen_models.py",
14
        "models/test_reward_models.py",
15
        "sampling/penaltylib",
16
        "test_abort.py",
17
        "test_chunked_prefill.py",
18
        "test_custom_allreduce.py",
Shuo Yang's avatar
Shuo Yang committed
19
        "test_double_sparsity.py",
20
        "test_eagle_infer.py",
21
        "test_embedding_openai_server.py",
22
        "test_eval_accuracy_mini.py",
23
        "test_gguf.py",
Rin Intachuen's avatar
Rin Intachuen committed
24
        "test_input_embeddings.py",
Yineng Zhang's avatar
Yineng Zhang committed
25
        "test_mla.py",
26
        "test_mla_flashinfer.py",
Yineng Zhang's avatar
Yineng Zhang committed
27
        "test_mla_fp8.py",
28
        "test_json_constrained.py",
29
        "test_large_max_new_tokens.py",
Lianmin Zheng's avatar
Lianmin Zheng committed
30
        "test_metrics.py",
31
32
        "test_no_chunked_prefill.py",
        "test_no_overlap_scheduler.py",
Ying Sheng's avatar
Ying Sheng committed
33
        "test_openai_server.py",
34
        "test_pytorch_sampling_backend.py",
35
        "test_radix_attention.py",
36
        "test_regex_constrained.py",
37
        "test_release_memory_occupation.py",
38
        "test_request_length_validation.py",
39
        "test_retract_decode.py",
40
        "test_server_args.py",
Lianmin Zheng's avatar
Lianmin Zheng committed
41
        "test_session_control.py",
42
        "test_skip_tokenizer_init.py",
43
        "test_srt_engine.py",
44
        "test_srt_endpoint.py",
45
        "test_torch_compile.py",
46
        "test_torch_compile_moe.py",
47
        "test_torch_native_attention_backend.py",
48
        "test_torchao.py",
Ke Bao's avatar
Ke Bao committed
49
50
        "test_triton_attention_kernels.py",
        "test_triton_attention_backend.py",
51
        "test_hidden_states.py",
52
        "test_update_weights_from_disk.py",
53
        "test_update_weights_from_tensor.py",
54
        "test_vertex_endpoint.py",
55
        "test_vision_chunked_prefill.py",
56
        "test_vision_llm.py",
57
        "test_vision_openai_server.py",
58
        "test_w8a8_quantization.py",
59
        "test_fp8_kernel.py",
60
        "test_block_int8.py",
61
    ],
62
63
    "nightly": [
        "test_nightly_gsm8k_eval.py",
64
        # Disable temporarily
65
        # "test_nightly_math_eval.py",
66
    ],
67
68
69
    "sampling/penaltylib": glob.glob(
        "sampling/penaltylib/**/test_*.py", recursive=True
    ),
70
71
}

72
# Expand suite
73
74
75
76
77
78
79
for target_suite_name, target_tests in suites.items():
    for suite_name, tests in suites.items():
        if suite_name == target_suite_name:
            continue
        if target_suite_name in tests:
            tests.remove(target_suite_name)
            tests.extend(target_tests)
80
81
82
83
84
85

if __name__ == "__main__":
    arg_parser = argparse.ArgumentParser()
    arg_parser.add_argument(
        "--timeout-per-file",
        type=int,
86
        default=2000,
87
88
89
90
91
92
93
94
95
        help="The time limit for running one file in seconds.",
    )
    arg_parser.add_argument(
        "--suite",
        type=str,
        default=list(suites.keys())[0],
        choices=list(suites.keys()) + ["all"],
        help="The suite to run",
    )
96
97
98
99
100
101
102
103
104
105
106
107
    arg_parser.add_argument(
        "--range-begin",
        type=int,
        default=0,
        help="The begin index of the range of the files to run.",
    )
    arg_parser.add_argument(
        "--range-end",
        type=int,
        default=None,
        help="The end index of the range of the files to run.",
    )
108
109
110
111
112
113
114
    args = arg_parser.parse_args()

    if args.suite == "all":
        files = glob.glob("**/test_*.py", recursive=True)
    else:
        files = suites[args.suite]

115
116
    files = files[args.range_begin : args.range_end]

Lianmin Zheng's avatar
Lianmin Zheng committed
117
    print(f"{args=}")
118
119
    print("The running tests are ", files)

120
121
    exit_code = run_unittest_files(files, args.timeout_per_file)
    exit(exit_code)