Repository navigation
feat(gguf): serve DeepSeek-V4 Flash and Pro GGUF checkpoints on deepseek4 - #774
void-mckenzie wants to merge 3 commits into
Conversation
|
Thanks, I checked your code and found the issues below. Must fix1. The routed experts lose the SwiGLU clamp on GGUF. With None it falls back to Should fix2. The HF row's Your open question: files without
|
- route the offload experts through swiglu_clamp so the GGUF MoE path applies the limit - map model.embed -> embed on the HF row so the bf16 exemption matches - default a wholly missing rope.scaling block to the family yarn values with a warning; refuse a partly present one
f0a1fd3 to
39f6b7e
Compare
|
All three addressed in 39f6b7e, rebased onto current main (cc4aa08, clean). 1. swiglu_clamp. 2. embed exemption. Added 3. rope.scaling, per your ruling. Full block -> used as written. Wholly missing -> family values (yarn, factor 16, original 65536, betas 32 / 1) with a warning naming the file and values. Partly present -> refused as inconsistent. Re-ran the sweep rows that were failing on the missing block: 26 of the 31 now pass the dry load (bartowski MXFP4, the antirez Pro mixes, ...); the other 5 parse past config and surface their next problem, all in existing classes (2 MTP-ish missing LEt me know if you have any other changes :) |
|
Retitling and updating the body: this loads the text trunks of the whole V4 family : Flash (GA + 0731), Pro (GA+ 0813), and Vision-Exp, which has the mmproj for vision. Plain Pro is verified in the sweep now too (batiai Q4_K_M / Q3_K_M: config, dry load, banks and kernels pass; the files just carry no chat template). On the mmproj follow-up: I am happy to pick it up. I have a local branch with vision GGUF support already working for GLM-5.3-Flash and DeepSeek-Vision-Exp, so if you have pointers on how you want it structured (mmproj discovery, vision tower mount, where the mm processor hooks in), I can adapt it to the gguf pattern. |
FlashML-org#777 FlashML-org#776 FlashML-org#774 FlashML-org#781 FlashML-org#779 deferred. Assisted-by: Claude Opus 5.5
Adds the llama.cpp
deepseek4GGUF reader on the GGUF quant kind from #690, serving every DeepSeek-V4 text release: Flash, Flash-0731, Pro and Pro-0813. Vision-Exp trunks serve text too - their vision towers ship as mmproj sidecars, which stay out of scope here (#671's vision item). Part of #671. Review fixes from #774 folded in: the clamped SwiGLU reaches the routed experts, the embed exemption matches through its checkpoint root, and a missing yarn block defaults to the family values.What it does
parse_gguf_configbuilds the family's ownDeepseekV4Argsfrom the GGUF KVs, then amodel_config_from_argsextracted from the HFparse_config- one ModelConfig construction for both flows, no drift.indexer.*-> 4; compressor without indexer -> 128, or 4 when itswkvhas the CSA overlap's double rows). Every released file'sattention.compress_ratiosarray (43 trunk entries + MTP zeros on Flash, 61 on Pro - all layers compressed, 30 with indexers) agrees with the derivation element for element.rope.scalingblock is used as written; a wholly missing one falls back to the family values (yarn, factor 16, original 65536, betas 32 / 1 - identical in all four official configs) with a warning naming the file and values; a partly present one refuses. llama.cpp serves these files unscaled, which is wrong for them.iter_gguf_weightsyields the same names the HF loader yields:wkv/wgate(read through a bf16 einsum, not the quant method; registry exempts them like the HF spec),wo_a, mHC mixers, router,attn_sinks,tid2eid(I32 -> int64)embedresolves dense on the HF row through a new("model.embed", "embed")checkpoint root so the bf16 exemption matches (it ships bf16 although the fp8 config claims it, theheadpattern); the GGUF row'sto_ggufmaps it itself and packstoken_embd.activation="swiglu_clamp") - plainsiluwould silently drop the +-limit clamp on the GGUF path; the ds_fp4 kernels read only the limit, so the HF path is unchanged.joyai-llmis DeepSeek-V4's pre-tokenizer spelling; transformers 5.18 maps no split for it, soload_gguf_tokenizerinstalls the model's own three splits + ByteLevel.expert_gating_func!= sqrtsoftplus (deepseek4.cpp: no default)tok_compare
Check sweep (scripts/gguf_check)
1,992 header stubs, 812 files checked, kernels probed on the RTX 5090.
Every failure is a clean refusal or a broken file. Not covered:
token_embd(LoRA exports, per-layer streams, vision sidecars)expert_gating_func(llama.cpp refuses too)swiglu_clamp_exp(custom EXTENSOR file)Real-file serving (the dry load never runs a forward)
unsloth Flash-0731 UD-Q2_K_XL (3 shards, 90.18 GiB), RTX 5090 32 GB, Ryzen 9 7950X3D, 187 GiB RAM, driver 580.95.05:
Serving caught one bug the dry load could not: the KV compressors read
wkv.weightdirectly through a bf16 einsum, so packed Q8_0 rows must dequantize (the crash was a [1024 x 4352] matmul; 4352 = Q8_0 row bytes for k=4096). Fixed before the runs below.Tests
pytest tests/models(not slow): 328 passed, 1 failed -test_minimax_m3.py::test_nvfp4_experts_restricted_to_triton_for_swigluoai, which fails identically on current main127aa0a(verified side by side). Registry and AOT-claim tests pick up the new entries. Review-fix checks:scheme_for("model.embed")resolves to None on the HF row, and the no-yarn files parse to the family values with the warning. No per-family GGUF test file, per the #721 review direction.