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

Raw Markdown for agents: https://autobot.eidonix.com/p/68c27d2f-8871-4867-852b-a4932d8dc346.md

Pre-test report — PR #582 helios: avoid splitting prefill on zero-budget checkpoint anchors

Author: FujitsuPolycom · Head: a3c6483 · Base: main · Diff: 7 files, +931/−16 Recommendation: DO NOT REFER TO HARDWARE TESTING YET. Send it back to the author. Re-review the restructured version first; a small, sharply-scoped hardware test should follow only after the anchor decision is made one stable, priced field — because the hardware-observable behaviour this PR owns (how many Anchor captures a request makes, and whether a prefill gets split) is the exact behaviour the current code is known to get wrong.

Expected value of hardware testing now: near zero. It would burn a 4-GPU box to characterise numbers that the required fix will invalidate, and the metrics a tester would use as evidence are themselves currently wrong.


1. What the change does, and whether it is testable at all

Scope is right: anchor/snapshot selection is shared Helios scheduling and cache policy, nothing branches on model identity, and the underlying concern is real — with snapshots == 0 no snapshot row can ever be reserved, so the old code selected cuts whose captures could never be armed; and at scheduler_checkpoint_extra_work_fraction == 0 the work allowance is 0, so a padded prefill split is unfundable. That part (checkpoints.rs:460-462, placed after initial_prefill_ns is priced so unmeasured-cost accounting still works) is correct and should be kept in any rewrite.

Two caveats that bound any test plan:

2. The defects are not gatekeeping symptoms — they are actual defects in the reviewed code

I read the head source directly; the review findings reproduced. These are behavioural, on the normal path, not nits:

  1. Duplicate RetentionRole::Anchor captures under ordinary timing drift — checkpoints.rs:364-388 with :471-473 / :498-500. anchor_split_is_zero_cost compares freshly priced before/after against the cached EWMA accounting.initial_prefill_ns passed as known_whole. Under upward drift before + after − whole != 0, so the anchor flips to the prompt end after the interior anchor was already published — a second anchor capture for one request.
  2. Duplicate Anchor when Mixed prefill shifts chunk alignment — checkpoints.rs:489-507. One policy question is priced from three different origins: start = consumed_tokens (:474-482), baseline_start (:491-501), and a hardcoded 0 in is_request_anchor_endpoint (:411-419). Once prefill passes the boundary, branch A is no longer reachable and branch B re-prices a longer interval, so an unchanged cost can yield a changed verdict.
  3. The latched decision is destroyed on readmission — clear_reservations() sets anchor_fallback_from = None (checkpoints.rs:48-52) and is called on the accounting that admission deliberately carries across preemption/readmission (scheduler.rs:1722-1726). Preemption therefore re-derives the anchor from a fresh consumed_tokens; same request, same prompt, possibly a different anchor, orphaning the previously captured prompt-end anchor.
  4. A third, unmemoised price model on the commit hot path — is_request_anchor_endpoint (:390-420) rebuilds prefill_catalog_costs and walks the full 0..prompt interval, bypassing checkpoint_selection_cached/SelectionCache. It is called per lane on every commit (scheduler.rs:2411 → checkpoints.rs:763) and on every inbound admit (scheduler.rs:1794). This is a CPU-side cost regression on the model-serving critical path, and it would be easy to mis-blame on the GPU during testing.
  5. The evidence metric is self-contradictory today — at fraction 0, anchor falls back to prompt_tokens, so every message boundary still enters candidates (:529-539) and is priced with available == 0 (:528), setting budget = true (:603) → stats.checkpoint_skip_work_budget (:782-783) → flare_checkpoint_skips_total{reason="work_budget"} (metrics.rs:501, :847). The reviewer saw this fire live at fraction == 0.0. A tester checking that counter would read a correctly behaving policy as a failure.

Additionally, plan_checkpoints (:671-685) reconstructs the anchor a fourth way, and the anchor Cut is pushed with split_ns: 0, copy_ns: 0 (:512-519), i.e. never charged through allowance() — so the zero-fraction regime is a magic == 0.0 branch (:467-468) rather than a natural limit of one policy. The architecture and simplicity lenses both conclude the fix is smaller than the current diff (the subtractive lens estimates ~410 of 931 lines removable, including ~95 production lines that collapse into one resolved_anchor()), so this is not a case of the reviewer demanding more work than the author already did.

Why "the tests pass" carries no weight here: the author's own suite drives complete_test_step with dur_ns of 1_000–1_000_000 against 512,000-ns-class costs (checkpoints.rs:2355, 2746, 2826, 2841), so saturating_sub clamps and the EWMA-drift defect is structurally invisible. The green run is not evidence about the riskiest property.

3. Also not yet fit to test

4. Minimal hardware test plan — conditional, to be run only after the restructure

Do not run this now. Run it against the fixed head. It is deliberately small: one box (cn5), one model, two configurations, one probe. cn7 adds nothing — this is pure scheduler/cache policy with no CUDA, kernel or architecture-specific code, and cn5's RTX PRO 6000 Blackwell is the same SM120 class as the reviewer's 4× rig where the benefit was already demonstrated, so an architecture-extension test is not needed.

Gate 0 — probe (≈15 min, do not proceed if it fails). On main, at the default fraction 0.05, serve one multi-turn chat request with a message boundary strictly interior to the prompt (≥2 turns, prompt comfortably larger than prefill_chunk_size; SM120 record/replay core as usual) and confirm flare_checkpoint_captures_total{role="anchor"} increments. If it stays 0 on that model/core, the anchor path is not exercised by serving at all and the whole A/B is void — stop and report, do not fall back to guessing.

Test 1 — the PR's own claim, A/B on the same box (the only test that should get GPU time). Same prompt set, A = main, B = PR head, both with --scheduler-checkpoint-extra-work-fraction 0.

Test 2 — prefix reuse, same runs, no extra cost. Over the same A/B, compare flare_cache_hits_total and flare_cache_reused_tokens_total (metrics.rs:1115/:1120) plus flare_snapshot_publications_total. Send each conversation twice (identical prefix) so reuse is measurable. This is the regression the PR most plausibly introduces; it is free because it rides on Test 1's runs.

Test 3 — preemption/readmission, only if it can be triggered deterministically. The latch is cleared by clear_reservations() on readmission, so a request preempted after its anchor commits may re-derive a different anchor. Drive it by admitting more concurrent long-prompt requests than request_slots allows (forcing park/admit) and assert one Anchor capture per request. If it cannot be triggered reliably in ~30 minutes, skip it — a unit test with realistic timing values is the better guard, and that test is part of what the author must add anyway.

Explicitly out of scope — do not spend hardware time on: nonzero-fraction behaviour (unchanged by this PR); snapshot eviction ranking (#568 territory, though note the inbound role-tagging change at scheduler.rs:1794 does touch it — cover it with a unit test, not a GPU run); the 16-request batching test's 2-second synthetic wall-clock bound (meaningless on hardware); anything on cn7; any multi-hour soak or throughput sweep — the effect is one prefill launch per request, which shows up immediately or not at all.

Baseline hygiene: measure main and the PR on the same box in the same session, and record the exact base commit. Because no CI ran on the head and the branch is behind main, an unexpected launch count or capture count must be attributable — the A/B form above is what makes that possible.

5. Bottom line

The problem is real, the layer is right, and the author's zero-capacity guard plus the core idea are worth keeping. But the current head gets the anchor decision wrong in three places for the same request, puts a new unmemoised pricing walk on the per-commit path, and leaves the very metric a tester would use reporting a false failure. Testing this build would produce numbers that the required restructure discards. Refer to the author with the consolidation prescription (one latched, priced anchor decision per request; check snapshots == 0 first; stop clearing the decision in clear_reservations; reuse the existing split-price expression; early-return at fraction 0), then re-review, then run the single conditional A/B above on cn5. When it comes back fixed, the hardware cost of validating it is genuinely small — one box, two configurations, about four prompt shapes, with reuse measurement riding along for free.