Final review report · NVIDIA/hyperflare-inference #732

Raw Markdown for agents: https://autobot.eidonix.com/p/9f89c694-ca54-4c3f-8f5f-d9828827290c.md

Recommendation: Changes Requested

The core format, schema validation, and runtime decoding additions for EngramTable.Encoding.FP8_E4M3_GLOBAL = 4 are small, additive, wire-compatible, and cleanly reuse #664's Planes { weights, scales: Option<Plane> } seam with zero FP8-specific exporter or native reader/staging branches. However, the PR is blocked on Layer-1 verification (docs/design-review.md:180-194, 247-251) because only narrow name-filtered debug subsets were run for helios and heliopause, and it has two real should-fixes: non-exhaustive fallback dispatch with missing None guards in ignition/components/ngram_delivery.py and factual discrepancies in the PR description (off-by-one wire enum numbers and an unbacked hardlink-reuse test claim).

Merge Risk

Level: Low

Walkthrough

Pre-merge Checks

Blockers

  1. Incomplete Layer-1 CPU verification for affected crates (docs/design-review.md:180-194, 247-251; AGENTS.md:309-321):
    • Verified gap: This PR modifies the signed core-format schema, runtime-core decoder, exporter tests, and Ignition ABI component across helios, heliopause, and ignition, yet reports only three narrow name-filtered debug test runs (helios --lib core::schema::tests, helios --lib runtime_core::engram, heliopause --lib payload_export_tests), non-release flare --lib, and a single pytest file (tests/components/test_ngram_delivery.py). It skipped --locked --release builds and unfiltered tests across the affected crates—omitting helios::engram::*, helios::core::reader, helios::core::conversion, helios::runtime_core::{protection,selection}, heliopause::export::{weight_reuse,binding}, and tests/preparation/ (including test_core_boundary.py and test_embedding_table_handoff.py (not opened)). Per docs/design-review.md:247-251, disclosing skipped runnable CPU checks as limitations does not waive them and blocks PR acceptance.
    • Fix: Run and report the Layer-1 release-mode commands for the affected crates and Python suites (matching .github/workflows/native-serving.yml (not opened) and .github/workflows/python-cpu.yml (not opened)):
      • cargo test --locked --release --manifest-path helios/Cargo.toml (not opened) --features runtime-core,server (with FLARE_TEST_TEMPLATE_DIR prepared via tests/frontend/prepare_templates.py (not opened), or running the full crate suite and noting only externally-gated template fixtures if offline),
      • cargo test --locked --release --manifest-path heliopause/Cargo.toml (not opened) --lib,
      • pytest tests/components/ tests/preparation/.

Should Fix

  1. Non-exhaustive catch-all else: and missing optional-plane validation in ignition/components/ngram_delivery.py:98-115, 132-145:
    • Verified behavior: Both _lookup (flare::staged_ple, lines 105–114) and PreparedPLELookup.__init__ (lines 136–144) duplicate the same three-way if mode == "bf16" / elif mode == "fp8_e4m3_per_tensor" / else: dispatch. Because scales and scale are now torch.Tensor | None (lines 99–100, 132):
      • Any unrecognized quant_mode string silently falls into the two-plane NVFP4 else: branch rather than raising an error, and crashes with AttributeError: 'NoneType' object has no attribute 'view' if scales is None.
      • "nvfp4_group16" with scales is None or scale is None crashes with AttributeError or forwards None as weight_scale_2.
      • "fp8_e4m3_per_tensor" does not reject scale is None or an unexpected non-None scales plane, and "bf16" does not reject unexpected scales/scale.
    • Fix: Extract one module-level helper _ple_lookup_planes(mode, weights, scales, scale) called by both PreparedPLELookup.__init__ and _lookup that explicitly handles "bf16", "fp8_e4m3_per_tensor", and "nvfp4_group16", validates presence/absence of scales and scale per mode, and raises ValueError on unsupported modes or mismatched planes. Add negative test cases in tests/components/test_ngram_delivery.py.
  2. PR description wire-tag errors, unbacked hardlink-reuse claim, and missing SM121 verification details (helios/proto/core.proto:269, helios/proto/runtime_core.proto:665, heliopause/src/export/core.rs:3907-4146):
    • Verified discrepancies:
      • The description states Added Encoding::FP8_E4M3_GLOBAL = 3 alongside NVFP4_E4M3_GLOBAL = 1 and BF16 = 2, which is off by one on every tag and omits FP8_E4M3_E8M0 = 1. The actual signed-core enum in both .proto files is UNSPECIFIED = 0; FP8_E4M3_E8M0 = 1; NVFP4_E4M3_GLOBAL = 2; BF16 = 3; FP8_E4M3_GLOBAL = 4.
      • The description claims FP8_E4M3_GLOBAL hardlink-reuse test coverage in heliopause/src/export/core.rs, but reuse_engram_hardlinks_shared_and_partitioned_embedding_planes (heliopause/src/export/core.rs:3907-4146) only loops over Nvfp4E4m3Global and Bf16 ((partitioned, bf16) at line 3910). Fp8E4m3Global is only exercised in core_engram_preserves_shared_and_partitioned_plane_layouts (4560-4768), which passes cache = None.
      • The claimed live SM121 ignition export + native flare run verification (disk/RAM FP8_E4M3_GLOBAL and backward-compatible NVFP4_E4M3_GLOBAL replay) omits commands, observed results, and confirmation that the pinned flashinfer-python[b12x] revision (1441ce86 in pyproject.toml:47) provides "fp8_e4m3_per_tensor" (which tests/components/test_ngram_delivery.py:56-67 mocks out).
    • Fix: Correct the enum tag numbers in the PR description, either add Fp8E4m3Global cases to reuse_engram_hardlinks_shared_and_partitioned_embedding_planes (recommended—small loop extension) or update the description to match actual coverage, and include a brief command/result summary for the SM121 export/serve and NVFP4 replay runs (docs/design-review.md Principles 12 & 16).

Subtract / Simplify

  1. Match the decoded Encoding enum once in helios/src/core/schema.rs:497-512, 561-571: After engram_encoding_has_scales, validate_engram re-compares table.encoding == ... as i32 three times (506, 561, 567) and duplicates the "single-plane engram table cannot carry scale metadata" error return (505, 508). Decoding wire::engram_table::Encoding once and matching exhaustively removes raw-i32 comparisons, collapses the duplicate error branch, and ensures future encodings cannot silently fall into an else branch.
  2. Consolidate single-plane decode geometry in helios/src/runtime_core/engram.rs:150-167: Encoding::Bf16 and Encoding::Fp8E4m3Global construct the same (table.embedding_width, 0, row_bytes, None) tuple differing only in bytes_per_element (2 vs 1) and the global_scale check; factoring the shared width-to-bytes conversion trims boilerplate while keeping both scale guards clear.

Nits

  1. docs/core-design.md:607 still describes PLE lookup as "b12x NVFP4 PLE embedding" (pre-existing staleness since #664's BF16, now also omitting FP8_E4M3_GLOBAL); consider updating it for consistency across the core-format doc set.
  2. Although adding an EngramTable.Encoding tag does not introduce a new captured-graph operation contract, getting a brief maintainer sign-off (@lukealonso) on the new signed-core enum tag and b12x "fp8_e4m3_per_tensor" vocabulary before merge is good hygiene.

Dropped on verification