Case file — PR #664: helios, heliopause, ignition: support single-plane BF16 and identity-indexed offloaded embedding tables
kbenkhaled · open, "ready for review" · branch engram-bf16-identity-pr → main · head c769355 · opened 2026-12-01 · 23 files, +1757/−548 · 0 comments, 0 reviews, no labels, no CI checks on head · https://github.com/NVIDIA/hyperflare-inference/pull/664
Key findings
- No producer exists in this repository. The PR is consumer/contract-side only. Ignition's Engram producers still emit two-plane FP8/NVFP4 —
ignition/components/engram.py:40-58hardcodes 256-byte weight rows, 8-byte E8M0 scale rows andlookup_op(..., weight.view(torch.float8_e4m3fn), scales, ...). The only Python production change is descriptor counting inignition/preparation/rank_group.py:47(expected = sum(len(table["planes"]) for table in catalog["tables"]), was2*len(tables)). So nothing in-tree can emitEncoding.BF16orMethod.IDENTITY; the Gemma 4 E2B/E4B producer lives outside the repo (recipes are explicitly external,docs/model-preparation.md:326-330, which already listsgemma-4-e2b/gemma-4-e4b). This is the same "only in-tree producer is unexercised" gap that was raised as a blocker on the direct predecessor #566. - The "distinct partitioned delivery groups" fix works through
Indexequality, not through the reader.Table.partition: Option<usize>(helios/src/engram.rs:176-187), set athelios/src/runtime_core/engram.rs:425((!table.shards.is_empty()).then_some(rank)), is never read in production code — only in tests (helios/src/runtime_core/engram.rs:1076,helios/src/execution/threaded.rstest fixtures, see the diff ofthreaded.rs). Its effect comes entirely from derivedPartialEqplus the dedup athelios/src/runtime_core/model.rs:458(engram.iter_mut().find(|(existing, _)| existing == &index)): two TP ranks with byte-identical shard bytes used to compare equal and collapse into oneShared/delivery group. That is an indirect and easy-to-miss mechanism and is not mentioned in the description. - Loader validation is tightened for all partitioned tables, not just the new ones — an undeclared compatibility change.
helios/src/core/schema.rs:454-503now requiresshards.len() == ranks,shard.rank == indexin order,first_row == running end,rows != 0, andend == table.rows; error strings changed to "engram partitions must cover table rows in rank order" / "must cover all table rows". Onmainthe schema only rejected overlap/empty/absent-rank whilehelios/src/runtime_core/engram.rs:80-117already enforced contiguity. Net effect: signing now matches loading (a genuine correctness fix, and the PR does say this), but a previously signed core with a gapped or short shard list now fails validate. Charter line 42 asks to "verify that existing data, artifacts, and exported cores still load"; no test in the diff covers loading/rejecting an older gapped core. - An undeclared behavior relaxation:
heliopause/src/export/binding.rs:648-658—append_planesnowcontinues when aweights/scalesJSON value isnullinstead of failing deserialization. Tolerating"scales": nullfrom Python is not mentioned anywhere in the description. - No GPU, no benchmark, no serving replay, no Windows build — the description says so itself, and its Validation section still carries the author's placeholder "(update this line once the Thor E2B export + benchmark completes)". The only numbers (4.38 GiB E2B / 5.25 GiB E4B PLE) are unverified arithmetic; no test reproduces them.
- New core-contract surface with no recorded owner approval.
Encoding.BF16 = 3andMethod.IDENTITY = 3plus new mailbox semantics are documented as core contract inhelios/manifest.md:455-470(added by this PR) and inhelios/proto/core.proto/runtime_core.protocomments. The charter's "Captured-graph op contracts: Adding a new one … requires owner approval before you write it" applies; #535 is still the open approval thread for the neighbouring advisory-mailbox contract, and #566 was merged with exactly that blocker open.
The change
Two orthogonal primitives plus two shared correctness fixes, all threaded through the same offloaded-embedding machinery (verified in the diff):
- Single-plane BF16 storage.
helios/proto/core.protoandruntime_core.protoappendEngramTable.Encoding.BF16 = 3with a comment stating raw bfloat16 rows, nonzeroembedding_width, no scale plane,scale_block == 0,global_scale == 0. On the runtime sidehelios/src/engram/reader.rs:60-100introducespub(crate) struct Planes { weights: Plane, scales: Option<Plane> }replacing the fixed[Plane; 2]across disk, row-cache, advisory-warm, RAM (Data::Ram(Arc<Resident>, Option<Arc<Resident>>)) andPreparedTables;helios/src/engram/prepared.rsswapsTableSource.planes: [PlaneSource; 2]forweights_plane+scales_plane: Option<PlaneSource>andscales: Option<String>, so the peer descriptor count becomes1 + scales.is_some()per table instead of 2 per table. Schema side:engram_encoding_has_scales()(helios/src/core/schema.rs:316-329), BF16 row-size checks (rows*width*2, shared atschema.rs:436-444and per shard atschema.rs:480-488), rejection of any scale plane on a single-plane table (schema.rs:451-453,495-499), and negative-zero-tolerantglobal_scale/scale_block/scale_bufferchecks.helios/src/core/reader.rsskips the scales payload for single-plane tables. - Direct token indexing.
EngramHash.Method.IDENTITY = 3.helios/src/runtime_core/engram.rsdecode requires one head, GPU request delivery (request_buffer), empty hash arrays,compressed_vocabulary == rows, emitsorder: None, and producesTable.partitionfor sharded tables.helios/src/core/schema.rs:338-352widens the empty-token_mapallowance toEOS_XOR_MODULO or IDENTITYwithrequest_buffer. The mailbox contract — oneint64row ID per token in[0, stored_rows), partition-local when sharded,-1for inactive slots — is written intohelios/manifest.md:457-463and the two.protofiles. - Resident scales.
helios/src/runtime_core/model.rs:475-479computeshas_scale_planesfrom the decoded tables and passes it toLoadOptions::validate_embedding_resident_scales/embedding_resident_scales(helios/src/runtime_core/selection.rs:52-76): explicit--embedding-table-resident-scalesnow errors ("resident embedding scales require an embedding table with a scale plane") when no table carries scales, and the automatic default is gated onhas_scale_planesinstead of!engram.is_empty(). - Shard contiguity (key finding 3) and
partitionfield (key finding 2). - Exporter/peer handoff:
heliopause/src/export/core.rs(+393/−88) makes the scale plane optional inroles(),validate_ranks()andcore_engram();heliopause/src/embedding_tables.rsaccepts 1–2 planes withscalesoptional;heliopause/src/export/binding.rsnull tolerance;ignition/preparation/rank_group.pyextracts_receive_embedding_tables()and counts descriptors per catalog. - Docs and generated code:
docs/cli-design.md:789-800,docs/core-format-design.md:89-104(single-plane encodings omit the-scalessafetensors file),docs/model-preparation.md:480-490,helios/manifest.md:455-470, and regeneratedignition/preparation/runtime_core_pb2.py(+109/−109, protoc 36.2 as #566 did).
Size: genuinely large (+1757/−548), and roughly half the Rust delta is tests — core::schema ~+130, runtime_core/engram ~+250, heliopause/src/export/core ~+250 including a new verify_published() helper, engram/prepared ~+50, Python ~+35. helios/src/engram/reader/windows.rs and most of helios/src/execution/threaded.rs are mechanical test-fixture updates (Planes::two(...), scales: Some(...), partition:).
The why
A real memory constraint, not a hypothetical: Gemma 4 E2B/E4B per-layer embedding (PLE) tables are raw BF16, indexed by token ID, and take ~4.38 GiB (E2B, 35 layers) to ~5.25 GiB (E4B, 42 layers), leaving little KV headroom on unified-memory GPUs (DGX Spark / Jetson Thor class). Helios already had a shared offloaded-embedding path (direct-I/O staging, host row cache, advisory lookahead prefetch, shared-RAM handoff) that assumed exactly two quantized planes and n-gram hashing.
No issue in this repository asks for this. Related but distinct: #511 (open, "Disk-Engram prefill leaves three of four ranks idle on a rank-partitioned table" — same subsystem, different problem), #535 (open, approval for the advisory mailbox), #334 (open, read-ahead on every rank). The demand is one author's, about a month old, driven by external recipe work; #592 (their merged "sm110/thor identifiers" PR) and the "Thor E2B export" placeholder tie it to Jetson Thor bring-up.
Related work
- Builds on #566 (merged 2026-11-28,
perf(engram): add graph-driven advisory lookahead prefetch for disk-backed tables, +1501/−199; 15 files in common). #664'sPlanesrefactor has to thread prefetch/mailbox state through the same reader/prepared paths. #566 is the direct template for both the mechanism and the process: it addedEngramTable.prefetch_buffer = 16andValueSource41/42 with a self-declared "Maintainer contract approval note" and was merged with the owner-approval blocker (B1) still open. #664 provides no such approval note at all. - Builds on #590 (merged 2026-11-29, "helios,ignition: fix Engram reader bugs and add PLE lookahead publish"), which established the PLE-on-disk path with two planes, and on #580 (merged, row-cache insertion after readiness), #583 (closed, per-storage-group I/O priority), #586 (merged, parallel Engram plane assembly — the code
heliopause/src/export/core.rsthat this PR makes plane-optional), #561 (merged, io_uring lane refill). - Diverges from #334, in the right direction. #334 (open, "Read Engram rows ahead of prefill on every rank") was rejected by yatesdr on 2026-11-19 on the grounds that Helios must not evaluate the Engram hash. #664 is fully compatible with that stance and arguably the cleanest expression of it:
IDENTITYremoves hashing from the runtime entirely and the captured graph publishes row IDs. That alignment is worth crediting; it is also the strongest argument that this is "the right problem in the right place" per charter line 12. - Adjacent, not competing: #554 (open draft, RDMA reads for row-cache misses; 9 files in common — will collide mechanically with the
Planesrefactor), #511 (rank-partitioned prefill idling), #535 (mailbox approval), #314 (signed tensor execution, same schema/selection files), #519 (open, parking an Engram gather while waiting for device-published ids — closest in spirit to the IDENTITY mailbox), #620/#647/#628 (recent churn in the same files). - No competing implementation of single-plane BF16 or identity indexing was found in the local copy of open/closed items.
Recent activity
The touched files were rewritten repeatedly in the three days before this PR: #566 (2026-11-28, reader/prepared/model/selection), #580, #583, #586, #590 (2026-11-29), #620 and #647 (externalized core signing, stream-0 weight race — model.rs/selection.rs), #628 (2026-12-01, copy-engine gating in threaded execution), #652/#656/#657/#645/#646 on the helios side. Helios' last-touch authors are Luke Alonso (235 commits in helios/src), Martin Vit (52) and yatesdr (48); heliopause is Luke Alonso (63); ignition/preparation is Luke Alonso (160). #664 duplicates none of that work and silently reverses none of it, but it patches code that changed twice in the preceding 48 hours, so it needs a rebase review and its Planes refactor will produce conflicts with #554 and #334 if those move.
People
- Author: kbenkhaled, GitHub association CONTRIBUTOR, in-repo history of exactly one merged PR — #592 "Add sm110/thor identifiers", merged 2026-11-29 — plus 1 merged change in
tests/preparation. Their earlier PR's Autobot review was stopped as "low value / does not align with the charter" yet merged anyway, so contributor standing is real but not in the priority-contributor tier the charter names (@voipmonitor,@original-el8,@lukealonso). - Area owners who would review: Luke Alonso (dominant committer in every touched area, 390 commits in docs), Martin Vit, yatesdr (the reviewer who drew the "no model computation in Helios" line in #334), voipmonitor (author of #566 and the prefetch machinery this builds on; likely the closest technical reviewer).
- Engagement so far: none. No comments, no reviews, no reactions, no labels, no CI. By contrast #566 drew a full Autobot case file and a "Changes Requested" review on day one; other PRs in this area get
area:*/triage:design-reviewlabels immediately. Interest from others in this subsystem in the past has come from tastyrice90 (#511, #535), javieratomic (#334) and voipmonitor (#566) — none of them has touched #664.
Community
Nothing to report beyond the above: zero discussion on the PR, and the only "community" pressure behind the underlying feature is the memory complaint pattern in #511/#535 and the external recipe work. No Discord handle given.
Project fit
Aligned. No model allowlists, no capability flags, no new captured-graph operation families — a general storage-encoding primitive and a general indexing primitive. Enum values are appended (= 3) leaving existing tags, defaults and FP8/NVFP4 wire layout untouched (helios/proto/core.proto:254-300). It directly answers a measured memory problem, which the charter's "What gets merged" list accepts; it solves it in the runtime's own vocabulary rather than with a per-model branch (charter line 12, #267/#334); and it removes hashing from the runtime for this table class rather than adding model logic.
In tension. (a) Encoding.BF16/Method.IDENTITY and the IDENTITY mailbox semantics are new core-contract values and behaviour — the charter requires owner approval before writing them and the PR records no approval and no approval request (contrast #566's explicit note and #535's explicit question). (b) The charter's "New model recipes, aliases, or formats … must list supported checkpoints, prove they export and serve cleanly from the PR branch, and support more than a single checkpoint" is unmet: nothing exports or serves a BF16/IDENTITY core here, and only Gemma 4 E2B/E2B-class tables motivate it. (c) Charter line 42's compatibility demand ("verify that existing data, artifacts, and exported cores still load") is met for FP8/NVFP4 unit tests but not exercised for the newly stricter shard validation, and the targeted hardware (SM110/Thor, and Windows I/O ring builds) is untouched.
Claims and evidence
Verified present in the diff (unit/local level, thick): core::schema BF16/IDENTITY validation matrix including negative-zero global_scale, mismatched vocabulary, non-empty hash arrays, and gapped / short / misordered / oversized shards (helios/src/core/schema.rs BF16 and shard tests, and the engram suite the description counts at 52 passing); decode strictness plus an identical-shard / delivery-group test (helios/src/runtime_core/engram.rs tests, selection 43 passing); single-descriptor sharing and gather (helios/src/engram/prepared.rs tests); Heliopause export of shared and partitioned BF16/IDENTITY, parallel assembly, FD accounting, weight reuse, a new verify_published signing round-trip and a gapped-shard publish rejection (heliopause/src/export/core.rs, reported as 34 passing); mixed 2-plane + 1-plane peer handoff plus a descriptor-count mismatch ValueError (tests/preparation/test_embedding_table_handoff.py).
Claimed, not backed by anything in the repo:
- Any GPU, serving or benchmark behaviour. The Validation section itself is unfinished ("update this line once the Thor E2B export + benchmark completes") and admits Windows I/O ring builds, mutation testing, serving replay of a previously exported FP8/NVFP4 core, and live GPU replay were not run.
- The 4.38 GiB / 5.25 GiB PLE figures — arithmetic only.
- "Existing FP8/NVFP4 unit and wire-format tests passing unchanged" — plausible on inspection (none of the FP8/NVFP4 assertions are edited), but not independently verified here and not something the missing CI can confirm.
- "Helios verifies, decodes, and gathers them across disk, row cache, advisory warm, and RAM paths" — the paths were generalized, but no test exercises BF16 end-to-end through advisory warm with a real mailbox (which is precisely the case that needs a producer).
- The two "shared correctness fixes" are presented as side findings with no issue link, no reproduction and no evidence that either bug was observed in the field (no linked issue, no failing test that existed before the patch).
Reach
- Operators:
--embedding-table-resident-scalesgains a new hard-error case for catalogs with no scale plane, and its automatic default is now gated onhas_scale_planes(helios/src/runtime_core/selection.rs:52-76,model.rs:475-479); docs updated in three places. No change for existing FP8/NVFP4 cores; no default, CLI flag or dependency changes. - Core/recipe authors: two new enum values and a new mailbox contract that any PLE producer must match exactly (row-ID range,
-1for inactive, partition-local conversion on sharded tables, "out-of-range row IDs fail gathering"). - Artifacts on disk: single-plane tables omit
engram-<index>-scales.safetensors/ shard-scalesfiles (docs/core-format-design.md:89-104), so any tooling that assumes a-scalesfile per table (heliopause/src/embedding_tables.rs, hosting/publishing scripts,verify_published) must handle the missing file — handled in this PR for the changed paths. - Compatibility: older cores still load in the FP8/NVFP4 case, but gapped partitioned cores that used to pass
validatenow fail;runtime_core_pb2.pyis regenerated so Python-side imports stay consistent. - Deployment/hardware: aimed at unified-memory (DGX Spark / Thor, SM110); nothing in the PR touches the Windows paths it changes types in (
helios/src/engram/reader/windows.rsis compiled but the author did not build Windows).
Process
Open and self-declared "ready for review", ~1 day old at packet time, one commit (c769355), zero CI checks on the head commit, zero labels, zero reviewers, zero comments, no Discord. The Validation section is unusually honest for the parts it covers and conspicuously unfinished for the parts that matter (GPU export + benchmark). By this project's habits the PR is still in the pre-review stage: no case-file comment, no design-review label, and — most consequentially — no contract-approval note comparable to #566's, even though it changes the same kind of surface.
Open questions / what could not be found
- Where is the Gemma 4 E2B/E4B recipe that produces BF16/IDENTITY tables? Not in this repo;
docs/model-preparation.md:326-330says external recipe repositories are supported, and #566's companion waslocal-inference-lab/hyperflare-recipes#70— no corresponding external PR is referenced by #664. - Is the new contract approved, and by whom? No issue, comment or note records it; #535 (open) is the nearest approval venue and does not cover
IDENTITY. - Was the shard-contiguity tightening ever requested, or did it come out of an observed corruption case? No issue is linked.
- Do
heliopause/hosting tools outside the changed paths assume a-scalespayload per Engram table (publishing, verification, resumable export)? Not established here. - Does any existing exported core, checked-in fixture or recipe test rely on a gapped partitioned table and would now fail
validate? Not tested in the diff. - Whether
helios/src/engram/reader/windows.rsand the RAM/advisory-warm paths are exercised at all for single-plane tables — the Windows module changes are test-fixture type updates only, and the author states Windows builds were not run.