Value proposition report · NVIDIA/hyperflare-inference #496

Raw Markdown for agents: https://autobot.eidonix.com/p/19fd3555-42de-4cd4-97b1-94e04cf4dd25.md

PR #496 — Coalesce shared ancestor reads across concurrent Selene disk fetches

Verdict: worth merging, with changes

Nothing new landed on the branch (head is still 0c04b1e2; files: docs/prefix-cache-offload.md +35/−2, selene/src/disk_store.rs +3,313/−931, selene/src/shard.rs +10/−0). The change clears the charter's bar on all four tests it sets for a performance PR, and the prior round's blocker (61.3K retrieval parity) is settled. What is left is a short list of should-fix items — two of real substance, the rest docs and process. I update the previous report: one of the bot's five items is overstated, and two panic/consistency sites it did not mention need the same treatment.

Charter fit

Who benefits, how much

Anyone running concurrent branching/agent traffic at a disk-resident shared prefix on SM121/DGX Spark with --prefix-cache-memory 0 --prefix-cache-disk — precisely the mode selene/src/offload.rs:600-641 builds as a bare DiskStore.

Author's GB10, head 0c04b1e2 Physical NVMe read Median TTFT
27B-NVFP4 TP1, simultaneous 18,177.5 → 4,306.7 MB (−76.3 %, 4.22×) 7,974.6 → 5,662.8 ms (−29.0 %)
27B-NVFP4 TP1, +25 ms stagger 18,194.2 → 4,843.6 MB (−73.4 %, 3.76×) 6,883.6 → 5,951.9 ms (−13.5 %)
Flash-Next TP1, simultaneous 7,944.9 → 1,981.1 MB (−75.1 %) 3,327.5 → 3,225.0 ms (−3.1 %)
Flash-Next TP1, +25 ms stagger 7,958.0 → 2,251.5 MB (−71.7 %) 3,137.7 → 3,049.9 ms (−2.8 %)

The TTFT percentages all recompute correctly, and the arithmetic is coherent: one 61,054-token prefix is 954 pages × ~4.19 MB ≈ 4.0 GB, so "after" at 4,306.7 MB is essentially one copy plus eight ~256-token tails, and the removed duplicate reads at the measured 6–7.7 GB/s account for the 2.31 s drop. The bandwidth win is uniform (~75 %); the latency win is concentrated where the single disk thread is the bottleneck (27B TP1), and the description now says Flash-Next only gains 3 %.

No-regression path, verified in the code: build_pending_demand returns early when device_inbound.len() <= 1 (disk_store.rs:1736), window_index is an O(1) HashMap lookup (1646-1663), attach_pending is shared with Pass 4 (1711), and plan_windows(..., align_to_window) only aligns for device restores (682-727). The single documented cost — at most one extra partial window per segment when skip_pages % 64 != 0 — is in docs:354-358.

Is there a simpler way? No

Re-checked at this head: copier::Job::replication fans one verified share to several ranks, not one host window to several GPU page ranges across requests; keeping a 4 GB prefix in DRAM is what --prefix-cache-memory 0 exists to avoid on a 128 GB Spark; and scheduler-side dedup cannot work because each branch needs its own pages in its own snapshot slot. The bytes can only be shared where this PR shares them. It also does not duplicate #497: #497 shrinks disk-only intake to intake_slots(layout, 1) — two staging windows — and documents that concurrent unique-prefix restores serialize through them; #496 is what lets eight shared-ancestor restores share those two windows. #497 alone would make shared-prefix bursts worse; #496 alone wins on a larger pool.

What it costs

Evidence — strong

Should fix before merge

  1. Get the rate sample out of TransportEvent (the strongest item). InboundWindowSample (disk_store.rs:97-101) carries no JobId yet sits in the enum documented as "Completion the transport reports to the disk store" (:83). It forces two unreachable!()s, not one: shard.rs:476-478 (Kind::of) and disk_store.rs:3638 (DiskStore::apply's match, guarded only by the early if let return at 3632), held up by the filters at shard.rs:722-725 and 1148-1150. A third call site is a release-mode serving crash; a Staged drain method or a field on Fetched removes both.
    • Correction to the bot: the CompositeStore::poll side effect it cites (composite.rs:1376 stats.progress += 1, re-running spill_parked + disk.maintain() at :1418-1428) cannot happen in the benchmarked configuration. With --prefix-cache-memory 0 --prefix-cache-disk, capture is false (offload.rs:587) and offload.rs:632-641 returns a bare DiskStore. It does bite warm-plus-disk configs, where ~954 windows would each trigger maintenance instead of ~8. Say so; do not let the wrong config justify the right fix.
  2. Close the HeaderIdentity hash drift — but not the way the bot suggests. It hashes 14 fields through a .. pattern (disk_store.rs:1014-1050, .. at :1030) against Header's exhaustive PartialEq in another module (shared/record.rs:136-152); a new Header field silently drops out of the hash and coalescing quietly stops. Deriving Hash on Header is wrong — version is deliberately excluded from equality (shared/record.rs:118-119). Instead spell the ignored fields explicitly (version: _) so adding a field is a compile error, and add an a == b ⇒ hash(a) == hash(b) test.
  3. De-flake staggered_arrival_attaches_out_of_order_to_in_flight_windows. assert_eq!(staged.disk_window_reads() + staged.coalesced_windows(), 10) at disk_store.rs:8487 contradicts its own comment (8481-8484: "at least W1 and W2 are guaranteed"). Assert bounds (coalesced ≥ 2, reads + coalesced ≥ 10) instead of an exact total that depends on disk-thread timing; this runs in CI.
  4. Document the metering semantics once. State that inbound_rate excludes queueing and the GPU upload, that on multi-host it is rank-0 NVMe only (shard.rs:1148-1150), and that CompositeStore keeps an end-to-end disk_inbound_rate. Merge the duplicate statement (docs:362-366 vs :1528-1531) and split the 250-word §2.4 paragraph into mechanism + limits/failure-scope bullets — the bot's item 4 is right on maintainability.
  5. Note the public-API surface. TransportEvent is public via selene::disk_store (not re-exported in lib.rs:44-56); adding a variant is a breaking change for any external exhaustive matcher. One line in What, and consider #[non_exhaustive].
  6. Reconcile the "8 child branches" label with the read totals. "After" = 4,306.7 MB is ~one copy — correct and impressive. But "before" = 18,177.5 MB is ≈4.5 copies, not 8 (8 concurrent ~4 GB restores would be ≈32 GB), while flare_host_cache_bytes_in_total is claimed to be 8× single (~32 GB) in the same breath; and simultaneous vs staggered before-totals agree to 0.1 % (18,177.5 vs 18,194.2), which points to a shared cause rather than arrival timing. Either the burst overlapped ~4–5 restores at read time or the physical gauge under-counts — say which. An honest 8-way figure makes 4.22× larger, so this is credibility, not a threat.
  7. Sequence and reconcile with #497 in writing. Both now say "merge in either order" while both edit Staged::pump_all (disk_store.rs:2291) and #497 adds MAINTENANCE_DEFER_LIMIT plus inbound-first ordering. Note also that #497 shrinks integrated disk-only intake to two windows, which is exactly the pool this PR needs to be shared — state the order and land the second one's pump_all as reviewed.
  8. State the coverage boundary in Evidence: multi-host RoCE (the entire shard.rs surface of this PR), 2-GPU split_pools, discrete PCIe GPUs, Windows serving, and live PooledStore GPU serving were not exercised live. main is unaffected there, and #497 has the same boundary, but the shard edits are untested beyond unit level.

Items 1–3 are small code changes; 4–8 are text plus one maintainer ack. None requires redesign. The Layout::record_slots item the bot raised last (disk_store.rs:1777 vs geometry.rs:180-182) is cosmetic — record_slots(pages, row) is literally pages + usize::from(row) * row_slots — worth doing while touching the function, not a reason to hold the merge.

Bottom line

Worth merging, with changes. By the charter's own tests: it fixes a measured, reproducible performance problem (#210) on the project's headline model and hardware; it lives in the one layer where the bytes can be shared and adds no flag, format, re-export, or per-model branch; its correctness evidence is unusually good for a performance PR and now covers the exact misalignment hazard plus five-repeat FP32 parity against main; and it composes with #497 rather than duplicating it. The cost is real — ≈1,100 production lines of reference-counted concurrent state in selene's most delicate file, a cohort-wide blast radius on a corrupt record, and a changed bandwidth metric — but it is paid once, it is documented, and the alternative is 4.5× redundant NVMe reads for the exact burst shape (branching agents on a shared prefix) Flare exists to serve. Fix item 1 (both unreachable!s), 2 and 3, tighten 4–8, get the maintainer ack, and merge.

(Conversation on the PR is this repo's own automated case-file bot plus the author's responses; the only instruction-like text are the bot's "to opt out" footers, which I did not act on. No human reviewer has signed off yet.)