Repository navigation
dsv41: read the release checkpoint's FP8 blocks, MXFP4 experts and Engram tables, and Engram rows on Darwin - #1705
Conversation
|
Thank you @gilby. This is a big, careful piece of work, and splitting it into one-job parts with contract records for each kernel makes it much easier to review. This reply covers the whole stack, #1705 to #1722, for #1676. We'll review in this order: the release-format readers (#1705), then the kernel parts, then the decode forward, then serving. Images come after the text path lands. It won't make 1.2.0, which we're cutting in the next few hours, but it's first in line after that. A few requests before landing:
Thanks again. We're keen to get this in. |
f0199f3 to
347ac6b
Compare
|
Thank you for the careful review, and congratulations on 1.2.0. Since you review bottom-up and main moves quickly, I've rebased only this part for now: #1705 is now one commit on current main (acea3b5). I'll rebase each later part onto main when you reach it, rather than rebasing all 18 at once and doing it again a day later. All the changes below are done and tested together on main in one tree, and each part will carry its share. Rebase and #1705 on CUDA: the CUDA engine now refuses a release checkpoint right after reading its config, before any pack, weights or launch, with: "DeepSeek V4.1 CUDA: this checkpoint stores the release's own FP8 blocks and MXFP4 experts; the CUDA engine executes EXL3 trellises, so pack the checkpoint to EXL3 (or serve it on Metal) first". The test ( Kimi K3 (#1707): DeepSeek now has its own copy of the expert plan, chains and combine ( Contract coverage for Default test step: the DeepSeek Metal device suites (layer and served) are out of CUDA (#1719): the Metal lane target no longer depends on it. Engram tables: The full model (release checkpoint on an M3 Ultra, 512 GB; the full receipts go on the serving PR):
Test counts: the moving numbers were what |
347ac6b to
76fdb0c
Compare
|
#1705 is rebased on current main (6d3fa01), still one commit, and now carries the Engram manifest writer I mentioned: |
76fdb0c to
0f2ce63
Compare
|
Thanks @gilby, this answers everything for the first three parts. The early CUDA refusal with its test, DeepSeek's own copy of the expert kernels (Kimi's files are untouched), and the records kept out of |
…gram tables, and Engram rows on Darwin Config admits the release's own format (quant_method fp8, 32x32 weight blocks, ue8m0 scales, fp4 experts) beside the EXL3 trellises, and parseShapes reads a small checkpoint of the same format. A projection reads as fp8_block (E4M3 with one E8M0 scale a 32x32 block), mxfp4 (two E2M1 codes a byte, one scale per 32 of K) or fp8_rows (the Engram table, one scale per row and 32 columns); names gives the release's block and expert tensor names. Engram row shards open on macOS with the reader threads (Darwin has no io_uring or AIO), and tf-dsv41-engram-pack writes the release's Engram tables as packed row shards beside the token map. The CUDA engine refuses a release checkpoint right after reading its config, before any pack, weights or launch, with a message naming the format and what to do instead; cuda_format.zig's test admits the EXL3 fixture and refuses the release one. tf-dsv41-engram-pack pack also writes engram-manifest.json beside the tables: the release tensors each table came from (file, offset, length, dtype, shape), each table's SHA-256 and a seeded sample of rows. manifest writes one for tables packed before, after checking the sampled rows against the release shards, and refuses if any differs. engram_manifest.check() is what a backend calls at boot to refuse tables that no longer match the release.
0f2ce63 to
8d749a1
Compare
|
Thank you @gilby. 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. |
|
Thanks @gilby! Reading DeepSeek-V4.1's release checkpoint as published, with the checked Engram pack, is in 1.2.1: https://github.com/ashhart/TensorFold/releases/tag/v1.2.1 |
What this changes
Main's
deepseek_v41family reads the release checkpointdeepseek-ai/DeepSeek-V4.1-Flash-1017as published: FP8 E4M3 blocks with 32x32 E8M0 scales, MXFP4 routed experts and the FP8 Engram table, beside the EXL3 trellises; Engram row shards open on macOS, andtf-dsv41-engram-packwrites the release's Engram tables as row shards with a manifest beside them: the release tensors each table came from (file, offset, length, dtype, shape), each table's SHA-256 and a seeded sample of rows.tf-dsv41-engram-pack manifestwrites one for tables packed earlier, after checking the sampled rows against the release shards, andengram_manifest.check()is what a backend calls at boot to refuse tables that no longer match the release (the Metal server's boot check comes with its part). The CUDA engine refuses a release checkpoint right after reading its config, with a message that says to pack it to EXL3 or serve it on Metal.Part 1 of 18 of the stack for #1676; stacks on
main.Receipt
tools/bench_concurrent.py --alone --serialortoken_shaagainst"draft": false: n/a: readers and admission only; no served path changes.tools/bench_openai.py: measured on the last PR of the stack.ttft_sfromtools/bench_cache.py --require-coldon a long prompt, or "n/a" with the reason when the change cannot reach prompt processing: measured on the last PR of the stack.zig build test test-dsv41-shared dsv41-engram-pack -Dcpu=apple_m1: exit 0, 586/586 steps succeeded;test-dsv41-sharedincludes the four new manifest tests (a good table passes and parses back; one flipped byte in a sampled row, re-sharded source tensors and a missing manifest are each refused by name); on the GB10,zig build test-dsv41-cuda-host test-dsv41-shared: exit 0, 18/18 steps, 436 pass, 0 fail, 1 skip, including the refusal test (cuda_format.zig);python3 tools/zig/lean_check.py: 4817 files, 424 problems, the same count as main (4807 files, 424). ACHANGELOG.mdUnreleased line is included. Zig's summary counts only the test binaries it ran in that invocation, so the step count is the comparable figure.Checklist
"draft": false, a resumed prompt equals a fresh one, and concurrent equals solo.SUMMARYline is in the receipt.