Repository navigation
Serve lossless MXFP4-CSF DeepSeek-V4-Flash and Vision-Exp checkpoints - #971
Conversation
Add the deepseek_v4_flash MXFP4-CSF family (43 target layers of 256 routed experts, hidden 4096, MoE intermediate 2048, DeepSeek-native tensor names, TP1/2/4/8) and dispatch it to DeepseekV4Mxfp4CsfConfig. The config derives from the class CUDA registers as deepseek_v4_fp8 and parses the retained source block-FP8 fields, so attention, dense, shared-expert, vision and MTP/DSpark draft weights keep their native methods. Target routed experts read compressed scales with MXFP8 activations unless VLLM_B12X_MOE_FP4_FORCE_A16=1 requests BF16. Expert parallelism is rejected: MegaMoE experts bypass quantization methods and would never read the compressed experts. The loader family table records each family's compressed layer range and rejects reads outside it. The FP4-CSF guide documents the DeepSeek MXFP8 activation default and the DeepSeek-V4-Flash serving contract. Validation: tests/quantization/test_mxfp4_csf.py and test_nvfp4_csf.py pass on CPU (74 tests, 13 new); ruff, mypy hook, typos pass. No GPU serving run yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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 |
|
GPU A/B with the dk profile parameters (2x RTX PRO 6000 Max-Q 325 W per server, beta image f71cfb7b with the merged beta b12x/vLLM code as overlays; both arms up at once on separate GPU pairs, measured one at a time; decode = aggregate output tok/s at context 0, two 30 s runs; prefill = one 8K / 32K prompt): DeepSeek-V4-Flash-0731, TP2, DSpark 5, 8 slots
Per verification step (tok/s divided by the measured acceptance length): C1 -1.6%, C4 -2.0%, C8 -0.2%; raw C1 differs by the acceptance noise of single-request runs. DeepSeek-V4-Flash-Vision-Exp, TP2, DSpark 3, 4 slots (local CSF serving directory; the Hub upload of this checkpoint is still pending)
Per verification step: C1 -1.7%, C2 -2.7%, C4 +0.8%; prefill -1.4% / -2.9%. Model memory per GPU: DS4-Flash 77.29 vs 80.64 GiB, Vision 77.73 vs 81.08 GiB. Greedy answers are coherent with both checkpoints and diverge after a few words, as two runs of serving with non-deterministic MoE output can; the b12x MXFP4-CSF expert output is bit-exact against native in deterministic mode ( |
|
Update: the DeepSeek-V4-Flash-Vision-Exp lossless CSF checkpoint is now on the Hub ( |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 33617d4)
Load lossless MXFP4-CSF checkpoints of DeepSeek-V4-Flash and DeepSeek-V4-Flash-Vision-Exp
The MXFP4-CSF reader so far knew the DeepSeek-V4.1-Flash family only. This adds the
deepseek_v4_flashfamily, so the lossless CSF containers of DeepSeek-V4-Flash (0731) and DeepSeek-V4-Flash-Vision-Exp serve with compressed expert scales that stay compressed in GPU memory:vllm/models/deepseek_v4/mxfp4_csf.py: the family reads the compressed scales of the 256 routed MXFP4 experts in each of the 43 target layers by DeepSeek's native tensor names, at TP1/TP2/TP4/TP8;VLLM_B12X_MOE_FP4_FORCE_A16=1still selects BF16);Checkpoints (built with trellis-quant, byte-exact restore verified for every tensor):
local-inference-lab/DeepSeek-V4-Flash-0731-lossless-CSF(166.89 → 159.44 GB) andlocal-inference-lab/DeepSeek-V4-Flash-Vision-Exp-lossless-CSF(167.82 → 160.37 GB).Tests
tests/quantization/test_mxfp4_csf.py: 65 passed in the beta image on CPU (family detection, tensor names, TP shards, EP rejection, config rewrite).ds4-flashprofile parameters, this loader as a Python overlay on the beta image): DeepSeek-V4-Flash-0731 lossless CSF serves at TP2; model memory 77.29 GiB vs 80.64 GiB for the original, KV cache 1,853,797 vs 1,308,256 tokens (+41.7%); greedy answers coherent (they diverge from the original's after a few words, as two original runs can: serving runs non-deterministic MoE output; the b12x MXFP4-CSF expert output is bit-exact against native intests/moe/test_mxfp4_csf.py). DeepSeek-V4.1-Flash CSF (TP4) served with the same overlay (shared loader files): KV 12,951,057 vs 9,566,426 tokens, prefill -1.3/-1.7% at 8K/32K, decode -1% to -3.5% depending on concurrency. Speed numbers for DS4-Flash and the Vision variant follow in a comment.Fragment
vllm-mxfp4-csf-ds4-flash. AI-assisted (Claude Code); reviewed and run by the submitter.🤖 Generated with Claude Code