Fix: Resolve CSV output generation failure in benchmarks #435
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes two critical bugs that cause the
guidellm benchmarkcommand to crash when using the--output-formats csvoption. These changes ensure that CSV reports are generated reliably and correctly.Details
Fix
AttributeError**:In
src/guidellm/benchmark/output.py, ahasattrcheck has been added to the_get_benchmark_status_metrics_statsfunction.This check ensures that the code only attempts to access status attributes (e.g.,
successful) on metric objects that actually possess them (likeStatusDistributionSummary). It safely skips composite metrics such asGenerativeTextMetricsSummary, thus preventing theAttributeError.Fix
KeyError**:The data flow for benchmark compilation has been refactored to ensure the original data configuration (
args.data) is correctly propagated.The method signatures for
Benchmarker.run(inbenchmarker.py) andGenerativeBenchmark.compile(inschemas.py) were updated to accept adataparameter.args.datais now passed in during thebenchmarker.runcall withinbenchmark_generative_text(inentrypoints.py).As a result, the
benchmark.benchmarker.requestsfield in the finalGenerativeBenchmarkobject now directly stores the raw data configuration, which resolves theKeyErrorinoutput.py.Test Plan
guidellm benchmark
--target "http://x.x.x.x:x/"
--processor "Qwen/Qwen3-8B-FP8"
--rate-type "concurrent"
--rate 1
--max-requests 10
--data "prompt_tokens=32,output_tokens=32,samples=1"
--output-formats csv
Related Issues
#434
Use of AI
## WRITTEN BY AI ##)