Skip to content

Commit

Permalink
[Misc] Separate total and output tokens in benchmark_throughput.py (v…
Browse files Browse the repository at this point in the history
  • Loading branch information
mgoin authored Oct 23, 2024
1 parent e5ac6a4 commit fd0e2cf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion benchmarks/benchmark_throughput.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,10 @@ def main(args: argparse.Namespace):
raise ValueError(f"Unknown backend: {args.backend}")
total_num_tokens = sum(prompt_len + output_len
for _, prompt_len, output_len in requests)
total_output_tokens = sum(output_len for _, _, output_len in requests)
print(f"Throughput: {len(requests) / elapsed_time:.2f} requests/s, "
f"{total_num_tokens / elapsed_time:.2f} tokens/s")
f"{total_num_tokens / elapsed_time:.2f} total tokens/s, "
f"{total_output_tokens / elapsed_time:.2f} output tokens/s")

# Output JSON results if specified
if args.output_json:
Expand Down

0 comments on commit fd0e2cf

Please sign in to comment.