Skip to content

Commit b46a4d9

Browse files
committed
Merge branch 'sysinfov2' of https://github.com/mlcommons/mlperf-automations into sysinfov2
2 parents f64a52a + f1fd6b9 commit b46a4d9

1 file changed

Lines changed: 22 additions & 2 deletions

File tree

  • script/get-mlperf-serving-config

script/get-mlperf-serving-config/parse.py

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
_VLLM_PATTERNS: list[tuple[str, str]] = [
2323
("tensor_parallel", r"tensor_parallel_size\s*[=:]\s*'?(\d+)"),
2424
("pipeline_parallel", r"pipeline_parallel_size\s*[=:]\s*'?(\d+)"),
25-
("expert_parallel", r"expert_parallel_size\s*[=:]\s*'?(\d+)"),
26-
("batch", r"max_num_seqs\s*[=:]\s*'?(\d+)"),
25+
("expert_parallel", r"expert_parallel_size\s*[=:]\s*'?(\d+)"),
26+
("batch", r"max_num_seqs\s*[=:]\s*'?(\d+)"),
2727
]
2828

2929
# SGLang patterns match the server_args=ServerArgs(...) startup line.
@@ -36,6 +36,26 @@
3636
]
3737

3838

39+
def _choose_patterns(text: str, serving_framework: str) -> list[tuple[str, str]]:
40+
if serving_framework == "vllm":
41+
return _VLLM_PATTERNS
42+
if serving_framework == "sglang":
43+
return _SGLANG_PATTERNS
44+
# auto: detect from log keywords
45+
if re.search(r"(?i)sglang", text):
46+
return _SGLANG_PATTERNS
47+
return _VLLM_PATTERNS
48+
49+
# SGLang patterns match the server_args=ServerArgs(...) startup line.
50+
# max_running_requests=None does not match \d+, so batch stays null when unlimited.
51+
_SGLANG_PATTERNS: list[tuple[str, str]] = [
52+
("tensor_parallel", r"tp_size=(\d+)"),
53+
("pipeline_parallel", r"pp_size=(\d+)"),
54+
("expert_parallel", r"ep_size=(\d+)"),
55+
("batch", r"max_running_requests=(\d+)"),
56+
]
57+
58+
3959
def _choose_patterns(text: str, serving_framework: str) -> list[tuple[str, str]]:
4060
if serving_framework == "vllm":
4161
return _VLLM_PATTERNS

0 commit comments

Comments
 (0)