Hardware test plan — PR #665 (scan-resistant dual-turnover prefix-cache eviction)
Bottom line
The change is ready to test, but the only thing worth measuring on your hardware is the GPU prefix-cache eviction effect, and the PR's own numbers cannot be reused as-is: they were taken on a7568c2c (pre-hardening), on DeepSeek‑V4.1‑Flash TP4, which is not present on cn5 or cn7, at n = 2 trials/arm on one boot with --prefix-cache-memory 0. Every functional claim except the GPU-tier eviction ordering is already covered by CPU tests, and the one path the PR admits is unmeasured (host-store restore promotion) is observable on cn5 with existing /metrics if you run the disk tier.
Test on cn5 only (4× RTX PRO 6000 Blackwell 96 GiB, amd64, 125 GiB RAM, 16 GiB scratch). Budget ≈ 3.5–4 h of 4-GPU time plus a one-time core acquisition. cn7 is not suitable for the performance question (see §7) — optionally use it for a 20-minute arm64/SM121 smoke test.
Replacement model: nvidia/GLM-5.3-Flash-NVFP4 at TP4 on cn5 GPUs 0–3 — the only 4-rank-capable checkpoint on that host, and GLM at TP4 is the recipe the repo declares end-to-end qualified (docs/model-preparation.md:171). Its page size is 128 tokens (docs/prefix-cache-offload.md:97 region, PR geometry), so the PR's eviction-pressure regime is reproducible. Deviating from DeepSeek is unavoidable; record it as a scope limit (§6).
1. What is being tested (verified against head c5b39236)
| Mechanism | Code | Observable on hardware? |
|---|---|---|
Two-tier victim order (is_protected, RetentionRank, id) after filters |
helios/src/cache.rs:378-380, applied :777 |
Yes — via which prefixes survive (usage.prompt_tokens_details.cached_tokens, flare_cache_reused_tokens_total) |
Sticky demotion on dual turnover / 2x under compaction |
cache.rs:360-376, called from retire_leaf / compact_ancestor |
Only indirectly (survival after many retirements); directly proven by CPU tests |
≥33 % inheritance (parent_len * 2 >= tail_tokens) |
cache.rs:492-495 (PR body) |
Indirectly via multi-turn hit rate |
Fresh-admission gating (touch_hit only on fresh GPU hits) |
scheduler.rs:1739-1745 |
Yes — hit rate must not rise on a zero-reuse control workload |
| Host-restore promotion gated on a live fresh waiter | scheduler.rs:1863-1903, cache.rs:423-506 |
Yes, but only with the disk tier enabled — host_hits vs cache_reused_tokens discriminate (§5) |
Completion refresh stays plain touch |
scheduler.rs:3138-3155 |
Indirectly (multi-turn retention) |
Citations: PR body/review for #665; /metrics names in docs/api.md:336-346; cached_tokens semantics docs/api.md:1006-1007.
Not hardware: check.py --mutations, TLA+ conformance, --jobs 4, unit/policy tests. These are CPU-only gates (docs/design-review.md:209-251) and must be run before any GPU allocation, not during it.
2. Phase 0 — CPU gate (no GPU; ~45 min wall, run on cn5 CPU or a login node)
Do not allocate GPUs until all of this is green.
# build both arms from the same tree, only the commit differing
git checkout 1fbcc3c9 && cargo build --release --manifest-path flare-cli/Cargo.toml (not opened)
cp flare-cli/target/release/flare /tmp/flare-main
git checkout c5b39236 && cargo build --release --manifest-path flare-cli/Cargo.toml (not opened)
cp flare-cli/target/release/flare /tmp/flare-665
# blocking CPU gates on the PR head
cargo test --locked --release --manifest-path helios/Cargo.toml (not opened) --features runtime-core,server
python3 verification/helios-lifecycle/check.py --tlc-jar /path/tla2tools.jar --mutations --jobs 4
Pass: both binaries byte-identical to their commits; tests green; --mutations reports its KILLED totals. Also record sha256sum of both binaries and of the core you will serve — the A/B is a binary swap only (the change adds zero flags, so nothing else may differ).
Core acquisition. The listed models are checkpoints, not exported cores; flare run needs an SM120/gb202 TP4 core, and each TP size needs its own export (docs/model-preparation.md:168-171). Check first, and only export if absent — export is the single largest GPU-time risk in this plan:
flare models list --json # look for a gb202-tp4 (or gb202-tp1) GLM-5.3-Flash NVFP4 entry
flare inspect <CORE> --plain # must show the expected tensor_parallel and sm120/gb202 arch
# only if missing (one-time, hours; runtime flags never require a re-export — docs/cli-design.md:896-899):
.venv/bin/ignition export glm-5.3-flash-nvfp4 --gpus 0,1,2,3
If only a TP2 core exists, fall back to --gpus 0,1 for both arms and note that the KV pool (and therefore eviction pressure) is roughly halved — do not mix TP widths between arms.
3. Phase 1 — geometry and pressure pre-flight (cn5, 4 GPUs, ~20 min)
Start each arm once, identical flags, and prove the two arms are comparable and that the workload actually creates eviction pressure. If any of these differ between arms, stop: the comparison is invalid.
# arm ∈ {main, 665}; PORT=8000
/tmp/flare-$ARM run $CORE --gpus 0,1,2,3 --host 127.0.0.1 --port 8000 \
--max-concurrency 32 --mtp-draft-tokens 7 --mtp-adaptive-verification \
--mtp-max-verification-token-budget 128 --mtp-adaptive-verification-alpha 1.0 \
--scheduler-policy balanced --embedding-table-storage disk \
--embedding-table-cache-size 84GiB --embedding-table-workers 1 \
--embedding-table-resident-scales --kv-cache-limit memory --memory-limit 83GiB \
--prefix-cache-memory 0 --prefix-cache-disk-limit 0
(These are the PR's exact serving flags minus the client, and minus --verify-weights, which only adds minutes to startup.) Then, per arm, record at idle and confirm equality between arms within a few pages:
flare_total_kv_pages, flare_kv_page_tokens, flare_snapshot_capacity, flare_cached_kv_pages, and the core's max_model_len from GET /v1/models.
Abort rule (saves hours): the PR's geometry was 2,606,848 KV tokens / 20,366 pages at 128-token pages. If flare_snapshot_capacity is so large that a 24×8K + 8×214K burst cannot force flare_snapshot_evictions_total to move in the first trial of §4, the policy is inert for this core — re-tune prompt lengths (--kv-cache-limit context or fewer 214K lanes) before spending the measurement budget, not after.
4. Phase 2 — primary A/B: the claimed speedup (cn5, 4 GPUs, ~2.2 h)
Two workloads, both arms, interleaved paired trials, n = 6 per arm per workload, cold-salted per trial index, same server process per arm per workload (no per-trial restarts — that alone would waste ~8 min × 12).
Workloads (adapted from the PR's client suite, seed=42, T=0.0):
- Scan: Phase A = 8 lanes ×
L_coldcold scan prompts (L_cold = min(214144, max_model_len - 64)); Phase B = 32 lanes × 8192-token multi-turn prompts. Baseline hit rate should land near the PR's 19.76 %; candidate must rise. - Long-MT: Phase A = 4 lanes ×
min(127K, …)multi-turn conversation prompts; Phase B = 12 lanes × 8192-token cold fillers. Baseline ~28.6 %. - Control (cheap, 20 min total): 32 lanes × 8192 tokens, every request a unique salted prefix, zero reuse. Purpose: prove the change does not alter hit rate or throughput when nothing is reusable — this is the check that would catch a wrongly-gated
touch_hit.
If the core's context cannot hold 214K, scale both phases down proportionally (e.g. 128K) and say so in the report; keep the ratio between cold-scan and reuse prompt size, since that ratio is what creates the eviction asymmetry the PR targets.
Driver: the repo's own harness, unmodified — scripts/benchmark_scheduler.py. It gives you --trials, closed-loop concurrency, per-request TTFT, median/p99 ttft_median_seconds/ttft_p99_seconds, cached_prompt_token_counts, and /metrics before/after per trial (:128-173), and --reuse-requests so identical bodies replay in both arms (:191-198).
Cold-salt without restarts. prompt() embeds Workload lane {lane}. at the front of every prompt (:94), so rotating the lane base gives a distinct prefix per trial while its binary search keeps token counts exact. Generate the six salted body sets once (≈2 min, tokenizer-only), then replay the same file for the same trial index in both arms:
python3 - <<'EOF'
import json; from pathlib import Path
from scripts.benchmark_scheduler import prompt
url, model, length = "http://127.0.0.1:8000", MODEL_ID, 8192
for t in range(6):
bodies = [prompt(url, model, length, t * 32 + i) for i in range(32)]
Path(f"bodies-scan-{t}.jsonl").write_text(json.dumps({"requests": bodies}) + "\n")
EOF
# per trial t, per arm, per workload:
python3 scripts/benchmark_scheduler.py --base-url http://127.0.0.1:8000 \
--model $MODEL_ID --concurrency 32 --output scan-$ARM-t$t.json (not opened) \
--seconds 60 --warmup-seconds 30 --trials 1 --variant $ARM \
--reuse-requests bodies-scan-$t.jsonl
Interleave arms as trial pairs and alternate order (baseline,candidate, then candidate,baseline) so a thermal or allocator drift cannot masquerade as the effect. Snapshot /metrics between phases A and B of each trial.
Record per trial: hit rate (Δ flare_cache_reused_tokens_total ÷ prompt tokens), Δ flare_snapshot_evictions_total, Δ flare_cached_checkpoints, TTFT p50/p99, completed tok/s, Δ flare_checkpoint_captures_total{role} and flare_checkpoint_skips_total{reason} (diagnostics for whether the policy changed capture selection, which the PR says it must not).
Pass/fail (pre-register these before running):
- Primary: candidate mean hit rate ≥ baseline +15 % relative on both Scan and Long-MT, with the correct direction in ≥ 5 of 6 pairs each. Treat the PR's 1.89×/1.74× as the expected ceiling, not the bar.
- Latency: Long-MT TTFT p50 improvement ≥ 30 % with 5/6 consistent direction. Do not require the headline −86.3 %: it is unexplained against a 1.74× hit-rate gain and was measured pre-hardening.
- No regression: control workload hit rate ≈ 0 in both arms and tok/s within the baseline trial spread (±3 %); zero errors; zero
store_failed/fetch_failed. - Report variance: per-arm median, min, max, and IQR of hit rate and TTFT p50. The PR currently reports none, which is the weakest part of its evidence.
5. Phase 3 — the claim nobody has measured: host-restore promotion (cn5, 4 GPUs, ~1 h)
This directly checks the sentence added at docs/prefix-cache-offload.md:298-303 and the gate at scheduler.rs:1863-1903, which both A/B arms in the PR bypassed (--prefix-cache-memory 0, no disk tier ⇒ [Prepare host prefix cache] omitted, docs/prefix-cache-offload.md:143-150).
Trick that makes it observable: with a disk tier on, a GPU-tier hit increments flare_cache_reused_tokens_total only, while a host restore increments flare_host_cache_hits_total (docs/api.md:341) — so "did the prefix survive in GPU?" is directly readable.
./flare-$ARM run $CORE --gpus 0,1,2,3 <same flags> \
--prefix-cache-memory 0 --prefix-cache-disk $SCRATCH/records --prefix-cache-disk-limit 8G
Per arm, one server session (~20 min):
- Ask prefix A (a ~9K-token factual probe set) → publishes and offloads A (
flare_host_cache_stored_total> 0). - Force A out of the GPU cache with distinct filler requests until
Δ flare_snapshot_evictions_total ≥ flare_cached_checkpoints(the looptests/server/test_minimax_m3_cache.py:128-137uses; it is bounded and fails loudly instead of looping forever). - Ask A once (host restore, fresh waiter → should promote) and ask freshly-prefilled prefix B (same length, created by live prefill ⇒ probationary).
- Add filler bursts, then re-ask A and B, reading
Δflare_host_cache_hits_totalandΔflare_cache_reused_tokens_totalfor each.
Pass: in the candidate arm, A survives in the GPU tier (no host hit) across at least one filler burst where B is evicted (host hit or prefill). Baseline expectation: neither is preferentially retained, so this discriminates the change rather than the workload. Also assert identical answers for A and B (the factual probes must still resolve) — correctness gate, docs/core-design.md:1890-1891.
If this produces no separation, the honest conclusion is that restore promotion does not change GPU retention on a real workload, and the PR's restore-gating sentence should be demoted to "unit-tested only" in the description.
6. Time budget and stop rules (no wasted GPU time)
| Step | Hardware | Time |
|---|---|---|
| Phase 2 geometry + pressure pre-flight | cn5, 4 GPUs | 20 min |
| Phase 2 primary A/B (2 workloads × 2 arms × 6 trials + control) | cn5, 4 GPUs | ~2.2 h |
| Phase 3 restore-promotion probe | cn5, 4 GPUs | ~1 h |
| Optional cn7 smoke | cn7, 1 GPU | 20 min |
| Total | ≈ 3.5–4 h + one-time core export |
Stop immediately and fix the workload (not the metric) when: flare_snapshot_evictions_total does not move in trial 1; baseline hit rate is < 10 % or > 60 % (mis-sized pressure); the two arms' flare_total_kv_pages differ; or startup logs differ in captured-graph counts. Keep the server up across trials within an arm; restart only between arms and between workloads.
7. cn7: recommend not using it for this PR
cn7 is a single NVIDIA GB10 (SM121, integrated memory, 10 CPUs, 60 GiB job RAM). Consequences, verified in-repo:
- Single GPU ⇒ TP1 only, so no 4-rank concurrency and far less per-GPU eviction pressure; the change's effect is a victim-ordering effect that only shows under contention.
- A core must be re-exported for SM121 (an SM120 core fails the arch check,
docs/model-preparation.md:477-479), and on GB10--lossless-kv-compression gpu/ host budgets interact with shared DRAM (docs/prefix-cache-offload.md:96-100, 169-173) — extra cost for no gain. - The candidate models that fit are small (
google/gemma-4-E4B-it,nvidia/Qwen3.8-27B-NVFP4), which reduces per-token cost and shrinks the TTFT signal.
Optional only (20 min, disposable): serve nvidia/Qwen3.8-27B-NVFP4 on cn7 with both binaries at --max-concurrency 4 --prefix-cache-memory 1G, run tests/server/test_prefix_cache_offload.py::test_disabled_offload_preserves_gpu_prefix_reuse_without_host_resources and one repeat-prefix ask; pass = same answers, flare_cache_reused_tokens_total rises by >32K, no host errors. Treat it as arm64/SM121 portability evidence, not performance evidence.
8. What this hardware cannot answer (state in the report)
- Cross-model generality. DeepSeek-V4.1-Flash (the PR's measured model) is on neither host.
AGENTS.md:500-503expects shared-component checks across recipes; GLM TP4 alone leaves that partially unproven. - Real host-store / pooled restore at scale. Phase 3 uses the local disk tier. Pool (
--prefix-cache-pool) and multi-host configurations are out of scope for this plan. - Whether the PR's −86.3 % Long-MT TTFT figure is real. It was measured on
a7568c2c(pre-hardening) withn = 2and no variance; the shipped policy only demotes earlier, so the PR's numbers are an upper bound, not a prediction. Do not treat a smaller gain as a regression without comparing against the same-arm spread. - The formal/CPU gates (§2) are prerequisites, not hardware results. If
check.py --mutationsfails, cancel the GPU allocation. - No metric exposes the protected tier — there is no
flare_protected_checkpointscounter (docs/api.md:336-346,helios/src/server/metrics.rs), so tier membership is only inferable through survival experiments like §5. If the author wants cheap future validation, that counter is the one observability addition worth requesting; it was correctly kept out of this PR to avoid #549 conflicts.
9. Deliverables the test engineer should hand back
For each of §4 and §5: the two arm binaries' hashes, the core hash and TP width, the full flag lines, raw /metrics snapshots and benchmark_scheduler.py JSONL per trial, and a table of hit rate / Δsnapshot_evictions / TTFT p50 / p99 / tok/s with median, min, max and IQR per arm. That is exactly the evidence the PR description currently lacks (it reports n = 2, one boot, no variance, and an unexplained latency delta), and it is what would let a reviewer accept the Result section instead of treating it as author-reported.