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
…llm-project#8914)

Signed-off-by: Sumit Dubey <[email protected]>
  • Loading branch information
mgoin authored and sumitd2 committed Nov 14, 2024
1 parent 9a666f4 commit 3035c04
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 3035c04

Please sign in to comment.