Repository navigation
Conversation
993faef to
3a5c09b
Compare
|
Thanks @laudney. The world-four admission, release emitters and cache-cut identity complete the wiring, but the deferred FP32 compressor and mHC arithmetic and the teacher-forced comparison leave the fidelity gate open. Please keep admission refused until that arithmetic and comparison are complete; the GSM8K score and drafted/plain equality do not establish them. The changed top-k selector now has a CUDA contract registration in a commit of ours on top, which also shortens the inline comment at
|
|
@ashhart thanks. Two new commits on top, head
Checks: On the preview flag, my ranked choice: (1) keep it, so the four-GB10 receipt and the fidelity work can run the release at this head without a code change; (2) drop it and refuse outright, with the receipt run from a local patch. I will follow whichever you prefer. The four-GB10 receipt at the final head (seeded sampling, prompt/decode seams, the supported resume paths or their named refusals) follows in a separate comment. |
|
@ashhart the four-GB10 receipt at the final head (
The seams are the one cell that is not equal. I read them as arithmetic, not state, for the reason in the description, and the teacher-forced comparison that keeps admission refused is what will bound them. If you want a seam cell that must be exact before admission, my ranked choice: (1) a teacher-forced next-token comparison at each seam (logits, not greedy tokens), as part of the fidelity gate; (2) a decode-arithmetic prompt path for the last rows. Your call. |
a20b060 to
f62be6b
Compare
|
@ashhart thanks: #3388 landed, so this stack now takes the split-rows plan fix from main. Head
Checks on the new head:
#3530-#3533 are rebased the same way (each a fast-forward of the one below it); they carry no content change. |
|
Thanks @laudney for the preview gate, the narrow/wide top-k split and the checks after the rebase. Default admission stays refused while the fidelity work is open, and EXL3 keeps its 32-bit, four-pass kernel; only the release uses the 48-bit, six-pass selector. The opt-in preview appropriately contains the intentional release arithmetic differences. One evidence ask remains at final head The cumulative diff also conflicts in
|
f62be6b to
541354b
Compare
|
@ashhart rebased onto main
Final-head matrix (
Checks: host suites and |
The CUDA plan typed every projection as an EXL3 group, so another weight format would have to thread branches through every reader. GroupPlan and ExpertsPlan now hold their stored form in a tagged union with an EXL3 arm, readers go through it, and the expert width splits on a per-format block (expertShare: 128 for EXL3, 64 for the release format). EXL3 plans, emitted calls and pinned fingerprints are unchanged; block.Options gains the checkpoint format for the release arms to come.
The CUDA reader opens engram-l<L>-r<R>of<W>.bin, but the packer wrote only rank 0 of 1, so a four-rank release had no tables to read from SSD. A rank's rows are now its whole hash columns (rankRows, the reader's headShard), the packer, verifier and manifest work on that span with shard-relative offsets, the tool takes --rank and --world, and checkShards validates a rank's shards against its span at boot.
DeepSeek's own checkpoint stores FP8 32x32 blocks, MXFP4 experts and BF16 matrices that the CUDA plan could not express. The plan gains FP8, BF16 and MXFP4 forms with the rank's rows, columns and expert ids, cut on the mesh (release_shard over fabric/mesh), the Engram tables are checked and left on disk, and staging uploads the stored bytes unchanged. The real release plans at worlds 1, 2 and 4 with no tensor left over: 72.31 GiB a rank at world 4. Serving still refuses the format until its kernels land.
The release checkpoint's dense projections need GB10 kernels that multiply its FP8 block-scaled and BF16 weights as stored, with prompt and decode rows bit-equal; this adds block-scaled mxf8f6f4 and BF16 MMA tiles (decode, mid, prompt and a stage-free warp form) over one per-element K order and a row-independent split, the FP8 activation round trip with and without RMSNorm, the fixed split sum, a separate sm_121a image set loaded only for release checkpoints, contract checks (prompt equals decode, every tile position, one-CTA grids, group views, cancellation) and records for nvcc 13.0 and 13.5.
The release contract's prompt-versus-decode, row-independence and launch-shape checks ran FP8 only at splits 4 and 1, while the world-4 plan serves wkv and the shared w1/w3 at split 8. A wkv case (K 5120, N 512, BF16 out) now runs every check at split 8, the case table's comment names the splits it covers, and the tile comment no longer quotes a bandwidth measurement.
The release reference normalizes routing weights as s / (sum + 1e-20) so a row of zero scores stays finite; the CUDA router divided by the sum alone. Args gains an eps in its old tail padding (size and other offsets unchanged), the replay reads it as an optional argument, and EXL3 keeps passing 0, which leaves its bytes unchanged because the sum is never below +0. A device check covers zero sums (NaN at 0, +0 at 1e-20, lower ids on ties) and equal bytes for ordinary scores at top-k 6 of 384 and 3 of 128 on the narrow and wide kernels.
Adding eps to the router's Args moved the register count of ten of its sm_121 instances under nvcc 13.0, the compiler the base records pin; the records now hold the measured values. Shared memory is unchanged, and the 13.2 measurements stay as measured on 13.2.
The release checkpoint's routed experts store MXFP4 weights, so the MoE needs GB10 kernels that multiply E2M1 codes with their UE8M0 scales against the FP8 round trip of the FFN input. This adds the grouping of (row, k) pairs by the rank's held slots (an id -> slot table, so expert groups need only a plan change), gate/up with the reference SwiGLU epilogue and the round trip of v, down to bf16 partials, the rank-local combine in top-k order then the shared partial, and the shared expert's SwiGLU round trip; each staged kernel has a stage-free warp form with the same bytes. Contract checks cover prompt equals decode, every tile position, one-CTA grids, exact FP32 combine order and refusals; records for nvcc 13.0 and 13.5.
With a release checkpoint the decode, prefill and DSpark emitters now issue the release kernels instead of EXL3 trellises: one FP8 round trip for each distinct input view, then one block-scaled FP8 or BF16 MMA launch for each projection into the same output columns the EXL3 bodies write. The loader's `<base>.w` tensors give each projection's form, scratch names drop the layer so the arena does not grow with depth, split partials keep one buffer per stream, and the runner maps the new tf_dsv41_rel_v1 calls onto the release launches.
The release reference's head gives FP32 logits, so the release path no longer applies the EXL3 kit's bf16 rounding. The device top-k kept only a logit's top 16 bits in its keys, which can rank FP32 logits wrongly; its keys are now 48 bits (the whole value, then the column), so FP32 logits match the host sampler's order and the bf16-valued EXL3 logits keep exactly their old picks. A new device check compares the selector with a host sort on FP32, sub-bf16 and bf16 rows (the old kernel fails it). Shared memory grows to 13,336 bytes under nvcc 13.0, 13.4 and 13.5; 13.2 is not measured, so its record takes that source-fixed size with the unchanged registers.
Release checkpoints route with FP32 weights (no kit rounding, the reference's 1e-20 guard, no shared slot) and then run one FP8 round trip of the FFN input, the MXFP4 grouping, gate/up and down kernels, the FP8 shared expert as three dense launches, and the rank-local combine into the buffer the exchange reads, in decode, prefill and DSpark alike. The id -> slot table is built at boot from the plan's held ids, and the runner maps the new calls onto the expert launches.
The CUDA engine refused release FP8/MXFP4 checkpoints by name; it now admits them at world 4 (72 GiB of weights a rank) and refuses other worlds by name. Boot loads the sm_121a release images, checks this rank's Engram shards on disk, and refuses EXL3-only knobs by name; the forward takes the checkpoint's format, the L2 prefetch sites step aside (they priced trellis words), and capabilities list fp8.
The prepared-image cache key gained the checkpoint format and the release's resolved mesh cuts, but the serving caller still built the key with the EXL3 defaults, so a slice that moved at the same shape could read stale release bytes. A keyFor helper now builds the serving key from the config (format, and the rank's cuts for a release checkpoint), with a test of both formats.
Widening the top-k keys to every fp32 bit made EXL3's bf16-valued logits pay six radix passes for bits they never carry. The kernel body is now one template with two entries: topk_kernel keeps main's 32-bit keys, symbol, SASS and records for EXL3, and topk_kernel_wide takes the 48-bit keys for the release, chosen by Kernels.wideLogits at the device pick and the sampler, with the device and sampler checks covering each width on the rows it is built for.
The release fidelity gate is still open: the FP32 compressor and mHC arithmetic and the teacher-forced comparison are not done, so world-4 admission must not be the default. The CUDA format gate now refuses a release checkpoint at world 4 by name unless TF_DSV41_RELEASE_PREVIEW=1, a registered startup flag that receipts and development runs set explicitly, while other worlds keep their refusal whatever the flag says.
541354b to
55023b7
Compare
|
@ashhart main moved again, so the stack is rebased onto
Host checks pass at this head ( |
Step 5 of #3527: the release checkpoint serves on CUDA at world 4.
TF_DSV41_RELEASE_PREVIEW=1serves it at TP=4 on four GB10s, 72.3 GiB a rank, loaded in ~141 s"draft": false"draft": falseWhy
Serving the checkpoint as DeepSeek released it is crucial for benchmarking and for adoption: SGLang, vLLM and TRT-LLM serve these same bytes, so comparisons are like for like with no conversion step, and users run the checkpoint they already download, with no TensorFold-specific requant (#3527).
What this changes
The emitters issue the release kernels when
Config.formatis the release's: decode, prefill and DSpark dense projections (one FP8 round trip a distinct input, then one MMA launch a projection), the MoE (FP32 routing weights with the 1e-20 guard and no kit rounding, MXFP4 routed experts, FP8 shared expert, rank-local combine), FP32 logits. Boot refuses the release by name unlessTF_DSV41_RELEASE_PREVIEW=1(the fidelity gate below is open) and at any world but 4; with the flag at world 4 it loads thesm_121arelease images, checks the rank's Engram shards on disk and refuses EXL3-only knobs by name (TF_DSV41_R1,EXPERT_TOPP,PF_DENSE,GM_V2,GM_GU2,X3LD_EPI,ROUTER_GROUP_ROT,PF_TBO,L2PF,EX_STACKS,FORMS_INPLACE); the L2 prefetch sites step aside; capabilities listfp8; the prepared cache keys a release rank by its cuts. It also carries #3529's prefill plan fix (131c00c), which the rebase drops once #3529 lands.Deferred, stated in #3527: the FP32 ratio-2 compressor and FP32 mHC
fnarms (BF16 as EXL3 until an error gate asks for them),aot-needs --config(the release adds no Triton calls; the existing AOT set serves it), a teacher-forced logprob comparison.Issue: Refs DeepSeek-V4.1-Flash release weights (FP8 + MXFP4) on CUDA at world 4 on four GB10s #3527 (step 5 of 5; completes the stack's goal, the issue stays open for the gate)
Stacked on: cuda: DeepSeek release MXFP4 expert kernels and the router's eps (#3527 4/5) #3533 and fix(dsv41): plan prefill buffers at the split boundary's rows #3529 (adds 131c00c, 9444229, 28d1f2e, dd51e89, 653bf93, 3a5c09b, 5c099ed, a20b060)
atc overlap --json: run on the stack head against main e7e2424: textual conflicts with idol: Idol's denoiser on CUDA (stacked on #1766) #1767 and CUDA: #1764's BF16 prompt tile for Qwen ModelOpt, Nemotron and Dory, plus two exact Qwen prompt kernels (#1762) #2008 (shared registries:registry_joins.zig,build/cuda.zig,contract_family_sets.zig,kernel-contract.md) and DeepSeek-V4.1: read the pack's weight spans past the page cache (core/direct_io) #1924 (prepared.zig,build/dsv41_shared.zig); 10 open pull requests untested (ATC coverage limits). The registry entries are additive; whichever lands second rebases.Shared primitives: the release headers take their
mma.sync,cp.asyncandldmatrixfromcommon/(qmm_frag.cuh,cp_async.cuh, and the newcommon/block_scale_mma.cuhfor the block-scaled MMA), astools/zig/cuda_common_check.pyrequires; the three release images' SASS (nvcc 13.5, sm_121a) is identical before and after, so the contract results, records and receipts below (measured at 993faef) carry over.Checks on this head
zig build test test-golden test-dsv41-cuda-host test-dsv41-forward test-dsv41-device-host test-kernel-contract compile-dsv41-cuda compile-dsv41-serveron the stack head: 5296/5334 passed, 37 skipped, 1 failed (cli_config_test"serve --config: expand ...", which fails identically on main e7e2424 on the same host: inherited).zig fmt --check build.zig zigandgit diff --checkpass at every stack head. Each commit ran the family host suites when it was made (on main 811c384). Device:tf-dsv41-test topk-keys(the selector against a host sort on fp32, sub-bf16 and bf16 rows; the old kernel fails it) passes.zig build test-host10565/10661 passed, 94 skipped, 2 failed (bothcli_config_test"serve --config": our hosts' umask is 0002, so the fixture file is created group-writable; inherited); the DeepSeek host suites pass;tf-dsv41-test topk-keyspasses on a GB10 for both key widths (wide on fp32, sub-bf16 and bf16 rows; narrow on the bf16-valued rows);topk_kernel's SASS equals main's.zig build kernel-contract(the release filterdsv41_relran; see the kernel section); other SMs (the release images aresm_121aonly).Receipt
Four GB10s at this head (a20b060)
TF_DSV41_RELEASE_PREVIEWbench_concurrent.py --temperatures 0.8,0 --levels 1,4 --alone --serial)"draft": false4/4 equal; seed 99 gives other tokens"draft": false1/1 equal, both promptsTF_DSV41_SESSIONS=1, 1 slot)TF_DSV41_SESSION_RESIDENT=0)sessions_gpu.zig:195,fresh_start = true), so the restarted server prefills; equal to fresh (3/3)On the seams: no cell differs at its first token, as a lost KV, compressor, Engram or drafter state would make it; the prompt path's attention, compressor and mHC kernels round differently from decode's, so greedy near-ties flip later. This PR does not claim prompt == decode bits; the open teacher-forced comparison (below) is what bounds that difference. Sampled requests need
TF_DSV41_SAMPLING=1(else the request ends witherror (Sampling), HTTP 500).Earlier receipt (stack head 993faef, same SASS)
tools/bench_concurrent.py --tokens 256 --reps 3 --temperatures 0 --levels 1,4 --alone --serial, stack head 993faef (same SASS as this head),TF_DSV41_SLOT_DRAFTS=1): code prompt 1 stream alone 3/3 equal, 4 streams alone 12/12 equal, serial equal; chat prompt the same."draft": falsegives the sametoken_sha(ef896ebdbc61) as drafts on a 260-token reply.tools/bench_openai.py --tokens 256 --reps 3 --temperatures 0): 49.1 tok/s (fibonacci-raw), 42.2 tok/s (gpu-chat-no-think);"draft": false: 28.5 tok/s. 4 streams: 116.5 / 104.4 tok/s aggregate.tools/bench_cache.py --require-cold, raw token prompts): TTFT 1.83 s at 2,048, 7.22 s at 8,192, 29.2 s at 32,768 tokens (cached 0).Checklist
The title and description match the head commit, including the receipt and the stack.
New tests fail before the change, pass after it, and skip cleanly without their dependency.
Comments and docstrings are one line. No measurements or history in the source.
No personal data, machine names, internal hosts or local paths in the diff or its commits. No AI attribution lines.
Every token still goes through the lane rounds. No serial path, and nothing that needs drafts off.
Drafted output equals
"draft": false, a resumed prompt equals a fresh one, and concurrent equals solo. (Receipt above: drafts, concurrency and seeded sampling equal; RAM and NVMe resumes equal fresh at 1 slot; sessions are off by name at 4 slots; a restart prefills fresh by design.)No precision traded for speed. The release arithmetic is the checkpoint's own (DeepSeek-V4.1-Flash release weights (FP8 + MXFP4) on CUDA at world 4 on four GB10s #3527); EXL3 bits are unchanged.
Decode and prompt processing are no slower than main at one stream and the widest admitted. (n/a for the release checkpoint: main refuses it. EXL3 paths are untouched by format gating; not re-measured, no EXL3 pack on the test machines.)