Skip to content

Commit

Permalink
Fix float division by zero in benchmark (#62)
Browse files Browse the repository at this point in the history
* Fix float division by zero in benchmark

* Fix format
  • Loading branch information
FanhaiLu1 authored Apr 25, 2024
1 parent a7b4ef3 commit 7805b5d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions benchmarks/benchmark_serving.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,12 @@ def calculate_metrics(
)
total_output += output_len
total_input += input_requests[i].prompt_len
if output_len == 0:
print(
f"""-------- output_len is zero for {i}th request:,
output: {outputs[i]}"""
)
continue
per_token_latencies.append(outputs[i].latency / output_len)
ttfts.append(outputs[i].ttft)
completed += 1
Expand Down

0 comments on commit 7805b5d

Please sign in to comment.