Repository navigation
MXFP4-CSF: load DeepSeek-V4.1-Flash checkpoints at TP3 - #982
voipmonitor merged 2 commits into
Conversation
The deepseek_v41 reader admitted TP 1, 2, 4 and 8 only. At TP3 each rank owns 768 of the 2304 routed-expert channels, which is 32-channel aligned and falls on whole 16-row scale slabs, so the slicer and the b12x W4A8 CSF geometry already hold. Add 3 for deepseek_v41 only; the deepseek_v4_flash (2048 channels) and kimi_k3 lists are unchanged. Tests: the TP byte-slicing test also runs at TP3, and a new test pins which families admit TP3. Signed-off-by: Christopher Maher <chris@mahercode.io>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Signed-off-by: Christopher Maher <chris@mahercode.io>
voipmonitor
left a comment
There was a problem hiding this comment.
Verified on beta e1ccbaf0 (overlaying this loader): DeepSeek-V4.1-Flash-lossless-CSF loads at TP3 on 3x RTX PRO 6000 (weights loaded in 38 s), then OOMs because the model itself needs ~93 GiB per GPU at TP3 on 96 GB cards (71.4 GiB at TP4); not related to this change. Fine for larger-memory nodes such as GB10. Unit tests and fragment (validated with dk release_changelog) look good.
f1c2508
into
local-inference-lab:integration/karmic-kraken-beta
Purpose
The MXFP4-CSF reader admits DeepSeek-V4.1-Flash at TP1, TP2, TP4 and TP8 only, through the explicit TP allowlist in
read_mxfp4_csf_layer. This adds TP3 for thedeepseek_v41family so the lossless CSF checkpoint can serve on three GPUs, for example three DGX Spark (GB10) nodes. Thedeepseek_v4_flashandkimi_k3lists are unchanged.Every other constraint on the path already holds at TP3. The routed-expert intermediate size is 2304, so a TP3 rank owns 768 channels:
tp_extentneeds 32-channel alignment (2304 is divisible by 96), the compressed scale-plane slicer needs whole 16-row slabs (rank boundaries 0, 768 and 1536 are multiples of 16), and the b12x compact W4A8 CSF geometry needs N64/K64 (w13 1536 x 5120 and w2 5120 x 768 per rank). Attention already handles TP3 through the fork's head padding (64 heads and 8 o_groups padded to 72 and 9 at runtime), so the checkpoint'sconfig.jsonstays as published. DeepSeek-V4-Flash is left out on purpose: its 2048 channels do not split in three.Not a duplicate: no open or closed PR in this repo covers MXFP4-CSF at TP3. The open TP3 PRs (#547, #601) are for GLM-5.3 models.
Release-note fragment:
.lil/changes/vllm-mxfp4-csf-ds41-tp3.json.Test Plan
pre-commit run ruff-checkandruff-formaton the changed files (ruff 0.14.0)..venv/bin/python -m pytest tests/quantization/test_mxfp4_csf.py -v. The existing byte-slicing test,test_tensor_sources_preserve_projection_order_and_tp_bytes, now also runs at TP3 (ranks 0, 1 and 2). It checks that each rank's nibbles and decoded compressed scale planes equal exactly its third of the source. It calls_load_mxfp4_csf_weightsdirectly, below the TP guard. The newtest_reader_admits_tp3_for_deepseek_v41_onlychecks that the reader gets past the TP guard at TP3 fordeepseek_v41, and that TP6 fordeepseek_v41and TP3 fordeepseek_v4_flashandkimi_k3are rejected.local-inference-lab/DeepSeek-V4.1-Flash-MXFP4-CSFat revision872da235, TP3 across three GB10 nodes on a switchless RoCE ring. The image is built from source at fork1286ae9c(this branch's TP guard change applied as a one-line patch) and b12x78ee52c3plus [II] Align hybrid recurrent checkpoints with cache-group boundaries #457. The recipe is public: feat(cuda-gb10-vllm-dsv41-kk): karmic-kraken-beta vLLM + b12x for DSv4.1 TP3, fenced NCCL, MXFP4-CSF defilantech/llmkube-runtimes#56, variantcuda-gb10-vllm-dsv41-kk. Serving settings:--tensor-parallel-size 3,--quantization mxfp4_csf --load-format mxfp4_csf, 262K context, max-num-batched-tokens 4096, RoCEnante all-reduce on, DSpark off, KV cache 2.2 GiB per rank.Test Result
tests/quantization/test_mxfp4_csf.pyon this branch, run on a GB10 (DGX Spark) in an image built from fork1286ae9cand b12x78ee52c3, with this branch's Python files undervllm/overlaid (all pure Python): 72 passed. That includes the byte-slicing test at TP3 for ranks 0, 1 and 2, and all four cases of the new guard test. Negative control with the loader file from the base commit: 1 failed, 71 passed. The failure is the new test's TP3deepseek_v41case (ValueError: MXFP4-CSF deepseek_v41 supports TP (1, 2, 4, 8)). The byte-slicing cases pass on the base loader too, since_load_mxfp4_csf_weightssits below the TP guard; they show the slicer is correct at TP3, and the guard test shows the reader now admits it.This PR was prepared with AI assistance (Claude Code), including the test and serving runs above on my lab hardware. I reviewed the change and the results, and I'm responsible for it.
Assisted-by: Claude Code
Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.