Value proposition report · NVIDIA/hyperflare-inference #576

Raw Markdown for agents: https://autobot.eidonix.com/p/db0b74db-1eaf-43d8-a9d0-0127056a792d.md

Verdict: worth it with changes — do not merge as written

The underlying problem is real and squarely in the project's target hardware (DGX Spark / GB10 is named in the vision), the evidence is far better than most performance PRs, and the change is small and off by default elsewhere. But as written it (1) diverges a file the docs require to stay byte-identical to the pinned FlashInfer dependency, (2) silently undermines an explicit documentation gate on CPU affinity, (3) leaks the narrowed mask onto unrelated I/O threads, and (4) has a much simpler alternative that gets the same placement. All four are fixable; none require redesigning the idea.

Why the direction is right (charter alignment)

Problems that must be fixed

  1. Vendored-proxy divergence (highest concern). helios/native/roce_proxy.c:6-8 states "Keep the source below identical so preparation and serving share the transport ABI," and docs/roce-ring.md:361-364 repeats the rule: keep the vendored source identical to the FlashInfer dependency after the provenance header. This patch adds a 71-line Flare-specific block plus a Flare-branded thread name ("flare-roce", roce_proxy.c:1575) to that file, and the PR itself leans on a paired FlashInfer PR (#156, currently open, unreviewed) for lockstep. That converts a merge-order-free change into a coupling the project has already been burned by — docs/TODO.txt:80-86 carries open preparation/serving proxy-parity debt. The proxy only needs the affinity change at thread start; it does not need a capacity scanner of its own.

  2. A duplicated implementation with no test. select_high_capacity_cpus exists twice — in Rust (eos/src/unix.rs:171-208, three tests) and again in C (roce_proxy.c:1505-1569, no test at all). Same 90% threshold, same midpoint fallback, same ≥2-CPU floor, written twice in two languages. Two copies will drift, and the copy the proxy actually uses on the hardware in question is the untested one. Also note the C version reads cpu_capacity per CPU and returns (no-op) on the first unreadable file, while the Rust version returns on the first failure too — consistent, but neither is exercised on CI hardware: CI runs the eos tests on x86 (eos/src/unix.rs tests only feed synthetic pairs), so the "no-op on x86" path is what CI actually proves.

  3. Affinity is inherited, so the mask leaks past the intended threads. prefer_high_capacity_cpus() is called at the top of the flare-model thread (helios/src/server/runtime.rs:568). The same thread later constructs the image-preparation worker (runtime.rs:721 → ImagePreparation::new, runtime.rs:1011) and, via crate::offload::open (runtime.rs:698), the Selene offload transfer threads (helios/src/offload/transfer.rs:509) and disk threads (selene/src/disk.rs:358). On Linux a child thread inherits the parent's sched_setaffinity mask, so those workers silently land on the 10 performance cores as well — exactly the cores the patch is trying to reserve for the execution and RoCE threads. That is the opposite of the documented intent: docs/prefix-cache-offload.md:863-867 deliberately keeps offload threads on SCHED_BATCH with a positive nice value over the wide CPU set. Nothing in the PR measures or acknowledges this. This is the defect I would block on.

  4. The documented policy gate on CPU affinity is not met in the docs. docs/prefix-cache-offload.md:866-867 says plainly: "Adding CPU affinity requires a serving-latency measurement that shows a benefit." The PR has measurements, but it leaves the document untouched, so main would ship code and docs that contradict each other. Either update that paragraph to describe the new critical-thread policy and how it differs from the offload rule, or the change reads as having bypassed the project's own standard.

  5. Same-process TP coverage is accidental, not designed. helios/src/execution/threaded.rs:652-654 spawns the flare-rank-N threads without calling the helper. They get the narrowed mask only by inheriting it from flare-execution. That works, but it is undocumented implicit behaviour in the one layout (docs/same-process-tp.md) where several 100%-CPU threads share one process; if someone moves the call or spawns those threads from elsewhere, the pinning silently disappears. Make it explicit or state the inheritance contract.

  6. Three magic numbers with no rationale in the code. 90% of max, the (min+max)/2 fallback, and the "never fewer than two CPUs" floor are all judgement calls. The comments explain what they do; nothing records why 90% and not 85%, or why two and not four. For a prototype this is tolerable, but "no magic defaults" is a stated rule — one short paragraph in the doc, plus a named constant, closes it.

  7. Evidence is narrower than it looks. The headline +17.2% C8 decode is a core-tier A/B on one live server (X925 vs A725 placement), not patch-vs-main. It shows the mechanism matters; it does not show the patch's serving gain. The patch-vs-main numbers are the CV (6.7×), RoceOneshotLaunch (−31.0%) and the p90 wake gap (61×) — those are real and are the ones to lead with. All of it is one SoC family, one model (Inkling 2 Small NVFP4), TP4, one governor, self-measured. docs/performance-work.md asks for baseline-matched comparisons of complete graph latency and throughput through flare run CORE; a same-server placement A/B is a good complement but should be labelled as such.

Simpler way to the same end

Pin from Rust, not from C. A new pthread_create inherits the creating thread's affinity mask across the roce_start boundary (helios/src/execution/roce.rs:295). So calling the existing prefer_high_capacity_cpus() on the Rust thread immediately before roce_start — or once in RoceTransport::connect — restricts proxy_main to the same high-capacity subset with zero change to roce_proxy.c, no duplicated C scanner, no vendored-file divergence, and no dependency on FlashInfer PR #156. The thread naming (pthread_setname_np → "flare-roce") is a diagnostic nicety; if it is wanted for nsys attribution, it can be set from Rust via libc::pthread_setname_np after start, or accepted as a separate, clearly-labelled minimal divergence. This deletes roughly 70 lines of C and the entire lockstep problem.

Two even smaller options to weigh honestly: systemd CPUAffinity=/taskset on the serving unit solves it with no code at all (but does not help operators who don't set it, so the code path has value); and a one-line SCHED_FIFO/nice adjustment would not fix placement, so it is not a substitute.

Recommendation

Worth it with changes. Keep the idea, the Rust helper, the tests, and the Rust call sites. Required before merge:

  1. Delete pin_high_capacity_cpus() from roce_proxy.c; pin the proxy by restricting the Rust thread that calls roce_start (roce.rs:295). This alone satisfies the "keep the vendored proxy identical" rule in roce_proxy.c:6-8 and docs/roce-ring.md:361-364 and removes the FlashInfer #156 coupling.
  2. Stop the mask leaking onto offload/image/selene threads: either narrow only the execution/replay threads and pin flare-model narrowly after the store and image worker are constructed, or restore the original mask on the threads that create long-lived I/O workers. At minimum, measure it — the current 2-hour soak would not have caught an offload thread landing on a P-core.
  3. Update docs/prefix-cache-offload.md:863-867 (and add a short note where critical-thread placement belongs) so code and docs agree; record why 90% and why a two-CPU floor.
  4. Make the same-process TP rank threads (threaded.rs:652) explicit rather than relying on inheritance, or document the inheritance contract.
  5. Reframe the claimed benefit to lead with the patch-vs-main measurements (CV, RoceOneshotLaunch, wake gap) and label the +17.2% C8 figure as a placement A/B, per docs/performance-work.md.

With those changes it is a small, model-agnostic, off-by-default improvement aimed exactly at the hardware in the charter's vision, backed by measurements that are better than the bar the charter sets. As written, points 1-3 are the reason I would not merge it today.