Explore scratchpad · NVIDIA/hyperflare-inference #733

Raw Markdown for agents: https://autobot.eidonix.com/p/fe6dbd39-9324-4818-ab1d-59e9774f689f.md

#1 [high] Related work: PR #732 is a near-identical competing implementation opened 29 min earlier

PR #732 (open) "helios,heliopause,ignition: add FP8_E4M3_GLOBAL single-plane engram table support", by yatesdr (COLLABORATOR), branch feat/qwen4-fp8-ple into main, head 078b0435, opened 2026-12-04 19:37, updated 19:54. Labels: area:engram, enhancement, triage:review. +565 -145, 10 files.

It adds the SAME enum value: Encoding::FP8_E4M3_GLOBAL = 4 (its own description says "= 3" in one bullet, but its Autobot review and the actual proto say = 4). Same protobuf files, same schema.rs, same engram.rs, same heliopause exporter, same docs (manifest.md, core-format-design.md), same runtime_core_pb2.py regeneration.

Files in common with #733 (from related_items on #733): docs/core-format-design.md, heliopause/src/export/core.rs, helios/manifest.md, helios/proto/core.proto, helios/proto/runtime_core.proto, helios/src/core/schema.rs, helios/src/runtime_core/engram.rs, ignition/components/ngram_delivery.py, ignition/preparation/runtime_core_pb2.py — 9 of #733's 11 files.

Key mechanical difference:

#732's companion recipe PR: local-inference-lab/hyperflare-recipes#165. #733's companion recipe PR: hyperflare-recipes#167. #732 verification: DGX Spark SM121 live export+serve of BOTH FP8 and NVFP4 cores; release-mode-ish suites listed (helios core::schema 18 passed, engram 10 passed, heliopause payload_export_tests 33 passed, flare 247 passed, pytest 3 passed). #733: RTX 5090 SM120 export+serve of FP8 core only, plus a BF16(encoding=3) core replay for backward compat.

#732 already has an Autobot review posted (2026-12-04 19:54): Recommendation Changes Requested, Merge Risk Low, 1 blocker / 2 should-fix. Its review says "no competing PR" — written before #733 existed (19:37+90min vs #733 at 20:06), so the duplicate check was stale in both directions.

#733 has ZERO discussion, zero reviews, zero CI. Opened 29 minutes after #732.

#2 [high] Claims: PR description's "before" enum numbering is wrong — there is no FP16 encoding

The PR description says: "Before: EngramTable.Encoding defined NVFP4_E4M3_GLOBAL = 1, FP16 = 2, and BF16 = 3."

Actual baseline on main: helios/proto/core.proto:257 — enum Encoding { UNSPECIFIED = 0; FP8_E4M3_E8M0 = 1; NVFP4_E4M3_GLOBAL = 2; } (read at ref=main). BF16 = 3 does not exist on the literal main ref either; it was merged in #664 (helios/proto/core.proto:269 at ref=pr/732 and at #733's head reads UNSPECIFIED = 0; FP8_E4M3_E8M0 = 1; NVFP4_E4M3_GLOBAL = 2; BF16 = 3; FP8_E4M3_GLOBAL = 4).

So the description:

  1. Invents an FP16 = 2 encoding that does not exist in the proto at all (repeated three times: "before" for proto, "keeping FP16 and BF16 strictly unscaled" for helios, "parse_engram_encoding only recognized NVFP4_E4M3_GLOBAL, FP16, and BF16" for heliopause).
  2. Renumbers NVFP4_E4M3_GLOBAL as 1 (it is 2) and omits FP8_E4M3_E8M0 = 1 entirely.
  3. Says it appends FP8_E4M3_GLOBAL = 4 "preserving existing tags 1–3" — tags 1-3 in reality are FP8_E4M3_E8M0=1, NVFP4_E4M3_GLOBAL=2, BF16=3.

Note the same factual-error pattern was independently flagged for #732 by its Autobot review ("factual discrepancies in the PR description"). Both PRs share the misnumbering. Source: PR #733 body; helios/proto/core.proto:257 (main) and :267-269 (PR head).

#4 [high] Project fit: design-review.md Principle 1 requires Luke Alonso's approval for new contract enums/ops

docs/design-review.md lines relevant to #733:

Paralleling this, #664 was blocked on exactly two gates: (a) recorded owner approval for new contract enums, (b) CI + backward-compat serving replay of a pre-existing FP8/NVFP4 core. #733 supplies (b) but not (a) or CI.

#5 [high] The change: what #733 actually does at head 3198eae, file by file

PR #733 head 3198eae. Actual code content (not what the description says):

  1. PROTO (helios/proto/core.proto:267-269, runtime_core.proto:664-665): appends FP8_E4M3_GLOBAL = 4 + 1 comment line. Full enum: UNSPECIFIED=0; FP8_E4M3_E8M0=1; NVFP4_E4M3_GLOBAL=2; BF16=3; FP8_E4M3_GLOBAL=4; Wire-additive, 2 lines in each proto.

  2. helios/src/core/schema.rs:

    • :445-456 engram_encoding_has_scales — extended (from #664) so Bf16 | Fp8E4m3Global => Ok(false) (single-plane) vs Fp8E4m3E8m0 | Nvfp4E4m3Global => Ok(true).
    • :496-511 validate_engram per-table: if has_scales → validate scale_buffer; else reject non-empty scale_buffer / non-zero scale_block ("single-plane engram table cannot carry scale metadata"); for BF16 additionally require global_scale.to_bits() == 0; otherwise (i.e. FP8) require finite AND > 0 global_scale ("FP8 global engram table requires a finite positive global scale").
    • :562-573 adds single_plane_row_bytes: embedding_width * 2 for BF16 (generalizes #664's bf16_row_bytes), embedding_width for FP8_E4M3_GLOBAL — used to pin exact rows*row_bytes plane and shard sizes.
    • New test at :2067 validate_engram_accepts_and_checks_single_plane_fp8_global (fixture at :2104 uses encoding Fp8E4m3Global).
  3. helios/src/runtime_core/engram.rs:

    • :159-167 new decode match arm: Encoding::Fp8E4m3Global if global_scale finite && > 0 && embedding_width > 0 => (embedding_width, 0 /*block*/, embedding_width /*row_bytes*/, None /*no scale bytes*/).
    • :1161-1264 new test decode_single_plane_fp8_global_engram: decodes width 160 contiguous table, asserts planes.scales.is_none() and scales.is_none(); negative cases 0..7: scale_block=16 → "invalid Engram table encoding or bindings"; global_scale 0.0 / -1.0 / NaN / INFINITY / embedding_width 0 → "invalid n-gram encoding or global scale"; scale_buffer set / scales span set → "cannot carry scale bindings". Also partitioned (2 ranks) decode at :1224-1260 asserting partition == Some(rank), asserts shard carrying scales is rejected with "cannot carry scales".
    • Decode arm for NVFP4 at :141-149 is #716's (embedding_width-derived), not this PR.
  4. ignition/components/ngram_delivery.py:

    • :115-129 NEW custom op @torch.library.custom_op("flare::staged_ple_fp8", mutates_args=("out","timings","barrier_output")) with a register_fake. Body: state.run_lookup(weight.view(torch.float8_e4m3fn), scale, None, ids, count, out, token_count=out.shape[0]) — third arg (scales) is None.
    • :137-139 PreparedPLELookup.__init__ now raises ValueError for any caps.quant_mode not in ("nvfp4_group16", "fp8_e4m3_per_tensor"); self.is_fp8 flag.
    • :143-144 self.weights = table.weights[:tokens*heads], self.scales = None if is_fp8 else ....
    • :148-161 branch builds invocation_from_tensors(weight=..., weight_scale=..., weight_scale_2=None for fp8).
    • :206-213 __call__ dispatches to _lookup_fp8 or _lookup.
    • Existing flare::staged_ple at :98-106 unchanged, still takes both scales and scale.
  5. heliopause/src/export/core.rs: the FP8-specific code is ONLY in TESTS. Measured against the #664 baseline: roles(), validate_ranks(), core_engram() already route through helios_core::core::schema::engram_scales and optional scales_idx: Option<usize>; diff hunks touching those functions are #664's work, not #733's. #733's own contributions are the test fixture tables fp8_global_shared / fp8_global_part at :4560-4596 (rows 2, embedding_width 8, encoding Fp8E4m3Global, global_scale 0.015625, no scales) and their payload registration at :4609-4611. So "Heliopause exporter" needs no production change and got none. NOTE: file:line :4413-4768 cited by #732's review as coverage; #733's test additions are around :4525-4596.

  6. tests/preparation/test_embedding_table_handoff.py:98-135 new test_fp8_e4m3_global_proto_and_ngram_delivery_contract asserts runtime_core_pb2.EngramTable.FP8_E4M3_GLOBAL == 4, that torch.ops.flare.staged_ple_fp8 write-alias set is exactly {"out","timings","barrier_output"} and that "frame" is NOT mutated, and that quant_mode="bf16" raises ValueError. It does NOT execute the op or check the cast/scale math, and it passes metadata=None so construction can never reach the plan path.

  7. Docs: docs/core-format-design.md:92-103 ("single-plane encodings (BF16, FP8_E4M3_GLOBAL) omit the -scales file"); helios/manifest.md:526; docs/cli-design.md:815.

#6 [high] Claims: several description bullets describe code that does not exist; new custom op lacks recorded approval

Verified facts vs. #733's description and evidence section:

A. "Heliopause exporter (heliopause/src/export/core.rs): Before: parse_engram_encoding only recognized NVFP4_E4M3_GLOBAL, FP16, and BF16. After: Parses "FP8_E4M3_GLOBAL"..." → parse_engram_encoding DOES NOT EXIST anywhere in the repository (search_code for the exact name: no matches; also no match in heliopause/). There is no string parsing of encoding names and no scale_block validation in heliopause (only reads table.scale_block at core.rs:1713). The sole FP8 additions in heliopause/src/export/core.rs are test fixtures (:4560-4596, :4609-4611). The exporter needed no production change because #664 already made the scale plane optional via schema::engram_scales. This bullet is fabricated/incorrect.

B. "Before: ... NVFP4_E4M3_GLOBAL = 1, FP16 = 2, and BF16 = 3" (also "keeping FP16 and BF16 strictly unscaled"). No FP16 encoding exists; there is no FP16 token anywhere in helios/proto. Real baseline in main: FP8_E4M3_E8M0=1, NVFP4_E4M3_GLOBAL=2. This misnumbering is repeated 3x in the description.

C. "Helios schema ... Before: schema.rs rejected unknown encodings and treated single-plane tables as forbidding global_scale" — the single-plane BF16 path that forbids global_scale was added 15 hours earlier by merged #664 (2026-12-04 03:51). #733 extends it by one enum variant. Framed as pre-existing baseline.

D. Claimed "19.1 GiB vs 38.2 GiB in BF16" and the export artifact "20,480,458,752 bytes": 20,480,458,752 bytes = 19.07 GiB — that is the size of the SINGLE FP8 weights plane. If the table were BF16 the same table would be 40,960,917,504 bytes = 38.15 GiB. Arithmetic is self-consistent. Note the export ran on an RTX 5090 with only 32 GiB VRAM at 28,327 MiB used, so the table was streamed, not resident.

E. Evidence realism check: reported "Ready in 12s (21.02 GiB loaded...)" for Inkling-2-Mini; and "2.4s RAM table load", "24.54 GiB loaded", "10s ready" for Qwen4. Numbers are internally plausible and specific (925,696 KV tokens / 64 snapshot slots; 503,808 / 82 slots).

F. Command form vs. required gate: docs/design-review.md:180-188 requires cargo test --locked --release on every affected crate matching .github/workflows/native-serving.yml. #733 reports cargo test --locked (NO --release) and name-filtered suites only (--lib engram 55 passed, --lib schema 21, heliopause --lib engram 7). Not the full crate suites. But the PR DOES run backward-compat serving replay (Principle 13, :116-123), which is what #664 was blocked on.

G. New custom op without approval: #733 adds flare::staged_ple_fp8 — a new torch.library.custom_op, i.e. a new captured-graph operation contract. docs/design-review.md:22-26: "A new operation contract requires approval even if it reuses a graph kind or enum value." #733's own description concedes owner approval from Luke Alonso is required, but at head 3198eae there are 0 comments and 0 reviews, so no approval is recorded. Contrast #566/#535 which recorded explicit approval notes.

H. Discord line present ("Discord: nero") — satisfies design-review Principle 17 (:163-169).

I. Charter fit: mod el-agnostic wire-format addition at the shared layer, no per-model branch → aligns with charter "Keep the runtime small and model-agnostic" and "What gets merged: ... a roadmap item". Roadmap names "Engram & shared Engram tables (#267); A broader design, scoped as its own project." Charter also says "Captured-graph op contracts: Adding a new one—even if it reuses an existing graph kind—requires owner approval before you write it." → the op is the sharper charter tension than the enum.

J. Scope creep beyond the 11 files: #733 adds NO changes to .github/workflows, AGENTS.md, THIRD_PARTY_NOTICES.md, docs/api.md, docs/TODO.txt or flare-winui — those appeared only in the contaminated pr_diff output (see entry 3). Nothing undeclared in the actual file list.

#7 [high] Recent activity: engram encoding files churned by #664 and #716 hours before; #554/#334/#723 overlap

Area activity (items_touching, last 180 days) — helios/src/runtime_core/engram.rs, newest first: #733 (open, nero-), #732 (open, yatesdr), #554 (open, ateska, DRAFT "engram: read row-cache misses from an Engram store host over RDMA READ"), #334 (open, javieratomic, "Read Engram rows ahead of prefill on every rank"), #664 (merged, kbenkhaled, 2026-12-04 03:51), #716 (merged, lukealonso, 2026-12-04 02:34), #711 (merged, lukealonso), #590 (merged, lukealonso, "fix Engram reader bugs and add PLE lookahead publish"), #566 (merged, voipmonitor, advisory lookahead prefetch), #539 (merged, FujitsuPolycom), #479 (merged, voipmonitor), #220 (merged, nero-, "DeepSeek V4.1 Flash: TP6 preparation with per-rank Engram partitions"), #219 (merged, nero-, "load partitioned Engram tables on rank-selective package copies").

helios/proto/core.proto: #733, #732, #723 (open, lukealonso, fleet-wide 2-way codec green contexts — 6 files in common with #733, mechanical rebase risk), #314 (open, schopde-nvidia, diffusion), #334, #664, #711, #618, #566.

So the engram table/encoding area is the hottest file pair in the repo right now: two merged engram PRs in the 15 hours before #733 opened (#716 at 02:34, #664 at 03:51 on 2026-12-04), and two competing open PRs (#732, #733) opened 29 minutes apart the same evening. nero-'s own prior merged work in this exact file is #220 and #219 (partitioned Engram tables, per-rank partitions) — #733's partitioned-shard handling builds directly on that.

CI: no checks ran on head 3198eae (orientation packet: "CI on the head commit: no checks"). No commits on the default branch since #733 branched (cc0a49d) touched its changed files.

Note on how #733 builds on #664/#716/#711/#720 (all merged within ~18h before it opened): #733's decode arm sits beside #716's embedding_width-derived NVFP4 arm; its schema checks extend #664's engram_encoding_has_scales/engram_scales/single_plane byte-size pinning; its Planes { weights, scales: Option<Plane> } and Table.partition come from #664; external_extents in Enigma test fixtures comes from #711/#720. It does not reverse any of that work — it is strictly additive on top of it.

#3 [medium] Process: pr_diff output includes unrelated merged work because the local main ref lags the PR base

The main ref visible to tooling is BEHIND the PR's stated base (cc0a49d): helios/src/async_transfer/ and ExternalExtentTable/external_extents in helios/proto/core.proto exist at pr/733 head but NOT at ref=main, yet related_items says #711 (which added async_transfer) and #720 are merged. Consequently pr_diff with no path returns 2.2M chars / many files, and per-file pr_diff (e.g. helios/src/core/schema.rs) includes hunks from #664, #711, #720 that are NOT part of this PR.

Authoritative change set = pr_files: 11 files, +499/-138. docs/cli-design.md +1-1; docs/core-format-design.md +1-1; heliopause/src/export/core.rs +64-4; helios/manifest.md +3-1; helios/proto/core.proto +2-1; helios/proto/runtime_core.proto +2-1; helios/src/core/schema.rs +121-12; helios/src/runtime_core/engram.rs +114-0; ignition/components/ngram_delivery.py +47-8; ignition/preparation/runtime_core_pb2.py +109-109; tests/preparation/test_embedding_table_handoff.py +35-0.

Consequence for reading: #733 is stacked on a very fast-moving main (#664 merged 2026-12-04 03:51, #716 merged 02:34, #711, #720 all same day). Lines cited below are from ref=pr/733 head.