Repository navigation
dsv41 Zig: load the EXL3 2.8 bpw pack (bf16 router weights and confidence head, one source a tensor) - #38
Conversation
…idence head, one source a tensor) The 2.8 bpw pack holds ffn.gate.weight in bf16 (the 2.9 pack: f16). The reader now narrows a bf16 tensor to the f16 the router kernel reads, as the Python loader's .to(torch.float16) does. The DSpark confidence head is converted to f16 at load like the markov head, because the draft code reads it as f16. Shards.open fails on a tensor name that is in two shards (for example a dtype-override file next to the pack), so a view with two sources for a name cannot load silently.
…ffers The 1017 packs repeat the Engram q / k tables in two shards with the same dtype and shape (the 1017-headers fixture shows it). Such a pair loads as before: the later shard is used. A name in two shards with another dtype or shape (a dtype-override file next to the pack) still fails the load. The message is a warning, so a test that expects the failure does not log an error.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex review |
|
@codex review |
|
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
…very pull request) zig fmt 0.17.0 changes only layout and @intFromEnum to @backingInt. The Zig format check fails on these five base-branch files in every open dsv41-zig pull request, also where the pull request does not touch them.
…ments are one line (lean check)
|
@codex review |
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Merged on the Codex 👍 and green checks. Follow-up (needs a GPU window): measure prefill speed (cold 32K/128K TTFT and prefill tok/s) on the 2.8 bpw pack against the last release. Scheduled by the main session after the EAGLE chain. |
What this changes
The Zig dsv41 loader now loads the DeepSeek-V4.1-Flash-1017 EXL3 2.8 bpw pack. A header comparison against the 2.9 bpw pack found these differences:
ffn.gate.weight(43)UnsupportedConversion)ffn.gate.bias(43)attn.indexer.weights_proj.weight(8)engram.q_weight/k_weight(4)mtp.2.markov_head.head.weightmtp.2.confidence_head.proj.weightChanges:
checkpoint.readFrom: a bf16 tensor under an f16 key is narrowed withnarrowBfloat(round to nearest even, as the Python loader's.to(torch.float16)does).weights.zig:markovHeadis nowhalfAtLoad, used for the markov head and the confidence head. The cache key stays the checkpoint's own dtype, so no rank cache is invalidated.Shards.open: a tensor name in two shards with another dtype or shape fails witherror.DuplicateTensor. Example: the dtype-override file that the Python A/B view keeps next to the pack. The 1017 packs repeat the Engram q / k tables in two shards with the same dtype and shape (the1017-headersfixture shows it). Such a pair loads as before: the later shard is used.No change was necessary for these:
experts_cb.cubinhas the mma, rows and cp kernels for the ranges [2, 10], [2, 16] and [8, 8] (k2, half-bits).attn.compressor.wkv/wgate,attn.indexer.wkin layers 2, 8, 14 and 20). Their EXL3 forms are also in the pack, and both engines load the EXL3 form.native.safetensorsequal the kit'sgate_bias_vl(F32, difference 0); the tokenizer and chat template are the same files.Receipt
Environment: TensorFold
dsv41-zigplus this branch, indsv41-zig-dev@32894bad, imagetensorfold-dsv41-zig:32894bad(the same image IDsha256:89812ac5…on both nodes). Zig 0.17.0. Two NVIDIA GB10 nodes at TP=2. DeepSeek-V4.1-Flash-1017 EXL3 2.8 bpw, from a view without the Python dtype-override file, and its own rank cache (built bytf-dsv41-rank-cachein 288 s).Tests run: the new unit test in
checkpoint.zig(bf16 router weights read as f16, f32 bias copied, a repeated name with the same dtype loads, a repeated name with another dtype fails);zig build test-cuda-hostat32894bad: rc 0.zig fmt --checkon the changed files: passed. The first host-test run at977e3487failed one test: the strict duplicate rule rejected the 1017 fixture packs. That is what made the rule depend on dtype and shape.Bring-up window on the GB10 pair, 2.8 pack:
so_check16/16;router/chat_tools_stream, which calls the LAN router, not this engine);Decode speed: kit_bench set a, 512 tokens, median of 3: 85.0 tok/s at 1 stream (84.9 to 85.2); concurrent set b, 4 streams, 384 tokens: 122.4 tok/s in all.
Memory (
MemAvailable):Prompt speed (release campaign, window C, with dsv41: special-token text in request strings is plain text #39): cold 32K prefill, median of 3, Zig / Python 1.1.1 on the same pack: 2,161 / 2,004 tok/s (+7.8%), 2,242 / 2,066 (+8.5%), 2,487 / 2,268 (+9.7%) on three prompt sets;
cached_tokens0. Decode: 85.3 / 87.1 tok/s at 1 stream (97.9%), 123.0 / 123.3 at 4 streams (99.8%).Release fault campaign on this pack (2026-10-22, images
32894badand2307b3f3): agentic tool-call load 505 requests, 0 lost; needle found 7/7 up to 1,038,664 tokens (low point head 3.25 GiB); prefix cache on and off pass; two 65-min soaks, about 2,500 requests each, 0 reference mismatches, head memory flat (4.4-4.7 GiB). Faults it found are in other PRs: F1 (dsv41: special-token text in request strings is plain text #39) and F3 (dsv41: a rank whose peer dies ends with exit 75 (peer link watch) #40).The 2.9 pack still serves with this image (
2307b3f3): ready after 26 s, smoke andso_checkpass, both ranks exit 0.Not run: Metal (dsv41 is CUDA only).
Checklist