0xSero commited on
Commit
594537c
Β·
verified Β·
1 Parent(s): b0a3f58

Add files using upload-large-folder tool

Browse files
.gitattributes CHANGED
@@ -69,3 +69,9 @@ GLM-5.2-REAP-504B-Q4_K_XL-00001-of-00008.gguf filter=lfs diff=lfs merge=lfs -tex
69
  GLM-5.2-REAP-504B-Q4_K_XL-00006-of-00008.gguf filter=lfs diff=lfs merge=lfs -text
70
  GLM-5.2-REAP-504B-Q3_K_XL-00003-of-00006.gguf filter=lfs diff=lfs merge=lfs -text
71
  GLM-5.2-REAP-504B-Q4_K_XL-00003-of-00008.gguf filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
69
  GLM-5.2-REAP-504B-Q4_K_XL-00006-of-00008.gguf filter=lfs diff=lfs merge=lfs -text
70
  GLM-5.2-REAP-504B-Q3_K_XL-00003-of-00006.gguf filter=lfs diff=lfs merge=lfs -text
71
  GLM-5.2-REAP-504B-Q4_K_XL-00003-of-00008.gguf filter=lfs diff=lfs merge=lfs -text
72
+ GLM-5.2-REAP-504B-Q3_K_XL-00006-of-00006.gguf filter=lfs diff=lfs merge=lfs -text
73
+ GLM-5.2-REAP-504B-Q2_K_XL-00005-of-00005.gguf filter=lfs diff=lfs merge=lfs -text
74
+ GLM-5.2-REAP-504B-Q2_K_XL-00002-of-00005.gguf filter=lfs diff=lfs merge=lfs -text
75
+ GLM-5.2-REAP-504B-Q2_K_XL-00004-of-00005.gguf filter=lfs diff=lfs merge=lfs -text
76
+ GLM-5.2-REAP-504B-Q2_K_XL-00001-of-00005.gguf filter=lfs diff=lfs merge=lfs -text
77
+ GLM-5.2-REAP-504B-Q2_K_XL-00003-of-00005.gguf filter=lfs diff=lfs merge=lfs -text
GLM-5.2-REAP-504B-Q2_K_XL-00001-of-00005.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:58417ae9e82666624eb153be37c1b693826b7c35bc3a638a9b58e956e2f49e3b
3
+ size 44769604288
GLM-5.2-REAP-504B-Q2_K_XL-00002-of-00005.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:55479b34a090bf33ef3796b0f5d434aaab7013c9410ce6263b8f26199efaa493
3
+ size 44168328864
GLM-5.2-REAP-504B-Q2_K_XL-00003-of-00005.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:10f037e9011a3df669c401dd126ba4b9755ab3c54d0cd096710aba5dcf41a55f
3
+ size 44564908096
GLM-5.2-REAP-504B-Q2_K_XL-00004-of-00005.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d5f400699af5bcf50dad51dead657ee8d4c2c23e657f86bcb1c7f9ae77d9c2f3
3
+ size 44876437408
GLM-5.2-REAP-504B-Q2_K_XL-00005-of-00005.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:87b0a466f6ff75690abaaac94a5f1eae32337a49766a0081f7f6314a927cbe4b
3
+ size 27009792000
GLM-5.2-REAP-504B-Q3_K_XL-00006-of-00006.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fa0ddda9eb8c66b1e7ab15fc7d0947a3b9a631e9fe9769a76a4ea874c4299a28
3
+ size 37565276768
README.md ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ base_model: zai-org/GLM-5.2
4
+ tags:
5
+ - moe
6
+ - reap
7
+ - pruning
8
+ - gguf
9
+ - llama.cpp
10
+ - glm
11
+ ---
12
+
13
+ # GLM-5.2-REAP-504B-GGUF (keep-168, Router-KD)
14
+
15
+ GGUF builds of a **34%-pruned** GLM-5.2 β€” 168 of 256 routed experts kept per layer (incl. the MTP
16
+ layer), **~504B params**, recovered with **gate-only Router-KD** to the unpruned teacher. This is
17
+ the keep-168 "floor": it reaches **parity with the full unpruned GLM-5.2** on real-world prompts
18
+ while being a third smaller.
19
+
20
+ ## πŸ™ Sponsor
21
+
22
+ All pruning, distillation, and evaluation ran on **8Γ— NVIDIA B200 sponsored by [Lambda](https://lambda.ai)**. **Thank you, Lambda.** πŸ™
23
+
24
+ ## Files
25
+
26
+ | file | bits | size (approx) | notes |
27
+ |---|---|---|---|
28
+ | `GLM-5.2-REAP-504B-BF16` | 16 | ~933 GB | full precision β€” for fine-tuning / re-quantizing |
29
+ | `GLM-5.2-REAP-504B-UD-Q4_K_XL` | ~4.5 | ~270 GB | dynamic β€” **recommended** quality/size balance |
30
+ | `GLM-5.2-REAP-504B-UD-Q3_K_XL` | ~3.5 | ~210 GB | dynamic β€” smaller, strong quality |
31
+ | `GLM-5.2-REAP-504B-UD-Q2_K_XL` | ~2.7 | ~160 GB | dynamic β€” smallest usable |
32
+
33
+ **`UD` = Unsloth-style Dynamic.** Quantized with an **importance matrix (imatrix)** calibration pass,
34
+ and **per-tensor dynamic precision**: attention, the shared expert, token-embedding and output tensors
35
+ are kept at higher bits while the routed experts are pushed low. This is dramatically better than flat
36
+ K-quants at 2–3 bit. The `imatrix.dat` used is included in the repo for reproducibility.
37
+
38
+ Large files are split into ≀45 GB shards (`...-00001-of-000NN.gguf`); llama.cpp loads them directly
39
+ from the first shard.
40
+
41
+ ## What this is
42
+
43
+ - **Arch:** `GlmMoeDsaForCausalLM` β€” 78 layers (3 dense + 75 MoE) + 1 MTP layer, DeepSeek Sparse
44
+ Attention, sigmoid router (top-8), 1 shared expert, hidden 6144.
45
+ - **Prune:** REAP (saliency = `gate Γ— β€–expert_outputβ€–`) β†’ top-168/layer, consistent across all MoE
46
+ layers **and** the MTP layer; `n_routed_experts: 168`.
47
+ - **Recover:** freeze experts + backbone, train only the 75 router gates (~0.016% of params) to
48
+ KL-match the **unpruned** GLM-5.2 teacher's next-token distribution (plain uniform weighting,
49
+ lr 5e-5, 2999 sequences). This variant minimizes repetition / thought-loops.
50
+
51
+ ## Eval
52
+
53
+ Held-out real-world prompts (50 probes, raw sampling, **no max_tokens / no timeout** β€” loops are
54
+ *detected*, not truncated):
55
+
56
+ | metric | keep-168 + Router-KD | unpruned teacher |
57
+ |---|---|---|
58
+ | attractor / loop rate | **0.08** (4/50) | 0.10 (6/50) |
59
+ | natural-EOS rate | **0.92** | 0.88 |
60
+ | output diversity (distinct-4) | **0.878** | β€” |
61
+ | median output length | 995 tok | β€” |
62
+
63
+ On this eval the pruned+recovered model is **at parity with the full teacher** β€” the 0.08 vs 0.10
64
+ gap is within noise on n=50. Metrics are measured on the recovered model; lower-bit quants (esp.
65
+ Q2_K) inherit the recipe but were not individually loop-tested and will degrade somewhat.
66
+
67
+ ## Serving (llama.cpp)
68
+
69
+ ```bash
70
+ # loads all shards from the first one
71
+ llama-cli -m GLM-5.2-REAP-504B-Q4_K_M-00001-of-000NN.gguf -p "Hello"
72
+ llama-server -m GLM-5.2-REAP-504B-Q4_K_M-00001-of-000NN.gguf --host 0.0.0.0 --port 8080
73
+ ```
74
+
75
+ **Tip β€” brevity prompt:** GLM-5.2 (pruned or not) can over-think on some agent prompts. An optional
76
+ system prompt like *"Be concise. Think only as much as the task needs, then answer and stop."* cuts
77
+ median length roughly in half and removes some loops, at no retraining cost.
78
+
79
+ ## Known limitations
80
+
81
+ - A few residual `</think>`-restart loops are **inherent to GLM-5.2** β€” the *unpruned* teacher loops
82
+ on the same prompts β€” so they are not an artifact of pruning and are not fully fixable via routing.
83
+ - The dynamic low-bit quants inherit the recipe but were not individually loop-tested; prefer `UD-Q4_K_XL` or BF16 where quality matters most.
84
+
85
+ ## More
86
+
87
+ - Siblings: [`0xSero/GLM-5.2-481B`](https://huggingface.co/0xSero/GLM-5.2-481B) (keep-160), [`0xSero/GLM-5.2-469B`](https://huggingface.co/0xSero/GLM-5.2-469B) (keep-156).
88
+ - Writeup + code: [github.com/0xSero/glm52-reap-suite](https://github.com/0xSero/glm52-reap-suite)
89
+
90
+ ---
91
+ *Compute sponsored by **[Lambda](https://lambda.ai)** β€” thank you. πŸ™*