guidellm.benchmark.profiles.profile
Profile base class for multi-strategy benchmark execution.
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 |