"docs/source/vscode:/vscode.git/clone" did not exist on "6133cecdaed0ba3df8f03e6ba6f2cc1800a787b2"
Unverified Commit 9924bbe1 authored by fzyzcjy's avatar fzyzcjy Committed by GitHub
Browse files

Fix bench_serving fail when zero warmup requests (#5574)

parent fbdc94ba
...@@ -690,7 +690,6 @@ def sample_random_requests( ...@@ -690,7 +690,6 @@ def sample_random_requests(
dataset_path: str, dataset_path: str,
random_sample: bool = True, random_sample: bool = True,
) -> List[Tuple[str, int, int]]: ) -> List[Tuple[str, int, int]]:
input_lens = np.random.randint( input_lens = np.random.randint(
max(int(input_len * range_ratio), 1), max(int(input_len * range_ratio), 1),
input_len + 1, input_len + 1,
...@@ -1025,7 +1024,9 @@ async def benchmark( ...@@ -1025,7 +1024,9 @@ async def benchmark(
warmup_outputs = await asyncio.gather(*warmup_tasks) warmup_outputs = await asyncio.gather(*warmup_tasks)
# Check if at least one warmup request succeeded # Check if at least one warmup request succeeded
if not any(output.success for output in warmup_outputs): if args.warmup_requests > 0 and not any(
output.success for output in warmup_outputs
):
raise ValueError( raise ValueError(
"Warmup failed - Please make sure benchmark arguments " "Warmup failed - Please make sure benchmark arguments "
f"are correctly specified. Error: {warmup_outputs[0].error}" f"are correctly specified. Error: {warmup_outputs[0].error}"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment