magiccodingman commited on
Commit
73dfc17
·
verified ·
1 Parent(s): 3c67abc

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +219 -3
README.md CHANGED
@@ -1,3 +1,219 @@
1
- ---
2
- license: apache-2.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ tags:
4
+ - mxfp4_hybrid
5
+ - gguf
6
+ - text-generation
7
+ - quantized
8
+ - cpu
9
+ - gpu
10
+ - mxfp4
11
+ - mxfp4_moe
12
+ - qwen3
13
+ base_model:
14
+ - unsloth/Seed-OSS-36B-Instruct
15
+ ---
16
+
17
+
18
+ # Unsloth - Seed OSS 36B Instruct MXFP4 Hybrid GGUF
19
+
20
+ **Dense model utilizing MXFP4_MOE with hybrid weights on a dense model. Achieving interesting results that show smaller file size, more TPS, and near lossless precision.**
21
+
22
+ ## **Use The Following Model!**
23
+
24
+ Stats compared against the standard Q8_0 (precision loss still compared to F16)
25
+
26
+ * **MXFP4_MOE-output_q6_K-router_gate_emb_q6_K**
27
+
28
+ 8.8% smaller than Q8 • 21.82 TPS • 0.053% precision loss
29
+
30
+
31
+ ---
32
+
33
+ This repository contains a set of hybrid MXFP4 quantized GGUF models designed to explore a surprising discovery:
34
+
35
+ > A carefully targeted combination of MXFP4 + high-precision embeddings/output weights can deliver near-Q8 accuracy with Q4–Q6 level throughput and smaller file sizes than Q8.
36
+
37
+ Unlike pure MXFP4, which heavily degrades dense models. This hybrid method selectively protects tensors that matter most for semantic stability, while allowing MXFP4 to accelerate everything else.
38
+
39
+ > **This is experimental**. And should be treated as such. I am more than encouraging people to use this model and leave feedback! Though precision loss seemed near lossless, did the hybrid models act strange in certain situations? Worse or better on some topics compared to the original model? Did it do better/worse overall on everything? I'd love to hear back from others!
40
+
41
+ ---
42
+
43
+ # The Magic Model
44
+
45
+ This model achieved:
46
+
47
+ > **File size reduction compared to the Q8_0**
48
+ >
49
+ > **Better precision loss scores than the pure Q6_K**
50
+ >
51
+ > **Achieving noticeably better TPS than a Q4_K_M**
52
+
53
+ _I have personally deemed this in the category of "Q7.5" quantization._
54
+
55
+
56
+ #### MXFP4_MOE-output_q6_K-router_gate_emb_q6_K
57
+
58
+ > **(8.8% smaller than Q8 • 21.82 TPS • 0.053% precision loss )**
59
+
60
+ This version created beat out everything in every way in the MXFP4 hybrid family created. Out of the batch, this MXFP4 hybrid was the only worth considering to utilize.
61
+
62
+ The following was the conversion script:
63
+ ```bash
64
+ llama-quantize \
65
+ --tensor-type token_embd.weight=Q6_K \
66
+ --tensor-type output.weight=Q6_K \
67
+ --tensor-type 'router.*'=Q6_K \
68
+ --tensor-type 'gate.*'=Q6_K \
69
+ "Path_To_F16_GGUF.gguf" \
70
+ "Path_To_GGUF.gguf" \
71
+ mxfp4_moe
72
+ ```
73
+
74
+ ---
75
+
76
+ # MXFP4_MOE Hybrid Naming Scheme & Synopsis
77
+
78
+ Multiple different combinations of converted models were created. The results were interesting to say the least. The following table will explain my naming scheme to what was done to the model to create it.
79
+
80
+ | Suffix Example | Meaning |
81
+ | ----------------------------------- | -------------------------------------- |
82
+ | `MXFP4_MOE` | Pure MXFP4 pipeline |
83
+ | `MXFP4_MOE-Q8` | Embedding/output in Q8_0 |
84
+ | `MXFP4_MOE-F16` | Embedding/output in F16 |
85
+ | `output_mxfp4-embd_q8` | Output → MXFP4, Embedding → Q8 |
86
+ | `output_mxfp4-router_gate_emb_q5_K` | Output → MXFP4, Emb/Router/Gate → Q5_K |
87
+ | `MXFP4_MOE-Q6_K` | Both embedding + output in Q6_K |
88
+ | `Q8_0`, `Q6_K`, `Q4_K_M` | Pure model-wide quantizations |
89
+
90
+ The results achieved were interesting to say the least. It was a brute force game of mass creating models with hybrid methods to find combinations that didn't cause too much noise and paired well with MXFP4.
91
+
92
+ This repo showcases the converted models, whether good or bad that was created. But, I have been testing other models in different combinations as well. **The winning hybrid combinations shown in this repo DOES NOT always equate to the same results on different models.**
93
+
94
+ Some models do better or worse with different kinds of combinations. It depends if it's dense, MOE, and much more. Many times the results surprise me. Many models no matter the combination will not play nice with MXFP4. At least with the methods shown here.
95
+
96
+ ---
97
+
98
+ ## Benchmark Methodology
99
+
100
+ All models were tested with a unified automated harness using `llama.cpp` tools.
101
+
102
+ **Included tests:**
103
+
104
+ - **Throughput:**
105
+ `llama-bench` with descending GPU offload (`-ngl 35 → 0`) and automatic OOM retry.
106
+ Highest successful TPS is recorded.
107
+
108
+ - **Perplexity:**
109
+ Three domains: **general**, **code**, **math**.
110
+ Each uses an auto-generated corpus of ~**32k tokens**.
111
+ Perplexity is computed with `llama-perplexity` at **2048-token** context.
112
+ Same GPU retry logic as above.
113
+
114
+ - **Precision loss:**
115
+ Each model is compared to its **family F16 baseline**.
116
+ Precision-loss % is computed for all PPL domains, plus an averaged score.
117
+ Models are ranked by this metric.
118
+
119
+
120
+ ---
121
+
122
+ ### Table - Overview of Results
123
+
124
+ Comparing to F16.
125
+
126
+ | model_name | size_reduction | tps_change |
127
+ | ------------------------------------------- | -------------- | ---------- |
128
+ | MXFP4_MOE-Q8 | 46.87% | 61.73% |
129
+ | Q8_0 | 46.87% | 66.72% |
130
+ | MXFP4_MOE-F16 | 40.46% | 41.91% |
131
+ | MXFP4_MOE-output_q6_K-router_gate_emb_q6_K | 51.57% | 84.76% |
132
+ | MXFP4_MOE-Q6_K | 48.52% | 66.55% |
133
+ | Q6_K | 58.98% | 97.63% |
134
+ | Q5_K_M | 64.6% | 90.69% |
135
+ | MXFP4_MOE-output_mxfp4-router_gate_emb_q6_K | 53.21% | 82.98% |
136
+ | MXFP4_MOE-output_mxfp4-embd_q6_K | 50.19% | 74.01% |
137
+ | MXFP4_MOE-output_mxfp4-embd_q8 | 49.92% | 64.94% |
138
+ | MXFP4_MOE-output_mxfp4-router_gate_emb_q8 | 49.92% | 74.09% |
139
+ | MXFP4_MOE | 73.42% | 77.31% |
140
+ | Q4_K_M | 69.9% | 132.18% |
141
+
142
+ * All percentages compared against the selected family F16 baseline.
143
+
144
+ ---
145
+
146
+ ### Table - File Size + TPS + Avg Precision Loss
147
+
148
+ | model_name | file_size_gb | bench_tps | avg_prec_loss |
149
+ | ------------------------------------------- | ------------ | --------- | ------------- |
150
+ | F16 | 67.35 | 11.81 | 0 |
151
+ | MXFP4_MOE-Q8 | 35.78 | 19.1 | 0.0171 |
152
+ | Q8_0 | 35.78 | 19.69 | 0.0171 |
153
+ | MXFP4_MOE-F16 | 40.1 | 16.76 | 0.0215 |
154
+ | MXFP4_MOE-output_q6_K-router_gate_emb_q6_K | 32.62 | 21.82 | 0.053 |
155
+ | MXFP4_MOE-Q6_K | 34.67 | 19.67 | 0.0566 |
156
+ | Q6_K | 27.63 | 23.34 | 0.1651 |
157
+ | Q5_K_M | 23.84 | 22.52 | 0.2512 |
158
+ | MXFP4_MOE-output_mxfp4-router_gate_emb_q6_K | 31.51 | 21.61 | 1.0377 |
159
+ | MXFP4_MOE-output_mxfp4-embd_q6_K | 33.55 | 20.55 | 1.0464 |
160
+ | MXFP4_MOE-output_mxfp4-embd_q8 | 33.73 | 19.48 | 1.0473 |
161
+ | MXFP4_MOE-output_mxfp4-router_gate_emb_q8 | 33.73 | 20.56 | 1.0473 |
162
+ | MXFP4_MOE | 17.9 | 20.94 | 2.694 |
163
+ | Q4_K_M | 20.27 | 27.42 | 2.8138 |
164
+
165
+ * Bench NGL was 35
166
+ * Utilized CUDA
167
+
168
+ ---
169
+
170
+ ### Table - PPL Columns
171
+
172
+ | model_name | gen | gen_er | code | code_er | math | math_er |
173
+ | ---------- | ---- | ------- | ----- | -------- | ------ | -------- |
174
+ | F16 | 6.8905 | 0.1681 | 1.4129 | 0.0095 | 5.4475 | 0.121 |
175
+ | MXFP4_MOE-Q8 | 6.8866 | 0.1679 | 1.413 | 0.0095 | 5.4474 | 0.121 |
176
+ | Q8_0 | 6.8866 | 0.1679 | 1.413 | 0.0095 | 5.4474 | 0.121 |
177
+ | MXFP4_MOE-F16 | 6.8893 | 0.1679 | 1.4132 | 0.0095 | 5.4508 | 0.1211 |
178
+ | MXFP4_MOE-output_q6_K-router_gate_emb_q6_K | 6.8932 | 0.1682 | 1.4127 | 0.0095 | 5.4548 | 0.1213 |
179
+ | MXFP4_MOE-Q6_K | 6.8946 | 0.1682 | 1.4128 | 0.0095 | 5.4539 | 0.1213 |
180
+ | Q6_K | 6.9012 | 0.1685 | 1.4135 | 0.0095 | 5.4637 | 0.1218 |
181
+ | Q5_K_M | 6.9071 | 0.1685 | 1.4168 | 0.0096 | 5.4604 | 0.1212 |
182
+ | MXFP4_MOE-output_mxfp4-router_gate_emb_q6_K | 6.9647 | 0.169 | 1.4196 | 0.0095 | 5.5326 | 0.1227 |
183
+ | MXFP4_MOE-output_mxfp4-embd_q6_K | 6.9649 | 0.1691 | 1.4199 | 0.0095 | 5.5327 | 0.1226 |
184
+ | MXFP4_MOE-output_mxfp4-embd_q8 | 6.9638 | 0.1691 | 1.4198 | 0.0095 | 5.5341 | 0.1227 |
185
+ | MXFP4_MOE-output_mxfp4-router_gate_emb_q8 | 6.9638 | 0.1691 | 1.4198 | 0.0095 | 5.5341 | 0.1227 |
186
+ | MXFP4_MOE | 7.1007 | 0.1728 | 1.4351 | 0.0097 | 5.636 | 0.1239 |
187
+ | Q4_K_M | 7.0964 | 0.1759 | 1.4235 | 0.0098 | 5.7037 | 0.1303 |
188
+
189
+ * gen = ppl_general
190
+ * gen_er = ppl_general_error
191
+ * code = ppl_code
192
+ * code_er = ppl_code_error
193
+ * math = ppl_math
194
+ * math_er = ppl_math_error
195
+
196
+ ---
197
+
198
+ ### Table - Precision Loss Columns
199
+
200
+ | model_name | loss_general | loss_code | loss_math |
201
+ | ---------- | ------------ | ---------- | ---------- |
202
+ | F16 | 0 | 0 | 0 |
203
+ | MXFP4_MOE-Q8 | -0.0566 | 0.0071 | -0.0018 |
204
+ | Q8_0 | -0.0566 | 0.0071 | -0.0018 |
205
+ | MXFP4_MOE-F16 | -0.0174 | 0.0212 | 0.0606 |
206
+ | MXFP4_MOE-output_q6_K-router_gate_emb_q6_K | 0.0392 | -0.0142 | 0.134 |
207
+ | MXFP4_MOE-Q6_K | 0.0595 | -0.0071 | 0.1175 |
208
+ | Q6_K | 0.1553 | 0.0425 | 0.2974 |
209
+ | Q5_K_M | 0.2409 | 0.276 | 0.2368 |
210
+ | MXFP4_MOE-output_mxfp4-router_gate_emb_q6_K | 1.0768 | 0.4742 | 1.5622 |
211
+ | MXFP4_MOE-output_mxfp4-embd_q6_K | 1.0797 | 0.4954 | 1.564 |
212
+ | MXFP4_MOE-output_mxfp4-embd_q8 | 1.0638 | 0.4884 | 1.5897 |
213
+ | MXFP4_MOE-output_mxfp4-router_gate_emb_q8 | 1.0638 | 0.4884 | 1.5897 |
214
+ | MXFP4_MOE | 3.0506 | 1.5712 | 3.4603 |
215
+ | Q4_K_M | 2.9882 | 0.7502 | 4.7031 |
216
+
217
+ * loss_general = precision_loss_general_pct
218
+ * loss_code = precision_loss_code_pct
219
+ * loss_math = precision_loss_math_pct