Skip to content

Commit 0adaff9

Browse files
sjmonsonmarkurtz
authored andcommitted
Add global fields to each row
Signed-off-by: Samuel Monson <smonson@redhat.com>
1 parent a37aa52 commit 0adaff9

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

src/guidellm/benchmark/outputs/csv.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ async def finalize(self, report: GenerativeBenchmarksReport) -> Path:
137137
benchmark_values,
138138
)
139139
self._add_scheduler_info(benchmark, benchmark_headers, benchmark_values)
140+
self._add_runtime_info(report, benchmark_headers, benchmark_values)
140141

141142
if not headers:
142143
headers = benchmark_headers
@@ -182,6 +183,34 @@ def _add_field(
182183
headers.append([group, field_name, units])
183184
values.append(value)
184185

186+
def _add_runtime_info(
187+
self,
188+
report: GenerativeBenchmarksReport,
189+
headers: list[list[str]],
190+
values: list[str | int | float],
191+
) -> None:
192+
"""
193+
Add global metadata and environment information.
194+
195+
:param report: Benchmark report to extract global info from
196+
:param headers: List of header hierarchies to append to
197+
:param values: List of values to append to
198+
"""
199+
self._add_field(
200+
headers,
201+
values,
202+
"Runtime Info",
203+
"Metadata",
204+
report.metadata.model_dump_json(),
205+
)
206+
self._add_field(
207+
headers,
208+
values,
209+
"Runtime Info",
210+
"Arguments",
211+
report.args.model_dump_json(),
212+
)
213+
185214
def _add_run_info(
186215
self,
187216
benchmark: GenerativeBenchmark,

src/guidellm/benchmark/schemas/generative/report.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,12 @@ class GenerativeBenchmarkMetadata(StandardBaseModel):
3333
Versioning and environment metadata for generative benchmark reports.
3434
"""
3535

36+
# Make sure to update version when making breaking changes to report schema
3637
version: Literal[1] = Field(
37-
description="Version of the benchmark report schema",
38+
description=(
39+
"Version of the benchmark report schema, increments "
40+
"whenever there is a breaking change to the output format"
41+
),
3842
default=1,
3943
)
4044
guidellm_version: str = Field(

0 commit comments

Comments
 (0)