guidellm.benchmark.schemas.base
Base schemas for benchmark execution, metric accumulation, and result compilation.
Defines abstract interfaces and configuration models for coordinating benchmark execution with schedulers. The module centers around three key abstractions: BenchmarkConfig encapsulates execution parameters and constraints; BenchmarkAccumulator tracks incremental metrics during scheduler runs; and Benchmark compiles final results with comprehensive latency, throughput, and concurrency distributions. Supports configurable warmup/cooldown phases, transient period handling, and flexible metric sampling strategies.
BenchmarkAccumulatorT = TypeVar('BenchmarkAccumulatorT', bound='BenchmarkAccumulator[Any, Any]') module-attribute
Generic type variable for benchmark accumulator implementations
BenchmarkT = TypeVar('BenchmarkT', bound='Benchmark') module-attribute
Generic type variable for benchmark result implementations
Benchmark
Bases: StandardBaseDict, ABC, Generic[BenchmarkAccumulatorT]
Compile and expose final benchmark execution metrics.
Defines the interface for benchmark result implementations capturing comprehensive performance metrics including latency distributions, throughput measurements, and concurrency patterns. Subclasses implement compilation logic to transform accumulated metrics and scheduler state into structured results with statistical summaries.
Source code in src/guidellm/benchmark/schemas/base.py
duration abstractmethod property
Returns:
| Type | Description |
|---|---|
float | Benchmark execution duration in seconds |
end_time abstractmethod property
Returns:
| Type | Description |
|---|---|
float | Benchmark completion timestamp in seconds since epoch |
request_concurrency abstractmethod property
Returns:
| Type | Description |
|---|---|
StatusDistributionSummary | Statistical distribution of concurrent request counts |
request_latency abstractmethod property
Returns:
| Type | Description |
|---|---|
StatusDistributionSummary | Statistical distribution of request latencies |
request_throughput abstractmethod property
Returns:
| Type | Description |
|---|---|
StatusDistributionSummary | Statistical distribution of throughput measurements |
start_time abstractmethod property
Returns:
| Type | Description |
|---|---|
float | Benchmark start timestamp in seconds since epoch |
compile(accumulator, scheduler_state) abstractmethod classmethod
Transform accumulated metrics into final benchmark results.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
accumulator | BenchmarkAccumulatorT | Accumulator instance with collected metrics and state | required |
scheduler_state | SchedulerState | Scheduler's final state after execution completion | required |
Returns:
| Type | Description |
|---|---|
Any | Compiled benchmark instance with complete statistical results |
Source code in src/guidellm/benchmark/schemas/base.py
BenchmarkAccumulator
Bases: StandardBaseDict, ABC, Generic[RequestT, ResponseT]
Track and accumulate benchmark metrics during scheduler execution.
Maintains incremental metric estimates as requests are processed, enabling real-time progress monitoring and efficient metric compilation. Subclasses implement specific metric calculation strategies based on request/response characteristics and scheduler state evolution.
Source code in src/guidellm/benchmark/schemas/base.py
update_estimate(response, request, info, scheduler_state) abstractmethod
Incrementally update metrics with completed request data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
response | ResponseT | None | Backend response data if request succeeded | required |
request | RequestT | Request instance submitted to backend | required |
info | RequestInfo | Request timing, status, and execution metadata | required |
scheduler_state | SchedulerState | Current scheduler state with queue and concurrency info | required |
Source code in src/guidellm/benchmark/schemas/base.py
BenchmarkConfig
Bases: StandardBaseDict
Encapsulate execution parameters and constraints for benchmark runs.
Defines comprehensive configuration including scheduler strategy, constraint sets, transient phase handling, metric sampling preferences, and execution metadata. Coordinates profile, request, backend, and environment configurations to enable reproducible benchmark execution with precise control over metric collection.