guidellm.benchmark.benchmarker
Benchmark execution orchestration and lifecycle management.
Provides the core benchmarking engine that coordinates request scheduling, data aggregation, and result compilation across execution strategies and environments. The Benchmarker manages the complete benchmark lifecycle from request submission through result compilation while implementing thread-safe singleton operations for consistent state management across concurrent workflows.
Benchmarker
Bases: Generic[BenchmarkT, RequestT, ResponseT], ABC, ThreadSafeSingletonMixin
Orchestrates benchmark execution across scheduling strategies.
Coordinates benchmarking runs by managing request scheduling, metric aggregation, and result compilation. Implements a thread-safe singleton pattern to ensure consistent state management across concurrent operations while supporting multiple scheduling strategies and execution environments.
Source code in src/guidellm/benchmark/benchmarker.py
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 | |
run(accumulator_class, benchmark_class, requests, backend, profile, environment, warmup, cooldown, sample_size=None, prefer_response_metrics=True, progress=None) async
Execute benchmark runs across scheduling strategies in the profile.
:yield: Compiled benchmark result for each strategy execution
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
accumulator_class | type[BenchmarkAccumulatorT] | Class for accumulating metrics during execution | required |
benchmark_class | type[BenchmarkT] | Class for constructing final benchmark results | required |
requests | DatasetIterT[RequestT] | Request datasets to process across strategies | required |
backend | BackendInterface[RequestT, ResponseT] | Backend interface for executing requests | required |
profile | Profile | Profile defining scheduling strategies and constraints | required |
environment | Environment | Environment for execution coordination | required |
warmup | TransientPhaseConfig | Warmup phase configuration before benchmarking | required |
cooldown | TransientPhaseConfig | Cooldown phase configuration after benchmarking | required |
sample_size | int | None | Maximum number of requests per status group (completed, errored, incomplete) to retain full data for. None keeps all, 0 strips all, N > 0 uses reservoir sampling. | None |
prefer_response_metrics | bool | Whether to prefer response metrics over request metrics, defaults to True | True |
progress | BenchmarkerProgress[BenchmarkAccumulatorT, BenchmarkT] | None | Optional tracker for benchmark lifecycle events | None |
Raises:
| Type | Description |
|---|---|
Exception | If benchmark execution or compilation fails |
Source code in src/guidellm/benchmark/benchmarker.py
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 | |