sleepyeldrazi commited on
Commit
c062d7a
·
verified ·
1 Parent(s): 0c47a3c

Upload DeepSeek-V4-Flash-REAP-K128 Q2/Q4 Mixed GGUF

Browse files
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ DeepSeek-V4-Flash-REAP-K128.gguf filter=lfs diff=lfs merge=lfs -text
DeepSeek-V4-Flash-REAP-K128.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b46812c007a43dd8c2888fc51cd4fa7b331785f89ef6866fb0389c478e7d54e6
3
+ size 55875180192
DeepSeek-V4-Flash-REAP-K128.gguf.reap_plan.json ADDED
The diff for this file is too large to render. See raw diff
 
README.md ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ tags:
4
+ - deepseek
5
+ - deepseek-v4
6
+ - deepseek-v4-flash
7
+ - mixture-of-experts
8
+ - reap
9
+ - expert-pruning
10
+ - gguf
11
+ - ds4
12
+ - experimental
13
+ - dgx-spark
14
+ pipeline_tag: text-generation
15
+ ---
16
+
17
+ # DeepSeek V4 Flash — REAP K128 (Mixed Precision)
18
+
19
+ REAP-pruned DeepSeek V4 Flash at **K128** (128 routed experts per MoE layer).
20
+ Prunes 50% of routed experts via Cerebras REAP (Router-weighted Expert Activation Pruning),
21
+ preserving all attention, embeddings, shared experts, router, and MTP components.
22
+
23
+ ## At a Glance
24
+
25
+ | | |
26
+ |---|---|
27
+ | **Base model** | DeepSeek V4 Flash |
28
+ | **Donor GGUF** | antirez Layers37-42Q4KExperts (90.9 GiB) |
29
+ | **Pruning method** | REAP (Cerebras Research) |
30
+ | **Routed experts** | 128 per layer (down from 256) |
31
+ | **Kept slots** | 5,888 / 11,008 |
32
+ | **Hash-preserved** | Layers 0-2 (256 experts each) |
33
+ | **Pruned** | Layers 3-42 (128 experts each) |
34
+ | **Format** | ds4-compact-v1 GGUF |
35
+ | **File size** | 52.04 GiB |
36
+ | **Mixed precision** | Layers 3-36: Q2_K/IQ2_XXS · Layers 37-42: Q4_K |
37
+
38
+ > **Note:** This variant preserves the donor's mixed quantization (Q4_K in layers 37-42,
39
+ > IQ2_XXS/Q2_K elsewhere). Requires a ds4 runtime that handles per-layer quant type dispatch.
40
+ > If you encounter "expected IQ2_XXS expert tensors" errors, use the
41
+ > [uniform variant](https://huggingface.co/sleepyeldrazi/deepseek-v4-flash-reap-k128-uniform).
42
+
43
+ ## Domain Split (Calibration)
44
+
45
+ 8,000 prompts · 5.0M tokens · 1.3B routed expert observations
46
+
47
+ | Domain | Share |
48
+ |---|---|
49
+ | Coding & development | 35-40% |
50
+ | Agentic tool-calling | 16% |
51
+ | Research & knowledge | 15-20% |
52
+ | Math & science | 10-15% |
53
+ | Design & planning | 5-10% |
54
+ | Trivia & general QA | 3-5% |
55
+
56
+ Calibration used the REAP `activation_energy_sum2` score metric with 4,096 token context per prompt.
57
+ Top-to-bottom expert score gap in layer 3: 2,200x (strong pruning signal).
58
+
59
+ ## How to Run
60
+
61
+ Requires **eouya2/ds4-for-reaped** (ds4 engine with compact GGUF support):
62
+
63
+ ```bash
64
+ git clone https://github.com/eouya2/ds4-for-reaped
65
+ cd ds4-for-reaped
66
+ make cuda-spark -j$(nproc) # DGX Spark / CUDA
67
+ # or: make # Metal / macOS
68
+
69
+ ./ds4 --cuda -m DeepSeek-V4-Flash-REAP-K128.gguf --ctx 131072
70
+ ```
71
+
72
+ API server mode:
73
+ ```bash
74
+ ./ds4-server --cuda -m DeepSeek-V4-Flash-REAP-K128.gguf \
75
+ --host 0.0.0.0 --port 17777 --ctx 131072
76
+ ```
77
+
78
+ ## How It Was Built
79
+
80
+ 1. **Donor GGUF**: Downloaded antirez Layers37-42Q4KExperts variant (90.9 GiB) — Q4_K experts in deep layers, IQ2_XXS/Q2_K elsewhere
81
+ 2. **Calibration**: 8,000 prompts collected and run through ds4's imatrix collector on a DGX Spark (NVIDIA GB10) at 4,096 token context
82
+ 3. **REAP scoring**: Imatrix activation data converted to per-expert REAP scores using `activation_energy_sum2`
83
+ 4. **Pruning**: 50% expert removal via `ds4_prune_gguf.py` from eouya2/reap-for-ds4. Layers 0-2 (hash-routed) preserved. Expert tensors copied byte-for-byte — no dequant/requant.
84
+ 5. **Output**: `ds4-compact-v1` GGUF
85
+
86
+ **No fine-tuning.** Purely structural expert removal. Weights are unmodified — a subset of the original experts.
87
+
88
+ ## Acknowledgments
89
+
90
+ - **DeepSeek** — [DeepSeek V4 Flash](https://huggingface.co/deepseek-ai/DeepSeek-V4-Flash) base model
91
+ - **antirez** — [ds4 engine](https://github.com/antirez/ds4) and [GGUF quants](https://huggingface.co/antirez/deepseek-v4-gguf)
92
+ - **eouya2** — [ds4-for-reaped](https://github.com/eouya2/ds4-for-reaped) and [reap-for-ds4](https://github.com/eouya2/reap-for-ds4)
93
+ - **Cerebras Research** — [REAP](https://arxiv.org/abs/2510.13999) ([code](https://github.com/CerebrasResearch/reap))
94
+ - **NVIDIA** — DGX Spark hardware