Repository navigation
Conversation
11d21d6 to
85ced53
Compare
|
Thanks @laudney. The MXFP4 experts have contract entries and fixed pair ordering. The changed router was covered only by One thing from you: this changes EXL3's router too, so please post EXL3 before and after timings with unchanged tokens. We can repeat the kernel checks on a GB10; release serving still needs four ranks.
|
85ced53 to
e136fc1
Compare
|
@ashhart rebased onto main |
|
@ashhart thanks for the router contract commit. EXL3 before and after, on one GB10 (sm_121a), the router kernel as
The picks and weights of all six shapes are byte-equal between the two (148,176 bytes). That follows from the change: with eps 0 the denominator is Served EXL3 tokens I cannot add here: these four GB10 hold the release checkpoint and NVFP4, not the EXL3 one, and I would rather not download it for this. If you want the served EXL3 tokens on your GB10, the kernel result above says they cannot change; I am glad to run any other check you name. |
|
Thanks @laudney for the patch-identical rebase and the EXL3 router comparison. Across all six shapes the timings are effectively unchanged, and all 148,176 bytes of router picks and weights are identical. The zero-epsilon defaults and the exact The remaining issue is application to current main. The cumulative diff conflicts in
|
e136fc1 to
4a711de
Compare
|
@ashhart rebased with the lower steps onto main
Checks at the stack head (
|
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.
4a711de to
60f04eb
Compare
|
@ashhart rebased again with the lower steps onto main |
Step 4 of #3527: the release's MXFP4 routed experts and the routing weights' reference guard.
Why
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
Adds
release_experts.cu,release_moe.cuh,release_moe_tile.cuhand their launches (kernels_release_ex.zig), the router'sepsargument (in the old tail padding ofArgs), its device check, refreshed router limit records, the expert contract files and bench.Issue: Refs DeepSeek-V4.1-Flash release weights (FP8 + MXFP4) on CUDA at world 4 on four GB10s #3527 (step 4 of 5)
Stacked on: cuda: DeepSeek release FP8 and BF16 projection kernels (#3527 3/5) #3532 (adds 4678767, 3128f61, 85ced53)
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).zig build kernel-contract(the release filterdsv41_relran; see the kernel section); other SMs (the release images aresm_121aonly).Receipt
tf-dsv41-test release-bench 10 expertsin the table.Kernel contract, only when a GPU kernel is new or changed
tf_dsv41_rel_group,tf_dsv41_rel_gateup/_prompt/_warp,tf_dsv41_rel_down/_prompt/_warp,tf_dsv41_rel_combine,tf_dsv41_rel_swiglu_actq(new); the router keeps its kernels, with anepsargument.tf-cuda-test kernel-contract dsv41_rel(nvcc 13.5, GB10):(filtered) SUMMARY 22 kernels: 22 pass gates 1-4, 0 fail, 0 known findings; 0 controls: 0 red as planted, 0 missed; 0 limit problems, exit 0 (PR 3's 9 + 13 here). End to end (group -> gate/up -> down -> combine, top-6/384 and top-3/128): a token equals its one-row bytes in batches of 5..2,048, at every position of 16- and 64-pair tiles, and in one-CTA and warp-form launches.tf-dsv41-test router-eps: zero sums give NaN at eps 0 and +0 at 1e-20, ordinary bytes equal, narrow and wide kernels.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. (Drafts and concurrency: equal, receipt above. Resume: not run, sessions are off at 4 slots.)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.)