Case file — PR #715 "helios,ignition: implement additive packed multi-request prefill (Contract 3)"
Author original-el8 (COLLABORATOR) · branch docs/packed-prefill-rfc → main · head 84f789a · opened 2026-12-04 00:36, updated 2026-12-04 05:56 · open draft, no labels, no reviews, CI green · 21 files, +1639 / −56.
Key findings
- The description omits four shared-code behaviour changes beyond packed prefill: (a)
ignition/cli/serve.py:462-471now counts onlykind == "speculative"signatures for--packed-verification, so a recipe whose only non-zeropacked_token_capacitysits on a non-speculative graph previously passed and now getsUsageError("this prepared recipe does not declare packed verification capacities")— verified at head; (b)ScheduledStep::validate_mixedgained generallanes.len() > batch_capacitychecks for all steps (helios/src/scheduler.rs:2611-2640); (c)scheduler/cost.rscreates prefill cost models and refreshes prefill context slopes only forkey.batch == 1, changing solo-prefill cost behaviour; (d)scheduler/checkpoints.rsis a substantive rewrite of checkpoint interval pricing for all prefill (prefill_catalog_costs_for,interval_prefill_ns_for, newbound = bound.min(limit - max_terminal_cap)), only loosely covered by "tracks non-terminal packed prefill steps". - The mandatory design-review gates are not recorded as met.
docs/design-review.md:22-26(repeated atAGENTS.md:376-381,docs/core-design.md:276-277(not opened)) requires prior explicit owner approval (Luke Alonso) for a "captured-graph operation family", "even if it reuses a graph kind or enum value", and says "a design acknowledgment does not grant approval". ExtendingPREFILL/TERMINAL_PREFILLtobatch_capacity >= 2with a new prefillpacked_token_capacity/PACKED_TOKENparity layout is at minimum in that grey zone. No approval, noDesign-Signed-Off-By:trailer (.githooks/commit-msg:15), and no maintainer comment appear anywhere in the PR. - Two of the three CPU verification layers required by
docs/design-review.md:195-251are missing and the doc explicitly forecloses the excuse used. The PR adds a cohort algorithm (packed_prefill_candidates, policy.rs:1623-1789) and new timing estimates (packed_prefill_duration, cost.rs:644-661), which triggers thescripts/scheduling_sim/+scripts/scheduling_sim/learning.py(not opened) 64-seed catalog; and it changes commit/checkpoint/admission-adjacent validation, which triggers TLA+/Kani. The limitations section names onlytla2tools.jarandcargo-kanias unavailable and reports no simulator run at all — whiledocs/design-review.md:247-251states "Disclosure does not excuse skipping runnable CPU checks… noting it as a limitation does not make the omission acceptable." - The headline A/B is confounded and self-disclosed as such. The two arms are different signed cores from different FlashInfer revisions (
887785adpre-change vs4aea5c54exported against FlashInfer5a8ceed80), not a flag-only comparison on one core. The C=1 control moving111.2 ms → 118.7 ms(0.94×) is consistent with a ~6% systematic overhead in the packed arm, so the 1.68×–4.15× figures are not an isolated measurement of packed prefill.docs/design-review.md:109-111requires "equivalent baselines". - Do not trust
pr_difffor this PR. The local copy ofmainis stale (predates merged #697, #711, #720), so the diff renders unrelated hunks (AGENTS.md,docs/api.md,docs/cli-design.md(not opened),preserve_message_anchor,pool_vram_limit,external_extents,async_transfer, workflow changes) that belong to those merged PRs. The authoritative set is the 21 files listed below; the PR description claims exactly those, so this is a tooling artifact, not a hidden-file problem. - The change is inert without an opt-in core and costs KV capacity. No new flag or default in this repo; packed prefill only activates for cores declaring
B >= 2prefill graphs (helios/src/server/runtime.rs:846-900), and--max-concurrency 1removes them (runtime_core/selection.rs:339-350). The price is −4.2% logical KV tokens/rank (7,631,232 → 7,310,848). - Zero engagement, by anyone, including the project's automated reviewer. One comment (the author's own highlight summary,
pr_comments), no reviews, no reactions, no labels — unlike peer scheduler PRs #645, #655, #697, which each received an Autobot case file/review within ~an hour. Reviewers are demonstrably active in these files; the silence is specific to this PR (plausibly because it is a draft). - No issue ever asked for this. Searches for issues on "packed prefill", "prefill batching",
batch_capacityfound no request. The rationale is author-generated, but it continues a maintainer-led direction (merged #645 closing #485; #661/#663/#681) from about a week earlier.
The change
In plain terms. Before this PR, a PREFILL/TERMINAL_PREFILL graph had to be batch_capacity == 1, and GraphKind::Mixed admits exactly one prefill lane per step, so N concurrent short prompts cost N full-model replays. The PR lets a prepared core additionally declare prefill graphs with batch_capacity B >= 2 and an explicit 64-aligned aggregate packed_token_capacity P, and teaches Helios to pack 2..B text-only prefill lanes into one replay. Single-request prefill (B == 1, packed_token_capacity == 0) and ScoredPrefill are unchanged.
Where it lives (verified at 84f789a):
| Concern | Location |
|---|---|
Manifest geometry (draft_tokens == 0, max(64,B) <= P <= B*W, P % 64 == 0) |
helios/src/execution/manifest.rs:850-885, :911-928 |
Catalog shape selection; B == 1 must have packed == 0; P <= prefill_chunk_size |
helios/src/model/catalog.rs:263-285 |
Core selection geometry + --max-concurrency filter |
helios/src/runtime_core/selection.rs:257-300, :339-350 |
Vision bindings rejected on B >= 2 prefill |
helios/src/model/packing.rs:111-130 |
PackedToken buffers sized to P; pack_step lane/sum/image_slot checks |
helios/src/model/packing.rs:170-176, :419-437 |
packed_prefill_graphs(), is_non_terminal_prefill_step, validate_mixed, commit |
helios/src/scheduler.rs:891-919, :937-954, :433-473, :2611-2640 |
| Server wiring, solo vs packed catalog split | helios/src/server/runtime.rs:846-900 |
| Cohort builders & lane compatibility | helios/src/scheduler/policy.rs:1297-1424, :1585-1645, :1623-1789, :2026-2075, :2230-2245 |
| Cost model | helios/src/scheduler/cost.rs:644-661 |
Ignition signature validation / direct mode / --packed-verification |
ignition/preparation/execution.py:78-95, ignition/direct/scheduler.py:197-200, :288-292, ignition/cli/serve.py:462-471 |
| Test-compile fix | helios/src/runtime_core/cache_memory.rs:1 hunk (external_extents: vec![]) — needed because #711/#720 landed on main |
Size, honestly split: 21 files, +1639/−56; helios/src is ~+1398/−49 across 14 files, of which +238 model/tests.rs and +312 policy_tests.rs are tests, so production Rust is roughly +850; docs +186; Python ~+55.
Undeclared or under-declared behaviour (all verified in the diff, none in the "What changed" list):
--packed-verificationsemantics narrowed to speculative signatures (ignition/cli/serve.py:466), i.e. a new user-visible failure mode for non-speculative-only recipes.- New general
lanes.len() > batch_capacityvalidation applied to every scheduled step and tocommit(scheduler.rs:2611-2640). scheduler/cost.rs: prefill cost models andrefresh_prefill_context_slopesnow gated onkey.batch == 1, changing solo paths.scheduler/policy.rs:167-170: prefillCandidateequality also compareshost_lengths(safe today because solo candidates carryNone, but it is a shared predicate).scheduler/checkpoints.rs: pricing rewrite for all prefill, not just packed steps.- Two parallel cohort builders with different acceptance rules:
packed_round_candidatesrequirespromoted_count > 0(policy.rs ~1380-1385) while the standalonepacked_prefill_candidatespath does not.
Description vs code: the stated bound P <= prefill_chunk_size is enforced at core selection (runtime_core/selection.rs:257-300) and catalog (model/catalog.rs:263-285), not in execution/manifest.rs (which cannot see the chunk size) and not re-checked in validate_mixed/commit — it is a selection-time gate, not a manifest invariant. And docs/packed-prefill-design.md:45-46 documents work in hyperflare_recipes/components/{paged_batch,dspark}.py and recipes/deepseek41/* that is not in this repository (companion PR local-inference-lab/hyperflare-recipes#153), so half of the design document is unverifiable here.
The why
- Structural, verified:
GraphKind::Mixedcarries one prefill lane (prefill_capacityplus(batch_capacity - 1) * token_capacityrows,helios/src/model/packing.rs:168-176), and single-request prefill graphs forced one replay per prompt.docs/packed-prefill-design.md:11-14states the same. - Roofline argument (
docs/packed-prefill-design.md:16-35): on GB10 DeepSeek V4.1 layer 3 TP4 a single layer's FFN costs3,947.3 µsat 64 rows vs7,625.4 µsat 1,024 rows, so 16×64 tokens serial costs ~63.2 ms/layervs7.63 ms/layerpacked — "8.3×lower per-layer FFN latency" and an estimated "3–6×" p95/p99 TTFT inflation. Note these are a single-layer microbenchmark and estimates printed alongside measured A/B numbers without a separate label. - No originating issue: searches on "packed prefill", "prefill batching", "batch_capacity 1 prefill" returned nothing open or closed. Nearest related complaints are about mixed-prefill export failures (#115) and prefix-cache cost (#534, #255).
- Precedent that the project wanted this class of fix: merged #645 (lukealonso, 2026-11-30, closes #485) overhauled prefill scheduling with
PrefillCostModel,coalescing_horizon_tokensand two-frame prefill pipelining — i.e. it attacked burst prefill latency by scheduling, and explicitly left the multi-request-graph gap open. #661/#663/#681 continued tuning in the same direction. - Longer history of intent: #352 (closed, same author), #408/#410 (closed, same author) — #410's text notes the TERMINAL_PREFILL PR was "pending @lukealonso's Principle 1", evidence that this project gates such contract extensions on owner approval, and that the author knows it.
Related work
- Builds on #479 (merged, voipmonitor): introduced the
TerminalPrefillgraph kind andterminal_prefill_graphscatalog this PR widens toB >= 2; 13 files in common. - Builds on #645 (merged, lukealonso): 6 files in common (manifest.rs, scheduler.rs, checkpoints.rs, cost.rs, policy.rs, policy_tests.rs); the largest rebase risk, and the change whose residual gap this fills.
- Builds on #426 (merged, same author):
is_non_terminal_prefillgeneralised intois_non_terminal_prefill_step(kind, batch, capacity, packed)(scheduler.rs:937-954), reusingdeferred_prefillandterminal_prefill_window. - Calls helpers merged in #655/#661/#663/#681/#697 (
measured_duration,lane_value_for_tokens,prefill_slot_state,prefill_work_through,preserve_message_anchor), all landed within the preceding week. - Open items that overlap and need ordering:
- #621 (open, jcartu) validate admission against core parameter declarations — 8 files in common incl.
manifest.rs,packing.rs,scheduler.rs,server/runtime.rs,ignition/direct/scheduler.py; direct conflict surface with the new packed geometry validation. - #718 (open, fakoli) prefill-only KV handoff + announce barrier — 5 files in common (
scheduler.rs,checkpoints.rs,policy_tests.rs,model/tests.rs,server/runtime.rs). - #693 (open, jcartu) per-lane survival-curve caching — same
policy.rshot path, toucheslane_value_for_tokenswhich the packed cohorts call. - #571 (open) wide-round forcing —
policy.rs.
- #621 (open, jcartu) validate admission against core parameter declarations — 8 files in common incl.
- Same author, adjacent, open: #710 (speculative cost/forecast tracking, 2026-12-03), #712 (RoCE hairpin) — no file overlap with the packed-prefill subject, but they compete for review attention.
- Undone/competing work: none found. #715 reverts nothing.
Recent activity
The orientation packet's commit listing failed (git: Could not read c513e46a…), and search_history fails for the same reason; merged-PR traffic in the same files is the substitute evidence. In the ~5 days before this PR, the scheduler/cost/checkpoint layer was merged over repeatedly: #645 (2026-11-30), #661, #663, #681, #655 and #697 (2026-12-02/03), plus #711/#720 (AsyncTransfer, external_extents, pool limits) and #708 (decoded VLM feature tokens, adjacent to the vision-binding rejection in packing.rs). #715 is a continuation of that stack — it depends on #655's measured_duration and #697's anchor work — but it also lands a new cohort algorithm on the hottest file (policy.rs), so it will need rebasing against whatever lands next. No conflicts or reversals found. One duplication tension: two cohort builders for the same graph family, against #645's "subtract/simplify" review guidance and the charter's small-footprint principle.
People
- Author
original-el8— COLLABORATOR, and named in the charter's Respect-for-Contributors section as a priority contributor (@voipmonitor,@original-el8,@lukealonso) whose PRs are never closed out of hand. 25 merged / 29 closed / 10 open in 180 days; merged work touches docs (15),helios/src(14),helios(5),ignition/preparation(5),ignition/recipes(4). Owns the DeepSeek V4.1 / SM103 Parallax line and prefill pricing (#426, #352, #311/#312). Habitually ships very large multi-area PRs (#410/#408 closed mega-PRs share 18 files with #715) — this PR follows that pattern. - Who works in these files: lukealonso (owner) dominates
scheduler/policy.rs,manifest.rs,scheduler.rs(#645, #644, #620, #619, #613, #510, #656, #711, #720); FujitsuPolycom on policy/cost (#661, #681, #697, #538, #540, #542); yatesdr on cost/checkpoint/cache (#655, #663, #674, #694); voipmonitor on manifest/capacity/packing (#479, #485, #555, #566); jcartu on manifest/packing validation (#621, #688, #505, #404); fakoli on prefill KV handoff (#718). - Engagement on #715: none from anyone but the author. The one comment is the author's highlight summary. No maintainer has weighed in on the owner-approval question, which is the gate this change most obviously raises.
Community
One author comment (pr_comments, 2026-12-04 05:56), zero reviews, zero reactions, no labels. No flare-autobot case file or review, in contrast to #645 (case file ~27 min after opening, review ~50 min after), #655 and #697. Whether that is draft-suppression or a missed trigger is not determinable from the record; the practical consequence is that no independent verification of the claims exists. Cross-repo interest is only expressed in the companion recipe PR (local-inference-lab/hyperflare-recipes#153). The author supplies Discord: el8, satisfying design-review principle 17.
Project fit
Aligns:
docs/design-review.md:27-35: Helios must enumerate graphs/capacities from prepared-core metadata, never hardcode bucket lists. #715 does exactly this —packed_prefill_graphs()reads the manifest (server/runtime.rs:846-900),ignition/direct/scheduler.py:197-200keys on declaredpacked_token_capacity. No power-of-two list introduced.docs/design-review.md:58-61: no per-model booleans orsupports_*flags; text-only eligibility derives from absent vision bindings and request state (policy.rs:1585-1591).docs/design-review.md:116-123(charter principle 13, core compatibility):B == 1catalogs untouched; the description shows the pre-change core887785adloading and serving.- Charter evidence requirement (#210): a 15-row
flare runA/B on 4× GB10 SM121 TP4 with a C=1 control and median-of-3 rounds — more evidence than most PRs here.
Exposed:
- Owner approval for a new captured-graph operation contract (Key finding 2).
- Simulator /
learning.py(not opened) sweep and TLA+/Kani for a new cohort algorithm, timing keys and commit-validation changes (Key finding 3). - Evidence standard: "equivalent baselines" (#715's arms differ by FlashInfer revision) and in-repo GPU evidence (the 6 GB10 packed-prefill tests live in the recipes repo).
- Docs:
docs/packed-prefill-design.md(new, 155 lines) andhelios/model-contract.md:188-210are added, butdocs/scheduling-runtime-design.md(not opened),docs/core-design.md(not opened),docs/cli-design.md(not opened) andhelios/README.md(not opened) — the four files that #645/#655/#661/#663/#697 all kept in sync for scheduler changes — are not updated, and the new cohort algorithm is documented only in a standalone design doc not referenced from the canonical scheduler design. - Branch name
docs/packed-prefill-rfcwhile the payload is code.
Claims and evidence
| Claim | Evidence | Verdict |
|---|---|---|
| Burst p95 TTFT 1.68×–4.15× better; throughput 1.75×–4.23× | 15-cell barrier-synchronized flare run matrix, 4×GB10 SM121 TP4, median of 3, temperature 0; includes honest negative cells (0.94× C=1 control, 0.96× comp_w105_c8 p50, 0.98× comp_w185_c4 p50, 1.01× comp_w185_c16 p50) |
Real measurements, but not isolated: arms are different cores from different FlashInfer revisions; the 0.94× control suggests ~6% systematic overhead in the packed arm |
| Backward compatibility, existing cores load | Pre-change 151-graph core 887785ad served on the new binary at 7,631,232 KV tokens/rank |
Consistent with the code (B == 1 paths unchanged); credible |
| −4.2% KV capacity | 7,631,232 → 7,310,848 logical KV tokens/rank | Stated once in the description; not in helios/manifest.md |
FFN motivation (3,947.3 µs vs 7,625.4 µs/layer) |
Single-layer TP4 microbenchmark, docs/packed-prefill-design.md:20-28 | Justifies the idea; does not measure the change. The "8.3×" and "3–6× TTFT" numbers are extrapolations |
| helios runtime-core lib 1,284 passed / 37 ignored | Reported | Plausible; not independently reproduced here |
runtime-core+server 1,894 passed, 6 failures from unset FLARE_TEST_TEMPLATE_DIR |
Reported | Failure attributed to environment, not root-caused |
Python 905 passed / 2 skipped, 3 tests/cli failures from a stale installed wheel |
Reported | Same: attributed, not fixed |
| Multi-lane numerical parity on GPU | 6/6 CUDA and 112/112 CPU tests pass, but in the companion recipes repo #153 | No in-repo GPU parity evidence |
scripts/scheduling_sim/ and learning.py (not opened) validation |
Not run, not mentioned | Required by docs/design-review.md:195-208 |
TLA+ TLC, cargo kani |
Not run; disclosed as unavailable | docs/design-review.md:209-230, 247-251 says disclosure is not an excuse |
Reach
- Defaults/flags: none added in this repo. Packed prefill is inert without a core declaring
B >= 2graphs; recipes opt in via--packed-prefillin the companion PR. Only interaction with an existing knob is--max-concurrency(runtime_core/selection.rs:339-350; testpacked_prefill_selection_validates_geometry_and_filters_by_max_concurrency,selection.rs:2069). - Compatibility: old cores unaffected; new cores on older runtimes are rejected at catalog validation (
docs/packed-prefill-design.md§5) — a normal but real one-way versioning constraint. NoModelContractversion bump (new subsection under version 3,helios/model-contract.md:188-210). - Operators: pay −4.2% KV capacity for the TTFT gain under
--kv-cache-limit memory; vision and prompt-logprobs requests are excluded from packing and keepB == 1graphs, so multimodal cores gain nothing (and lose nothing). - Ignition direct mode:
Layout.capacities("prefill"|"terminal_prefill")returns onlyB == 1widths (ignition/direct/scheduler.py:288-292), so direct mode serves but does not exploit packed prefill. - Dependencies: no new crate or Python dependency; the benchmark depends on FlashInfer
5a8ceed80for the packed arm only (relevant to the charter's pin-dependencies/#215 concern). - Documentation: see Project fit; the design doc spans two repositories and its
(2,128,256)max-concurrency-2/3 shape is not exercised by any reported measurement.
Process
Open draft, less than a day old at review time, no labels (peer scheduler PRs carried area:scheduling, performance, triage:review), no reviewers requested, no reviews, CI green on the head commit. No review cycle has started, so none of the substantive questions above has been put to the author.
Open questions / could not find
- Whether owner approval for the packed-prefill operation contract exists outside this PR (Discord/offline). Nothing in the repo records it; the branch name suggests an RFC preceded it, but no RFC document is in the change set.
- Whether a flag-only, same-core A/B exists. The described matrix cannot isolate packed prefill because the two cores differ by FlashInfer revision.
- Whether the missing
scripts/scheduling_sim/and TLA+/Kani runs are planned; the description frames them as host unavailability (tla2tools.jar,cargo-kani) and does not address the simulator at all. - Whether the
ScheduledStep::validate_mixedlane-count check and theignition/cli/serve.py--packed-verificationnarrowing were intended as general behaviour changes or as incidental refactors. - Whether the checkpoint-pricing rewrite in
scheduler/checkpoints.rshas its own performance evidence — none is given. - Recent commits in the touched areas could not be listed:
search_history/items_touchingfail withgit: Could not read c513e46a79f3b6ac510235aaf09bcf055b841958; merged-PR traffic was used instead.