Case file: NVIDIA/hyperflare-inference#723 — fleet-wide 2-way codec green contexts, graph SM bounds, ScratchArena reserve_sms floor
Author: lukealonso (COLLABORATOR). Open, "ready for review", 2026-12-04, head 275b7a5, base main @ cc0a49d. Size per pr_files: 27 files, +1438 / −285. No reviews, no comments, no labels, CI pending.
Key findings
- It is the deliberate remainder of a P1 bug, not speculative work. Open issue #701 (ebfio, 2026-12-03, labels bug/performance/priority:P1) reports that on GB300/SM103
--lossless-kv-compression gpu(GKV1) collapsed decode from 67.12 tok/s to 0.34–0.61 tok/s and hung permanently atB>=2, because the GPU codec ran onrank.execution_context(). Merged PR #709 (lukealonso, 2026-12-03) fixed this only for cores declaring aPersistentWorker. #723 extends the fix to standard cores (DeepSeek-V4.1, GLM-5.3, Qwen3.8, Ergo, Gemma) via a 2-way(codec, compute)split. - The
pr_difftool over-attributes ~700 lines to this PR. Its base is stale: it shows.github/workflows/*,AGENTS.md(not opened),docs/TODO.txt,helios/src/model.rs(not opened) and hunks matching already-merged #711 (AsyncTransfer), #658 (capture reseal), #708, #664. Reconciling each file's real delta againstpr_filesshows the PR's actual content is exactly the three described sub-changes plusmin_compute_sms: 0, max_cluster_size: 0struct-literal churn in 8helios/src/core/*files (e.g.helios/proto/core.proto+4 = 2 comments + 2 fields,helios/proto/core.proto:251-254). Trustpr_files, not diff hunks. - The ScratchArena half is inert in this repository.
register_cooperative_plan,require_reserve_sms,resolve_reserve_sms,min_reserve_sms,reserve_sms_floorappear only inignition/preparation/scratch.py:59-187andtests/preparation/test_scratch.py:548-607. No recipe, component or preparation path calls them, and the docs that define the contract (docs/core-design.md:821,docs/preparation-development.md:256(not opened)) still describeregister_parallelas byte-sizing only. The advertised "immediate preparation-timeValueError" only fires once companionlocal-inference-lab/hyperflare-recipes#157lands. - The capture half depends on API that may not be pinned.
ignition/preparation/capture.py:78-83importstrack_capture_min_compute_smsfromb12x._lib.utils.deviceand falls back to{"min_compute_sms": 0}onImportError. That API ships with companionlocal-inference-lab/flashinfer#217. If the pinned flashinfer rev (pyproject.toml:47) predates it, every graph exports floor 0 and the load-time SM-floor validation silently never triggers. Not resolvable offline; it is the first thing to check. - The headline claim is not measured end-to-end. The description's own Limitations say full
ignition export+ liveflare run --lossless-kv-compression gpuserving across multi-GPU cores and SM103/SM121 execution were not run. The two GPU numbers quoted come from#[ignore]d component tests (see Claims). The reported regression was observed on SM103; the tests ran on SM120. - A normative doc is left stale.
docs/runtime-core-design.md:654-696— the section #709 itself updated — still says the partitioning is "two groups … or three groups … when prefix-cache offload is enabled with--lossless-kv-compression gpu", i.e. codec only alongside a worker. Post-PR behaviour adds a 2-way(codec, compute)topology with no worker entry.helios/manifest.md:114-135anddocs/prefix-cache-offload.md:59-66were updated; the design doc was not. In #709 the same class of gap was a "Should fix" review finding. - The change reverses a prior review recommendation without saying so. #532's automated review had recommended deleting
SmSplitPlan/split_sm_groupsin favour of the ABIpreferred_coscheduled_sm_countfield; #723 instead extendsSmSplitPlan(+824/−140 inhelios/src/runtime_core/persistent_worker.rs). - New fail-closed startup aborts on configurations that previously started. Any core with prefix-cache offload +
--lossless-kv-compression gpunow takes the primary-context path on every rank (helios/src/runtime_core/model.rs:718-733,mod.rs:386) and can refuse to load: no Green Context driver API (mod.rs:394), not enough SMs for one aligned codec + one aligned compute partition (persistent_worker.rs:137-170), compute partition belowmin_compute_sms(mod.rs:960-980), or a kernel cluster dimension exceeding partition SMs / co-scheduled alignment (mod.rs:1064-1094). All messages point at--lossless-kv-compression cpu. - The codec enablement condition changed, not just widened. #709 gated on
!model.gpu_codec_cubins.is_empty(); #723 gates onoptions.prefix_cache.compression == KvCompression::Gpu(model.rs:718-719), i.e. decided from serving options before modules load. This avoids a model-specific branch (charter-aligned) but means a core with nogpu_modulestill reserves SMs whengpuis requested. - Three separable changes are bundled, with no stated reason for the Python ScratchArena half riding with a CUDA change; precedent for asking for a split exists (yatesdr on #430).
The change
Scope and shape (verified):
- Manifest SM bounds (mechanical).
GraphIndex/Graphgainuint32 min_compute_sms = 7anduint32 max_cluster_size = 8, both documented as "0 means unspecified" (helios/proto/core.proto:251-254,helios/proto/runtime_core.proto:751-753). Capture side:heliopause/src/export/capture.rs:463hardcodesCU_LAUNCH_ATTRIBUTE_CLUSTER_DIMENSION: i32 = 4;kernel_cluster_size(:465-486) parses the 12-byte attribute blob as three u32s with overflow checks;graph_sm_requirements(:491-500) takesmax_cluster_sizeover kernel nodes and raisesmin_compute_smsto at least that value; call site writes both intowire::GraphIndex(:3438-3448). Python capture:ignition/preparation/capture.py:232-245wrapssession.capture()in_track_capture_min_compute_sms()and stores_flare_min_compute_smsonly when > 0;ignition/preparation/runtime_core.py:184-189, 296-306emitsmin_compute_smswith strict int/bool/negative validation. Readers/pass-through:heliopause/src/export/core.rs,helios/src/runtime_core/{format,protobuf,metadata,describe,protection,selection}.rs,helios/src/core/*. Undeclared consequence: because capture raises the floor to the cluster size,min_compute_smsandmax_cluster_sizeare not independent, and the loader uses the floor for the SM check whilemax_cluster_sizeonly drives co-scheduled alignment. - 2-way / 3-way green contexts (the bulk).
requested_worker_sms: u32→Option<u32>;SmSplitPlancarriesworker_index/codec_index/compute_index/baseline_coscheduled/min_compute_sms;plan_sm_split(device_sm, Option<u32>, reserve_codec_partition, min_compute_sms, max_cluster_size)errors when neither worker nor codec is requested; the codec partition is always exactly one aligned minimum partition (not tunable); the preferred 16-CTA coschedule is skipped whenmax_cluster_sizealready forces ≥16 (no fallback below the cluster size).GreenContextPartitiongainscodec_green_ctx/codec_context/codec_sm_count;destroy_green_contextsnulls and destroys it;offload_context()returns the codec context when present else the primary context, andmodel.rs:1062now passes that instead ofexecution_context().initialize_with_options(core, ordinal, reserve_codec_partition)retains the primary context whenwants_worker || reserve_codec_partition. - ScratchArena floor (Python, inert in-repo). As in Key finding 3, plus
release_preparation()clears both registries.
What the description does not say: the reversal of #532's split_sm_groups recommendation; the min_compute_sms ≥ max_cluster_size coupling; that docs/runtime-core-design.md:654-696 is now wrong; that the ScratchArena API has zero in-repo consumers; that #709's gpu_codec_cubins gating was dropped; the 8 SMs permanently removed from compute on every gpu-compression rank.
What the description says the change does but the repository does not yet do: "Turns missing reserve_sms on cooperative plans … into an immediate preparation-time ValueError" — true only of the unit tests until recipes adopt it.
The why
- #701 (open, ebfio, 2026-12-03; labels bug, performance, priority:P1, triage:investigate): GKV1 on GB300 SM103 shared
rank.execution_context()with cooperative compute, decode 67.12 → 0.34–0.61 tok/s, encode 6.9–12.4 MB/s, permanentB>=2hang. Its suggested direction #1 is literally to bind codec streams to a dedicated small Green Context partition. - #709 (merged 2026-12-03, lukealonso): added the 3-way split,
offload_context(), the offload-before-worker ordering, but stated it applies "on persistent-worker cores" only. #723 is the follow-up for every other core. - #698 (open, ebfio): fixes the
cuModuleLoadDatastartup deadlock from the same bug class; #709 already landed an equivalent reorder, so it is largely superseded. Its own note — "on SM103 GKV1 still contends … because model.rs opens the codec stream on rank.execution_context()" — is precisely the residual #723 closes. #723 does not touchserver/runtime.rs(not opened) and neither supersedes nor conflicts with it. - How long wanted: about one day, and that is a fact about the chain, not about the idea: #701 filed 2026-12-03, #709 merged the same evening, #723 opened 2026-12-04. The green-context infrastructure behind it is older: #430 (merged 2026-11-23) added
Execution.persistent_workersand the 2-way split; #532 (merged 2026-11-26) added the 16-SM coschedule request. The ScratchArenareserve_smshalf has no corresponding issue anywhere in the local index — it appears to be a new, self-initiated contract.
Related work
- #709 (merged) — direct predecessor, same author, next day. #723 keeps its behaviour (2-way worker+compute, 3-way) and generalizes; tests at
persistent_worker.rs:1184-1300assert the old expectations under the newOptionsignature. - #430 / #532 (merged, original-el8) — the planner and the
PREFERRED_COMPUTE_COSCHEDULED_SMS = 16request with 8-SM fallback that #723 rewrites. lukealonso reviewed #430 (APPROVED) and left inline design objections there (structured vs remainder SM groups, bounded drain) — relevant precedent for the current design. - #640 (open, original-el8) — allows persistent workers on rank 0 of local multi-rank cores, relaxing #430's
cores.len() > 1rejection. No textual conflict (it does not touchpersistent_worker.rs/mod.rs), but a real semantic interaction: after #723, rank 0 with a worker + gpu compression gets a 3-way split while peer ranks without a worker get a 2-way split, socompute_sm_countstays asymmetric across ranks — exactly the hazard #640's own review flagged for cooperative kernels, and #723'smin_compute_smscheck does not equalise it. Neither description mentions this. - #314 (open, schopde-nvidia, diffusion) — 19 files in common with #723 including both proto files and
heliopause/src/export/capture.rs; the largest external textual-overlap risk (both add proto fields and capture plumbing). - #711, #720, #667, #647, #664, #504/#492, #507 (merged) — earlier work in the same files; #504 (yatesdr) is the KV-compression feature whose GPU mode #701 broke, #507 (lukealonso) is the persistent-worker telemetry schema.
- #543 (merged) — the closest prior edit to
scratch.py(removed joint kernel tuning); no open PR competes with or reverses the ScratchArena half. No "revert 709 / codec green context didn't work" PR or issue found. - #622, #576, #696 reference #430 but not these files.
Recent activity
Per-commit history could not be read: search_history fails with git: error: Could not read c513e46a… cannot simplify commit ef38cb93, and the orientation packet's activity section is empty for all seven areas. Reconstructed from PR metadata:
- 2026-11-23 #430 merged (original-el8): schema + 2-way split,
#[ignore]d GPU tests, lukealonso approval. - 2026-11-26 #532 merged (original-el8): 16-SM preference + 8-SM fallback +
split_sm_groups; its review recommended deletingsplit_sm_groups/SmSplitPlanin favour ofpreferred_coscheduled_sm_count(driver.rs:115(not opened), written 0 and read nowhere) — #723 goes the other way. - 2026-12-02 #711 merged; #698 opened.
- 2026-12-03 #709 opened and merged the same day; #701 filed; #707, #708 merged.
- 2026-12-04 #716, #720, #721 merged; #723 opened.
#723 builds on this lineage and reverses none of it; its one refinement is replacing #709's gpu_codec_cubins gate with the compression == Gpu option check. The orientation packet's "People in these areas: no commits in the last 180 days" is wrong for these files — original-el8 and lukealonso both committed to persistent_worker.rs in that window.
People
- lukealonso — COLLABORATOR, one of the charter's three named priority contributors; 51 merged PRs and zero unmerged in 180 days; areas:
helios/src(36),docs(31),ignition/preparation(20),tests/preparation(15). Author of #709 and #723; reviewer/approver of #430. Their established positions (explicit structured compute groups overcuDevSmResourceSplitByCountremainders, bounded drain) are the design #723 extends. Discord given aslukealonso. - original-el8 — owner of the green-context planner (#430, #532) and the open #640; the natural technical reviewer, has not engaged.
- ebfio — FIRST_TIME_CONTRIBUTOR who filed #701 and authored #698; the reporter whose numbers motivate the change.
- yatesdr — KV compression feature (#504); previously asked on #430 that bundled changes be split into separate PRs with individually measured need — applicable here.
- voipmonitor —
scratch.pyhistory (#110, #443), also charter-named priority. - Engagement on #723: none —
pr_commentsreturns "No comments", no reviews, no labels.
Community
No comments, reviews, reactions or reviewer assignment of any kind. Interest is expressed indirectly: #701 carries priority:P1 and is still open, and companion PRs exist outside this repo (flashinfer#217, hyperflare-recipes#157) showing the author is coordinating the change across three repositories.
Project fit
- Aligns with charter "Keep the runtime small and model-agnostic": enablement is
options.prefix_cache.compression == KvCompression::Gpu(model.rs:718-719), no model-name branch. - Aligns with the four-part PR description rule (why / what changed / claimed result / evidence) plus Limitations and the required
Discord:line. - Aligns with "Be explicit and pin everything" mostly; soft spot is the hardcoded
CU_LAUNCH_ATTRIBUTE_CLUSTER_DIMENSION: i32 = 4(capture.rs:463) rather than a generated binding. - Tension with charter line 42, "verify that … exported cores still load": backward compatibility is argued from the
0 = unspecifiedcomment but no old-core fixture is loaded and noignition exportwas run. - Tension with the repo's docs-first norm:
docs/runtime-core-design.md:654-696still describes only 2-vs-3 groups with a worker. - Approval gap relative to "Captured-graph op contracts … require owner approval": the PR adds two fields to the graph contract with new load-time failure semantics and records no approval. (The author is himself the approver of record for
Execution.persistent_workers.) - Not roadmap-driven; it is a reproducible-bug/priority:P1-driven change, which the charter does accept. No non-goal engaged (SM103/SM120/SM121 serving path only).
Claims and evidence
| Claim | What backs it |
|---|---|
| "235 passed / 525 / 250 / 247 / 104 passed" suites | Author-reported only; CI on 275b7a5 pending; no review; all on one SM120 host (RTX PRO 6000 Blackwell Max-Q, 188 SMs). Not reproducible from this case file. |
3-way measurement worker=8 codec=8 compute=172 … concurrent_coop=138664 (138611.8/s) gpu_codec_rounds=247 and 2-way codec=8 compute=180 (cosched=16) concurrent_coop=73185 gpu_codec_rounds=126 |
Component-level #[ignore]d tests only. Note the 2-way run shows lower cooperative throughput (73185 vs 138664) despite a larger compute partition (180 vs 172 SMs); the runs used different kernels, so it is not apples-to-apples, and nothing reconciles it. |
| "isolates GPU KV-codec execution fleet-wide … rather than deadlocking … at replay time" | Not measured end-to-end: no full ignition export, no live flare run --lossless-kv-compression gpu, no multi-GPU core, no SM103/SM121 run — and #701 was an SM103 observation. |
Per-graph min_compute_sms capture works |
Depends on b12x._lib.utils.device.track_capture_min_compute_sms (capture.py:78-83) from companion flashinfer#217; on ImportError it silently yields 0. Pin at pyproject.toml:47 unresolved offline. |
max_cluster_size capture |
Backed by unit test graph_sm_requirements_extracts_cluster_dimension_and_merges_declared_floor (capture.rs:5621-5670, asserts (8,8)/(128,8)/(1,1)/(0,0)). |
| ScratchArena fails closed | Backed by pure-CPU tests tests/preparation/test_scratch.py:548-607; no in-repo caller, so no production path can trigger it yet. |
| Backward compatibility with existing cores | Argued from the proto comments (core.proto:251-254); no old signed core loaded as a fixture. |
| Tests are appropriately gated | The two new behaviour tests are #[ignore]d and do not check FLARE_RUN_CUDA_TESTS (no matches in persistent_worker.rs), unlike the tests #430 added; they ran via --ignored. Their assertions are substantive: null worker context/stream, codec_sm_count >= 8, compute_sm_count >= 16, offload_context() == codec_context, execution_context() == compute_context, stack limit 4096 on both, and fail-closed when min_compute_sms == total_sms with the cpu hint (persistent_worker.rs:3550-3607). |
Reach
- Users/operators: anyone serving with prefix-cache offload +
--lossless-kv-compression gpu, on every rank, including cores with no persistent worker — previously the untouched case. No new flag or config key; the behaviour change is implicit in an existing flag combination, so it will not appear in a changelog except through the docs diff. - New failure modes at load: missing Green Context driver API (
mod.rs:394,persistent_worker.rs:259); device too small/aligned for one codec + one compute partition (persistent_worker.rs:137-170); compute partition <min_compute_sms(mod.rs:977); cluster dimension > partition SMs or > co-scheduled alignment (mod.rs:1083,:1091). The last converts a latecuGraphInstantiateWithFlags-style failure into an earlier rejection, but also rejects previously-loadable cores on 8-aligned-only devices. - Cost: one
min_sm_partition_size-aligned codec partition (8 SMs at 8-SM alignment, 2 on SM8x perpersistent_worker.rs:1302-1310) is permanently withheld from compute whenever GPU compression is on — ≈4.3% of a 188-SM SM120 card, 8 of 152 on SM103. - Compatibility: wire format is additive (
core.proto:251-254);runtime_core_pb2.pyregenerated (+95/−95, descriptor rewrite). Cores exported before this change (0) keep loading; cores exported after carry nonzero floors and will be rejected on under-provisioned devices. - Docs: updated
docs/prefix-cache-offload.md:59-66andhelios/manifest.md:114-135; not updateddocs/runtime-core-design.md:654-696,docs/core-design.md:821,docs/preparation-development.md:256(not opened). - Dependencies: companion
local-inference-lab/flashinfer#217(grid-stride M=1 MoE + active-SM sizing +track_capture_min_compute_sms) andlocal-inference-lab/hyperflare-recipes#157(ScratchArena adoption). Both outside this repository; neither is a pin change in this PR.
Process
Open and marked ready for review (not a draft). No reviewers requested, no reviews, no comments, no labels, CI pending on 275b7a5. Zero days old at case-file time; this author's PRs have historically merged within hours (#709 opened 18:08, merged 20:09). The three sub-changes are separable and unevenly sized: persistent_worker.rs alone is +824/−140 (57% of insertions, mostly the two new #[ignore]d CUDA tests plus a hoisted TestFiles fixture); 8 helios/src/core/* files are pure struct-literal churn; the ScratchArena half is 77 Python lines + 62 test lines with no in-repo consumer.
Open questions / not found
- Does the pinned b12x/flashinfer revision already export
track_capture_min_compute_sms? If not, the SM-floor half is a silent no-op. - Was any owner approval sought for adding
min_compute_sms/max_cluster_sizeto the graph contract? - Why was the ScratchArena change bundled with the CUDA change, and when will recipes call it?
- Does the 3-way vs 2-way throughput difference (138664 vs 73185) reflect anything real, or just different cooperative kernels?
- No SM103 run exists for a change whose motivating bug is SM103-only.
- Per-commit history for these files could not be retrieved (
search_historygit errors), and the orientation packet's area-activity section was empty; the timeline above is reconstructed from PR metadata only. - Nothing found: no competing/superseding PR for the ScratchArena half; no revert of #709; no issue requesting per-graph SM floors; no community discussion on #723.