Skip to content

Commit 00a210d

Browse files
committed
Plumb output changes though progress and summary
1 parent 93f0fd1 commit 00a210d

File tree

4 files changed

+42
-42
lines changed

4 files changed

+42
-42
lines changed

src/guidellm/benchmark/benchmark.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ class Benchmark(StandardBaseModel):
277277
Specific benchmarker implementations should extend this model to include
278278
additional information or metadata as needed.
279279
280-
Note, requests_per_second and requests_concurrency are kept at this level
280+
Note, requests_per_second and request_concurrency are kept at this level
281281
and are expected to be populated by the subclass implementation to ensure
282282
the logic for Profiles can include more complicated logic for determining
283283
what rates and concurrency values to use for subsequent strategies.

src/guidellm/benchmark/benchmarker.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,8 @@ async def run(
235235

236236
benchmark: BENCH = aggregator.compile()
237237
profile.completed_strategy(
238-
average_rate=benchmark.requests_per_second.successful.mean,
239-
average_concurrency=benchmark.requests_concurrency.successful.mean,
238+
average_rate=benchmark.metrics.requests_per_second.successful.mean,
239+
average_concurrency=benchmark.metrics.request_concurrency.successful.mean,
240240
)
241241

242242
yield BenchmarkerResult(

src/guidellm/benchmark/output.py

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -258,29 +258,29 @@ def print_benchmarks_info(self):
258258
f"{datetime.fromtimestamp(benchmark.end_time).strftime("%H:%M:%S")}",
259259
f"{(benchmark.end_time - benchmark.start_time):.1f}",
260260
(
261-
f"{benchmark.successful_total:>5} / "
262-
f"{benchmark.incomplete_total} / "
263-
f"{benchmark.errored_total}"
261+
f"{benchmark.total_count.successful:>5} / "
262+
f"{benchmark.total_count.incomplete} / "
263+
f"{benchmark.total_count.errored}"
264264
),
265265
(
266-
f"{benchmark.prompt_token_count.successful.mean:>5.1f} / "
267-
f"{benchmark.prompt_token_count.incomplete.mean:.1f} / "
268-
f"{benchmark.prompt_token_count.errored.mean:.1f}"
266+
f"{benchmark.metrics.prompt_token_count.successful.mean:>5.1f} / "
267+
f"{benchmark.metrics.prompt_token_count.incomplete.mean:.1f} / "
268+
f"{benchmark.metrics.prompt_token_count.errored.mean:.1f}"
269269
),
270270
(
271-
f"{benchmark.output_token_count.successful.mean:>5.1f} / "
272-
f"{benchmark.output_token_count.incomplete.mean:.1f} / "
273-
f"{benchmark.output_token_count.errored.mean:.1f}"
271+
f"{benchmark.metrics.output_token_count.successful.mean:>5.1f} / "
272+
f"{benchmark.metrics.output_token_count.incomplete.mean:.1f} / "
273+
f"{benchmark.metrics.output_token_count.errored.mean:.1f}"
274274
),
275275
(
276-
f"{benchmark.prompt_token_count.successful.total_sum:>6.0f} / "
277-
f"{benchmark.prompt_token_count.incomplete.total_sum:.0f} / "
278-
f"{benchmark.prompt_token_count.errored.total_sum:.0f}"
276+
f"{benchmark.metrics.prompt_token_count.successful.total_sum:>6.0f} / "
277+
f"{benchmark.metrics.prompt_token_count.incomplete.total_sum:.0f} / "
278+
f"{benchmark.metrics.prompt_token_count.errored.total_sum:.0f}"
279279
),
280280
(
281-
f"{benchmark.output_token_count.successful.total_sum:>6.0f} / "
282-
f"{benchmark.output_token_count.incomplete.total_sum:.0f} / "
283-
f"{benchmark.output_token_count.errored.total_sum:.0f}"
281+
f"{benchmark.metrics.output_token_count.successful.total_sum:>6.0f} / "
282+
f"{benchmark.metrics.output_token_count.incomplete.total_sum:.0f} / "
283+
f"{benchmark.metrics.output_token_count.errored.total_sum:.0f}"
284284
),
285285
]
286286
)
@@ -313,29 +313,29 @@ def print_benchmarks_stats(self):
313313
rows.append(
314314
[
315315
strategy_display_str(benchmark.args.strategy),
316-
f"{benchmark.requests_per_second.successful.mean:.2f}",
317-
f"{benchmark.requests_concurrency.successful.mean:.2f}",
318-
f"{benchmark.output_tokens_per_second.total.mean:.1f}",
319-
f"{benchmark.tokens_per_second.total.mean:.1f}",
316+
f"{benchmark.metrics.requests_per_second.successful.mean:.2f}",
317+
f"{benchmark.metrics.request_concurrency.successful.mean:.2f}",
318+
f"{benchmark.metrics.output_tokens_per_second.total.mean:.1f}",
319+
f"{benchmark.metrics.tokens_per_second.total.mean:.1f}",
320320
(
321-
f"{benchmark.request_latency.successful.mean:.2f} / "
322-
f"{benchmark.request_latency.successful.median:.2f} / "
323-
f"{benchmark.request_latency.successful.percentiles.p99:.2f}"
321+
f"{benchmark.metrics.request_latency.successful.mean:.2f} / "
322+
f"{benchmark.metrics.request_latency.successful.median:.2f} / "
323+
f"{benchmark.metrics.request_latency.successful.percentiles.p99:.2f}"
324324
),
325325
(
326-
f"{benchmark.time_to_first_token_ms.successful.mean:.1f} / "
327-
f"{benchmark.time_to_first_token_ms.successful.median:.1f} / "
328-
f"{benchmark.time_to_first_token_ms.successful.percentiles.p99:.1f}"
326+
f"{benchmark.metrics.time_to_first_token_ms.successful.mean:.1f} / "
327+
f"{benchmark.metrics.time_to_first_token_ms.successful.median:.1f} / "
328+
f"{benchmark.metrics.time_to_first_token_ms.successful.percentiles.p99:.1f}"
329329
),
330330
(
331-
f"{benchmark.inter_token_latency_ms.successful.mean:.1f} / "
332-
f"{benchmark.inter_token_latency_ms.successful.median:.1f} / "
333-
f"{benchmark.inter_token_latency_ms.successful.percentiles.p99:.1f}"
331+
f"{benchmark.metrics.inter_token_latency_ms.successful.mean:.1f} / "
332+
f"{benchmark.metrics.inter_token_latency_ms.successful.median:.1f} / "
333+
f"{benchmark.metrics.inter_token_latency_ms.successful.percentiles.p99:.1f}"
334334
),
335335
(
336-
f"{benchmark.time_per_output_token_ms.successful.mean:.1f} / "
337-
f"{benchmark.time_per_output_token_ms.successful.median:.1f} / "
338-
f"{benchmark.time_per_output_token_ms.successful.percentiles.p99:.1f}"
336+
f"{benchmark.metrics.time_per_output_token_ms.successful.mean:.1f} / "
337+
f"{benchmark.metrics.time_per_output_token_ms.successful.median:.1f} / "
338+
f"{benchmark.metrics.time_per_output_token_ms.successful.percentiles.p99:.1f}"
339339
),
340340
]
341341
)

src/guidellm/benchmark/progress.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -553,10 +553,10 @@ def handle_update_benchmark_compiled(
553553
progress_state.compiling = False
554554
progress_state.ended = True
555555
progress_state.requests_rate = (
556-
current_benchmark.requests_per_second.successful.mean
556+
current_benchmark.metric.requests_per_second.successful.mean
557557
)
558558
progress_state.requests_processing = (
559-
current_benchmark.requests_concurrency.successful.mean
559+
current_benchmark.metric.requests_concurrency.successful.mean
560560
)
561561

562562
def handle_end(self, result: BenchmarkerResult): # noqa: ARG002
@@ -647,22 +647,22 @@ def handle_update_benchmark_compiled(
647647
progress_state.requests_successful = current_benchmark.successful_total
648648
progress_state.requests_errored = current_benchmark.errored_total
649649
progress_state.output_tokens = (
650-
current_benchmark.output_token_count.successful.mean
650+
current_benchmark.metric.output_token_count.successful.mean
651651
)
652652
progress_state.prompt_tokens = (
653-
current_benchmark.prompt_token_count.successful.mean
653+
current_benchmark.metric.prompt_token_count.successful.mean
654654
)
655655
progress_state.output_tokens_rate = (
656-
current_benchmark.output_tokens_per_second.successful.mean
656+
current_benchmark.metric.output_tokens_per_second.successful.mean
657657
)
658658
progress_state.total_tokens_rate = (
659-
current_benchmark.tokens_per_second.successful.mean
659+
current_benchmark.metric.tokens_per_second.successful.mean
660660
)
661661
progress_state.tokens_ttft = (
662-
current_benchmark.time_to_first_token_ms.successful.mean
662+
current_benchmark.metric.time_to_first_token_ms.successful.mean
663663
)
664664
progress_state.tokens_itl = (
665-
current_benchmark.inter_token_latency_ms.successful.mean
665+
current_benchmark.metric.inter_token_latency_ms.successful.mean
666666
)
667667

668668
def create_task_progress_state(

0 commit comments

Comments
 (0)