Pre test report report · NVIDIA/hyperflare-inference #742

Raw Markdown for agents: https://autobot.eidonix.com/p/9d7b9415-c3e2-4b09-9d40-172f6284bb90.md

Hardware test plan — PR #742 selene,helios: bound pool-only capture buffer to max_sequence_pages

Head tested: f26d8a8 (base main f46a9922, +105/−21 in 9 files). Recommendation to the test engineer: run a 4-phase, ~20-minute GPU plan on cn5, plus a 10-minute smoke on cn7 — and nothing else. The change is a startup-only sizing clamp; only three things are worth GPU time: (a) the slab actually shrinks, (b) GPU KV pages are not throttled and startup succeeds where main failed, (c) a near-max_sequence_tokens checkpoint still publishes to the pool and restores. Throughput/isolation benchmarking would burn GPU time without information.


1. What the change does, and therefore what is measurable

In single-process pool-only mode (--prefix-cache-pool + --prefix-cache-memory 0, no disk tier) Selene registers a CPU-readable capture buffer. Before this PR its slot count was "largest GPU page capacity + one row's slots". After it:

Three hard preconditions, or the test measures nothing:

  1. Single process — capture requires pool_only() and self.cluster().is_none() (memory.rs:1009) and shard.is_none() (offload.rs:699-700). Any --rank, --hosts, or --rendezvous disables it.
  2. Default --kv-cache-limit memory (flare-cli/src/cli.rs:926-939). With context or concurrency, page_ceiling already caps pages at ≈MSP (memory.rs:585-607), so the new min() is a no-op — an A/B there shows zero difference and proves nothing.
  3. kv_pages ≫ MSP — otherwise the clamp cannot bind. A small-context core on a 96 GiB GPU is the ideal rig (opposite of the PR's own 1M-context example, which would need a 1M-token prompt to hit the boundary).

2. Blocker to clear before touching a GPU (do this first, ~2 minutes, no GPU)

Both hosts list their models at 0 GiB, i.e. no prepared/packed signed core is known to be present. flare run needs an existing core file; exporting one needs the full checkpoint plus a preparation run, which is far outside this plan's budget.

# on cn5
flare models list                       # or: ls ~/.cache/flare/cores/models/*/*/
flare inspect <CORE|MODEL> --json > /tmp/core.json (not opened)
python3 - <<'PY'
import json; m=json.load(open('/tmp/core.json (not opened)'))['model']; c=json.load(open('/tmp/core.json (not opened)'))['cache']
ctx=m['max_sequence_tokens']; pt=c['page_tokens']
print('context',ctx,'page_tokens',pt,'MSP',-(-ctx//pt),'max_active',m['max_active'])
print('kv_page_bytes',c.get('kv_page_bytes'),'pages(exported)',c.get('pages'),'max_pages',c.get('max_pages'))
PY

Choose the core that maximises kv_pages / MSP with MSP ≥ ~1,500 and a context small enough to prefill in test time (a 128K–262K-context core at 128 tokens/page gives MSP = 1,024–2,048; on 96 GiB that is typically kv_pages ≈ 40k–100k, a 20–60× gap). If only a 1M-context core exists, the plan still works for Phases 1–2 (sizing and no-throttling) with Phase 3 reduced to a partial-chain (~64K token) publication, and the full-length boundary case must be recorded as not covered.


3. Build (once, on cn5; reuse the binary for all runs)

Build in a directory with room — cn5 gives only 16 GiB scratch, so use the workspace disk, not /tmp on scratch:

git fetch origin && git checkout f26d8a8            # PR head
cargo build --locked --release --manifest-path flare-cli/Cargo.toml (not opened)
cp flare-cli/target/release/flare /workspace/flare-head
git checkout f46a9922                               # base = A/B control
cargo build --locked --release --manifest-path flare-cli/Cargo.toml (not opened)
cp flare-cli/target/release/flare /workspace/flare-main
cargo build --locked --release --manifest-path selene-manager/Cargo.toml (not opened)
cp selene-manager/target/release/selene /workspace/selene

Optional, CPU-only sanity (skip if CI already showed green): cargo test --locked --release --manifest-path selene/Cargo.toml (not opened) --features test-support pool_only_sizes_registered_capture and cargo test --locked --release --manifest-path helios/Cargo.toml (not opened) --features runtime-core,server pool_capture_growth_caps.


4. Manager (shared by every run)

mkdir -p /run/selene /var/lib/selene
/workspace/selene --socket /run/selene/pool.sock --memory 8G --staging 512M \
  --metrics 127.0.0.1:9108 &

In a container this needs --ipc=host (or the same /dev/shm/selene bind-mounted) and the io_uring seccomp profile from selene-manager/deploy/ only if you pass --root. /dev/shm must hold --memory + --staging; check df -h /dev/shm before blaming the PR for a startup failure. Start the manager before instances — a configured pool that cannot attach stops startup.


5. Phase 1 — the claimed win: startup slab size, A/B (cn5, 1 GPU, ~3 min GPU)

Run the same command twice with flare-main and flare-head, one GPU, narrow concurrency so the chain term dominates the uncapped intake floor:

run() {  # $1 = binary label, $2 = extra concurrency flags
  /workspace/flare-$1 run <CORE> --gpus 0 --host 127.0.0.1 --port 80$3 \
    --prefix-cache-pool unix:/run/selene/pool.sock \
    --prefix-cache-memory 0 \
    --mtp-draft-tokens 0 $2 \
    > /workspace/$1.log 2>&1 &
  pid=$!; until curl -sf http://127.0.0.1:80$3/health >/dev/null; do sleep 0.2; done
  curl -s http://127.0.0.1:80$3/metrics > /workspace/$1.metrics
  grep -E 'VmHWM|VmRSS' /proc/$pid/status > /workspace/$1.rss
  kill -TERM $pid; wait $pid
}
run main "--max-concurrency 1" 1
run head "--max-concurrency 1" 2

Record from each log the line pool only: capture buffer X GiB (N slots, populate …, register …) (selene/src/offload.rs:432-460, emitted in the Prepare host prefix cache phase), and from each /metrics: flare_host_cache_slots_total, flare_host_cache_intake_slots (must be 0 in capture mode — anything else means you are not in the capture path), flare_total_kv_pages, flare_kv_page_tokens. VmHWM gives per-process host high-water mark (docker stats/cgroup memory.peak if containerised).

Pass criteria (all must hold):

Check Expected
Capture path engaged both logs contain pool only: capture buffer; flare_host_cache_intake_slots == 0
Head slot count slots_head == min(kv_pages, MSP) + row_slots (derive row_slots from the main run: slots_main − kv_pages)
Head < main slots_head < slots_main, and slots_main / slots_head ≈ kv_pages / MSP (expect ≥ 10× on a 96 GiB GPU with a 128K-context core)
Bytes page_record_bytes = bytes_main / slots_main; predicted head buffer = slots_head × page_record_bytes, within rounding of the logged GiB
RSS VmHWM_head − VmHWM_main ≈ slots_main × page_record_bytes − slots_head × page_record_bytes (±1 GiB, since the slab is populated and registered eagerly)
No KV throttling flare_total_kv_pages head ≥ main; equality is the expected result when the host budget was not binding

Phase 1b (one more run, ~1 min): repeat flare-head with the core's default (wide) --max-concurrency. Expected: slots rise to the uncapped intake floor 2·max_active·row_slots + 128. This is the PR's documented, intentional limitation ("automatic intake is not capped") — record the number, do not fail the run on it. It is the one user-visible caveat the title omits, and it is what tells the maintainer how much of the win survives a wide-concurrency deployment.


6. Phase 2 — the reproduction the PR is justified by: constrained host RAM (cn5, ~5 min GPU)

The claim is "startup succeeds where main exceeded container memory". Reproduce it deterministically with a cgroup rather than guessing:

systemd-run --scope -p MemoryMax=24G -p MemorySwapMax=0 -- \
  /workspace/flare-main run <CORE> --gpus 0 --port 8031 --prefix-cache-pool unix:/run/selene/pool.sock \
  --prefix-cache-memory 0 --max-concurrency 1 2>&1 | tee /workspace/main-24g.log
systemd-run --scope -p MemoryMax=24G -p MemorySwapMax=0 -- \
  /workspace/flare-head run <CORE> --gpus 0 --port 8032 --prefix-cache-pool unix:/run/selene/pool.sock \
  --prefix-cache-memory 0 --max-concurrency 1 2>&1 | tee /workspace/head-24g.log

Pass criteria: main fails or degrades — either the clean error host budget cannot hold a full pool capture (selene/src/offload.rs:175-176), an OOM kill, or flare_total_kv_pages visibly smaller than Phase 1's; and head reaches /health with flare_total_kv_pages equal to its Phase 1 value. Tune MemoryMax once (24G → 32G → 16G) until main fails; one retry is enough. If main also succeeds at 16 GiB, the win is real but small on this core/GPU — say so in the report instead of forcing a failure.


7. Phase 3 — the risk this PR introduces: can a long chain still publish and restore? (cn5, ~8 min GPU; the highest-value functional check)

The cap is only safe if no captured chain exceeds MSP. Unit tests prove the arithmetic; only hardware proves the end-to-end path (record → pool → restore) at the boundary. Run on flare-head, pool-only:

  1. Send one prompt sized to produce a checkpoint chain of 0.9–1.0 × max_sequence_tokens (a repeated filler sentence, ~0.95 × context tokens; keep it under the core's context to leave room for output). Ask a question answerable only from the middle of it, e.g. "…Item 211 records code 596… What code does item 211 record?" and require the exact answer.
  2. Wait for drain: poll /metrics until flare_host_cache_outbound_in_flight == 0 and flare_host_cache_inbound_in_flight == 0.
  3. Force GPU eviction of that checkpoint (send flare_snapshot_capacity + 8 distinct short requests, the pattern used by tests/server/test_minimax_m3_cache.py:128-137), then resend the identical prompt.

Pass criteria:

Metric Expectation
flare_host_cache_stored_total > 0 after step 1 (the chain fit the slab)
flare_host_cache_dropped_total{reason="oversize"} 0 — non-zero means the slab is smaller than one chain
flare_host_cache_retry_abandoned_total{reason="slabs"} 0 — non-zero means publications are being refused for slot space
flare_host_cache_root_pages_total ≈ the chain's page count, i.e. close to MSP (confirms a full-length chain, not a short one)
flare_host_cache_hits_total, flare_host_cache_reused_tokens_total increase after step 3; usage.prompt_tokens_details.cached_tokens > 0; answer identical to step 1
flare_host_cache_fetch_failed_total, store_failed_total 0

This is the check that would have caught the (later-refuted) "slab sized from minimum_pages" concern, and it is the only one that exercises PlannedHostBudgets::max_sequence_pages reaching prepare_offload on real geometry. If only a 1M-context core is available, run the same at ~64K tokens and label the full-boundary case "not covered".


8. Phase 4 — cn7 (GB10, 1 GPU, 60 GiB unified, arm64) smoke, ~10 min, no A/B

cn7 exercises the other branch: integrated > 0 (memory.rs:1140), sized_concurrency = 1 (offload.rs:683), integrated_offload_host_budget instead of host_pool_budget. One flare-head run, same pool-only flags, --gpus 0, plus one flare-main control only if MSP < kv_pages on this GPU:

Skip cn7 entirely if cn5 shows the slab never shrinks (MSP ≥ kv_pages): the clamp is inert on both hosts and there is nothing to validate.


9. What to compare, and what counts as a failure

Collect into one table before writing up: binary, core, flags, kv_pages, page_tokens, max_sequence_tokens, MSP, row_slots, logged slots and GiB, VmHWM, and Phase 3 counters.

Treat as test-plan failures (do not merge on this evidence): head slots ≠ min(kv_pages, MSP) + row_slots; head slots ≥ main's; flare_total_kv_pages lower on head than on main (the clamps should only relax throttling); any oversize drop or slabs retry on a long chain; a restore that returns a different answer than the cold run; a startup error on head that main does not also produce with identical flags.

Treat as documented, expected, not failures: the uncapped intake floor dominating at wide --max-concurrency; startup succeeding where main failed; a core/GPU combination where MSP ≥ kv_pages and nothing changes.


10. Explicitly do not spend GPU time on


11. Honest limits of this plan