Hardware test plan — PR #655 (helios: retain measured snapshot cost after expiry and discover unmeasured cost once, head f7f4d25)
0. What to test, and what "speedup" means here
PR #655 is not a throughput optimization. It removes a self-lock in checkpoint admission:
ActionCosts::fresh_durationis replaced bymeasured_duration(helios/src/scheduler/cost.rs:781-790), which returns the smallest batch withnanos != 0and never expires. Three gates switch to it:checkpoint_selection_uncached(helios/src/scheduler/checkpoints.rs:624),checkpoint_copy_allowed(:965),allocate_terminal_capture(:1039). So aSnapshotcost measured once keeps terminalEndpointcaptures and prefillMessageextras available after any >30 s decode or idle window (estimate_ttl_ns = 30 s,helios/src/scheduler/policy.rs:23 (not opened),39— note there is no CLI flag for it,grepofflare-cli/srcfinds none, so the 30 s must be real wall-clock).- A single server-global
snapshot_discovery: Option<RequestHandle>(helios/src/scheduler.rs:661,756,2690-2692,2700-2702,3067-3069,checkpoints.rs:1018-1023,1040-1043,1069-1072) lets exactly one zero-priced terminal capture run when noSnapshotcost has ever been measured (warm restart against a persistent host cache) so the cost can be observed.
The measurable claims are therefore counter movements and cache outcomes, plus a secondary latency claim (fewer refused checkpoints ⇒ more host/Selene prefix reuse ⇒ less re-prefill on follow-up turns). Treat "speedup" as TTFT / prefill-token reduction on a repeated prompt, not tokens/s.
Time-box: ~90 GPU-minutes total (cn5 primary ≈ 70, cn7 conditional ≈ 20), two builds, zero re-exports.
1. Environment (do first, in this order)
- Builds — two, side by side, same toolchain.
baseline= merge-base of the PR /origin/mainat test start (git merge-base origin/main f7f4d25), i.e. pre-PR.candidate=f7f4d253ee06a6580b7de2850a8febf58f1660af.cargo build --locked --release --manifest-path flare-cli/Cargo.toml(not opened) for each; tag the binariesflare-baseline,flare-candidate.- No re-export needed. This is a Helios serving-only change; docs state an existing compatible core loads unchanged (
docs/model-preparation.md:520-523;docs/cli-design.md:711"This option requires no core re-export"). Never runignition exportfor this PR.
- One core serves both arms. Use an already-prepared core from the model store
(
flare models list→flare models inspect <model> --graphs --jsonwill show platform, TP deployments and thesnapshotgraph batch capacities;docs/cli-design.md:1573-1615). - Run the cheap CPU layers while the arm64 build runs (they are part of the PR's evidence and cost no GPU):
cargo test --locked --release --manifest-path helios/Cargo.toml (not opened) --features runtime-core,server scheduler::andpython3 verification/helios-lifecycle/check.py(not opened) (matches.github/workflows/helios-lifecycle.yml(not opened)). - Prometheus scrape:
curl -s localhost:PORT/metrics > metrics-<arm>-<scenario>-<before|after>.txtaround every scenario. All counters below are flat text; no exporter needed.
2. Machine assignment (why not both everywhere)
| Machine | Role | Core requirement |
|---|---|---|
cn5 (4 × RTX PRO 6000 Blackwell Max-Q, 96 GiB, amd64) — GB202 ⇒ SM120 (helios/src/core/naming.rs:83-87) |
Primary arm. All six scenarios, both builds. | A gb202/SM120 TP1 core from the store. TP1 keeps KV/page pressure low and halves start-up cost; only use TP4 (--gpus 0,1,2,3) if the only resident core is TP4. |
cn7 (1 × GB10, arm64, 60 GiB RAM, 16 GiB scratch) — SM121 (naming.rs:63-64) |
Conditional architecture-coverage arm. Run only if a gb10-revision core is present/cached (flare models list | grep -i gb10). An SM120 core is rejected on GB10 (docs/model-preparation.md:477-479). |
gb10-revision core, smallest model on the box: google/gemma-4-E4B-it. Disk-only host retention (--prefix-cache-memory 0 --prefix-cache-disk … --prefix-cache-disk-limit 8G) because on integrated memory a warm DRAM tier duplicates bytes in the same physical pool (docs/prefix-cache-offload.md:190-197). |
Do not use --prefix-cache-pool / selene-manager, --lossless-kv-compression, or concurrency ≥ 32 sweeps: they add variables this diff cannot affect (docs/prefix-cache-offload.md:44-123,964-967).
Do not use ignition debug-serve, --direct, or --eager: explicitly not apples-to-apples (docs/performance-work.md:9-13). flare run CORE only.
Recommended model preference (in order): a small, fast, text model already on the box that supports exact 30 s+ idle and a >35 s decode cheaply. google/gemma-4-E4B-it (cn7) and, on cn5, whichever of nvidia/NVIDIA-Nemotron-3.5-Bolt-74B-A9B-24GB / zai-org/GLM-5.3-Flash / nvidia/GLM-5.3-Flash-NVFP4 fits TP1 in 96 GiB. Avoid the DFlash/speculative-heavy variants for this test: speculation adds acceptance noise to decode-length and TTFT numbers that the diff does not touch.
3. Common launch line
# cn5 primary (adjust model/core path and port)
flare-cli/target/release/flare-<arm> run "$CORE" --gpus 0 \
--host 127.0.0.1 --port 8000 \
--scheduler-policy balanced \
--prefix-cache-memory 4G \
--prefix-cache-disk /var/tmp/hc-<arm> --prefix-cache-disk-limit 40G \
--prefix-cache-drain-on-shutdown=on \
> /var/tmp/flare-<arm>-<scenario>.log 2>&1
--scheduler-checkpoint-extra-work-fractionstays at its default0.05(docs/cli-design.md:696-711) for S1–S4/S6; S5 sets it to0.- Use a fresh disk dir per arm (
hc-baseline,hc-candidate) so records from one build cannot serve the other; and reuse the same dir across the restart in S4. - Log the startup phase line
Prepare host prefix cache(slot pool size, record directory) — it is the proof that host retention is actually enabled (docs/prefix-cache-offload.md:975-977); without it every scenario is vacuous. - For the restart steps send SIGTERM and require exit code 0 so records flush (
docs/prefix-cache-offload.md:641-647; pattern intests/server/test_prefix_cache_offload.py:99-108). - Pass
--dangerously-approve-key <fp> --dangerously-accept-publisher <ns>(or--publisher-keys) for unattended loads (docs/cli-design.md:1281,1320-1322).
Prompt geometry: use the repo's own load generator so the requests are byte-identical across arms:
python3 scripts/benchmark_scheduler.py --base-url http://127.0.0.1:8000 \
--model <served-name> --concurrency 1 --prompt-tokens 4000 --output-tokens 32 \
--seconds 0 --warmup-seconds 0 --trials 1 --output /var/tmp/reqs.jsonl
then drive individual scenarios with a tiny client that reuses bodies from that JSONL (scripts/benchmark_scheduler.py:194-202 shows the reuse contract), or simply curl the same JSON body. scripts/benchmark_scheduler.py records metrics_before/metrics_after per trial (:141,173,207-222), so a --concurrency 1 --seconds 60 run already gives you every counter delta — use it as the "soak" wrapper and a 20-line curl script for the surgical steps.
4. Scenarios (all on cn5, both builds, in this order)
Each scenario: M() = scrape /metrics; d = after − before.
S1 — long decode (>35 s), then same-prefix follow-up. (the primary claim)
M()→ send prompt P (≈4000 tokens) withmax_tokenschosen so the stream takes ≥ 35 s (measure once:max_tokens ≈ 35 × measured tok/s; on a small model this is typically several thousand tokens;docs/model-bound) ×M()→ request P again withmax_tokens 32(this is the request whose terminal capture matters).M().
| Counter | candidate | baseline |
|---|---|---|
flare_checkpoint_skips_total{reason="unknown_cost"} delta at step 3 |
0 | ≥ 1 |
flare_checkpoint_captures_total{role="endpoint"} delta |
≥ 1 | 0 |
flare_graph_launches_total{kind="snapshot"} delta |
≥ 1 | 0 on the second request |
flare_host_cache_bytes_out_total delta |
> 0 | no new bytes after 30 s |
S2 — 33 s idle, then same-prefix request. Same prompt twice with sleep 33 between (idle > estimate_ttl_ns). Identical assertions to S1. This is the cheapest discriminator: the whole diff is visible in one counter (unknown_cost 0 vs ≥ 1).
S3 — multi-message prompt (prefill Message extras).
Send a 3–4 message conversation (mirror tests/server/test_prefix_cache_offload.py:111-114 shape, scaled so checkpoint_extra_work_fraction × prefill can afford a copy), after the model has one warm run.
- candidate:
flare_checkpoint_captures_total{role="message"}≥ 1 andunknown_cost == 0. - baseline:
messagecaptures 0 andunknown_costincrements (unless the run is within 30 s of a measurement — keep the 33 s idle in front to be sure). - Do this after S1/S2, so the retained-cost effect is isolated from discovery.
S4 — warm restart (unmeasured Snapshot) + cached-anchor hit → single zero-priced discovery. (exercises the new slot; the riskiest path)
- With disk retention on, run one full request so a record is written (
flare_host_cache_stored_total> 0), then SIGTERM (exit 0). - Restart the same arm against the same disk dir, same core.
M()→ send the identical prompt again: expect a host hit (flare_host_cache_hits_total+1,host_reused_tokens > 0), anendpointcapture +1 produced by the zero-priced discovery copy (checkpoint_copy_ns = 0), andflare_checkpoint_extra_work_nanoseconds_totaldelta 0 for that copy.- Immediately send a second distinct multi-message prompt:
unknown_costmust be 0 andmessagecaptures > 0 (proof the discovery actually measured the cost).
- Assertion that guards the review's caveat: exactly one
endpointcapture in step 3 even if you submit two identical cached-anchor requests concurrently (--concurrency 2): the second must be counted inunknown_cost. Log must not contain any occurrence ofrequested lifecycle operation must be feasible(the latent-panic path noted in review round 2). - baseline: step 3 produces
unknown_cost+1/+2 and noendpointcapture — i.e. #534's symptom reproduced on upstream. If baseline reproduces nothing here, say so explicitly in the report: that is the disputed part of the issue (#534was traced to a third-party forkAzallazA/hyperflare-inferencecarryingPrefillTailMerge), and a null result on upstream main is itself the finding that decides whetherRelated to #534is justified.
S5 — control: --scheduler-checkpoint-extra-work-fraction 0. One short run (cached and cold prompt). Expect byte-identical counters between builds: endpoint and message captures 0, unknown_cost 0, extra_work_ns 0. Any difference = regression; stop and report.
S6 — coalescing / cancel stress (only if time remains, ~8 min). From the S4 warm-restart state at --concurrency 3, submit three same-anchor requests in the same tick and cancel the first with a client disconnect ~200 ms after submit. Assert: at most one discovery capture, unknown_cost counts the rest, and a follow-up request after cancellation still achieves unknown_cost == 0 (the slot was released: scheduler.rs:2690-2692,2700-2702,3067-3069). This is the concrete check for the review's "burned probe slot" should-fix, which the new head claims to have fixed via the Finishing predicate.
5. The secondary "speedup" measurement (optional, 10 min, cn5)
Only worth running if you want a number for the latency benefit, and it must be paired:
# candidate then baseline, and again baseline then candidate (order control)
python3 scripts/benchmark_scheduler.py --base-url … --model … \
--concurrency 1 --prompt-tokens 8000 --output-tokens 16 --seconds 60 \
--warmup-seconds 20 --trials 3 --expected-cached-prompt-tokens <N> \
--pair-index 0 --variant <baseline|candidate> --pair-order baseline,candidate \
--output /var/tmp/ab-<arm>.jsonl
with a sleep 33-primed second request so the baseline is actually in its degraded regime (--expected-cached-prompt-tokens makes the script fail loudly if the cache condition differs between arms, :213-221). Report ttft_median_seconds and cached_prompt_tokens deltas, split by scenario, with ≥3 trials and the two orderings. Do not report tokens/s as the PR's effect — it is within noise for this diff.
6. Abort / don't-bother rules (GPU-time protection)
Stop the arm and report instead of continuing if any of these appear:
Prepare host prefix cachemissing ordisabledin the log → host retention off, all scenarios meaningless (docs/prefix-cache-offload.md:140-147).- Startup memory planning fails on cn7 (60 GiB shared with the OS;
docs/model-preparation.md:489-495) → drop the Gemma-4-E4B-it arm rather than shrinking other things; cn7 adds no value the cn5 TP1 arm doesn't already give for a scheduler-only diff. flare_snapshot_capacityis 0 → checkpoint cuts disabled entirely (docs/cli-design.md:704); pick another core.- Any
flare_host_cache_*_failed_totalorpool_refusedgrowth, orflare_host_cache_*_deferrals_totalrising → host tier saturated; reduce--prefix-cache-disk-limit/prompt size rather than interpreting it as a PR effect.
Skip: ignition export / re-export, ignition debug-serve, --direct, --eager, --prefix-cache-pool, --lossless-kv-compression, TP4 unless the store only has TP4, multi-host/Orbit, concurrency sweeps 1→32.
7. What each result means
| Observation | Interpretation |
|---|---|
cand: unknown_cost 0 after S1/S2, baseline ≥ 1 |
Core claim confirmed on hardware; the retained-cost half works. |
cand: S4 step 3 = 1 endpoint capture, extra_work_ns +0, follow-up unknown_cost 0 |
The discovery path works and truly unblocks prefill extras. |
cand: S4 step 3 = endpoint +1 but follow-up still unknown_cost |
Discovery did not close the loop (the batch_capacity vs smallest_batch_key concern from review round 1) — file as a real defect with the metrics files. |
| S4 concurrency-2 yields two discovery captures, or S6 leaves the slot burned | The single-in-flight invariant is broken → block merge; the fix is in snapshot_discovery_in_flight / the three clears. |
| S5 differs in any checkpoint counter | Behaviour is not identical at fraction 0 → block merge. |
| Baseline reproduces nothing in S4 | Upstream cold-boot deadlock is not reachable on main: strengthens the "fork-specific" rebuttal in #534, and the PR body should say so. |
Anyone finds requested lifecycle operation must be feasible in a candidate log |
The empty-Snapshot-catalogue malformed-core path is reachable in practice → escalate (review round 2, finding 4). |
8. Findings relevant to the test engineer
- Docs are consistent at head.
docs/scheduling-runtime-design.md:619-631,docs/core-design.md:1450-1457,helios/README.md:378-383,docs/cli-design.md:704-711were all updated together (the earlier review's should-fix #2 is discharged).docs/api.md:355-356was not updated and still says the counter "sums charged predicted … copy work", which is exactly what the zero-priced discovery copy violates → confirm S4'sextra_work_nsdelta of 0 and report it as a documentation gap, not a code defect. - Internal doc contradiction remains: "allows at most one in-flight discovery capture" (line 626-628) sits next to the unchanged "There is no fixed capture count or concurrency-based snapshot share" (line 630-631). One clause; worth catching while you have the reviewer's attention.
- A latent panic path exists but is blocked by core validation:
measured_durationreturnsNonefor "no Snapshot batch declared" as well as "unmeasured", so a malformed core plus a positive fraction would allocate a zero-priced capture that later hits.expect(...)inpolicy.rs(not opened).helios/src/model/catalog.rs:138-148(not opened) andcheckpoints.rs:1030block it. Worth a one-line grep of the log (see table) but not a test scenario. - No human maintainer review yet (only the automated review, on a superseded head). Since testing is being spent on this PR, having
yatesdr(author, owns this path) orLuke Alonsolook atf7f4d25before the run would avoid validating a shape that changes again.
9. Deliverable
For each arm and scenario, attach: the two /metrics snapshots, the log excerpt around Prepare host prefix cache and the Snapshot graph launches, the restart exit codes, and the S5 equality diff. That set is sufficient to accept or reject every claim in the PR body — including the ones the PR does not claim (no throughput change) — in under 90 GPU-minutes.