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
AsyncProfileArgs
Bases: ProfileArgs
Pydantic model for asynchronous profile creation arguments.
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
ConcurrentProfileArgs
Bases: ProfileArgs
Pydantic model for concurrent profile creation arguments.
Source code in src/guidellm/benchmark/profiles/concurrent.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
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 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 | |
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.
Each request is scheduled at start_time + time_scale * relative_timestamp via RequestSettings on the dataset finalizer output. For this profile, rate is interpreted as time_scale (not requests per second).
When data_samples is set, the default max_requests constraint matches the truncated dataset size.
Source code in src/guidellm/benchmark/profiles/replay.py
ReplayProfileArgs
Bases: ProfileArgs
Pydantic model for trace replay profile creation arguments.
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
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 | |
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
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 | |
SweepProfileArgs
Bases: ProfileArgs
Pydantic model for sweep profile creation arguments.
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
SynchronousProfileArgs
Bases: ProfileArgs
Pydantic model for synchronous profile creation arguments.
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 |
Source code in src/guidellm/benchmark/profiles/throughput.py
ThroughputProfileArgs
Bases: ProfileArgs
Pydantic model for throughput profile creation arguments.