Repository navigation
Conversation
…d and encoded on the host (FP4-Local's routed experts)
|
Thanks @Bizuayeu for the block-CSF codec and the reported byte-for-byte round trips of all 36,288 scale matrices. We're taking this with a geometry/exception-count overflow guard for 1.1.1. The independent order/digest tests matter: a matching encoder and decoder can both have the wrong layout and still round-trip. Review keeps the local-inference-lab format/reference attribution and checks allocation-failure cleanup. The full checkpoint result remains your reported receipt; we have not independently repeated it. This is a host foundation for #1015, with the mixed-format loader and its device/model gate still separate. No further codec changes are requested beyond the guarded integration. Posted by Ash's AI Assistant Synthena |
Credit: @Bizuayeu for the contributed implementation and original tests. Retain local-inference-lab format and reference-oracle attribution. Include the mandatory maintainer geometry, exception-count and allocation-unwind review fixes.
|
Thanks @Bizuayeu for #1021 and your reported round trip of all 36,288 scale matrices. 1.1.1 includes the block-CSF host codec with the geometry, code-length and exception-count overflow guards, independent layout/order checks and allocation cleanup. The local-inference-lab format and reference attribution stays with it. This is a host foundation; mixed-format family loading and #1015's checkpoint/device/model checks remain separate. The full checkpoint round trip has not been independently repeated here. Posted by Ash's AI Assistant Synthena |
Credit: @Bizuayeu for the contributed implementation and original tests. Retain local-inference-lab format and reference-oracle attribution. Include the mandatory maintainer geometry, exception-count and allocation-unwind review fixes.
What this changes
Adds
core/nvfp4_csf32.zig, a host decoder and encoder forcsf_32x2_v1, the lossless encoding of the routed experts' NVFP4 block scales in NVIDIA'sGLM-5.3-Flash-FP4-Local(#1015). Decoding gives the e4m3[n, k/16]bytes thatcore/nvfp4.zigreads today; nothing calls it yet.docs/csf-scale-blocks.mdof local-inference-lab/flashinfer (Apache-2.0). The code is written for TensorFold from that document. The test's golden digests were computed with its reference encoder,scripts/encode_csf.py(Apache-2.0). None of its code is in this change.core/nvfp4_csf.zig, which reads the slab encoding (csf, Qwen3.8 FP4-Local). This file reads the block one,csf_32x2_v1, and takes its name from the checkpoint'sweight_scale.csf32_*tensors. The two share no code.Receipt
9ccf4727plus this commit, Zig 0.17.0. Host tests on x86_64 Linux, on an LF tree fromgit archive. The checkpoint check ran on a GB10 (aarch64) againstnvidia/GLM-5.3-Flash-FP4-Local@76348ddb.[R, K/2]withK = 16C.zig build test: 84/84 steps, 1383/1390 tests passed, 7 skipped.zig build test-kernel-contract,test-golden,fuzz-cortheonand a plainzig build: succeeded.main).git diff --check: clean.nvfp4_csf32.zigadds 7 tests:Checklist
"draft": false, a resumed prompt equals a fresh one, and concurrent equals solo. (No served path changes; nothing calls the decoder yet.)SUMMARYline is in the receipt. (No GPU kernel.)std; a changed tile order fails the order and golden tests.)