Repository navigation
Conversation
|
A case file has been opened for 732. Future reviews will auto-run 90 minutes after code updates are pushed.
|
Autobot ReviewFull Review · Value Proposition · Case File Recommendation: Changes RequestedThe
Walkthrough
Merge Risk: Low · up to
|
…able support Offloaded engram and PLE tables previously supported only two-plane FP8_E4M3_E8M0 (=1) and NVFP4_E4M3_GLOBAL (=2), plus single-plane BF16 (=3). Checkpoints such as Qwen4-35B-A3B store 160M-row PLE tables as single-plane FP8 E4M3 weights with a shared FP32 tensor scale, which could not be exported or served natively without a matching single-plane encoding contract. Add Encoding::FP8_E4M3_GLOBAL = 4 to helios/proto/core.proto and helios/proto/runtime_core.proto (and regenerate ignition/preparation/runtime_core_pb2.py). Validate single-plane 1-byte-per-element row sizing, scale_block == 0, absent scale plane/buffer, and finite positive global_scale in helios/src/core/schema.rs (matching the decoded Encoding enum exhaustively once) and helios/src/runtime_core/engram.rs (sharing single-plane row-byte geometry). Update ignition/components/ngram_delivery.py with an explicit _ple_lookup_planes validator shared by PreparedPLELookup and flare::staged_ple across nvfp4_group16, fp8_e4m3_per_tensor, and bf16. Preserve wire and behavioral compatibility for existing FP8_E4M3_E8M0, NVFP4_E4M3_GLOBAL (including omitted default encoding), and BF16 cores. Document the encoding in docs/core-format-design.md, docs/core-design.md, and helios/manifest.md, and add unit coverage in helios, heliopause (including shared and partitioned FP8_E4M3_GLOBAL hardlink reuse), and tests/components/test_ngram_delivery.py. This enables single-plane FP8 engram/PLE export, hardlink reuse, and disk- or RAM-backed native serving via flare run without re-exporting existing cores. Verification: - cargo test --release --manifest-path heliopause/Cargo.toml --lib: 234 passed, 0 failed, 6 ignored (including shared and partitioned FP8_E4M3_GLOBAL export and hardlink reuse alongside NVFP4_E4M3_GLOBAL and BF16). - cargo test --release --manifest-path helios/Cargo.toml --features runtime-core,server --lib core::: 527 passed, 0 failed, 14 ignored. - cargo test --release --manifest-path helios/Cargo.toml --features runtime-core,server --lib runtime_core::: 204 passed, 0 failed, 13 ignored. - cargo test --release --manifest-path flare/Cargo.toml --lib: 247 passed, 0 failed, 4 ignored. - pytest tests/components/test_ngram_delivery.py: 10 passed, 0 failed (covers nvfp4_group16, fp8_e4m3_per_tensor, bf16, FX tracing, and invalid mode/plane rejection). - Live single-GPU DGX Spark (NVIDIA GB10, SM121) ignition export (--max-concurrency 4 --prefill-chunk-size 2048 --autotune-effort default) and native flare run serving verified end-to-end with FP8_E4M3_GLOBAL (eidonix/Qwen4-35B-A3B-MXFP8, disk and --embedding-table-storage ram backing, 37.8 GiB GPU, 71.3 GiB disk / 53.1 GiB RAM KV cache) and backward-compatible NVFP4_E4M3_GLOBAL (eidonix/Qwen4-35B-A3B-NVFP4-MXFP8-Hybrid, 28.0 GiB GPU, 81.1 GiB KV cache). - Limitations: partitioned TP>1 FP8_E4M3_GLOBAL export, hardlink reuse, and decode are covered by CPU unit tests rather than multi-GPU hardware execution. Signed-off-by: yatesdr <6937857+yatesdr@users.noreply.github.com> Design-Signed-Off-By: yatesdr; design-review=2e5b
078b043 to
02ba762
Compare
|
+1 — closed #733 in favor of this PR since the |
Autobot ReviewFull Review · Value Proposition · Case File Recommendation: Changes RequestedThe
Walkthrough
Merge Risk: Low · up to
|
…PLE and MXFP8 MoE support
The existing qwen4_35b recipe entry pointed to an unpinned local path and
assumed NVFP4_E4M3_GLOBAL PLE, NVFP4-only routed MoE layers, separate
up/gate/down MTP expert weights, and quantized-only QSA projections carrying
calibrated KV scales. As a result, published Qwen4-35B-A3B checkpoints using
FP8_E4M3_GLOBAL PLE, MXFP8 or hybrid MXFP8/NVFP4 MoE layers, BF16 early QSA
layers with calibrated k_scale/v_scale, and fused 3D BF16 MTP experts could
not be prepared or exported for single-GPU NVIDIA DGX Spark (GB10, SM121).
Update the qwen38 recipe family and shared weight loader to support these
checkpoint contracts cleanly:
- Pin three Hugging Face checkpoints on QWEN4_35B_RECIPE in
hyperflare_recipes/recipes/qwen38/recipe.py with verified model-card
sampling defaults (Qwen/Qwen4-35B-A3B thinking mode):
- qwen4-35b-a3b (local-inference-lab/Qwen4-35B-A3B-NVFP4 @ 42496ec4)
- qwen4-35b-a3b-mxfp8 (eidonix/Qwen4-35B-A3B-MXFP8 @ f1feaf48)
- qwen4-35b-a3b-hybrid (eidonix/Qwen4-35B-A3B-NVFP4-MXFP8-Hybrid @ 4590c68c)
- Support FP8_E4M3_GLOBAL (fp8_e4m3_per_tensor) and BF16 single-plane PLE
tables alongside NVFP4_E4M3_GLOBAL across checkpoint.py,
checkpoint_schema.py, geometry.py, and ple.py.
- Load calibrated QSA k_proj.k_scale / v_proj.v_scale in attention.py,
weights.py, and mtp_weights.py via shared QwenWeightLoader.load_qsa_kv_scales,
allow those side-tensors on unquantized BF16 projections in
DirectWeightLoader.linear_format() (components/weights.py), and keep b12x
QSA attention on SM103 when calibrated FP8 KV scales are present.
- Support MXFP8 routed MoE layers in QwenWeightLoader.load_experts() ahead of
the force_moe_decode_a16 NVFP4 check so hybrid MXFP8/NVFP4 checkpoints apply
W4A16 decode to NVFP4 layers while keeping MXFP8 layers on MXFP8 A8 kernels.
- Extend load_bf16_experts_as_nvfp4 (components/weights.py) and
mtp_weights.py to load fused 3D BF16 gate_up_proj / down_proj draft experts.
- Document DGX Spark export and serving in docs/model-preparation.md and add
regression coverage in tests/recipes/test_qwen4_35b.py.
This enables single-GPU DGX Spark (GB10, SM121) export and native flare run
serving for all three Qwen4-35B-A3B checkpoints. On the 64-window (131,008
positions) confirmation KLD benchmark against the bit-exact BF16 teacher,
qwen4-35b-a3b-mxfp8 reduces mean KLD by 1.86x vs qwen4-35b-a3b (0.02761 vs
0.05122 nats; 94.04% vs 92.04% top-1; PPL 3.2788 vs 3.3005, teacher 3.2752),
and qwen4-35b-a3b-hybrid with --force-moe-decode-a16 reaches 0.04824 KLD in
28.0 GiB GPU memory (81.2 GiB / 7.26M KV tokens headroom) and 71.1-81.1 tok/s
single-request MTP decode in live compiled flare run serving.
Verification:
- CUDA_VISIBLE_DEVICES=0 FLARE_RUN_CUDA_TESTS=1 pytest on SM121 (GB10):
tests/recipes/test_qwen4_35b.py, test_qwen38_ple.py, test_qwen38_mtp.py,
and tests/cli/{test_models,test_planning}.py (-k qwen4/qwen38/mtp/ple/hybrid):
51 passed, 6 skipped, 0 failed (including CUDA fused-3D gate/up parity,
MTP KV-scale loading, and hybrid MXFP8/NVFP4 force_moe_decode_a16 routing).
- Live compiled + autotuned DGX Spark (NVIDIA GB10, SM121) ignition export
(--max-concurrency 4 --prefill-chunk-size 2048 --autotune-effort default)
and native flare run serving verified on qwen4-35b-a3b-mxfp8 and
qwen4-35b-a3b-hybrid.
- Limitations: qwen4-35b-a3b and qwen4-35b-a3b-mxfp8 require the companion
NVIDIA/hyperflare-inference#732 FP8_E4M3_GLOBAL engram table support;
TP2/TP4 serving and SM103 execution were not hardware-tested in this change.
Signed-off-by: yatesdr <6937857+yatesdr@users.noreply.github.com>
Design-Signed-Off-By: yatesdr; design-review=6fcc
Adds
EngramTable.Encoding.FP8_E4M3_GLOBAL = 4single-plane engram / Per-Layer Embedding (PLE) table support across Helios, Heliopause, and Ignition.Summary
helios/proto/core.proto,helios/proto/runtime_core.proto,ignition/preparation/runtime_core_pb2.py): AppendsEncoding::FP8_E4M3_GLOBAL = 4alongsideFP8_E4M3_E8M0 = 1,NVFP4_E4M3_GLOBAL = 2, andBF16 = 3.helios/src/core/schema.rs,helios/src/runtime_core/engram.rs): Exhaustively matches the decodedEncodingenum once invalidate_engram, enforces single-plane 1-byte-per-element row sizing (rows * embedding_width),scale_block == 0, absent scale plane/buffer, and finite positiveglobal_scale, and consolidates single-plane row-byte geometry inruntime_core::engram.ignition/components/ngram_delivery.py): Extracts_ple_lookup_planes(mode, weight, scales, scale)shared byPreparedPLELookupandflare::staged_ple, explicitly validating"nvfp4_group16","fp8_e4m3_per_tensor", and"bf16"plane/scale contracts and raisingValueErroron unsupported modes or mismatched planes.FP8_E4M3_E8M0,NVFP4_E4M3_GLOBAL(including omitted default encoding), andBF16cores without re-export.docs/core-format-design.md,docs/core-design.md,helios/manifest.md,heliopause/src/export/core.rs,tests/components/test_ngram_delivery.py): Covers shared and partitionedFP8_E4M3_GLOBALexport, signed round-trip, and hardlink reuse (reuse_engram_hardlinks_shared_and_partitioned_embedding_planes), plus invalid mode/plane rejection tests.Companion recipe PR:
local-inference-lab/hyperflare-recipes#165Verification
cargo test --release --manifest-path heliopause/Cargo.toml --lib: 234 passed, 0 failed, 6 ignored (including shared & partitionedFP8_E4M3_GLOBALexport and hardlink reuse).cargo test --release --manifest-path helios/Cargo.toml --features runtime-core,server --lib core::: 527 passed, 0 failed, 14 ignored.cargo test --release --manifest-path helios/Cargo.toml --features runtime-core,server --lib runtime_core::: 204 passed, 0 failed, 13 ignored.cargo test --release --manifest-path flare/Cargo.toml --lib: 247 passed, 0 failed, 4 ignored.pytest tests/components/test_ngram_delivery.py: 10 passed, 0 failed.ignition export(--max-concurrency 4 --prefill-chunk-size 2048 --autotune-effort default) + nativeflare runserving verified on bothFP8_E4M3_GLOBAL(eidonix/Qwen4-35B-A3B-MXFP8, disk and--embedding-table-storage rambacking:37.8 GiBGPU,71.3 GiBdisk /53.1 GiBRAM KV cache) and backward-compatibleNVFP4_E4M3_GLOBAL(eidonix/Qwen4-35B-A3B-NVFP4-MXFP8-Hybrid:28.0 GiBGPU,81.1 GiBKV cache).Discord: D-Rock