From 9766e3b149a5c8a71de7aee98335e132775fa151 Mon Sep 17 00:00:00 2001 From: yewentao256 Date: Thu, 6 Nov 2025 08:03:31 -0800 Subject: [PATCH 1/2] Default `ignore_eos` True when `random_output_len` is set Signed-off-by: yewentao256 --- vllm/benchmarks/serve.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/vllm/benchmarks/serve.py b/vllm/benchmarks/serve.py index b8f44966db7a..ac638821f65a 100644 --- a/vllm/benchmarks/serve.py +++ b/vllm/benchmarks/serve.py @@ -1359,6 +1359,15 @@ async def main_async(args: argparse.Namespace) -> dict[str, Any]: "'--dataset-path' if required." ) + # when using an explicit output length, default to ignoring EOS + # so generation runs to the requested length + if ( + args.dataset_name in ("random", "random-mm") + and getattr(args, "random_output_len", None) is not None + and args.backend in OPENAI_COMPATIBLE_BACKENDS + ): + args.ignore_eos = True + # Load the dataset. input_requests = get_samples(args, tokenizer) goodput_config_dict = check_goodput_args(args) From 7faa898b0fd23fada7b532c4651076b0ba41e6d2 Mon Sep 17 00:00:00 2001 From: yewentao256 Date: Thu, 6 Nov 2025 08:21:33 -0800 Subject: [PATCH 2/2] update Signed-off-by: yewentao256 --- vllm/benchmarks/serve.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/vllm/benchmarks/serve.py b/vllm/benchmarks/serve.py index ac638821f65a..e58cf5911282 100644 --- a/vllm/benchmarks/serve.py +++ b/vllm/benchmarks/serve.py @@ -1359,11 +1359,10 @@ async def main_async(args: argparse.Namespace) -> dict[str, Any]: "'--dataset-path' if required." ) - # when using an explicit output length, default to ignoring EOS + # when using random datasets, default to ignoring EOS # so generation runs to the requested length if ( args.dataset_name in ("random", "random-mm") - and getattr(args, "random_output_len", None) is not None and args.backend in OPENAI_COMPATIBLE_BACKENDS ): args.ignore_eos = True