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)
- Target hardware, not "broad hardware support." The vision names "SM120/SM121 workstations and DGX Spark." GB10 is an SM121 device (
helios/src/core/naming.rs:26(not opened)), so this is the project's own machine, not a non-goal expansion. CPU/non-NVIDIA backends are the non-goal; this touches no CPU backend and no model path. - Model-agnostic, no flags, no env vars, no Protobuf/ABI change. The hook is a generic "run hot threads on the fast cores" call, not a per-model branch — it satisfies "no per-model special cases or flags" and "no magic switches."
- Root cause, not a symptom. Scheduler placement variance is genuinely the cause of the jitter, and the change addresses it at the placement layer. Operator cpusets are preserved by intersecting with
sched_getaffinity, which is the right behaviour. - Evidence is in the expected four parts and is unusually concrete: launch-to-launch CV 4.82% → 0.72%,
RoceOneshotLaunchsum −31.0%, p90 inter-graph wake gap 1,880 µs → 30.9 µs, plus a 2-hour soak. Rust unit tests cover homogeneous, single-tier, zero-capacity and three-tier cases.
Problems that must be fixed
-
Vendored-proxy divergence (highest concern).
helios/native/roce_proxy.c:6-8states "Keep the source below identical so preparation and serving share the transport ABI," anddocs/roce-ring.md:361-364repeats 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-86carries 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. -
A duplicated implementation with no test.
select_high_capacity_cpusexists 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 readscpu_capacityper CPU andreturns (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.rstests only feed synthetic pairs), so the "no-op on x86" path is what CI actually proves. -
Affinity is inherited, so the mask leaks past the intended threads.
prefer_high_capacity_cpus()is called at the top of theflare-modelthread (helios/src/server/runtime.rs:568). The same thread later constructs the image-preparation worker (runtime.rs:721→ImagePreparation::new,runtime.rs:1011) and, viacrate::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'ssched_setaffinitymask, 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-867deliberately keeps offload threads onSCHED_BATCHwith 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. -
The documented policy gate on CPU affinity is not met in the docs.
docs/prefix-cache-offload.md:866-867says plainly: "Adding CPU affinity requires a serving-latency measurement that shows a benefit." The PR has measurements, but it leaves the document untouched, somainwould 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. -
Same-process TP coverage is accidental, not designed.
helios/src/execution/threaded.rs:652-654spawns theflare-rank-Nthreads without calling the helper. They get the narrowed mask only by inheriting it fromflare-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. -
Three magic numbers with no rationale in the code. 90% of max, the
(min+max)/2fallback, 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. -
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-mainnumbers 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.mdasks for baseline-matched comparisons of complete graph latency and throughput throughflare 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:
- Delete
pin_high_capacity_cpus()fromroce_proxy.c; pin the proxy by restricting the Rust thread that callsroce_start(roce.rs:295). This alone satisfies the "keep the vendored proxy identical" rule inroce_proxy.c:6-8anddocs/roce-ring.md:361-364and removes the FlashInfer #156 coupling. - Stop the mask leaking onto offload/image/selene threads: either narrow only the execution/replay threads and pin
flare-modelnarrowly 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. - 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. - Make the same-process TP rank threads (
threaded.rs:652) explicit rather than relying on inheritance, or document the inheritance contract. - Reframe the claimed benefit to lead with the patch-vs-
mainmeasurements (CV,RoceOneshotLaunch, wake gap) and label the +17.2% C8 figure as a placement A/B, perdocs/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.