Skip to content

Add Q4-dense variant: DeepSeek-V4-Flash-IQ2XXS-w2Q2K-AProjQ4-SExpQ4-OutQ8-chat-v2-imatrix.gguf #618

Description

@GiorgioOppo

Context / Motivation

On memory-constrained Macs (16 GB) with SSD streaming, decoding the Flash IQ2XXS model (81 GB) is ~2× slower than it needs to be. Root cause: the dense / non-routed weights are Q8 and take ~8.2 GiB resident, which crushes the dynamic expert cache down to 1.27 GiB — below a single token's routed working set (1.70 GiB) → thrashing (experts are re-streamed from SSD every token).

Moving the dense tensors from Q8 → Q4 frees ~2.6 GiB: the expert cache now fits under the RAM ceiling without swapping → higher hit rate → faster decode. This mirrors what the Swift app does (Q4 dense).

What changes vs. the current GGUF

Only the type of the dense tensors; routed experts and everything else are identical:

Component | Current (Q8) | New (Q4) -- | -- | -- attention projections (attn_q_a/q_b/kv/output_a/output_b) | Q8_0 | Q4_K shared experts (ffn_{gate,up,down}_shexp) | Q8_0 | Q4_K routed experts (ffn_{gate,up,down}_exps) | IQ2_XXS / Q2_K | unchanged output / embedding / norm / indexer | unchanged | unchanged

Coherence: native output is coherent (verified with greedy generation).

Expected gain

  • ~2.1× decode throughput in SSD streaming on memory-constrained (16 GB) machines.
  • Modest quality cost: ~+3.4% perplexity, with greedy next-token choice essentially unchanged (86.1% → 85.9%). The model picks the same tokens, just slightly less confident.
  • No engine changes required to run it (Q4_K dense is already supported via matvec_q4_k).

Notes

  • The requant was done with a NULL imatrix; using --imatrix <file.dat> (the same one used for the base model) would further shrink the quality gap  recommended for an official release.
  • Q4 dense is lossy: an intentional speed/quality trade-off.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions