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

Raw Markdown for agents: https://autobot.eidonix.com/p/6e97c5e8-c28f-4616-ab85-ae14ed9a7ea1.md

Pre-test report — PR #549 "Report KV pages held by active requests"

Recommendation: DO NOT refer to hardware testing yet. Send back to the author.

The code is fundamentally sound and the approach is right, but the PR cannot be tested as it stands for four reasons: (1) the functional contract — what the gauges mean — is still being changed by two competing readings, one of which I verified as a real behavioural change the author denies; (2) the PR's own evidence shows it does not deliver the number #537 exists to produce; (3) it is a draft with zero CI, so a hardware run would be the first execution of cargo test on this head; (4) there is nothing GPU-specific to test — this is an observability-only change with no kernel, no numerics and no throughput path, so hardware time buys almost nothing that a host-side test does not.

A ready, minimal test plan is below for when the should-fix items land. It deliberately avoids any GPU-time A/B throughput work.


1. What the change is

Two new Prometheus text gauges: flare_request_kv_pages (KV pages active requests reference) and flare_reserved_kv_pages (pages reserved for their growth). Supported by a maintained counter in PrefixCheckpointCache (request_pinned_pages, helios/src/cache.rs:224) updated through a new dual pin API (pin_request/unpin_request, cache.rs:551-580), plus per-slot sums in SchedulerStats (helios/src/scheduler.rs:1216-1228) rendered at helios/src/server/metrics.rs:1306-1318. Prometheus text only — deliberately not in the JSON snapshot. +218/−10 across 7 files. Closes #537.

2. Substantive problems that must be fixed before testing

2.1 BLOCKER — the PR changes a scheduling decision while claiming it does not

I verified this myself. SchedulerStats derives PartialEq/Eq (scheduler.rs:112) and is embedded whole in CopyoutResources (helios/src/server/runtime.rs:1053-1059), whose comparison at runtime.rs:2448 computes retry_copyouts, which decides whether host-store copy-outs deferred for headroom are re-offered to store.store (runtime.rs:2450-2474).

Adding request_pages/reserved_pages to that struct therefore silently joins a behavioural key. The author's PR body says "No allocation, eviction, or scheduling decision changes." That is false — allocation and eviction are untouched, but a scheduling decision (copy-out retry cadence) has changed.

The correctness reviewer is also right about why it can now trigger: refill_reservations (scheduler.rs:1383-1425) pops pages out of free_pages into reserved_pages, and commit (scheduler.rs:2433-2438) moves reserved_pages → private_pages. So the two new fields can move while free_pages/cached_pages/retiring_slots hold. Magnitude is unproven — the correctness reviewer conceded they "could not show a measurable regression," and I agree; free_pages was already in the key and already moves on refill. So this is a narrowing, not a rewrite: compare a resource-only key, or zero the two gauges in the comparison.

Why this blocks testing specifically: it gives a hardware test two possible excesses to chase — extra host_reoffer_calls (a real, if small, behaviour change) and any host-cache throughput/latency effect of the extra re-offers — on a change that is supposed to be inert. Testing the intended change means testing a hybrid. Also, if the fix is to zero the fields or narrow the key, a test that has already been written against "the gauges are in the key" would have to be rewritten.

2.2 BLOCKER — the PR does not deliver the number #537 was opened for

This is the highest-value finding and it is not in any of the reviews, which all treat the design as answering #537.

#537 (by Napuh) is explicitly a vLLM-parity request: current bounds are ~16% (upper) and ~0% (lower) against vLLM ≈9% on the same hardware and load, and the reporter could not tell where the truth lies. The PR's own live numbers are request_kv_pages 399 and 402 of 21504 total → ratio 0.0186 / 0.0187, i.e. ≈1.9%, on two concurrent 1831-token-prefix streams. That is five times below the vLLM reference, not near it.

So the shipped gauge produces a third number that is still far from vLLM semantics. The reason is structural, and the architecture reviewer half-found it: flare_request_kv_pages counts live slots' private pages plus request_pinned_pages, but a vLLM "in use" block is all blocks allocated to running requests. Flare's shared/pinned prefix pages are counted in both request and cached (they are never excluded from cached_pages — cache.rs:258-275), while #537's option 2 (split cached into pinned/idle) would have exposed exactly the pinned set that a vLLM-equivalent needs.

Three things follow:

Do not spend hardware time validating a ratio that is under discussion. Either the docs are corrected to describe what is actually measured (distinct-pages-held, not vLLM usage), or the counting changes — and if the counting changes, the tests change with it.

2.3 BLOCKER — stale contract: the docs state two things that are false

Both are cheap to fix, but a tester who reads docs/api.md will write the wrong assertions:

2.4 SHOULD FIX before merge (not blocking a later test run)

2.5 Nits — safe to ignore for testing purposes

Duplicated if inbound.is_none() branch in three mirrored blocks in admit_planned (this one can't be collapsed to pin_request — the invariants reviewer correctly notes the ticket-parent pin must stay plain so the ancestor survives ensure_resources eviction; the fix is to carry the kind in the existing pinned binding, not to unify the API); three scans of self.slots in stats() where one fold suffices; a test assertion (cache/tests.rs:335) that exercises a generic guard rather than the behaviour it claims; missing docs/runtime-core-design.md (not opened) entry; JSON-snapshot omission unstated in api.md.

2.6 Subtract the duplicated scheduler test — cuts the test plan's cost

The new scheduler test (scheduler/tests.rs:970-1034) reproduces branching_requests_own_distinct_tail_pages_and_terminal_snapshots (tests.rs:1036-1081) step for step — I diffed both: identical scheduler(2,8,5) → admit(spec(64,1)) → … → complete(records(second,7,65,1,90,1)) sequence, and the existing test already asserts the shared/private split at :1078-1079. Only four assertions and a cancel pair are new. Append them to the existing test. This matters for the test plan because it removes a redundant target rather than adding one.

3. What the reviews got right that I confirmed, and one they got wrong

Confirmed sound — this is why the change is salvageable:

One claim I checked and would qualify: the architecture reviewer's knock-on that the description's live inequality (request + reserved < total − free − cached) "does not validate this gauge." Directionally correct — total − free − cached is dominated by snapshot-backing pages — but it is not meaningless as a sanity bound. It just isn't evidence for this gauge. The in-repo drift assertion is the right evidence, and the description should point at that instead.

Process state I verified: draft, no CI checks on head 5ed7af8, discussion contains only the automation case-file notice, author unaffiliated with the repo, and the live scrape was produced from a third-party fork base commit (5ffe4d54) not present in this repository. None of those measurements are reproducible from this branch.

4. Hardware assessment — why the expected value is low

Available: cn5 4× RTX PRO 6000 Blackwell (SM120, amd64), GLM-5.3-Flash-NVFP4 TP4; cn7 1× GB10 (SM121, arm64) Qwen3.8-27B-NVFP4 TP1 (documented qualified native ARM64 path).

Bottom line: expected value of a hardware test on this PR as written is low. It would first run the suite for the first time on a draft, capture a ratio the design discussion may change, and chase a copy-out effect the author says does not exist.

5. Proposed test plan — defer until the §2.1–§2.4 fixes land

Split into two stages so no GPU minute is spent before it is justified.

Stage 1 — host only, no GPU (do this first)

  1. Full suite, release profile. cargo test --release --lib -- cache:: scheduler:: server::metrics plus the full --lib run. The author reports 508 passing on Linux x86_64 but no CI ran on this head; establishing a green baseline is the highest-value check available and costs nothing. Also run the Windows build the description flags as unrun if a Windows runner exists — this is what the description itself asks for.
  2. Drift assertion across the whole suite. Confirm the extended #[cfg(test)] assertion (cache.rs:817-837) now covers request_pinned_pages and that it stays silent across the cache, scheduler and lifecycle tests. This is the real correctness evidence.
  3. The Existing-publication path — currently untested. Both the correctness and conventions reviewers note no test drives pin_request through publish_boundary's shared-checkpoint Existing branch (scheduler.rs:2988-3000), which is exactly where one request pins a checkpoint another request just published, and where a double count or a missing pin would hide. The new test cancels rather than completes its requests, so the PublishResult::Created retire path (scheduler.rs:3146-3153) is also unexercised. Add these two cases before hardware. Cheapest form: the four assertions the subtractive reviewer suggests appended to branching_requests_own_distinct_tail_pages_and_terminal_snapshots (tests.rs:1036-1081), extended with one completed (not cancelled) retirement.
  4. A regression test for §2.1 if the author fixes it by narrowing the key: leave one copy-out deferred for headroom, advance one decode step across a page boundary (moving pages reserved → private while free_pages/cached_pages hold), and assert FakeStore saw no second store call. This test is what makes the "no scheduling decision changes" claim true and checkable — it should exist either way.
  5. A test pinning the Inbound semantics (§2.3): assert both gauges while a request is in RequestPhase::Inbound, so the documented phase boundary is explicit rather than incidental.

Stage 2 — one GPU run, only after Stage 1 is green and §2.2 is settled

One job, one model, ~30 minutes. cn7 preferred (1× GB10, Qwen3.8-27B-NVFP4 TP1, the documented qualified ARM64 path — the simplest single-GPU KV pool, so the ledger arithmetic has the least confounding machinery). If the author's target is the TP4/Blackwell path, cn5 with GLM-5.3-Flash-NVFP4 instead — but not both.

Exact checks, all scrape-based, no benchmarking:

  1. Idle ledger. With no request live: request_kv_pages == 0, reserved_kv_pages == 0. (The author observed 0/0 with cached 2019.)
  2. Scrape freshness (§2.3). Confirm the doc's corrected claim: take one scrape against an idle worker and one immediately after activity, and verify the gauge reflects the last progress pass, not the scrape instant. This validates the doc fix and is the one check that could otherwise be silently wrong.
  3. Two concurrent streams on a shared prefix — the author's scenario. Record request, reserved, cached, free, total. Two assertions:
    • request + reserved < total − free − cached (sanity bound, as in the description);
    • request_pinned_pages <= cached_pages (the invariant that actually attests the gauge — the architecture reviewer's point, and better than the bound above).
  4. The ratio, recorded not asserted. Log request/total. Do not gate the PR on matching vLLM (§2.2) — record the number so the maintainer can judge gap-closure against #537's ≈9% reference on the spot. This is the single most valuable output of the hardware run.
  5. Drain window (§2.3, correctness reviewer's nit 2). Cancel one request mid-flight and scrape immediately: confirm both gauges drop to 0 while the pages are still retiring, and that the docs' corrected wording says so. One scrape, no extra setup.

Explicitly not on the plan, and why: no throughput A/B against main (no perf path changed — pure waste of a GPU slot); no long soak; no multi-model matrix; no repeat of the author's two-GPU DeepSeek run (unreproducible fork base, and it answers a design question rather than a correctness one); no per-model sweeps.

Estimated total: Stage 1 free, Stage 2 one job ≈30 min on cn7. That is the minimum that validates this code.

6. Referral decision

Not referred now. Return to the author for: the CopyoutResources key (§2.1), the #537 value gap and the ratio claim (§2.2 — needs a maintainer/reporter decision, not a code fix alone), the two false doc statements and the inverted PR-body sentence (§2.3), and the chain-walk fold plus saturating_sub and retire ordering (§2.4). Non-draft status with CI green on the new head is a precondition for Stage 2.

When those land, refer for Stage 1 + the single cn7 job above. The underlying accounting logic is sound and well-guarded (maintained counter with a full-scan drift assertion on every stats() read, sound compaction and eviction invariants, symmetric pin/unpin across all nine call sites), so the change is worth landing — its value is real. It just is not yet testable as the vLLM-parity metric it advertises, and its central number is ~1.9% against a ≈9% reference on the same class of load.