Repository navigation
hy4_flash: host W8A16 FP8 weight map, TP=1/2/4 partition, and Engram FP8 row format (slice 1 of #4795) - #4827
Conversation
|
Thank you, @GrgaPalcic, for sending the first slice of the FP8 support. The host tensor map, the TP partition and memory-floor arithmetic, and the Engram row codec are careful work. The refusal controls in the tests make it clear which bad checkpoints are turned away and why. We found nothing that needs a change from you. The new modules stay inside the test build, so this slice does not touch any served token, default or model load. When the served slices follow, they will need the serial token-equality receipts next to the kernel and memory checks. We will check the CI result on our side.
|
|
Independent host verification of head
Host-side looks clean. Not run here: the full no-GPU suite ( — eXsoR65's AI agent (DeepSeek Harness): eXsoR65 authorized this comment before posting. |
e1b0146 to
5a1db5d
Compare
|
Thank you @GrgaPalcic. This is merged into main with your commits under your own name, so you're listed as a TensorFold contributor. It ships in the next release, credited to you in the changelog and the release notes. |
What this changes
Adds Slice 1 (host-only) of official
tencent/Hy4-flash-FP8(W8A16) support insidezig/src/families/hy4_flash/(Refs #4795):zig/src/families/hy4_flash/fp8_weights.zig(292lines): W8A16 checkpoint tensor map built directly onconfig.Text,core.Checkpoint, andcore.quant.fp8— admits per-projection BF16 vsF8_E4M3+BF16weight_scale_inv[ceil(N/128), ceil(K/128)], stacked FP8 routed MoE experts, and Engram/indexer/iHC tensors while refusing leftover tensors (UnusedTensors), stray scale tensors beside BF16 weights (UnexpectedTensor), and unsupported weight dtypes (UnsupportedQuantization).zig/src/families/hy4_flash/fp8_partition.zig(225lines):TP=1,TP=2, andTP=4block-aligned (128-row FP8 block) partitioning and per-rank memory floor accounting (layerBytes,weightBytes,engramTableBytes,tokenBytes,ringBytes), verified byte-for-byte against the officialconfig_fixture.json(158,445,453,396B stored text weights,126,721,231,872B stored Engram BF16,660,006,416 × 100B packed FP8 Engram rows,16,896B/tok BF16 KV,17,694,720B sliding rings).zig/src/families/hy4_flash/engram_fp8.zig(135lines): 100-byte FP8 Engram row format (96e4m3fncodes via exact round-to-nearest-even from fp64amax / 448.0+f32row scale,4096-byteHY4ENGR1header encode/parse/config validation).zig/src/families/hy4_flash/fp8_weights_test.zig(325lines) wired intozig/src/families/hy4_flash/host_tests.zig: synthetic W8A16 mapping + refusal controls, releaseTP=1/2/4partition & memory floor tests, exhaustivee4m3Rneverification across all65,536BF16 values +packRow/unpackRowF32round-trip +HY4ENGR1header/tiling checks across all 4 Engram layers (2, 12, 22, 32).Remaining slices (held until this slice and its parent receipts settle): Slice 2 (
PR 4B: CUDA kernels +core/contract/+ planted controls +sm_121SUMMARY), Slice 3 (PR 4C: served W8A16TP=2/TP=4+ DFly2 CUDA Graphs + BF16 KV receipts with serial token equality), Slice 4 (PR 4D: SigLIP2--vision+ 3D M-RoPE).Refs #4795(Slice 1 of 4;#4795remains open for Slices 2–4).main(141d6995a59e3e08685d0bbf4b741aebdd8bfe8c), 1 commit (e1b01462e).atc overlap --json: run on 2026-11-24T02:29Z againstorigin/main(141d6995a) —changedFiles: 5,overlaps: [],conflict: "clean"(complete: falsedue topullRequestsLimit/pullFilesUnavailable;gh pr list --search hy4_flash --state openalso notes#4110and#4566touchzig/src/families/hy4_flash/host_tests.zigwith independent test imports).Checks on this head
e1b01462epython3 tools/zig/lean_check.py, on the base and on this head:165on base (141d6995a),165on head (e1b01462e),0new findings (python3 tools/pr_check.py --base origin/main:0 error(s), 1 warning(s)— advisory Unreleased changelog bullet).0.17.0):zig build -Dfixed-cpu test-hy4-flash-host --summary all—31passed,0failed,0skipped (28baseline +3new test suites with negative controls)zig build -Dfixed-cpu test --summary all—12,489passed,0failed,89skipped (822/822steps)zig build -Dfixed-cpu test-golden --summary all—324/337+69/69equal,0unexpected differences (5/5steps)zig fmt --check build.zig zig— pass (exit0)git diff --check— pass (exit0)Receipt
n/a — host-only W8A16 checkpoint map, TP partition/memory floor, and Engram FP8 row codec + unit tests inside
zig/src/families/hy4_flash/; no existing loader, kernel, or serving inference path is reached yet. Full GPU kernel contracts and servedTP=2/TP=4receipts with serial token equality follow in Slices 2 and 3.Checklist