Explore report · NVIDIA/hyperflare-inference #645

Raw Markdown for agents: https://autobot.eidonix.com/p/5cbf15d0-0edf-4a87-9ec2-4042d7e80bd9.md

Case file: PR #645 — Overhaul Helios prefill scheduling, cost modeling, and two-frame pipelining

Author lukealonso (COLLABORATOR), open, "ready for review", head 05cccb6, base main, opened and last updated 2026-11-30, 0 reviews, 0 comments, no labels, CI passed on head. 20 files, +1417/−127. It closes #485. Single commit 05cccb65 (no review-driven fixups).

Key findings (what the description does not tell you)

  1. A new always-on scheduling coefficient is not documented where operators look. PolicyConfig::coalescing_horizon_tokens (default 64.0; helios/src/scheduler/policy.rs:26,42, validated non-negative at policy.rs:225-230) is missing from the canonical PolicyConfig table (docs/scheduling-runtime-design.md:651-661, which lists 10 fields and stops at adaptive_verification_alpha) and from helios/README.md:478-488, which enumerates the same defaults and is untouched by this PR. There is no CLI flag and no server-config key: flare-cli/src/cli.rs:634-647 (not opened) exposes only --scheduler-policy, --scheduler-terminal-value, --scheduler-terminal-age-price, --scheduler-checkpoint-extra-work-fraction, and helios/src/server/config.rs:305-330 parses the equivalent scheduler_* keys plus mtp_adaptive_verification_alpha. The bonus is therefore unreachable and un-disableable for flare run operators except through in-process configure_policy (policy.rs:206).
  2. The checkpoint-pricing O(1) stride fast path is silently lost as soon as fills are non-constant — not mentioned in the description. interval_prefill_ns builds its stride only from entry.non_terminal?.constant_ns()? (helios/src/scheduler/checkpoints.rs:222-232, changed line 225), and PrefillPredictor::constant_nanos is Some only when the NNLS fit yields theta1 == theta2 == 0 and u_max >= 0.75 (helios/src/scheduler/cost.rs:298-302). As soon as any partial-fill (u <= 0.5) sample lands in a stratum, the stride disappears and pricing falls back to the per-position walk over every catalog capacity (checkpoints.rs:270-338). The description's claim that constant predictors "preserve … the O(1) stride path" is true only for the constant case; the budget tests (checkpoints.rs:1292-1312, 2375-2378) do not cover the new non-constant regime.
  3. An undeclared behaviour change in the mixed branch of policy.rs. else if r.generated_tokens > 0 became else if r.consumed_tokens >= r.prompt_tokens as u64 && r.generated_tokens > 0 (helios/src/scheduler/policy.rs ~812-820), so prefilling lanes that already hold generated tokens no longer take the mixed decode branch. Not in the description.
  4. The headline burst gains are simulator-only, and one of them is not reproducible from the tree. +14.6% / −42.6% TTFT for burst_eight come from scripts/scheduling_sim with a synthetic catalog (scripts/scheduling_sim/workloads.py:9-22) and are pinned as an exact test assertion (max TTFT ≤ 528.0 ms, every batch == 8) in tests/test_scheduling_utility.py:334-345. The 8 × 8,192 multi-chunk burst (+12.8%, TTFT 1492→1056 ms) has no checked-in workload — workloads.py:50-53 only adds 4096-token bursts, so those numbers rest on an ad-hoc run.
  5. The #485 fix is verified only by unit-test inputs, not by a live long-context measurement. The 100 × 128-token tails / 3,584-token graph / 7.81 s vs 1.76 s numbers are hand-set inputs in cost.rs tests and policy_tests.rs:6547-6581; #485's own DS4.1 TP4 64k–128k scenario is never re-run. The PR's only live measurement of the mechanism is a 46,509-token prompt TTFT (2655 ms), single-arm with no main control.
  6. A test that asserted the opposite behaviour was renamed and inverted. prefill_frames_drain_even_when_the_next_request_is_independent → nonterminal_prefill_frames_pipeline_two_deep_and_terminal_chunks_drain (helios/src/scheduler/policy_tests.rs:1420-1480); the corresponding doc paragraph was rewritten (docs/scheduling-runtime-design.md:567-577). Existing production estimate expectation also moved: a 13-token tail in a 64-capacity graph went from 600 ns to 195..=210 ns (helios/src/server/runtime/phase_tests.rs:1311-1318), a 2.9× shift in planned prefill durations on a real path.
  7. Same-author, same-day overlap with open PR #644 on 7 of these files, including utility.rs/service.rs/policy.rs regions this PR edits. Not stacked; whoever merges second rebases. #644 rewrites LaneValue (decode_within, finish) while #645 adds prefill_finish to it.

The change

Four coupled changes in one commit:

  1. Completion-attributed burst coalescing (policy.rs:440-620, utility.rs:88-95, plus the Python mirror scripts/scheduling_sim/utility.py). A finishing prefill chunk (scheduled_consumed + work == prompt_tokens) receives surplus * horizon, where surplus is the max over added decoders m of ((K+m)/m) * (1 - R(K)/R(K+m)) times a steady-state token value output_token_value + token_fairness/x_ss + delivery_fairness/(z_ss*E), and horizon = min(coalescing_horizon_tokens, prefiller budget, min active-decoder remaining budget). Preconditions: at least one active under-batched decoder and a prefiller without prompt_logprobs whose post-prefill budget > 1 (policy.rs:446-620). LaneValue::prefill(consumed, first_output) adds prefill_finish once on first_output; the first_output flag was repointed from consumed_tokens + work == prompt_tokens to scheduled_consumed + work == prompt_tokens (policy.rs:752, 804, 1227) because a pipelined chunk is planned before the previous one completes. Python mirror: COALESCING_HORIZON_TOKENS = 64.0 (scripts/scheduling_sim/utility.py:22,183,222) and new workloads burst_four/burst_eight/burst_four_low/burst_eight_low (workloads.py:50-53).
  2. Stratified prefill ActionCosts (helios/src/scheduler/cost.rs, +497/−1): PrefillCostModel with 6 strata (fill u <= 0.5 vs > 0.5 × start < 4096 / 4096..32768 / >= 32768), each a 9-sample rolling median, fitted as theta_0 + theta_1*u + theta_2*u*(start/4096) by exact 7-subset relative-error-weighted non-negative least squares (cost.rs:298-302); narrow-regime upward bound t_at_umax * u/u_max when u_max < 0.75 and spread < 0.15. ActionCosts::get now routes every single-lane prefill step through prefill_duration(work, start_position) (cost.rs:529-590, 679-691), so planned prefill durations and expected_finish_ns depend on live work and KV depth — which feeds queue windowing (policy.rs:423-438) for every prefill-capable core with no flag. observe records only step.lanes.first() (cost.rs:709-723), so a multi-lane prefill step contributes one lane's (work, start). Callers switched in policy.rs (add_candidate, natural-fit, continuation_candidate, resize_prefill), service.rs::service_rates, checkpoints.rs (prefill_catalog_costs, interval_prefill_ns).
  3. Two-frame pipelining for consecutive nonterminal GraphKind::Prefill. Three "non-barrier kind" lists widened from Decode | Speculative to Decode | Speculative | Prefill: scheduler gate scheduler.rs:1132-1143 plus the new prefill_step_requires_feedback (scheduler.rs:1109-1130); eligibility policy.rs:311-322; and the four executor layers helios/src/execution/transport.rs:968,1021, threaded.rs:874-876, threaded/protocol.rs:32-37, parallel.rs:262-264. Completion-input guard widened in helios/src/model.rs:350-354. Cursor plumbing: prefill_cursor = max(scheduled_consumed, consumed_tokens) (scheduler.rs:854-856) with _from variants in scheduler.rs:858-944, checkpoints.rs:487-495, 681-700, policy.rs:741-760, service.rs:167-200. Bounds retained: in-flight frames < 2 and grammar-bearing frames serialized (transport.rs:1028-1040); terminal/scored/mixed/checkpoint-cut chunks still barriers.
  4. Mixed-graph and catalog fixes: learning::optimistic_tokens now uses forecast_tokens(&powered_curve(request, true), width) instead of speculative_curve (helios/src/scheduler/learning.rs:11-13); Mixed decode rate/continuation paths gained a !prefill guard plus powered_curve/forecast_tokens (service.rs:232-260, policy.rs ~791-806); unmeasured prefill discovery uses effective_prefill_catalog (policy.rs:341-352, 741-745, 966, 1270). Test: policy_tests.rs:6583-6635.

Supporting files: verification/helios-lifecycle/check.py:544-610 embeds verbatim source text of prefill_requires_terminal_completion_from for the Rust↔TLA trace harness, so later edits to that function must be mirrored there. No Protobuf or core ABI change; no .proto/ignition change in the file list.

The why

Recent activity

The change builds on a dense 10-day merge run in the same files rather than reversing it: #459 (2026-11-22), #510 (11-24), #538 (11-26), #555 (11-27), #540/#582/#608/#613/#619/#620/#626 (all 2026-11-29). Two behaviour reversals are worth flagging: the inverted test named above, and the changing meaning of Estimate::nanos for prefill keys (now a fitted full-fill, zero-context value, not the last raw median), which #540's staleness/refresh logic (costs.is_fresh, costs.stale_keys) consumes — freshness semantics are unchanged but the refreshed number differs. Single commit, so no review-driven history yet.

People

Community

Nothing found: no comments, no reviews, no reactions, no labels, no third-party engagement of any kind (pr_comments returns "No comments."). By contrast #619, #538 and #632 each drew an autobot case file and an autobot "Changes Requested" review within ~30–90 minutes, with blockers about missing live A/B evidence. #645 is ~0 days old at time of write, so the absence may simply be recency.

Project fit (as facts, not verdicts)

Claims and evidence

Claim Backing
burst_eight 923.4 → 1057.9 tok/s (+14.6%), max TTFT 920.0 → 528.0 ms (−42.6%), 32/32 full B=8 rounds Simulator only, synthetic catalog (workloads.py:9-22), rate_history="service"; pinned as exact assertion in tests/test_scheduling_utility.py:334-345. Rust counterpart policy_tests.rs:6489-6545 uses hand-set decode costs (27/30/37/48.5 ms) and only asserts no sub-batch decode, ≥120 full B=4 rounds, lower makespan
8 × 8,192 burst 737.2 → 831.2 tok/s (+12.8%), TTFT 1492 → 1056 ms Not reproducible from the tree — no 8192-token workload is checked in (workloads.py:50-53 adds 4096 only)
#485 fixed: 100 × 128-token tails (1.51 s) in a 3,584 graph don't undercut 7.81 s full estimate over 1.76 s at 4,096; scales with depth Unit tests only (cost.rs test module, policy_tests.rs:6547-6581); the numbers are inputs, borrowed from #485's narrative, not GPU measurements
46,509-token prompt, ~12 nonterminal chunks over TP2, 2655.0 ms TTFT (~17,518 tok/s), clean SIGTERM rc=0 Only live evidence that the pipelining works end-to-end; single arm, no baseline, no metric isolating the pipelining gain
Live bursts 307.8 tok/s (B=4, 1121.2 ms) / 363.4 tok/s (B=8, 2056.1 ms) No baseline; SM120 host while the motivating SM121 2-Spark Nemotron-3.5-Super-VL scenario is unmeasured
Interactive contention gap < 300 ms One simulator scenario
Test suites: eos 2; selene 548; selene-manager 188; helios 1742 passed / 46 ignored (one engram test needed --test-threads=4); lifecycle check --mutations exit 0 across 8 TLA+ models; pytest 644 Reported, not independently re-run here; CI on head passed

Not run: 6 chat-template tests (tests/frontend/prepare_templates.py (not opened) HTTP 403 on gated repo meta-models/Muse-Spark-Open-816B-A42B-NVFP4 — infrastructure, unrelated to the diff), the 64-seed learning.py (not opened) --preset validate sweep, and the live SM121 A/B. Companion local-inference-lab/hyperflare-recipes PR splits Qwen3.8 TERMINAL_PREFILL capacities > 128; both are stated to be independently mergeable.

Reach

Process

Open and marked ready for review, 20 files, one commit, CI green on the head commit, no labels, no reviewers requested, no discussion, same-day age. Closing issue #485 is claimed but the issue's design intent (logarithmic KV bands + a measured prototype) differs from what is implemented (affine NNLS over 3 ctx bands), and #485's own benchmark scenario is not re-run — worth checking with voipmonitor before merge rather than after.

Open questions / not found