Skip to content

Commit 51a034a

Browse files
mgoinLeiWang1999
authored andcommitted
[Misc] Separate total and output tokens in benchmark_throughput.py (vllm-project#8914)
Signed-off-by: LeiWang1999 <leiwang1999@outlook.com>
1 parent 07c8db3 commit 51a034a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

benchmarks/benchmark_throughput.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,10 @@ def main(args: argparse.Namespace):
272272
raise ValueError(f"Unknown backend: {args.backend}")
273273
total_num_tokens = sum(prompt_len + output_len
274274
for _, prompt_len, output_len in requests)
275+
total_output_tokens = sum(output_len for _, _, output_len in requests)
275276
print(f"Throughput: {len(requests) / elapsed_time:.2f} requests/s, "
276-
f"{total_num_tokens / elapsed_time:.2f} tokens/s")
277+
f"{total_num_tokens / elapsed_time:.2f} total tokens/s, "
278+
f"{total_output_tokens / elapsed_time:.2f} output tokens/s")
277279

278280
# Output JSON results if specified
279281
if args.output_json:

0 commit comments

Comments
 (0)