Skip to content

Commit d5a66d6

Browse files
authored
Separate total and output tokens in benchmark_throughput.py
1 parent c5d5535 commit d5a66d6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

benchmarks/benchmark_throughput.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,8 +364,11 @@ def main(args: argparse.Namespace):
364364
raise ValueError(f"Unknown backend: {args.backend}")
365365
total_num_tokens = sum(prompt_len + output_len
366366
for _, prompt_len, output_len in requests)
367+
total_output_tokens = sum(output_len
368+
for _, _, output_len in requests)
367369
print(f"Throughput: {len(requests) / elapsed_time:.2f} requests/s, "
368-
f"{total_num_tokens / elapsed_time:.2f} tokens/s")
370+
f"{total_num_tokens / elapsed_time:.2f} total tokens/s, "
371+
f"{total_output_tokens / elapsed_time:.2f} output tokens/s")
369372

370373
# Output JSON results if specified
371374
if args.output_json:

0 commit comments

Comments
 (0)