Repository navigation
Conversation
…oding Add single-plane FP8_E4M3_GLOBAL (= 4) encoding to EngramTable alongside existing NVFP4_E4M3_GLOBAL (= 1), FP16 (= 2), and BF16 (= 3) encodings so models with per-tensor FP8 auxiliary embedding tables can be exported and served losslessly without requantizing into NVFP4. - Proto & generated bindings: add FP8_E4M3_GLOBAL = 4 in helios/proto/core.proto, helios/proto/runtime_core.proto, and regenerate ignition/preparation/runtime_core_pb2.py with protoc 35.1. - Helios & Heliopause: accept single-plane FP8 weights (scale_block == 0, no scale plane, finite positive global_scale, 1 byte per element) in helios/src/core/schema.rs, helios/src/runtime_core/engram.rs, and heliopause/src/export/core.rs. - Ignition: support fp8_e4m3_per_tensor in ngram_delivery.py via custom op flare::staged_ple_fp8 (with strict quant_mode validation) and update docs and Rust/Python tests. Design-Signed-Off-By: Gemini; design-review=2e5b Signed-off-by: Jonathan Gutierrez <john.gtz@icloud.com>
Collaborator
|
A case file has been opened for 733. Future reviews will auto-run 90 minutes after code updates are pushed.
|
Collaborator
Review StoppedAuto-Review halted due to finding: Another open pull request already covers this change, or more of it. |
Contributor
Author
|
Closing in favor of #732, which was opened shortly before this PR with the identical single-plane |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why is this change being proposed?
Models that ship per-tensor FP8 E4M3 auxiliary embedding tables (such as Qwen4-35B-A3B's 19.1 GiB Per-Layer Embedding table) currently have no lossless wire encoding in
EngramTable.Encoding:NVFP4_E4M3_GLOBAL = 1requires 4-bit weights plus a separate block-scale plane, whileFP16 = 2andBF16 = 3double storage and forbidglobal_scale. Without a single-plane FP8 E4M3 encoding, exporting such a table either fails schema validation or forces lossy requantization into NVFP4.Because this PR adds a new enum tag to the signed core-format Protobuf contract (
EngramTable.Encoding), it requires explicit owner approval from Luke Alonso (<lalonso@gmail.com>) perdocs/design-review.mdPrinciple 1.Paired companion PR & merge order:
NVIDIA/hyperflare-inference— adds the model-agnosticFP8_E4M3_GLOBAL = 4engram table encoding across Protobuf, Helios, Heliopause, and Ignition.FP8_E4M3_GLOBALfor Qwen4-35B-A3B FP8 PLE checkpoints.What exactly did this PR change?
helios/proto/core.proto,helios/proto/runtime_core.proto,ignition/preparation/runtime_core_pb2.py):EngramTable.EncodingdefinedNVFP4_E4M3_GLOBAL = 1,FP16 = 2, andBF16 = 3.FP8_E4M3_GLOBAL = 4(preserving existing tags 1–3 with no wire break) and regeneratesruntime_core_pb2.pyusingprotoc 35.1.helios/src/core/schema.rs,helios/src/runtime_core/engram.rs):schema.rsrejected unknown encodings and treated single-plane tables as forbiddingglobal_scale;engram.rsonly handled two-planeNVFP4_E4M3_GLOBALand unscaledFP16/BF16.FP8_E4M3_GLOBALas a single-plane 1-byte-per-element weight table (scale_block == 0, no scale buffer/plane,row_width == embedding_width) requiring a finite positiveglobal_scale, while keepingFP16andBF16strictly unscaled (global_scale == 0). Runtime staging delivers the single FP8 weight plane across both contiguous and partitioned shard layouts.heliopause/src/export/core.rs):parse_engram_encodingonly recognizedNVFP4_E4M3_GLOBAL,FP16, andBF16."FP8_E4M3_GLOBAL", requiresscale_block == 0, forbids scale buffers/shards, validates finite positiveglobal_scaleand positiveembedding_width, and publishes single-planeweights/engram-*-weights.safetensors.ignition/components/ngram_delivery.py):nvfp4_group16staged lookup with weights + block scales.caps.quant_mode in ("nvfp4_group16", "fp8_e4m3_per_tensor")and registers a dedicated custom opflare::staged_ple_fp8(mutating("out", "timings", "barrier_output"), leaving"frame"immutable) that gathers FP8 E4M3 weights, casts to BF16, and scales by the per-tensorglobal_scale.helios/manifest.md,docs/core-format-design.md,docs/cli-design.md,helios/src/core/schema.rs,helios/src/runtime_core/engram.rs,heliopause/src/export/core.rs,tests/preparation/test_embedding_table_handoff.py):FP8_E4M3_GLOBAL = 4across core format, manifest, and CLI docs.FP8_E4M3_GLOBALtables plus negative tests (scale_block != 0, scale plane present,NaN/INFINITY/non-positiveglobal_scale,embedding_width == 0), and Python tests verifyingruntime_core_pb2.EngramTable.FP8_E4M3_GLOBAL == 4,flare::staged_ple_fp8schema mutations, and unsupportedquant_moderejection.What is the claimed benefit or result?
NVFP4_E4M3_GLOBAL = 1,FP16 = 2,BF16 = 3).What evidence supports those claims?
CPU & Unit Tests
cargo test --locked --manifest-path helios/Cargo.toml --features runtime-core,server --lib engram— 55 passed, 0 failed.cargo test --locked --manifest-path helios/Cargo.toml --features runtime-core,server --lib schema— 21 passed, 0 failed.cargo test --locked --manifest-path heliopause/Cargo.toml --lib engram— 7 passed, 0 failed.pytest -q tests/preparation/test_embedding_table_handoff.py tests/preparation/test_frontend_spec.py tests/cli/test_config.py— 138 passed, 0 failed.SM120host) and aarch64 (SM121DGX Spark):cargo build --locked --release --manifest-path flare-cli/Cargo.tomlandheliopause/Cargo.toml.Backward-Compatibility Serving Replay (No Re-Export)
Inkling-2-Mini-FLARE/model.safetensors, untouched / not re-exported) with the newly builtflarebinary (--gpus 0 --host 127.0.0.1 --port 8099):12s(21.02 GiBloaded,9.77 GiBcache budget,925,696KV tokens,64snapshot slots)./v1/chat/completions(What is 17 * 23? Answer with just the number.,temperature=0) returned"391"and shut down cleanly onSIGTERMin0.4s.encoding = 3table carryingglobal_scalewithError: single-plane engram table cannot carry scale metadata, confirmingBF16 = 3unscaled invariants remain enforced.End-to-End GPU Export & Serving (Combined with Companion Recipe PR)
hyperflare-recipesPR andflashinferadb09a827.Qwen4-35B-A3B-NVFP4-Hybrid(--max-concurrency 8 --prefill-chunk-size 4096 --speculative-method mtp --mtp-draft-tokens 7 --mtp-only --mtp-expert-quantization nvfp4 --force-moe-decode-a16 --autotune-effort default --gpus 0):weights/engram-0-weights.safetensors(20,480,458,752bytes, no scale plane) withFP8_E4M3_GLOBAL = 4;28,327.12 MiBused /3,783.81 MiBfree at export (83graphs,5,666kernels).flare run --embedding-table-storage ram --prefix-cache-memory 32G --lossless-kv-compression cpu:10s(2.4sRAM table load,24.54 GiBloaded,6.17 GiBcache budget,503,808KV tokens,82snapshot slots)./v1/chat/completions(What is 600 * 531? Answer with just the number.,temperature=0) returned"318600"and shut down cleanly onSIGTERMin1.4s.Material Limitations / Unrun Checks
flare-winuibuild, SM103, and multi-rank TP (world_size > 1) GPU export were not run on this machine (multi-span / partitioned table handling is covered by Rust unit tests inengram.rsandheliopause/src/export/core.rs).verification/helios-lifecycle/check.py) was not run because no scheduler, admission, fence, cache-compaction, or rank-coordination paths were modified.Discord: nero