[Bugfix] Fix benchmark script bug: inaccurate stats for vllm backend when max_model_len < input_len + output_len (#13691)

Signed-off-by: WangErXiao <863579016@qq.com>
This commit is contained in:
Robin
2025-02-22 14:10:38 +08:00
committed by GitHub
parent 95c617e04b
commit 8aca27fa11
4 changed files with 43 additions and 5 deletions
+4
View File
@@ -42,6 +42,10 @@ def main(args: argparse.Namespace):
# NOTE(woosuk): If the request cannot be processed in a single batch,
# the engine will automatically process the request in multiple batches.
llm = LLM(**dataclasses.asdict(engine_args))
assert llm.llm_engine.model_config.max_model_len >= (
args.input_len + args.output_len), (
"Please ensure that max_model_len is greater than"
" the sum of input_len and output_len.")
sampling_params = SamplingParams(
n=args.n,