Skip to content

Commit 343fb58

Browse files
fzyzcjytarinkk
authored andcommitted
Fix bench_serving fail when zero warmup requests (sgl-project#5574)
1 parent a2dcee2 commit 343fb58

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

python/sglang/bench_serving.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,6 @@ def sample_random_requests(
690690
dataset_path: str,
691691
random_sample: bool = True,
692692
) -> List[Tuple[str, int, int]]:
693-
694693
input_lens = np.random.randint(
695694
max(int(input_len * range_ratio), 1),
696695
input_len + 1,
@@ -1025,7 +1024,9 @@ async def limited_request_func(request_func_input, pbar):
10251024
warmup_outputs = await asyncio.gather(*warmup_tasks)
10261025

10271026
# Check if at least one warmup request succeeded
1028-
if not any(output.success for output in warmup_outputs):
1027+
if args.warmup_requests > 0 and not any(
1028+
output.success for output in warmup_outputs
1029+
):
10291030
raise ValueError(
10301031
"Warmup failed - Please make sure benchmark arguments "
10311032
f"are correctly specified. Error: {warmup_outputs[0].error}"

0 commit comments

Comments
 (0)