Skip to content

Community GGUF dialect compat for ds4f-mxfp4: metadata derivation and tensor-name aliases - #662

Open
nexus-cw wants to merge 4 commits into
antirez:ds4f-mxfp4from
nexus-cw:dialect-compat-metadata
Open

Community GGUF dialect compat for ds4f-mxfp4: metadata derivation and tensor-name aliases#662
nexus-cw wants to merge 4 commits into
antirez:ds4f-mxfp4from
nexus-cw:dialect-compat-metadata

Conversation

@nexus-cw

@nexus-cw nexus-cw commented Aug 3, 2026

Copy link
Copy Markdown

Summary

Addresses #661 (part 1 of 2). Lets community llama.cpp-dialect GGUFs of
DeepSeek V4 Flash, e.g. bullerwins/DeepSeek-V4-Flash-0731-MXFP4_MOE-Q8_0,
get past metadata loading and tensor lookup on ds4f-mxfp4. Part 2, the
dense tensor type conversion, is a separate PR stacked on this one.

Changes

Three commits, ds4.c only, about 340 net lines:

  1. Derive missing deepseek4.* metadata keys. The eight hc/lora/
    hash-layer keys the loader hard-requires are computed from keys the
    community dialect does carry. Derivation runs only when a required key
    is absent; native GGUFs stay on the exact required_u32 path.
  2. Tensor-name alias table. About twenty community-dialect names map to
    ds4 canonical names. The table is consulted only when the canonical
    lookup misses.
  3. vocab_size fallback. When deepseek4.vocab_size is absent, derive
    it from the length of tokenizer.ggml.tokens.

Testing

make cpu on this branch: clean build, no new warnings (the only warnings
are the two pre-existing rax.c use-after-realloc ones, untouched here).

Together with part 2, this stack has served the bullerwins GGUF in
production on a GB10 CUDA node with --ssd-streaming for several weeks,
12/12 on our eval battery.

Community llama.cpp-dialect GGUFs of DeepSeek V4 Flash omit eight
deepseek4.* keys the loader hard-requires. Derive the hc, lora and
hash-layer values from keys the community dialect does carry, keeping
native GGUFs on the exact required path.
Community GGUF exports use llama.cpp tensor naming that differs from
ds4 canonical names in about twenty places, including missing suffixes
and renamed attention and expert tensors. Add an alias table consulted
only when the canonical lookup misses, so native GGUFs are unaffected.
Some community GGUFs omit deepseek4.vocab_size. When the key is
missing, derive vocab size from the length of tokenizer.ggml.tokens
instead of failing the load.
@nexus-cw

nexus-cw commented Aug 3, 2026

Copy link
Copy Markdown
Author

Part 2 of the series is #664, stacked on this branch.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@nexus-cw

nexus-cw commented Aug 3, 2026

Copy link
Copy Markdown
Author

Added a short README subsection (Community GGUF dialects, under Model Weights) documenting what this PR does: direct loading of llama.cpp-dialect community GGUFs, the metadata keys derived when missing, tensor-name aliasing, and the vocab_size fallback. Docs only, no code change.

🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants