guidellm.benchmark.profiles
Orchestrate multi-strategy benchmark execution through configurable profiles.
Provides abstractions for coordinating sequential execution of scheduling strategies during benchmarking workflows. Profiles automatically generate strategies based on configuration parameters, manage runtime constraints, and track completion state across execution sequences. Each profile type implements a specific execution pattern (synchronous, concurrent, throughput-focused, rate-based async, or adaptive sweep) that determines how benchmark requests are scheduled and executed.
AsyncProfile
Bases: Profile
Schedule requests at specified rates using constant or Poisson patterns.
Schedules requests at specified rates using either constant interval or Poisson distribution patterns for realistic load simulation.
Source code in src/guidellm/benchmark/profiles/asynchronous.py
strategy_types property
Returns:
| Type | Description |
|---|---|
list[str] | Async strategy types for each configured rate |
next_strategy(prev_strategy, prev_benchmark)
Generate async strategy for next configured rate.
If a previous rate was terminated by a constraint with stopping_scope='all', remaining rates are skipped.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
prev_strategy | SchedulingStrategy | None | Previously completed strategy | required |
prev_benchmark | Benchmark | None | Benchmark results from previous execution | required |
Returns:
| Type | Description |
|---|---|
AsyncConstantStrategy | AsyncPoissonStrategy | None | AsyncConstantStrategy or AsyncPoissonStrategy for next rate, or None if all rates completed or escalation halted |
Raises:
| Type | Description |
|---|---|
ValueError | If strategy_type is neither 'constant' nor 'poisson' |
Source code in src/guidellm/benchmark/profiles/asynchronous.py
ConcurrentProfile
Bases: Profile
Execute strategies with fixed concurrency levels for performance testing.
Executes requests with a fixed number of concurrent streams, useful for testing system performance under specific concurrency levels.
Source code in src/guidellm/benchmark/profiles/concurrent.py
strategy_types property
Returns:
| Type | Description |
|---|---|
list[str] | Concurrent strategy types for each configured stream count |
next_strategy(prev_strategy, prev_benchmark)
Generate concurrent strategy for next stream count.
If a previous stream count was terminated by a constraint with stopping_scope='all', remaining stream counts are skipped.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
prev_strategy | SchedulingStrategy | None | Previously completed strategy | required |
prev_benchmark | Benchmark | None | Benchmark results from previous execution | required |
Returns:
| Type | Description |
|---|---|
ConcurrentStrategy | None | ConcurrentStrategy with next stream count, or None if complete or escalation halted |
Source code in src/guidellm/benchmark/profiles/concurrent.py
GoodputProfile
Bases: Profile
Locate the highest concurrency meeting configured latency objectives.
Doubles concurrency until a level fails its objectives, then bisects between the highest passing and lowest failing level. Concurrency is the control variable rather than request rate because every concurrency level has a well-defined steady state, whereas a rate above the server's capacity produces a growing backlog whose measurements describe the backlog rather than the server.
Each probe's pass or fail decision uses SLO attainment, the fraction of requests meeting every objective. Attainment is a ratio over the measured population, so unlike a rate it is unaffected by how much of the measurement window the server spent filling its pipeline.
Source code in src/guidellm/benchmark/profiles/goodput.py
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 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 | |
conclusion property
Returns:
| Type | Description |
|---|---|
dict[str, Any] | None | The recorded search trace, bounds and stop reason |
strategy_types property
Declare the probe budget rather than the probes run so far.
The progress display sizes its task list from this before the first strategy is generated, so reporting completed probes would leave it empty and render every run as complete.
Returns:
| Type | Description |
|---|---|
list[str] | Concurrent strategy types, one per probe the search may run |
next_strategy(prev_strategy, prev_benchmark)
Generate the next concurrency level to probe.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
prev_strategy | SchedulingStrategy | None | Previously completed strategy instance | required |
prev_benchmark | Benchmark | None | Benchmark results from the previous probe | required |
Returns:
| Type | Description |
|---|---|
ConcurrentStrategy | None | ConcurrentStrategy for the next level, or None when the search has converged, exhausted its probe budget, or hit its stream ceiling |
Source code in src/guidellm/benchmark/profiles/goodput.py
Profile
Bases: ABC
Coordinate multi-strategy benchmark execution with automatic strategy generation.
Manages sequential execution of scheduling strategies with automatic strategy generation, constraint management, and completion tracking. Subclasses define specific execution patterns like synchronous, concurrent, throughput-focused, rate-based async, or adaptive sweep profiles.
Example: :: @Profile.register("synchronous") class SynchronousProfile(Profile): def init(self, args: SynchronousProfileArgs): super().init(args)
args = SynchronousProfileArgs(kind="synchronous")
profile = Profile.create(args)
Source code in src/guidellm/benchmark/profiles/profile.py
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 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 | |
conclusion property
What the profile concluded, available once its run has finished.
Profiles that answer a question rather than execute a fixed sequence override this. It is read after the final strategy completes, which is the only point at which such an answer exists: info is captured into each benchmark's config before that benchmark runs, so it can never carry the last strategy's contribution.
Returns:
| Type | Description |
|---|---|
dict[str, Any] | None | Serializable conclusion mapping, or None for profiles that only execute a planned sequence |
info property
Help json serialization by deferring to ProfileArgs.
strategy_types property
Returns:
| Type | Description |
|---|---|
list[str] | Strategy types executed or to be executed in this profile |
__init__(args, random_seed, constraints, **kwargs)
Initialize a profile instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
args | ProfileArgs | Validated profile argument model for this profile type | required |
random_seed | int | Seed for reproducible random operations in profile strategies. | required |
constraints | MutableMapping[str, ConstraintInitializer | Any] | None | Constraints for the profile strategies. | required |
kwargs | Any | Additional profile-specific configuration parameters | {} |
Source code in src/guidellm/benchmark/profiles/profile.py
next_strategy(prev_strategy, prev_benchmark) abstractmethod
Generate next strategy in the profile execution sequence.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
prev_strategy | SchedulingStrategy | None | Previously completed strategy instance | required |
prev_benchmark | Benchmark | None | Benchmark results from previous strategy execution | required |
Returns:
| Type | Description |
|---|---|
SchedulingStrategy | None | Next strategy to execute, or None if profile complete |
Source code in src/guidellm/benchmark/profiles/profile.py
next_strategy_constraints(next_strategy, prev_strategy, prev_benchmark)
Generate constraints for next strategy execution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
next_strategy | SchedulingStrategy | None | Strategy to be executed next | required |
prev_strategy | SchedulingStrategy | None | Previously completed strategy instance | required |
prev_benchmark | Benchmark | None | Benchmark results from previous strategy execution | required |
Returns:
| Type | Description |
|---|---|
dict[str, Constraint] | None | Constraints dictionary for next strategy, or None |
Source code in src/guidellm/benchmark/profiles/profile.py
strategies_generator()
Generate strategies and constraints for sequential execution.
Returns:
| Type | Description |
|---|---|
Generator[tuple[SchedulingStrategy, dict[str, Constraint] | None], Benchmark | None, None] | Generator yielding (strategy, constraints) tuples and receiving benchmark results after each execution |
Source code in src/guidellm/benchmark/profiles/profile.py
ProfileFactory
Bases: RegistryMixin['type[Profile]']
Source code in src/guidellm/benchmark/profiles/profile.py
create(args, random_seed, constraints=None, **kwargs) classmethod
Create profile instances from validated profile arguments.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
args | ProfileArgs | Validated profile argument model for the target profile type | required |
random_seed | int | Seed for reproducible random operations in profile strategies. | required |
constraints | MutableMapping[str, ConstraintInitializer | Any] | None | Constraints for the profile strategies. | None |
kwargs | Any | Additional profile-specific configuration parameters | {} |
Returns:
| Type | Description |
|---|---|
Profile | Configured profile instance for the specified type |
Raises:
| Type | Description |
|---|---|
ValueError | If the profile kind is not registered |
Source code in src/guidellm/benchmark/profiles/profile.py
registered_names() classmethod
ReplayProfile
Bases: Profile
Replay a trace file using per-row relative_timestamp from the dataset.
schedule_turn=idle_gap (the default) keeps the idle gap after each request's recorded duration, so a slow or late predecessor shifts the following request by that overrun. schedule_turn=timestamp schedules each request at start_time + time_scale * relative_timestamp. A later turn waits only while its predecessor is still running.
Dataset-side time_scale and wait caps are applied by the trace dataset before this scheduler scale.
When data_samples is set, the default max_requests constraint matches the truncated dataset size.
Source code in src/guidellm/benchmark/profiles/replay.py
SweepProfile
Bases: Profile
Discover optimal rate range through adaptive multi-strategy execution.
Automatically discovers optimal rate range by executing synchronous and throughput strategies first, then interpolating rates for async strategies to comprehensively sweep the performance space.
Source code in src/guidellm/benchmark/profiles/sweep.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 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 | |
strategy_types property
Returns:
| Type | Description |
|---|---|
list[str] | Strategy types for the complete sweep sequence |
next_strategy(prev_strategy, prev_benchmark)
Generate next strategy in adaptive sweep sequence.
Executes synchronous and throughput strategies first to measure baseline rates, then generates interpolated rates for async strategies. If a failure constraint is triggered during the async phase, all remaining higher rates are skipped.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
prev_strategy | SchedulingStrategy | None | Previously completed strategy instance | required |
prev_benchmark | Benchmark | None | Benchmark results from previous strategy execution | required |
Returns:
| Type | Description |
|---|---|
AsyncConstantStrategy | AsyncPoissonStrategy | SynchronousStrategy | ThroughputStrategy | None | Next strategy in sweep sequence, or None if complete |
Raises:
| Type | Description |
|---|---|
ValueError | If strategy_type is neither 'constant' nor 'poisson' |
Source code in src/guidellm/benchmark/profiles/sweep.py
SynchronousProfile
Bases: Profile
Execute single synchronous strategy for baseline performance metrics.
Executes requests sequentially with one request at a time, establishing baseline performance metrics without concurrent execution overhead.
Source code in src/guidellm/benchmark/profiles/synchronous.py
strategy_types property
Returns:
| Type | Description |
|---|---|
list[str] | Single synchronous strategy type |
next_strategy(prev_strategy, prev_benchmark)
Generate synchronous strategy for first execution only.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
prev_strategy | SchedulingStrategy | None | Previously completed strategy (unused) | required |
prev_benchmark | Benchmark | None | Benchmark results from previous execution (unused) | required |
Returns:
| Type | Description |
|---|---|
SynchronousStrategy | None | SynchronousStrategy for first execution, None afterward |
Source code in src/guidellm/benchmark/profiles/synchronous.py
ThroughputProfile
Bases: Profile
Maximize system throughput with optional concurrency constraints.
Maximizes system throughput by maintaining maximum concurrent requests, optionally constrained by a concurrency limit.
Source code in src/guidellm/benchmark/profiles/throughput.py
strategy_types property
Returns:
| Type | Description |
|---|---|
list[str] | Single throughput strategy type |
next_strategy(prev_strategy, prev_benchmark)
Generate throughput strategy for first execution only.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
prev_strategy | SchedulingStrategy | None | Previously completed strategy (unused) | required |
prev_benchmark | Benchmark | None | Benchmark results from previous execution (unused) | required |
Returns:
| Type | Description |
|---|---|
ThroughputStrategy | None | ThroughputStrategy for first execution, None afterward |