Case file — PR #709 "Unblock lossless KV compression across Ignition, selene-manager, and Helios Green Contexts"
https://github.com/NVIDIA/hyperflare-inference/pull/709 · open, ready for review · head eb6c1e1, base main (cc0a49d) · 19 files, +2032/−137 · opened and last updated 2026-12-03 · CI passed on head · no reviews, no comments, no labels.
Key findings
- The headline diff is roughly twice the authored change. About half of +2032/−137 is already-merged
maincontent that the branch's base predates: thepreserve_message_anchorplumbing (= PR #697, merged 2026-12-03 01:18) appearing inhelios/src/scheduler.rs,helios/src/server/runtime.rs,event_tests.rs(not opened) and most ofhelios/src/server/runtime/phase_tests.rs, plushttp_preparation_failures_preserve_typed_error_codes_and_protocol_envelopes(= PR #689, merged 01:22). Onlyearly_startup_close_store_preserves_drain_and_slab_retention_contract(+63 inphase_tests.rs) is authored. Authored content is ≈+1,030 lines. (Inferred from content identity;search_historyis broken in this checkout — "Could not read c513e46…" for every ref — so the merge commit could not be listed.) - #698 is duplicated, not just referenced. #698 (ebfio, open, bug/triage:review) is the standalone fix for the same
helios/src/server/runtime.rsstartup ordering, and its Autobot review (2026-12-03 00:38, Changes Requested, 2 blockers) demanded exactly what #709 adds:fn close_store(helios/src/server/runtime.rs:1172, method at :1357) restoringHostStore::closeownership (ManuallyDropretention, close errors intoshutdown.error) plus a test. #709 thus supersedes #698 in substance while #698 stays open and the two will textually conflict. - The selene-manager change relaxes a guard PR #612 introduced on purpose. #612 (yatesdr, merged 2026-11-29) added "Reject multi-process (world >= 2) packed PutBegin and PinAck grants" citing per-rank arena sizing / concurrent rank writers. #709 redefines "multi-process" from
descriptor.ranks.len() >= 2to session/layout identity and adds 645 lines of TP≥2 tests as counter-evidence. I verified the new predicates are exactly equivalent to "multi-process session" (see Change). - Two behavior changes the description does not state. (a)
NativeResources::offload_context()(helios/src/runtime_core/mod.rs:1416-1421) returnscodec_contextif present else the rank base context — so offload/pool registration moved offexecution_context()for every persistent-worker core,cpumode included (memory.rs:1010); the description only discusses the GPU case. (b)reserve_codec_partitionis keyed onoptions.prefix_cache.enabled() && !model.gpu_codec_cubins.is_empty()(helios/src/runtime_core/model.rs:820-821), i.e. on cubin presence, not on--lossless-kv-compression gpu— acpu-mode core that embeds GPU codec cubins would also reserve the third SM partition. - The P1 claim is not demonstrated end-to-end. #701's symptoms (GKV1 encode 6.9–12.4 MB/s, decode 67.12 → 0.34–0.61 tok/s, B≥2 permanent hang) were measured on SM103/GB300; #709's evidence is an
#[ignore]d component test on SM120 (RTX PRO 6000 Blackwell, 188 SMs, worker=8/codec=8/compute=172: 135,922.6 steps/s cooperative compute, 251 bit-exact GKV1 round-trips, 266.4 MiB/s, 5.98×). The author states SM103 end-to-end andflare run --lossless-kv-compression gpuat B≥2 were not run. - New hard startup failure mode on small-SM devices. Cores that cannot fit worker+codec+compute partitions now fail startup with an error recommending
--lossless-kv-compression cpu(persistent_worker.rserror path; test asserts on a 16-SM device). Foroff/cputhe 2-way split is unchanged — the "zero SMs lost" claim applies only there. - Zero engagement so far, despite the author being a charter-named priority contributor with priors in this exact area (#607 fixed "multi-process put corruption"), and despite both linked reports (#698, #701) being filed by a different contributor (ebfio) who has not been asked to review.
The change
Three independent changes bundled in one PR.
1. Ignition authoring (ignition/preparation/contract.py +140/−7, tests/preparation/test_codec_layout.py (not opened) +150). New CodecEncoding(IntEnum) (contract.py:16) mirroring all 11 Selene IDs in selene/src/shared/codec_layout.rs (not opened), with block-byte and alignment tables; _validate_codec_encoding (:208) rejecting bools/non-ints/unknown IDs/lengths not divisible by block_bytes/misaligned FLOAT32_MATRIX_128 offsets; default_field_encoding(name, dtype, shape) (:232) conservatively classifying FP32 *.recurrent (…,128,128), BF16 *.convolution/*_convolution (…,10|16), other BF16 → BFLOAT16, rest → BYTES. codec_layout(pool, regions, buffers, *, field_encoding=None, state_buffer=None) (:249) now skips CONTINUATION_STATE entries in regions (:264), resolves the row buffer from CONTINUATION_STATE/explicit state_buffer (:276-280) instead of the hardcoded "state_pool", rejects conflicting buffers, and sorts/bounds-checks pool.layout.regions. field_encoding=None still returns None — backward compatible.
2. selene-manager pooled compression policy (selene-manager/src/pool/*.rs +40/−12, tests/packed.rs +645, tests/support/pool.rs (not opened) +3).
store_bridge.rs:412—PutBegin.packedrefused only whenself.sessions[&sid].ranks.is_some()(wasdescriptor.ranks.len() >= 2); refusal text unchanged ("packed storage is not supported for multi-process puts",:417).claims.rs:1181— packed peerPinAckgrants refused only whenclaim.mp.req.layout.world() > 1 || claim.mp.src.layout.world() > 1.claims.rs:637-642(claim_begin) and:922-929(get_answer) —packed_capsisNonewhenever requester or source is multi-process.core.rs:645-649—offered_codecretained forRankAttach/reconnect checks butcodec = Nonewhenranks.is_some(), so bothSessionOpened.codecandRankAttached.codecsignal raw-only.lookup.rs:226— same requester/source gating.- Verified equivalence:
claims.rs:805-816requester_slicesreturnslayout.clone()for multi-process andlayout.whole()(world == 1) otherwise, soworld() > 1⇔session.ranks.is_some(). Verified totality:selene/src/shared/packed.rs:50-67permitsrequires an R4 envelope with receive profiles, andpermits_holdingis(!packed && profiles.is_empty()) || permits(...), soNonecaps exclude all-literal v4 records too while raw v3 (packed=false) stays permitted — matching the description's claim. - Residual nuance:
lookup.rstreatsSourceId::Manageras single-process (source_mp = false); manager-tier records are gated by the requester predicate only.
3. Helios GPU codec Green Context (helios/src/runtime_core/{persistent_worker,mod,model,memory}.rs, helios/src/server/runtime.rs, phase_tests.rs, docs/prefix-cache-offload.md).
plan_sm_split(device_sm, requested_worker_sms, reserve_codec_partition)(persistent_worker.rs:77-130) now emits 2 or 3DevSmResourceGroupParams: worker, onemin_sm_partition_size-aligned codec group, and compute backfill flaggedCU_DEV_SM_RESOURCE_GROUP_BACKFILL;SmSplitPlan.codec_index: Option<usize>; the 16-CTAPREFERRED_COMPUTE_COSCHEDULED_SMSupgrade with 16→8 fallback now applies tocompute_index(asserted in tests).GreenContextPartitiongainscodec_green_ctx/codec_context/codec_sm_count(:40, creation at:392, teardown:453). Too-few-SMs error names--lossless-kv-compression cpu.prepare_kernelstakes a 5threserve_codec_partitionparam (mod.rs:761,778; non-model call site passesfalse); gated atmodel.rs:820-821as above.offload_context()(mod.rs:1416-1421) →codec_contextelseself.context;model.rspassesrank.offload_context()toprepare_offload;memory.rs:1010poolregistration_context=self.ranks[0].context;mod.rs:1641teardown recognizescodec_contextas green-context-derived.server/runtime.rs:crate::offload::open(...)at:683now precedesRankExecutor::new(...)at:699(comment at:661); new freefn close_storeat:1172invoked on the three early-error paths (executor,RequestScheduler::newat:713, scheduler configuration) withshutdown.error.get_or_insertso the original error survives;Worker::close_store(:1357) delegates.- Test-only widening:
helios/src/offload/{mod.rs,transfer.rs}#[cfg(test)] pub(crate) use GpuRankCodec,gpu_codec.rspub(super) → pub(crate).persistent_worker.rsadds ~650 lines of#[ignore]d CUDA test that compilesignition/preparation/kv_codec_gpu.cuwith nvcc.
Description vs. change. Everything the description claims is present, with two omissions it does not mention (findings 4a and 4b) and one thing it does not do: no update to selene-manager/PROTOCOL.md (not opened) or docs/same-process-tp.md (not opened) for the TP≥2 packaged-record policy; only docs/prefix-cache-offload.md (+15/−9) changed.
The why
- #701 (issue, ebfio, open, labels bug/performance/priority:P1/triage:investigate) is the driver for part 3: GKV1 bound to
rank.execution_context()shares the compute Green Context — encode 50–90 s (6.9–12.4 MB/s) vs ZKV1 0.25 s (2.45 GB/s), decode 67.12 → 0.34–0.61 tok/s, and a permanent hang at B≥2 after 60.55 s in the scheduler yield loop. The issue itself suggested "a separate non-compute context or a dedicated small Green Context partition" — the direction #709 implements — or fallback/warn tocpu, which #709 uses only in the too-few-SMs error message. No comments on #701. - #698 (PR, ebfio, open) is the driver for the startup ordering: on DGX Station GB300 SM103/CUDA 13.2
Start serverhung >400 s, gdb showingcuModuleLoadDatainflare-offload-0; after the reorder, 0.6 s start with GKV1 at 1.239–1.259× lossless and 3.6 s SIGTERM drain. #698's Abot review calls the deadlock a regression "introduced by #504" and blocks it on cleanup-ownership violations — the same code #709 rewrites. - Ignition side has no issue number cited. The stated failures (
KeyError("state_pool"), duplicate overlappingstate_poolfields rejected by SelenePlan::new) were author-observed while writing recipes; the beneficiaries are two external recipe repositories (local-inference-lab/hyperflare-recipes,local-inference-lab/hyperflare-jetson-recipes) that are not in this repository and no companion PR is linked. - Lineage: feature series #436 → #477 → #486 → #492 (all closed) → #504 (yatesdr, merged; introduced GKV1/ZKV1, the
--lossless-kv-compressionflag and the 2-way split) → follow-ups #496, #497, #607, #609, #610, #612, #628, #674, #694.
Related work
- #698 — open, superseded in substance (see Key findings 2). Same function region → textual conflict.
- #701 — open P1 issue; #709 is the candidate fix but does not close the reproduction gap.
- #612 (yatesdr, merged 2026-11-29, +293/−52, 10 files) — introduced the
world >= 2packed refusals #709 narrows, motivated by arena-extent sizing with compressed bytes vs uncompressed windows and concurrent rank writers. #709 reverses the condition rather than the safety property; multi-process stays refused. Its Autobot review said "already fixed another way". - #607 (lukealonso, merged) — same author, "pool staging UAF, chain walk DoS, multi-process put corruption, offload lifecycle": direct priors in the same code.
- #694 (yatesdr, open) — also edits
selene-manager/src/pool/claims.rs(write-side profitability gate) → adjacent, potential conflict. - #504 — origin of the codec/flag/2-way split; #674, #628, #497, #610, #496, #609 touch the same files.
- #691, #692 (jcartu, open) — overlap
helios/src/server/runtime/phase_tests.rsonly (textual). - #707 (same author, open) — also touches helios/ignition; no file overlap found in this diff.
- #697, #689 — already merged into
main; present in this diff only as inherited base drift (Key finding 1). - No competing PR proposes a different fix for the same three gates.
Recent activity
search_history returned errors for every ref, so no commit-level timeline exists. Reconstructed from item metadata: main took #697 (2026-12-03 01:18) and #689 (01:22) after #709's base cc0a49d; #709 opened later the same day (18:08). No commits on main since the branch point touch #709's files other than those inherited merges. Nothing recent was reverted or undone by #709 other than #612's refusal condition. (docs/: #497 etc. merged; helios/src, selene-manager/src, ignition/preparation all have recent merged activity from the author himself — #707, #708, #683, #695 the same week.)
People
- lukealonso (COLLABORATOR; Discord
lukealonso; charter-named priority contributor whose PRs are never closed out of hand): 42 merged PRs in 180 days, 4 open (#707, #668, #659, #658). Area counts:helios/src29,docs23,ignition/preparation14,flare-cli/src10,tests/preparation10. Priors: #607 (multi-process put corruption/offload lifecycle), #708, #683, #695, #667. - yatesdr — regular owner of
selene-manager/src/pool(#92, #376, #401, #402, #415, #504, #612, #674, #694): the author of both the machinery being relaxed and the guard being narrowed. The most likely informed reviewer; not yet involved. - ebfio (FIRST_TIME_CONTRIBUTOR) — filed #698 and #701 and authored #698; the party whose reports #709 claims to fix. Not engaged.
- FujitsuPolycom (#697 scheduler), jcartu (#689/#691/#692 server) — adjacency only.
- Community on #709: nothing. 0 comments, 0 reviews, 0 reactions, no labels.
Project fit (charter)
Lines up: "solve the right problem in the right place" (a root-cause fix per layer, no per-model branches); "bring real evidence" (the description carries why / what changed / result / evidence plus an explicit limitations section, unusual for this repo); "supported matrix & compatibility — check parallel layouts, multi-host, hardware targets, and that existing data still loads" (the PR explicitly separates single-host TP≥2 from multi-process and keeps raw v3 readable; no wire-format or ABI change — packed v4 bytes are untouched, only who may use them).
Tension: the charter asks performance PRs to show benchmarks "over main on a served workload"; the headline number here is a component CUDA microbenchmark, and the served-workload claim (SM103, B≥2) is unrun. "Keep the runtime small" is also mildly strained by +868 in persistent_worker.rs — though ~650 of those lines are a #[ignore]d test, so production helios growth is ~+110.
Claims and evidence
Verified by reading code at eb6c1e1: the CodecEncoding enum, validation, CONTINUATION_STATE skipping and state_buffer resolution in contract.py; the field_encoding=None → None early return; the selene-manager predicate rewrites and that None caps exclude literal-only v4 while keeping raw v3; the 3-way split, codec_index, alignment/fallback logic and too-few-SM error; offload_context(); offload::open before RankExecutor::new; close_store on all three early-error paths with get_or_insert; the docs update (third partition, pre-worker cuModuleLoadData, single-host TP≥2 vs multi-process).
Claimed, backed only by author-local runs (nothing reproducible in CI): SM120 numbers (135,922.6 steps/s, 251 rounds, 266.4 MiB/s, 5.98×); suite counts eos 12, selene 553, selene-manager 408 with 12/12 in packed.rs, helios lib 1,835 passed/48 ignored, flare 255, flare-cli 246, pytest 163/0 skipped, TLA+ 8 models.
Claimed without evidence: "eliminates … the multi-request cooperative decode collapse/hang (#701) on persistent-worker SM103 cores" — explicitly "pending live SM103 serving verification", with no SM103 GPU, no exported checkpoints, and flare run --lossless-kv-compression gpu at B≥2 not run. The recipe-side benefit ("companion recipe PRs can now declare validated codec_layout") has no linked companion PR and lives outside this repo.
Disclosed limitations: 6 chat-template tests failed only because FLARE_TEST_TEMPLATE_DIR was unset; pre-existing persistent_worker::tests::cuda_* tests hardcode device VA 0x800_0000_0000, collide with CUDA UVA on the 16-GPU host, and were left untouched (so effectively unrun).
Reach
- Operators using
--lossless-kv-compression cpu|gpuon persistent-worker cores (SM103 GB300 per #698/#701; SM120/SM121 workstations): new startup-abort path on devices that cannot fit three partitions.offis untouched;cpukeeps the 2-way split but, undeclared, moves offload and pool registration to the rank base context. - SM budget: one aligned
min_sm_partition_sizegroup (e.g. 8 of 188 SMs) is permanently removed from compute whenever GPU codec cubins are present. - Single-host TP≥2 pool users gain retiring/recovering/peer-exporting packed v4 over SHM and TCP; multi-process sessions are unchanged in effect — same refusal, same message (
store_bridge.rs:417), now decided by session shape rather than rank count. - Compatibility: no wire/ABI or file-format change; raw v3 remains readable, and multi-process peers see raw-only negotiation. No new flags, no new dependencies (still only
libcuda.so.1at runtime plus nvcc for the codec build). - Documentation:
docs/prefix-cache-offload.mdupdated for all three parts;selene-manager/PROTOCOL.md(not opened) anddocs/same-process-tp.md(not opened) not updated for the TP≥2 packed policy. - Ignition users:
default_field_encodingfalls back toBYTES(no savings, no corruption) — safe but potentially disappointing savings for recipes that rely on the default.
Process
Ready for review (not draft), opened and last updated 2026-12-03, CI green on eb6c1e1, 0 reviews, 0 comments, no labels, no maintainer request cited. Description carries all four charter-required parts plus a limitations section.
Points a reviewer will want to settle: (1) three unrelated fixes in one PR — splitting would decouple a Python authoring tool, a protocol-policy change and a CUDA scheduling change; (2) rebasing onto current main would halve the visible diff by dropping the inherited #697/#689 content; (3) the #698 duplication needs an explicit decision (close as superseded, or land #698 first); (4) the gpu_codec_cubins vs compression-mode gating and the rank-base-context offload switch are undeclared behavior changes; (5) #701's P1 symptom is not demonstrated fixed at the level it was reported; (6) the missing protocol doc update.
File map (PR head eb6c1e1)
| File | Δ | Content |
|---|---|---|
ignition/preparation/contract.py |
+140/−7 | CodecEncoding :16, _validate_codec_encoding :208, default_field_encoding :232, codec_layout(..., state_buffer=None) :249, CONTINUATION_STATE skip :264, row-buffer resolution :276-280 |
tests/preparation/test_codec_layout.py (not opened) |
+150 | new tests (count not verified test-by-test) |
selene-manager/src/pool/store_bridge.rs |
+1/−1 | packed refusal on ranks.is_some() :412, message :417 |
selene-manager/src/pool/claims.rs |
+16/−6 | claim_begin caps :637-642, get_answer caps :922-929, PinAck gate :1181 |
selene-manager/src/pool/core.rs |
+10/−4 | codec = None when multi-process :645-649, offered_codec retained :293, :617 |
selene-manager/src/pool/lookup.rs |
+13/−1 | packed_caps gating :226 |
selene-manager/tests/packed.rs |
+645 | single_host_tp2_packed_put_stores_and_serves_over_shm_and_tcp, single_host_tp2_peer_dram_packed_export_succeeds_over_shm_and_tcp, multi_process_tp2_stays_raw_only_and_excludes_packed_records |
selene-manager/tests/support/pool.rs (not opened) |
+3 | helper |
helios/src/runtime_core/persistent_worker.rs |
+868/−45 | plan_sm_split/SmSplitPlan/split_sm_groups/GreenContextPartition :34-470, unit tests :997-1135, #[ignore]d CUDA test ~:2590-3240 (:3004 asserts offload_context() == codec_context, :3008 cites #698) |
helios/src/runtime_core/mod.rs |
+20/−2 | prepare_kernels param :761/:778, offload_context :1416-1421, teardown :1641 |
helios/src/runtime_core/model.rs |
+10/−2 | reserve_codec_partition :820-821, prepare_offload contexts ~:966-970 |
helios/src/runtime_core/memory.rs |
+1/−1 | registration_context = ranks[0].context :1010 |
helios/src/server/runtime.rs |
+69/−57 | ordering :661-683 vs :699, close_store fn :1172, method :1357 |
helios/src/server/runtime/phase_tests.rs |
+63 authored (rest inherited) | early_startup_close_store_preserves_drain_and_slab_retention_contract |
helios/src/offload/{mod.rs,transfer.rs,transfer/gpu_codec.rs} |
+5/−1 | test-only re-exports and visibility |
docs/prefix-cache-offload.md |
+15/−9 | third partition, startup ordering, TP≥2 vs multi-process rules |
helios/src/scheduler.rs, event_tests.rs (not opened), phase_tests bulk |
inherited | #697 preserve_message_anchor / #689 typed-error test — not authored here |
Open questions / not found
- Whether a
cpu-mode core can actually embedgpu_codec_cubins(would it then reserve a codec partition it never uses?) — the gating condition permits it; no test covers it. - Whether the rank-base-context offload switch affects offload DMA correctness/perf on non-GPU-compression cores — no before/after numbers given.
- Baseline numbers "over main on a served workload" for the codec partition: none; the only numbers are the SM120 component test.
selene-manager/PROTOCOL.md(not opened) / same-process-TP documentation for the relaxed packed policy: not updated, and no doc states that single-host TP≥2 now advertises[ZKV1, GKV1]in the pool.- Companion recipe PRs in the two external
local-inference-labrepos: not findable here; the recipe-side benefit is unverifiable from this repository. - Contents of
tests/preparation/test_codec_layout.py(not opened) and the tail ofselene-manager/tests/packed.rswere not read line by line; test coverage there is taken as claimed. - Commit-level recent history could not be produced:
search_historyfails on this checkout ("Could not read commit c513e46…") — an environment defect, not a PR defect.