Explore scratchpad · NVIDIA/hyperflare-inference #644

Raw Markdown for agents: https://autobot.eidonix.com/p/41005a6d-865a-487b-af9a-dbc14748a66a.md

#1 [high] Change: file map and size of PR #644

PR #644 (open, ready for review, opened+updated 2026-11-30, base main, head 2b15114, no reviews, no comments, CI passed on head). Size: 10 files, +649/−230 (per pr_files):

Three coupled changes: (A) rounds.rs: per-step conditional speculative calibration (replaces cumulative-ratio calibration). (B) utility.rs/service.rs/policy.rs/sim: excluded-only waiting age, sigma_i = (K-b)T_f/b; new LaneValue::decode_within(preceding_ms, horizon_ms). (C) service.rs/policy.rs/sim: delivery fairness changed from burst-frequency 1/T to served wall-time share s_i in (0,1]; maximum_rate 1.0; delivered = duration_ms. Author: lukealonso (COLLABORATOR, priority contributor named in charter). Discord handle in description: lukealonso.

#2 [high] Related work: #632 competes directly with #644's calibration half

#632 (open PR, original-el8, COLLABORATOR, opened 2026-11-30 08:24, updated 15:52, head 9110228, +232/−38, labels area:scheduling, performance, triage:validation) is an OPEN, COMPETING fix for the SAME defect in the SAME code that #644 fixes:

#3 [high] Related work: #645 overlaps #644 on 7 files and the LaneValue type

#645 (open PR, lukealonso, opened 2026-11-30 17:36 — i.e. AFTER #644, head 05cccb6, +1417/−127, 20 files) is the author's other in-flight scheduler overhaul. File overlap with #644 is heavy:

#4 [high] Why: issue #152 is the unfixed field report #644 quietly addresses

#152 (OPEN issue, javieratomic, CONTRIBUTOR, opened 2026-10-30, last updated 2026-11-08, labels area:scheduling, model:deepseek-v4.1, performance, triage:design-review) is the direct, pre-existing field report of exactly the defect that #644 claims to fix, and neither the #644 description nor its linked items mention it.

Setup: DeepSeek V4.1 Flash, TP3 on 3× DGX Spark GB10, --max-concurrency 4 --mtp-draft-tokens 5 (verification width 6), 4 concurrent requests, 512 output tokens, temp 0. Measurements (aggregate tok/s): | | balanced (default) | --no-mtp-adaptive-verification | --scheduler-policy throughput | | Prose real text | 83.9 / 85.6 / 86.5 | 90.6 / 92.5 / 93.7 | 92.0 / 93.6 | | Code real text | 135.8 / 141.8 / 142.0 | 141.6 / 142.5 / 145.5 | 145.9 / 144.6 | | Random words | 89.2 | 102.3 | n/m | Rounds at batch 4 (flare_speculative_rounds_total): balanced = 416 rounds width 1 vs 165 rounds width 6; throughput = 1 width-1 vs 685 width-6. Per-request: prose 21.4–22.0 tok/s balanced vs 24.0–25.4 other two. Diagnosis in the issue: "throughput differs from balanced only by zeroing delivery_fairness (4.0) and decode_age_price (0.1). On this setup the balanced weights lead the scheduler to choose width-1 rounds at batch 4, which lowers both aggregate and mean per-request token rates." Maintainer response (original-el8, 2026-11-05): categorized performance/area:scheduling/triage:design-review; says the report shows a throughput difference but "does not measure the output-cadence tradeoff priced by the balanced policy"; asks for matched inter-token/delivery gaps and per-request latency alongside aggregate throughput and selected widths, then "a decision on intended fairness/cadence behavior."

CONNECTION: #644 changes exactly the two terms #152 identifies (delivery_fairness accounting and decode_age_price charging), and #644's headline claim is that default balanced now matches throughput (76.11 vs 76.43 tok/s). So #644 is effectively a fix for #152 — but #152 asked for inter-token-gap / cadence evidence, which #644 does NOT provide (it reports aggregate tok/s only, no inter-token latency / delivery-gap measurements). That is an unmet evidence request #644 leaves open.

#5 [high] Related work: calibration estimator lineage #495→#515→#521→#522→(#632 vs #644)

Lineage of the DepthCalibration/RequestCalibration code #644 rewrites (all in helios/src/scheduler/rounds.rs):

#6 [high] Change: what the excluded-only/delivery-share code actually does (verified at head)

Verified in the head (pr/644) code, not just the diff.

Delivery references (helios/src/scheduler/service.rs:59-160): delivery_reference_intervals → delivery_references returning DeliveryReference { excluded_wait_ms, served_share }.

Accounting (service.rs:304-320, :404-425): a served decode submission observes (dt, delivered=dt, maximum_rate=1.0) — i.e. delivery price is now value-per-served-ms with unit normalizer; an excluded observation is (dt, 0.0, 1.0). DeliveryObservation.maximum_rate field removed. First visible publication initializes to ServicePrice::initial(1.0) (:418) instead of 1.0/duration_ms.

Pricing (policy.rs:408-496): values[slot].delivery = exp(delivery_log - scale) where delivery_log = service.deliveries.unwrap_or(ServicePrice::initial(reference.served_share)).log_price(delivery_fairness); values[slot].reference_delivery_ms = reference.excluded_wait_ms (both for terminal lanes :448 and decode lanes :472).

LaneValue math (utility.rs:99-130): decode_within(expected, preceding_ms, horizon_ms) = output*E + delivery*service_ms + c*sigma*(A + horizon) + c*service_ms*(A + (horizon+preceding)/2); decode(e,T) = decode_within(e,0,T).

Two-stage lookahead (policy.rs:793-796): let preceding = if horizon == 0 { 0 } else { duration_ns }; then lane_value_within(request, role, extent, preceding, horizon, ...) — for prerequisite sequences the lane waits over the whole first stage and is served only over the second; prerequisite_value now receives horizon_ns instead of duration_ns (policy.rs:958). lane_value/lane_value_for_tokens become preceding = 0 wrappers, so fixed-graph cohort selection (best_cohort, best_two_stage_cohort, packed DP) stays additive.

#7 [high] Change: documentation left inconsistent by #644 (and #632 edits the same README line)

A. helios/README.md is not touched by #644 and still documents the OLD calibration contract. helios/README.md:446-450: "stored per-depth forecasts are scaled by a request-local aged per-depth verification calibration ratio (seeded scale-invariantly with prior weight 2 from a once-per-round population prior capped at weight 64, 128-token half-life, request EWMA cap 32, clamped to [0, 2])". The PR raises CALIBRATION_FACTOR_MAX to 4.0 and redefines the quantity as per-step, so the README's [0, 2] and "per-depth ... ratio" are now wrong. NOTE that the competing open PR #632 does update helios/README.md (+3/−2) for the same sentence, so whichever merges first leaves the other's doc stale.

B. docs/scheduling-runtime-design.md was only partly updated. The diff touches only the calibration item (~lines 110-152). Still describing the OLD delivery/age model at head:

C. Undeclared: LaneValue::finish no longer prices the retirement instant. utility.rs:121-130: completion_ms is now used only in a debug_assert; the age term is c * horizon_ms * (age + horizon/2) for the whole horizon, replacing the old c * (horizon - completion) * (age + (horizon+completion)/2). The PR description says only that LaneValue::finish was "updated"; the docs/scheduling-utility.md text it adds does state the full-horizon form, but the sibling docs/scheduling-runtime-design.md:381-383 still describes the H - t savings.

#9 [high] Claims: what backs each benchmark claim, and the baseline gaps

Claims in the description and what backs each:

  1. "No T-dependent bias when every decoder is served." Backed by (a) algebra I verified at head (see the cohort-additivity entry), (b) two new Rust unit tests balanced_unexcluded_decoders_maximize_throughput_without_delivery_or_age_penalty (solo B=1 and full B=4 both pick width 8) and oversubscribed_decoders_incur_excluded_wait_and_protect_skipped_lanes (policy_tests.rs:6515-6613), (c) the Python test_unexcluded_decoders_pick_peak_throughput_speculation_depth (tests/test_scheduling_utility.py:193-207). Synthetic catalogs with hand-set costs, not measured GPU timings.
  2. "default balanced achieves 76.11 tok/s ... matching throughput (76.43, 0.4% diff)." Served on 4× DGX Spark TP4 DeepSeek-V4.1-Flash, core gb10-tp4-202611301553, max_tokens=256, 5-prompt suite. Gap: no main baseline on that core for balanced. The only before/after is on a different core (gb10-tp4-202611301141: 70.30→75.98 on greedy_code; 5-prompt mean 72.46→74.15), and the throughput-policy reference there is not given. So the headline "balanced now matches throughput" rests on a cross-core comparison; the same-core before/after is the weaker 72.46→74.15 (+2.3%) figure.
  3. "per-step calibration eliminated the W=1/P=3 collapse on DFly2 (gb10-tp4-202611301002, throughput policy): ctx16k_T1 70.94 vs 57.12 forced P=6 (+24.2%); ctx4k_T1 62.57 vs 54.59 (+14.6%)." This compares the scheduler's choice against a forced P=6, i.e. an oracle, not against main. Read literally it says the adaptive choice is 24.2% faster than forcing the wide shape — it does not by itself show an improvement over pre-change main. This is the same "isolated matched A/B vs main" evidence bar Autobot applied to the competing #632.
  4. Test claims. helios scheduler:: "400 passed, 0 failed"; cross-check: #632 (same day, same base) reported 399 passed, 4 ignored for scheduler::, so +1 net test in the count while #644 adds 3 named tests — consistent with #644's #[cfg(test)]-gating of Forecasts::observe_calibration and removal of nothing, but not independently verifiable here. Simulator 786 passed; TLA+ all 8 models with transition counts; cargo-kani not run (CI job covers it, and the Kani-covered validators were not modified — plausible). "Live GPU multi-concurrency (B=4 uncontended and K>4 oversubscribed) serving benchmarks were not run in this pass" — i.e. the two regimes the new unit tests assert are unmeasured on hardware.
  5. "No Protobuf, core-format, or CUDA-graph ABI changes; existing exported cores load and serve unchanged." Consistent with the diff: only helios/src/scheduler/*, docs, simulator and Python tests. Verified by file list.

#10 [high] Reach: wider than the description says — all cores, both policies, same defaults

#11 [high] People: #644 rewrites code by voipmonitor, competes with original-el8's #632, authored by a priority contributor

Who is in these areas and why it matters:

#12 [high] Project fit: charter #210 evidence bar vs single-hardware, cross-core baselines

Charter (read_charter) mapped against #644, as facts:

#15 [high] Why: the defect's timeline — #152 (Oct 30) → #515/#522 (Nov 25) → #632 (Nov 30) → #644

Timeline showing how long and how widely the defect has been wanted:

#17 [high] Research summary

I have gathered the case file for PR #644 across all nine angles, with entries in the scratchpad (16 notes: entries 1–16).

Key findings recorded: the PR is open/ready, +649/−230 over 10 files, CI green, zero comments, zero reviews, no labels, and no Autobot intake/review yet. It bundles three coupled changes: per-step conditional speculative calibration in rounds.rs, excluded-only waiting age (sigma_i = (K−b)T/b), and served-share delivery fairness (s_i ∈ (0,1], maximum_rate = 1.0).

What a reader could not learn from the description:

I also disposed of every other lead in the orientation packet (entries 13–14) and mapped the charter (#210, explicit-constants, single-hardware evidence, docs) in entry 12.

#18 [high] Recent activity: rounds.rs ownership (vit/voipmonitor last week), LaneValue untouched since October

Explicit record for the "recent activity" angle (commits on main in the touched areas, last 60 days, from the orientation packet plus search_history):

helios/src/scheduler/rounds.rs — most recent first, before this PR: c146d7be #620 (lukealonso, 2026-11-29, copy/history draft removal), c9693765 #555 (Martin Vit, 2026-11-27, batch capacities 6/12/24), e30d55db #522 (Martin Vit, 2026-11-25, per-request calibration + surplus), 1e78f080 #515 (Martin Vit, 2026-11-25, DepthCalibration + SurplusHistory), fd6c0f3b #510 (lukealonso, 2026-11-24). So the file was rewritten by voipmonitor/Martin Vit four and five working days before #644, and #644 is lukealonso's first substantive change to the calibration code. helios/src/scheduler/utility.rs — da578c5c #426 (Jason Cook, 2026-11-25), before that a7d51ca1 (lukealonso, 2026-10-24, terminal retirement value/urgency) and 18cb0efc (lukealonso, 2026-10-13, value per time). #644 is the first change to LaneValue since October. helios/src/scheduler/service.rs — #645 (open), #644, #334 (open), #620, #555, #426, #479, #459, #188 (per items_touching). service_rates/delivery_rate lineage is #426 + #188. helios/src/scheduler/policy.rs — touched by #645, #620, #555, #542, #426, #538, #619, #510, #352, #188. docs/scheduling-utility.md — last substantive edit 70b01b59 (lukealonso, 2026-11-10, "Clean up serving documentation"); original design 18cb0efc (2026-10-13). #644 is the first semantic change to that document in seven weeks. scripts/scheduling_sim/ — Luke Alonso 4 commits, PCCessna 1, in 180 days; last 59adc480 #540 (2026-11-29). #644 edits utility.py; #645 edits utility.py and workloads.py the same day. tests/ — 8da73911 #624 (Wynn Drahorad, 2026-11-30) is the most recent; #632 rebased onto it. #644's base is 4ed5d875 (#637), which is later, so #644 is on top of #624 already. Does #644 build on, conflict with, or reverse this work? Builds on #620/#624/#540/#555. Directly rewrites the product of #515/#522 (the DepthCalibration/RequestCalibration estimators) — three working days after they merged — without those authors commenting. Conflicts textually with open #632 (same clamp, same file) and #645 (same LaneValue/action_lane_value/serviced sites). Does not reverse anything merged in the sense of removing a feature: SurplusHistory, optimistic probing, and funded acceptance learning are untouched.

#8 [medium] Change: algebra of the cohort-additivity and the 'no T bias' claim, verified

Derivation checked by hand against the head code (not taken on trust). The served-lane numerator in LaneValue::decode_within (helios/src/scheduler/utility.rs:107-118) is v_i + g_i*service_ms + c_i*sigma_i*(A_i + horizon) + c_i*service_ms*(A_i + (horizon+preceding)/2). ValueRate::new (utility.rs:142-152) then subtracts a common T/2 * Σ_all_active c_k (policy.rs:493 sums every lane's age_price into age_price). For a served lane the +c_i*T/2 inside the numerator exactly cancels its own share of that common subtraction, leaving −T²/2 c_j net only for lanes the cohort excludes — which is why best_cohort/best_two_stage_cohort/packed DP remain "pick the largest additive lane values for a fixed graph" (utility.rs:162-164 doc comment still says "All excluded-lane waiting costs are common to cohorts of that graph", which is now true only in this cancelling sense, not because every lane pays it). Worked out: doc formula in docs/scheduling-utility.md = correct average-reward-per-round expression + the cohort-independent constant Σ_all c(A+sigma); and when every decoder is served (sigma_i = 0, s_i = 1, preceding = 0) the score reduces to v_i/T + g_i + c_i*A_i, i.e. purely tok/s-maximising — so the PR's central "no T-dependent bias when nothing is excluded" claim holds arithmetically. Same for finish (terminal rows). Conclusion: the excluded-only/served-share design is internally consistent; I found no arithmetic error contradicting the description.

#13 [medium] Process: ready for review, CI green on head, no reviews, no labels, no Autobot pass yet

Process facts:

#14 [medium] Related work: disposition of each packet lead (#645, #632, #540, #522, #515, rest)

Lead-by-lead disposition of the orientation packet's "possibly related items":

#16 [medium] Change: calibration-half details a reviewer would not get from the description

Details in helios/src/scheduler/rounds.rs at head that the description summarises loosely:

  1. Sample weight and clamp. observe_weighted rejects sample_weight <= 1e-6, then weight = (weight + w).min(POPULATION_CALIBRATION_MAX_WEIGHT=64) and alpha = w/weight — an EWMA whose step depends on the survival weight, so deep depths (small w) learn far more slowly than depth 0. That is the intended shrinkage, but it means the effective half-life at depth 5 is ~1/0.15 ≈ 7× longer than at depth 0. Not stated in the description or the docs.
  2. Round aggregation. round_cal now accumulates (sum_w*cond_realized, sum_w*cond_pred, sum_w, count) per depth and publishes round_w = clamp(sum_w/count, 0, 1) — note the divisor is the lane count, not sum_w, so a round where every lane was already at low survival still teaches the global prior with weight ≈ mean survival (small), which is the stated intent ("a single correlated large-batch dip cannot overwrite the prior"), but the algebra differs from a plain mean.
  3. Undeclared prior re-initialization. Forecasts::new now uses vec![DepthCalibration::new(0.5); token_capacity - 1] where it used population.iter().map(|&p| DepthCalibration::new(f64::from(p))) — i.e. every depth's prior mean is 0.5 instead of 0.5^(i+1), and all are observed: false so pricing skips them until a real observation lands. Consequence: on a brand-new core before any observation, calibration_factor walks down to global.get(depth).map_or(1.0, |e| e.factor()) = 1.0 (0.5/0.5), so the calibration is neutral rather than depth-shrinking — a behaviour change at startup that the description does not mention.
  4. prior_calibration_factor fallback order (rounds.rs:290-307) exactly matches the documented rule: observed global at depth → walk depth-1..=0 taking the request-local factor first, then the global factor; final fallback 1.0. Verified.
  5. calibration_factor(depth) is now cumulative-product-based at the call site (two call sites: speculative_curve at :451-465 and the round-observation path at :625-640), both maintaining cumulative_factor *= forecast.calibration_factor(depth, ...). The #[cfg(test)] accessor Forecasts::calibration_factor(&self, depth) (rounds.rs:~370) also inherits from shallower observed depths, so tests observe the same inheritance rule as production.
  6. actual_bound/host_pred path unchanged. The !host_pred.is_empty() branch still multiplies the raw prefix by cal_factors[depth], which is now the cumulative product — consistent, but it means the host-estimate fallback and the GPU path share the same product, so a per-step error now compounds in the host-estimate bound too. No defect found in these; they are the parts a reviewer would otherwise have to reconstruct from the diff.

#19 [medium] Community: no engagement at all; #515/#522 and #632 authors silent

Explicit record for the "community" angle: