Case file — PR #644 "fix(helios): per-step speculative calibration and excluded-only waiting/delivery fairness"
Repo: NVIDIA/hyperflare-inference · base main (4ed5d875, #637) · head 2b15114 · open, ready for review, opened and last updated 2026-11-30 17:35 · author lukealonso (COLLABORATOR) · Discord lukealonso.
Method: read the diff and the head code (pr/644), the PR body, and the related PRs/issues in the local copy; verified arithmetic and the cited lines myself. Where something is only claimed by the author it is marked as a claim.
Key findings
- An open, competing fix for the same defect exists: #632 (original-el8, opened the same day, 08:24). It fixes the same under-selection of deep speculative depths in the same file (
helios/src/scheduler/rounds.rs) by scaling the per-step calibration ceiling across depth (CALIBRATION_FACTOR_MAX = 2.0,CALIBRATION_STEP_FACTOR_MAX = 1.75,2.0 * 1.75^depth); #644 instead redefines the calibrated quantity (per-step conditional rather than cumulative prefix ratio) and raises the flat clamp to4.0(helios/src/scheduler/rounds.rs:13,51,89). Both editrounds.rs,policy_tests.rsanddocs/scheduling-runtime-design.md; #632 additionally updateshelios/README.mdfor the exact sentence #644 leaves stale (see finding 5). #632's own review thread states its branch had "no conflicting open PR touchinghelios/src/scheduler/rounds.rs", which #644 falsifies. #632 has two Autobot "Changes Requested" verdicts for missing derivation and default-α regressions (−1.9% to −5.2% on 5 of 6 cells), so the same evidence bar is live for both. - #645, by the same author, was opened one minute after #644 (17:36) and overlaps 7 files (
policy.rs,policy_tests.rs,service.rs,utility.rs,scripts/scheduling_sim/utility.py,tests/test_scheduling_utility.py,docs/scheduling-runtime-design.md). #645 addsLaneValue::prefill_finishwhile #644 addsLaneValue::decode_withinand changesLaneValue::finish(same type), and #645's new coalescing term still pricesdelivery_fairness / (z_ss * E)— i.e. the old delivery-rate variable that #644 redefines as a served shares_i. Whichever lands second must be re-derived. #645 does not touchrounds.rs, so the calibration half is orthogonal. - Open issue #152 (javieratomic, 2026-10-30, still open,
triage:design-review) is the month-old field report of exactly this defect and is not referenced by the PR. On DeepSeek-V4.1-Flash TP3/3× DGX Spark,--max-concurrency 4 --mtp-draft-tokens 5, defaultbalancedran 416 width-1 rounds vs 165 width-6 whilethroughputran 1 vs 685, costing 8–14% aggregate throughput. The issue names the two causes asdelivery_fairness (4.0)anddecode_age_price (0.1)— the two terms #644 changes. #152's maintainer triage (original-el8, 2026-11-05) asked for inter-token/cadence evidence, which #644 does not supply (aggregate tok/s only). - Reach is wider than the description states. Only the calibration half is GPU-confidence-gated (
rounds.rs:472-474). The excluded-only age, served-share delivery andLaneValue::finishchanges run for every core shape and both policies;PolicyConfig::throughput()only zeroesdelivery_fairnessanddecode_age_price(policy.rs:49) and leavesterminal_age_price = 1.0(policy.rs:36), soLaneValue::finishnow charging the full horizon and ignoringcompletion_ms(utility.rs:121-130) reprices terminal retirement under--scheduler-policy throughputtoo. No new flags, no version gate, anddelivery_fairness/decode_age_pricekeep their names and default values while measuring different quantities (policy.rs:28-43). - Documentation is left contradictory.
helios/README.md:446-450still says the per-depth ratio is "clamped to[0, 2]" (now 4.0) and still describes a cumulative per-depth ratio;docs/scheduling-runtime-design.md:203-210(gradientg/z),:233-246(sigma_i = K*T/min(batch_capacity,k)and the old score formula),:378-383(terminalH−tsavings),:527-538(one-delivery accounting),:645(delivery_fairness"value/ms") all still describe the superseded model, so the two design docs now disagree (the new versions live indocs/scheduling-utility.md:28-41,60-68,212-231,252-257,276-298). - Benchmark claims lack a same-core
mainbaseline. The headline 76.11 tok/sbalancedis compared tothroughput(76.43) on the new coregb10-tp4-202611301553; the only before/after pair is on a different core (gb10-tp4-202611301141: 72.46→74.15 mean,greedy_code70.30→75.98); the DFly2 "+24.2%" compares the adaptive choice against a forcedP=6, not againstmain. - Zero engagement: no comments, no reviews, no inline comments, no reactions, no labels, no Autobot intake or review (contrast #632, which has 4 discussion entries including two Autobot reviews, and #515 with 12). voipmonitor/Martin Vit (#515/#522 author of the estimator #644 replaces, and last substantive author of
rounds.rs) and original-el8 (#632, #495, #521) have not engaged.
The change
Size: 10 files, +649/−230 (per pr_files): docs/scheduling-runtime-design.md +36/−22, docs/scheduling-utility.md +93/−63, helios/src/scheduler/policy.rs +44/−11, policy_tests.rs +197/−15, rounds.rs +108/−43, service.rs +47/−24, utility.rs +51/−17, scripts/scheduling_sim/utility.py +32/−22, tests/test_scheduling_learning_policy.py +3/−3, tests/test_scheduling_utility.py +38/−10. No Protobuf, core-format or CUDA-graph files appear in the diff, consistent with the "no ABI change" claim.
Three coupled changes in plain terms:
- (A) Calibration (
rounds.rs). Previously each depth stored a cumulative prefix-survival correction and unobserved deeper depths defaulted to1.0. Now each depth stores a per-step conditional correction: a survival-weighted EWMA ofrealized_d / w_d(wherew_dis the previous realized prefix survival) against the raw per-step GPU confidence, clamped atCALIBRATION_FACTOR_MAX = 4.0(rounds.rs:13,51,89), and pricing multiplies the cumulative product of per-step factors across0..=depth. Unobserved deeper depths inherit the deepest observed shallower depth's factor, request-local preferred over global (prior_calibration_factor,rounds.rs:290-307). Details a reviewer would not get from the description, all verified at head: the EWMA step isalpha = w/weightso deep depths learn ~1/0.15 ≈ 7× slower than depth 0; round aggregation publishesround_w = clamp(sum_w / count, 0, 1)— the divisor is the lane count, notcount… notsum_w(rounds.rs:701-706);Forecasts::newnow seeds every depth at0.5viavec instead of a geometric0.5^(i+1)per depth, withobserved: falseso pricing skips it (net effect at startup: neutral factor 1.0 rather than depth-shrinking);Forecasts::observe_calibration(unweighted form) is now#[cfg(test)]-only (rounds.rs:353-401); the host-estimate fallback branch shares the same cumulative product, so per-step error compounds there too. - (B) Excluded-only waiting age (
utility.rs,service.rs,policy.rs, sim). Served lanes no longer pay waiting age; only excluded delivery-bearing streams do.DeliveryReferencenow carriesexcluded_wait_msandserved_share(service.rs:59-160); default before measurement(K−1)/rand1/K; measured pathexcluded_wait_ms = (K − b)·T/b,served_share = b/K(service.rs:150-157), matching the documentedsigma_i = (K−b)T_f/b(docs/scheduling-utility.md:230-239).LaneValue::decode_within(expected, preceding_ms, horizon_ms)(utility.rs:99-119) prices wait over[0, preceding]and service over[preceding, horizon];decodeis thepreceding = 0wrapper. Two-stage sequencing passespreceding = duration_nsfor the second stage (policy.rs:793-796) andprerequisite_valuetakeshorizon_ns(policy.rs:958), so cohort selection (best_cohort,best_two_stage_cohort, packed DP) stays additive. - (C) Served-share delivery fairness (
service.rs,policy.rs, sim). Accounting records(dt, delivered = dt, maximum_rate = 1.0)for a served submission and(dt, 0.0, 1.0)when excluded (service.rs:304-320,404-425);DeliveryObservation.maximum_ratewas removed; first visible publication initializesServicePrice::initial(1.0)(service.rs:418); pricing usesservice.deliveries.unwrap_or(ServicePrice::initial(reference.served_share))(policy.rs:408-496). Effect: a served decoder earnsdelivery_price_i · service_ms, which divides byTto the constant+g_i/s_i.
Verified, not just claimed: the "no T-dependent bias when nothing is excluded" property holds in the arithmetic. In decode_within the served lane's +c_i·service_ms·(A + (horizon+preceding)/2) term supplies exactly the +c_i·T/2 that ValueRate::new's common subtraction −decode_age_price·T/2 (utility.rs:142-152, summed over all lanes in policy.rs:493) removes, leaving net −T²/2·c_j only for excluded lanes. With sigma_i = 0, s_i = 1, preceding = 0 the score reduces to v_i/T + g_i + c_i·A_i, i.e. pure tok/s maximisation. Same for finish on terminal rows. I found no arithmetic contradiction with the description.
What the description says that the code does not do: nothing material found — the formula sigma_i = (K−b)T_f/b, the served-share accounting, the inheritance rule and the cumulative-product pricing all match the head code. The finish change is under-described rather than overstated: the description says only "updated", while completion_ms is now used solely in a debug_assert and the full horizon is charged (utility.rs:121-130).
The why
- Problem: under default
balanced, Helios under-selects deeper (higher-tok/s) speculative verification depths, collapsing toW=1/P=3shapes. - #152 (open, javieratomic, 2026-10-30, labels
area:scheduling,model:deepseek-v4.1,performance,triage:design-review) is the prior field report: defaultbalancedchose 416 width-1 rounds vs 165 width-6 at B=4 wherethroughputchose 685 width-6; prose 83.9–86.5 vs 92.0–93.6 aggregate tok/s, per-request 21.4–22.0 vs 24.0–25.4. It explicitly blamesdelivery_fairness4.0 anddecode_age_price0.1 — the two terms #644 changes. - Maintainer triage on #152 (original-el8, 2026-11-05) accepted it as performance/
triage:design-reviewbut noted it "does not measure the output-cadence tradeoff priced by the balanced policy" and asked for matched inter-token/delivery gaps plus per-request latency. #644 supplies aggregate tok/s and depth/off/rratios only — so the cadence evidence #152 asked for remains missing. Neither #152 nor #632, #530, #515 or #522 is linked from the PR body. - Adjacent, different-cause symptom family, not addressed: #530 (devinkuhn, open) json_schema decoding 2–3× slower via width-1 grammar-constrained MTP.
- Timeline: #515 merged 2026-11-25 → #522 same day → #632 filed 2026-11-30 08:24 → #644 2026-11-30 17:35. #152 has been open a month.
Related work
- #632 (open, original-el8) — direct competitor on the calibration half. Same symptom (
W=1/P=3collapse, including in a test namedgpu_confidence_multi_step_calibration_escapes_packed_three_trap…), same root-cause diagnosis (proposal_confidence[frame,row,d]is per-step conditional while calibration clamps the cumulative ratio), opposite fix (scale the ceiling per depth,2.0·1.75^d, base ceiling stays 2.0). Files:rounds.rs,policy_tests.rs,docs/scheduling-runtime-design.md, plushelios/README.md(+3/−2) which #644 omits. Labels:area:scheduling,performance,triage:validation. Two Autobot "Changes Requested"; its evidence includes −1.9%…−5.2% regressions at default α=1.0 on 5 of 6 cells and an outstanding ask to derive 0.88, 4.0, 2.0, +3, 6 — the same derivation ask applies to #644's unexplained 4.0 clamp andclamp(sum_w/count,0,1)round weight. #632 verified thatscripts/scheduling_sim/does not model GPU-confidence calibration at all, so #644's 786 simulator tests cover only the age/delivery half. - #645 (open, same author, +1417/−127, 20 files) — stacked/overlapping. Opened one minute after #644; closes #485; rewrites
service_rates,policy.rscandidate pricing (add_candidate,next_progress,continuation_candidate,resize_prefill) and addsLaneValue::prefill_finish; norounds.rs. Its coalescing term still uses the oldz_ssdelivery-rate variable, which directly collides with #644's redefinition. - Calibration estimator lineage: #495 (closed, original-el8; superseded by #515) → #515 (merged, voipmonitor, 2026-11-25,
1e78f080; introducedDepthCalibrationwithclamp(realized/predicted, 0, 2),SurplusHistory,observed_prefixes) → #521 (closed) → #522 (merged, voipmonitor, 2026-11-25,e30d55db; added per-requestRequestCalibrationwhich #644 rewrites) → #632 vs #644. Three contributors have proposed fixes to this one estimator in five days. #515's own thread documents the bias that motivates request-local scoping ("globalDepthCalibrationbleeds across sequential workloads/contexts"; 28.7% plainW=1rounds at α=1.0 vs 0.3% uncalibrated; −21.2%/−26.7%/−19.6% on 1× GB300 TP1). #644 leavesSurplusHistory/SURPLUS_FACTOR_MAXuntouched. - #540 (merged, PCCessna, 2026-11-29): timing-refresh/acceptance-credit across idle; no semantic overlap, but it is the immediately preceding shaper of
policy_tests.rsand the simulator, into which #644's hunks land cleanly. - #620 (merged, lukealonso, 2026-11-29) and #619 (merged, lukealonso): #644 sits on top; #620's draft-removal publication path is preserved, #619's multi-token host-stop speculation is the precondition for deep widths.
- #426 (merged, original-el8): introduced
ServicePrice::rebase/rebase_upward(utility.rs:27-46), untouched; the served-share change keeps per-observemaximum_rate, so rebase semantics survive. - Not relevant beyond name collisions: #548 (metrics), #643 (RoCE opcodes), #628 (offload CE gating), #554 (Engram RDMA), #542 (closed; superseded by #555 batch capacities), #637/#626/#586/#617/#614/#613/#608 (recent merges, none touch scheduler pricing).
Recent activity
helios/src/scheduler/rounds.rs:c146d7be#620 (lukealonso 2026-11-29),c9693765#555 (Martin Vit 2026-11-27),e30d55db#522 and1e78f080#515 (Martin Vit 2026-11-25),fd6c0f3b#510 (lukealonso 2026-11-24). #644 is lukealonso's first substantive edit to the calibration code and rewrites an estimator Martin Vit landed four and five working days earlier.helios/src/scheduler/utility.rs:da578c5c#426 (Jason Cook 2026-11-25),a7d51ca1(lukealonso 2026-10-24, terminal retirement value),18cb0efc(lukealonso 2026-10-13). FirstLaneValuesemantic change since October.service.rs/policy.rsalso in flight in #645 (open) and touched by #620, #555, #542, #426, #538, #619, #510, #188.docs/scheduling-utility.md: last substantive edit70b01b59(lukealonso 2026-11-10), original design18cb0efc(2026-10-13) — #644 is its first semantic change in seven weeks.scripts/scheduling_sim/: lukealonso 4 commits, PCCessna 1 in 180 days; last59adc480#540 (2026-11-29).- Verdict: builds on #620/#624/#540/#555; directly rewrites the product of #515/#522 without their authors commenting; textually conflicts with #632 and #645; removes no merged feature.
People
- lukealonso (Luke Alonso) — COLLABORATOR and one of the three priority contributors named in the charter. 26 merged PRs in 180 days, 2 open (#645, #643); 229 commits to
helios/src, 384 todocs. Deep owner of exactly these files (policy.rs,utility.rs,service.rs,docs/scheduling-*) via #426-lineage work, #459, #538, #619, #620. No prior authority on the calibration estimator itself. - voipmonitor (Martin Vit) — author of merged #515 and #522 and, with #555, the recent owner of
rounds.rs; 52 commits tohelios/src, 55 todocsin 180 days. Silent on #644. - original-el8 — author of closed #495 and #521 and of open competing #632; also the maintainer who triaged #152. Silent on #644 — and the person whose competing design #644 would supersede on merge.
- javieratomic (CONTRIBUTOR) filed #152, the user-side symptom; not notified or credited in the PR body. devinkuhn reported the adjacent #530.
- yatesdr, PCCessna, Wynn Drahorad, Jason Cook appear in the touched areas' history but not in this PR.
Community
- #644: no comments, no reviews, no inline comments, no reactions, no labels, no reviewer requested, no Autobot intake or review. Same-day norms in this area: #632 got an Autobot intake within ~20 minutes and a review within ~45; #515 has 12 discussion entries; #152 has a maintainer reply. The automated review gate has not run on #644.
- Charter "Respect contributors" clause: priority PRs are never closed out of hand and missing pieces must be named specifically in review — nothing has been named yet for #644.
Project fit (charter, as facts)
- "Bring real evidence. Performance PRs need benchmarks showing an actual speedup over
mainon a served workload (#210)" — #644 is a performance PR; a served benchmark exists (4× DGX Spark GB10 TP4, DeepSeek-V4.1-Flash,max_tokens = 256, 5 prompts) but the same-coremainbaseline does not (see Claims). - "Be explicit and pin everything. No magic defaults" — tension:
CALIBRATION_FACTOR_MAX = 4.0, the round sample weightclamp(sum_w/count, 0, 1)and the new flat 0.5 prior are undocumented derivations;delivery_fairness/decode_age_pricekeep names and defaults while changing meaning, which silently changes hand-tuned configurations. - "Keep the runtime small and model-agnostic" — clean: no model branches, no per-model cases, no request-count special case.
- "Check interactions across every supported model, cache scheme, parallel layout, multi-host setup, and hardware target… existing cores still load" — partly satisfied: no ABI/core-format/Protobuf files touched and the change is scheduling arithmetic; but only one hardware target and one model family were measured, and the estimator's own recent history includes an independent 1× GB300 run at −19%…−27% (#515 thread) — the concrete reason cross-target checking matters here.
- "What gets merged: PRs that address a maintainer request, a roadmap item, a reproducible bug, a measured performance/memory issue, or bad docs." — #644 addresses the reproducible #152 and a measured performance issue; scheduler/cadence work is not itself on the roadmap (roadmap: in-process SDK #6, Engram #267, FlashInfer #215) but is the project's dominant current activity.
- Docs expectation: not met in
helios/README.mdand much ofdocs/scheduling-runtime-design.md(finding 5).
Claims and evidence
| Claim | Evidence offered | Assessment |
|---|---|---|
No T-dependent bias when every decoder is served |
algebra; new Rust tests balanced_unexcluded_decoders_maximize_throughput_without_delivery_or_age_penalty (policy_tests.rs:6517) and oversubscribed_decoders_incur_excluded_wait_and_protect_skipped_lanes (:6568); Python test_unexcluded_decoders_pick_peak_throughput_speculation_depth (tests/test_scheduling_utility.py:193-207); rewritten exact-Bellman identity utility.rs:338-383 |
Holds; I re-derived it at head. Tests are synthetic catalogs with hand-set costs, not GPU timings. |
Default balanced ≈ throughput (76.11 vs 76.43 tok/s, 0.4%) |
gb10-tp4-202611301553, 5 prompts, max_tokens = 256 |
No same-core main baseline; comparison is balanced-vs-throughput on the new core only. |
greedy_code 70.30 → 75.98 tok/s (off/r 2.04 → 3.17), mean 72.46 → 74.15 |
gb10-tp4-202611301141, a different core |
Only genuine before/after in the PR; +2.3% on the mean. |
Per-step calibration eliminates W=1/P=3 collapse (ctx16k_T1 70.94 vs 57.12, +24.2%; ctx4k_T1 62.57 vs 54.59, +14.6%) |
DFly2 gb10-tp4-202611301002, throughput policy |
Comparator is a forced P=6, not main; read literally it shows the adaptive choice beats forcing wide, not that it beats pre-change main. |
| Test suites green | eos 2; selene 548 (--features test-support); selene-manager; helios scheduler:: 400 (--features runtime-core,server); flare/flare-cli 201; pytest tests/test_scheduling*.py 786; TLA+ 8 models 0 TLC errors with per-model transition counts |
Internally consistent. Cross-check: #632 (same day, same base) reported 399 passed / 4 ignored for scheduler::, so +1 net test despite 3 new named tests — consistent with the #[cfg(test)]-gating of observe_calibration, not independently verifiable here. |
| All 8 TLA+ models pass | verification/helios-lifecycle/check.py (not opened) --tlc-jar … --target-dir flare-cli/target |
Claimed; counts given per model. |
cargo-kani not run |
not installed; CI job covers it; Kani-covered validators unmodified | Plausible — no Kani-relevant file in the diff. |
| B=4 uncontended and K>4 oversubscribed not benchmarked | stated as a limitation | Honest, and it is exactly the two regimes the new unit tests assert — the core claim of the PR is hardware-unmeasured. |
| No Protobuf/core-format/CUDA-graph ABI change; cores load unchanged | file list | Verified: 10 touched files are scheduler/docs/tests only. |
Reach
- Users/operators:
flare run's default--scheduler-policy balanced(docs/cli-design.md:683) changes for everyone with no opt-in; inter-token cadence differs across releases. No new flags, no new defaults, no version gate (policy.rs:28-43). - Cores: the age/delivery half applies to all core shapes, including host-allocation MTP and plain decode; only calibration is
gpu_confidence()-gated (rounds.rs:472-474). - Both policies:
throughputzeroes onlydelivery_fairness/decode_age_price(policy.rs:49) and keepsterminal_age_price = 1.0(policy.rs:36), so thefinishfull-horizon charge applies there too. - Configurations: anyone who set
delivery_fairness/decode_age_priceviaconfigure_policyor CLI gets the same numbers with different dimensions (per-ms against a burst rate → per-ms against a dimensionless share). - Simulator parity:
scripts/scheduling_sim/utility.pymirrors the change (action_lane_valuegainspreceding_ms, delivery accrues service ms, ages storeexcluded_wait), solearning.py(not opened) presets stay consistent; the simulator does not model GPU-confidence calibration, so the calibration half has no simulator coverage. - Compatibility/deployment: no Protobuf, core-format, CUDA-graph or dependency change; existing exported cores load and serve unchanged; no new allocations in the plan hot path beyond existing per-round
Vecs. - Documentation: the new model is documented in
docs/scheduling-utility.md;helios/README.mdand six sections ofdocs/scheduling-runtime-design.mdstill document the old one (finding 5).
Process
- Open, marked ready for review (not draft); opened and last updated at 2026-11-30 17:35 with no push since, so no review cycle has occurred. Branch
helios-adaptive-verification-and-excluded-fairness→main, base4ed5d875(#637 — already on top of #624). - CI on head
2b15114: passed. Reviews: none. Labels: none (contrast #632:area:scheduling,performance,triage:validation). No Autobot case file. - Test deltas in the diff:
policy_tests.rs+197/−15 (3 new tests: per-step calibration/inheritance, balanced-unexcluded, oversubscribed),tests/test_scheduling_utility.py+38/−10 (1 new test),test_scheduling_learning_policy.py+3/−3 (expectation updates). The rewrittenutility.rs:338-383identity is a stronger assertion (exact Bellman identity with an excluded lane). - Age: same working session as the review; ordering same day is #632 08:24 < #644 17:35 < #645 17:36.
Open questions / what could not be found
- No same-core
mainbaseline for the headline 76.11 tok/s figure; and no inter-token/cadence measurements, which #152's triage explicitly requested. - No derivation for
CALIBRATION_FACTOR_MAX = 4.0, theclamp(sum_w/count, 0, 1)round weight, or the new flat 0.5 prior — the same gap #632 was twice asked to close. - Merge ordering between #644, #632 (same clamp) and #645 (same
LaneValue/service_rates/action_lane_valuesites, and #645 still prices the oldz_ss) is undecided and unresolvable from the PR; no comment from voipmonitor or original-el8 exists. - Whether #644 is intended to supersede #632 or to be an alternative (no cross-reference either way) — not determinable from the PR.
- Multi-host / other parallel layouts / GB300-class hardware: asserted, not measured.
- No information found on whether a Kani-relevant validator was touched (the file list says no); and the exact
scheduler::test-count discrepancy vs #632 could not be reconciled without running the suites.