Repository navigation
dsv41 metal: MXFP4 routed experts for decode rows over Kimi's plan, down and combine - #1707
Conversation
29c9ac7 to
61305ae
Compare
|
On the Kimi K3 point: this part no longer touches Kimi's shipped kernels. DeepSeek has its own copy of the expert plan, down chains and combine ( |
…own and combine tf_dsv41_xp_up runs the gate/up (fp8 act_quant of the input, clamped SwiGLU, route weight, act_quant of the result) over Kimi K3's MXFP4 kernels, which DeepSeek V4.1's experts share. Kimi's down chain takes the E8M0 scale as two normal floats so every scale byte but 255 is exact. Registered with the contract, checked against the release's real FP4 expert bytes and end to end through the GPU's own plan.
61305ae to
e51eb97
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! DeepSeek V4.1's MXFP4 expert kernels on Metal, under the kernel contract, are in 1.2.1: https://github.com/ashhart/TensorFold/releases/tag/v1.2.1 |
What this changes
DeepSeek V4.1's MXFP4 routed experts for decode rows:
tf_dsv41_xp_up(fp8 act_quant, clamped SwiGLU, route weight) and the down, plan and combine as a DeepSeek-only copy of Kimi K3's (experts_kimi.metal:tf_dsv41_route_plan,tf_dsv41_xp_down_one/_multi,tf_dsv41_xp_combine), whose down chain is exact over the whole E8M0 scale range. Kimi K3's shipped kernels (kimi/experts.metal,kimi_common.h) are unchanged:git diff main -- zig/kernels/metal/kimiis empty andtf-kernel-contract --only kimipasses. All registered with the kernel contract;docs/kernel-contract.mddescribes the checks.Part 3 of 18 of the stack for #1676; stacks on
dsv41-metal-pr/02-fp8-kernels(part 2, #1706).Receipt
tools/bench_concurrent.py --alone --serialortoken_shaagainst"draft": false: n/a: kernels only; the kernel contract checks each launch geometry's bits against the others and against float64.tools/bench_openai.py: measured on the PR that turns serving on.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 PR that turns serving on.zig build test tf-kernel-contract -Dcpu=apple_m1: exit 0, 583/583 steps, 0 fail, 36 skip; kernel contract,tf-kernel-contract --only dsv41(Metal):SUMMARY 14 kernels: 14 pass gates 1-4, 0 fail, 0 known findings; 20 controls: 20 red as planted, 0 missed; 0 limit problems; gates 40783 ms, limits 129 ms;tf-kernel-contract --only kimi:SUMMARY 1 kernels: 1 pass gates 1-4, 0 fail, 0 known findings;python3 tools/zig/lean_check.py: 4838 files, 424 problems, the same count as main (4807 files, 424). 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.