guidellm.benchmark.analysis.knee
Throughput-knee and over-saturation analysis for concurrent benchmarks.
AdaptiveConcurrencyPlan
Bases: StandardBaseModel
Additional concurrent stream counts selected around saturation.
Source code in src/guidellm/benchmark/analysis/knee.py
KneeAnalysis
Bases: StandardBaseModel
Combined throughput-knee and temporal saturation analysis.
Source code in src/guidellm/benchmark/analysis/knee.py
KneeDetectionConclusion
Bases: StandardBaseModel
Initial and final knee analyses plus the adaptive execution plan.
Source code in src/guidellm/benchmark/analysis/knee.py
KneeResult
Bases: StandardBaseModel
Result of fitting rising and saturation segments to a throughput curve.
Source code in src/guidellm/benchmark/analysis/knee.py
SaturationAssessment
Bases: StandardBaseModel
Relationship between a throughput knee and temporal saturation evidence.
Source code in src/guidellm/benchmark/analysis/knee.py
SaturationBoundary
Bases: StandardBaseModel
Over-saturation boundary inferred from completed concurrent benchmarks.
Source code in src/guidellm/benchmark/analysis/knee.py
SaturationPoint
Bases: StandardBaseModel
Final over-saturation detector snapshot for one concurrency.
Source code in src/guidellm/benchmark/analysis/knee.py
analyze_knee(benchmarks)
Analyze concurrent benchmarks using throughput and temporal evidence.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
benchmarks | Sequence[GenerativeBenchmark] | Completed concurrent GuideLLM benchmarks | required |
Returns:
| Type | Description |
|---|---|
KneeAnalysis | Throughput fit, detector boundary, and their combined assessment |
Source code in src/guidellm/benchmark/analysis/knee.py
assess_saturation(throughput, saturation)
Combine a throughput knee with temporal over-saturation evidence.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
throughput | KneeResult | Result of fitting the throughput curve | required |
saturation | SaturationBoundary | Boundary inferred from the over-saturation detector | required |
Returns:
| Type | Description |
|---|---|
SaturationAssessment | Combined assessment and optional refinement bounds |
Source code in src/guidellm/benchmark/analysis/knee.py
benchmark_concurrency(benchmark)
Read the concurrent stream count from a completed benchmark.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
benchmark | GenerativeBenchmark | Completed GuideLLM benchmark | required |
Returns:
| Type | Description |
|---|---|
int | Positive integer concurrent stream count |
Raises:
| Type | Description |
|---|---|
ValueError | If the benchmark did not use a concurrent strategy |
Source code in src/guidellm/benchmark/analysis/knee.py
extract_saturation_boundary(benchmarks)
Infer the safe-to-over-saturated boundary from native benchmark state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
benchmarks | Sequence[GenerativeBenchmark] | Completed concurrent GuideLLM benchmarks | required |
Returns:
| Type | Description |
|---|---|
SaturationBoundary | Ordered detector points and the inferred saturation boundary |
Raises:
| Type | Description |
|---|---|
ValueError | If concurrency or detector metadata is malformed |
Source code in src/guidellm/benchmark/analysis/knee.py
368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 | |
find_throughput_knee(concurrencies, output_throughputs)
Find where output throughput changes from rising to substantially flatter.
Duplicate concurrency measurements are averaged. Missing throughput values are ignored. A knee is accepted only when segmented regression improves the fit, the tail is substantially flatter, and the breakpoint has reached most of the observed peak throughput.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
concurrencies | Sequence[int | float] | Concurrent stream counts for the measurements | required |
output_throughputs | Sequence[int | float | None] | Successful output-token throughput measurements | required |
Returns:
| Type | Description |
|---|---|
KneeResult | Detected knee and fit diagnostics, or a no-knee explanation |
Raises:
| Type | Description |
|---|---|
ValueError | If the inputs have different lengths or invalid values |
Source code in src/guidellm/benchmark/analysis/knee.py
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 | |
generate_adaptive_concurrency_plan(analysis, measured_concurrencies, *, points_each_side=5, max_step=5)
Select unmeasured integer concurrency points around saturation.
A clean max_step grid is preferred. The step is reduced near the bottom of the positive integer range so lower points remain valid.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
analysis | KneeAnalysis | Knee and over-saturation assessment from the initial run | required |
measured_concurrencies | Sequence[int] | Concurrent stream counts already executed | required |
points_each_side | int | Maximum additional grid points on either side | 5 |
max_step | int | Largest concurrency grid step to consider | 5 |
Returns:
| Type | Description |
|---|---|
AdaptiveConcurrencyPlan | Ready plan with new concurrencies, or an explanation for skipping |
Raises:
| Type | Description |
|---|---|
ValueError | If configuration or measured concurrencies are invalid |