Skip to content

Commit 8989f9c

Browse files
committed
Fix: Resolve CSV output generation failure in benchmarks
Signed-off-by: xinjun.jiang <[email protected]>
1 parent 2cbb7c9 commit 8989f9c

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

src/guidellm/benchmark/benchmarker.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ async def run(
5757
backend: BackendInterface[RequestT, ResponseT],
5858
profile: Profile,
5959
environment: Environment,
60+
data: list[Any],
6061
progress: BenchmarkerProgress[BenchmarkT] | None = None,
6162
sample_requests: int | None = 20,
6263
warmup: float | None = None,
@@ -149,6 +150,7 @@ async def run(
149150
environment=environment,
150151
strategy=strategy,
151152
constraints=constraints,
153+
data=data,
152154
)
153155
if progress:
154156
await progress.on_benchmark_complete(benchmark)

src/guidellm/benchmark/entrypoints.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,7 @@ async def benchmark_generative_text(
436436
backend=backend,
437437
profile=profile,
438438
environment=NonDistributedEnvironment(),
439+
data=args.data,
439440
progress=progress,
440441
sample_requests=args.sample_requests,
441442
warmup=args.warmup,

src/guidellm/benchmark/output.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,6 +649,8 @@ def _get_benchmark_status_metrics_stats(
649649
status_dist_summary: StatusDistributionSummary = getattr(
650650
benchmark.metrics, metric
651651
)
652+
if not hasattr(status_dist_summary, status):
653+
return [], []
652654
dist_summary: DistributionSummary = getattr(status_dist_summary, status)
653655

654656
headers = [
@@ -688,7 +690,7 @@ def _get_benchmark_extras_headers_and_values(
688690
values: list[str] = [
689691
benchmark.benchmarker.profile.model_dump_json(),
690692
json.dumps(benchmark.benchmarker.backend),
691-
json.dumps(benchmark.benchmarker.requests["attributes"]["data"]),
693+
json.dumps(benchmark.benchmarker.requests["data"]),
692694
]
693695

694696
if len(headers) != len(values):

src/guidellm/benchmark/schemas.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1674,6 +1674,7 @@ def compile(
16741674
environment: Environment,
16751675
strategy: SchedulingStrategy,
16761676
constraints: dict[str, dict[str, Any]],
1677+
data: list[Any],
16771678
) -> GenerativeBenchmark:
16781679
"""
16791680
Compile final generative benchmark from accumulated state.
@@ -1702,7 +1703,7 @@ def compile(
17021703
),
17031704
benchmarker=BenchmarkerDict(
17041705
profile=profile,
1705-
requests=InfoMixin.extract_from_obj(requests),
1706+
requests={"data": data},
17061707
backend=backend.info,
17071708
environment=environment.info,
17081709
),

0 commit comments

Comments
 (0)