loadgen: measure sweep saturation with a closed-loop capacity probe #1038
All Vouch review confidence checks passed
Residual risk 0.28 = Change Risk (0.53) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.53 · 533 lines diff across 6 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.376
Shallow Review Depth
shallow_review_depth
0.344
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #1038"
general
weight: 0.35
rishabhsinha17
Part of #904. This is the measurement half; binding probe-derived rates to
expression stages depends on #823/#829 landing first.
Old behavior
sweepestimated saturation from a fixed 1000-request burst: the preprocessloop sampled active-request counts every 0.5 s, derived a rate from each
sample, and took
saturation_percentile(default 95) of them as the upperbound for the generated stages. The drain tail of a burst is the least stable
part of the run, so the percentile over-represents the burst peak and the
estimate does not converge as load is added — the same server measured twice
produced different sweep bounds.
New behavior
Opt-in
load.sweep.probereplaces the burst with a closed-loop concurrencyladder. Each rung holds in-flight concurrency at N, skips
settle_duration,then measures throughput X(N) and mean latency R(N) over
rung_duration.Little's law (
N = X * R) is validated per rung; a rung that was not held atN is marked non-stationary rather than silently biasing the estimate. The
ladder grows N by
growth_factoruntil the upper confidence bound of themarginal throughput gain drops below
gain_threshold, bounded bymax_concurrency(and by workers x per-worker concurrency).The rung curve is fit two ways — an isotonic plateau that never extrapolates
and a saturating-curve asymptote — and the asymptote is kept only when it is
close to the measured plateau.
r_satandn_kneeare reported withbootstrap confidence intervals, and generated stages are spaced up to
r_sat.The probe is invisible to the benchmark it configures: probe traffic runs
under negative stage ids and is dropped from reports, and worker concurrency is
restored before the measured stages start.
Changes
inference_perf/loadgen/probe/— new package:result.py(rung/proberecords),
metrics.py(per-rung X, R, error rate, Little's law),stationarity.py(settle/measure split, drift detection),ladder.py(growth + stop policy),
estimator.py(plateau + asymptote fits, bootstrapCIs,
r_sat/n_knee), plusREADME.md.config/loadgen/config.py—ProbeConfigwith 7 documented fields;SweepConfig.probe; validation thatmax_concurrency >= start_concurrencyand that
sweep.proberequiresnum_workers > 0.loadgen/load_generator.py—generate_stage_rates(),_probe_preprocess(),_run_probe_rung(),_collect_rung_metrics(),_restore_worker_concurrency();shared_max_concurrencynow always createdon the
mp_runpath.metrics/request_collector/— abstractsnapshot(); local andmultiprocess implementations (multiprocess accumulates into
self.metrics).main.py— passes the collector intoLoadGenerator.test_probe_preprocess.py(real workerprocesses, rungs N=1/2/4),
test_request_collector_snapshot.py, 3ProbeConfigvalidation tests.docs/loadgen.md("Closed-loop capacity probe" section),docs/config.md(fields + note),docs/cli_flags.md(regenerated).Testing
pytest tests/required/loadgen/probe tests/required/metrics/test_request_collector_snapshot.py→ 65 passed.
pytest tests/required/loadgen/probe/test_probe_preprocess.py→ 1 passed(rungs N=1,2,4;
r_sat65.00; stages ran toCOMPLETED).ruff format --check+ruff checkclean at thepdm.lock-pinned 0.15.20.mypy --strictclean on all changed modules.python scripts/sync_cli_flags_doc.py --checkandsync_runtime_metrics_doc.py --checkpass.pytest tests: 3007 passed, 38 skipped. Of the 28 failures, 26reproduce on an unmodified checkout of the same commit on this Windows
machine (
fork,SIGKILL,killpg, path separators, cp1252); the tworemaining are load-dependent flakes that pass in isolation
(
test_worker_matrix5/5 twice;test_registryrun-elapsed fails 4/5 on thebaseline too).
check:covneeds PDM and amainfetch, so it runs in CI.Not in this PR
Binding the probe-derived rates to expression stages, which
#904alsodescribes. That depends on #823 and #829;
probe_resultand ther_sat/n_kneeoutputs are the contract that follow-up will read.