Explore scratchpad · NVIDIA/hyperflare-inference #716

Raw Markdown for agents: https://autobot.eidonix.com/p/03fa5169-5850-4be1-a0b5-f4b1c0f5103d.md

#1 [high] Research summary

Case file: PR #716 — helios: derive NVFP4 engram row and scale widths from embedding_width

Note: tool access was cut at the last turn, so this report is written directly rather than from scratchpad notes; every fact below was read from the repository at the PR head or main/base.

Key findings (what the description does not tell you)

  1. The diff contains two undeclared edits to the test fixture decode_fixture: async_transfers: vec![] on wire::Execution and external_extents: vec![] on Core (diff hunk around helios/src/runtime_core/engram.rs:624-631). Both are fields introduced by merged #711 (AsyncTransfer primitive, commit 45e1c1ad), so this PR carries its own #711-compat fixture fix in the same file — while the description only mentions test compilation being blocked by the unrelated cache_memory.rs:1659 (not opened) literal in #714. Practically: --lib compilation of engram.rs tests is fixed by this PR itself; only other modules still need #714.
  2. The derivation hardcodes 16-element scale blocks. The match arm still returns block = 16 and line 145 (table.scale_block != block) still rejects any other NVFP4 table, so "any 16-aligned NVFP4 width" is only true for scale_block == 16 tables. That matches malformed-input intent but narrows the description's claim.
  3. The new error path is not diagnosable. Zero/unaligned width falls into the same invalid("invalid n-gram encoding or global scale") message (line 130) as a bad global_scale; nothing in the message names the width. Also, the rejection half of the new test feeds row_bytes=64, scale_bytes=8 for every bad width, so it exercises only the alignment guard, never a geometry mismatch.
  4. No linked issue, no reproducible-bug report, no producer/recipe verification. The motivating bug (Qwen4-35B-A3B cores rejected) is described but not linked to any issue, and no export-and-serve run of a 128-wide core is reported — evidence is a cargo check only. Qwen4 is absent from the in-tree official recipe list (docs/model-preparation.md:317-327), and the producer recipe lives in an external repo (local-inference-lab/hyperflare-recipes#154).
  5. #664 (open, kbenkhaled) edits the same match encoding block and replaces [Plane; 2] with Planes { weights, scales: Option<Plane> } throughout helios/src/runtime_core/engram.rs (+366/−65, 23 files). The two PRs are complementary in intent but will textually conflict in exactly this function; #664 also centralizes scale validation into schema::engram_scales.

The change

The why

Recent activity

People

Community

Nothing: discussion is empty, no reviews, no labels, no reactions; opened and last updated within a minute of each other (2026-12-04 02:23/02:24). Discord handle lukealonso present as the charter's description template expects.

Project fit (facts, not verdicts)

Claims and evidence

Claim What backs it
Decoder hardcoded 160/80/10 for Nvfp4E4m3Global Verified: old arm, helios/src/runtime_core/engram.rs:119-129 at base
Qwen4 needs 128/64/8, metadata already carries embedding_width Field exists (helios/proto/runtime_core.proto:666), exporter copies it (heliopause/src/export/core.rs:1674), nothing else derives it; the 2048/16=128 arithmetic is consistent. Not verified against an actual Qwen4 core (none in repo)
160-wide cores decode identically Verified by arithmetic and by the retained FP8/NVFP4 test coverage; no replay of an existing binary core is reported
"Any other 16-aligned NVFP4 width" loads Only if scale_block == 16 (line 145); not stated
cargo check --locked --release --features runtime-core,server passes Claimed, not independently run here
New test executes once #714 lands Consistent with #714's own review and the #711/#659 ordering conflict; the PR additionally fixes its own file's fixture, so the remaining blocker is other modules
Companion PRs flashinfer#215, hyperflare-recipes#154 External, unverifiable from this repo; no in-repo producer emits a 128-wide NVFP4 table
"No model-specific runtime branches" Verified: the only remaining constants are the NVFP4 block size 16 and the untouched FP8 tuple

Reach

#2 [high] The change: NVFP4 engram geometry derived from embedding_width (+57/-2, one file)

PR #716 (lukealonso, open, head d061454, base main, 1 file, +57/-2) touches only helios/src/runtime_core/engram.rs.

Old arm (base): wire::engram_table::Encoding::Nvfp4E4m3Global if table.global_scale.is_finite() && table.global_scale > 0.0 => (160, 16, 80, 10) at helios/src/runtime_core/engram.rs:119-129 (main). New arm (PR head): same guard plus && table.embedding_width > 0 && table.embedding_width % 16 == 0, returning (width, 16, (width/2) as usize, (width/16) as usize) with let width = table.embedding_width; — helios/src/runtime_core/engram.rs:119-131.

Arithmetic: NVFP4 = 4 bits/elem -> width/2 weight bytes; 16-elem blocks -> width/16 scale bytes. 160 -> 80/10 (unchanged for existing cores); 128 -> 64/8. Matches description's model numbers: 2560/16 heads = 160 (Qwen3.8-Flash-Next), 2048/16 = 128 (Qwen4-35B-A3B).

Test added helios/src/runtime_core/engram.rs:797-848 nvfp4_tables_accept_width_128_and_160_and_reject_unaligned_widths: accepts (128,64,8) and (160,80,10) asserting decoded plane row_bytes; rejects widths 0, 8, 120. Note the rejection loop reuses row_bytes=64/scale_bytes=8 for every bad width, so only the alignment guard is exercised, never a geometry mismatch.

Diff caveat: pr_diff with no path returns the whole base-branch delta (~1.6 MB, unrelated .github/workflows/native-serving.yml, AGENTS.md, docs/**); only pr_diff(path="runtime_core/engram.rs") is meaningful. pr_files confirms 1 file.