Skip to content

Commit 7805b5d

Browse files
authored
Fix float division by zero in benchmark (#62)
* Fix float division by zero in benchmark * Fix format
1 parent a7b4ef3 commit 7805b5d

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

benchmarks/benchmark_serving.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,12 @@ def calculate_metrics(
338338
)
339339
total_output += output_len
340340
total_input += input_requests[i].prompt_len
341+
if output_len == 0:
342+
print(
343+
f"""-------- output_len is zero for {i}th request:,
344+
output: {outputs[i]}"""
345+
)
346+
continue
341347
per_token_latencies.append(outputs[i].latency / output_len)
342348
ttfts.append(outputs[i].ttft)
343349
completed += 1

0 commit comments

Comments
 (0)