worthant commited on
Commit
7b540ca
·
verified ·
1 Parent(s): 2bb6e77

:ledger: docs(readme): Write bench documentation

Browse files
Files changed (1) hide show
  1. README.md +133 -0
README.md ADDED
@@ -0,0 +1,133 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ pretty_name: DeepSeek-V4-Flash-0731 quantization measurements
4
+ task_categories:
5
+ - text-generation
6
+ language:
7
+ - en
8
+ tags:
9
+ - evaluation
10
+ - perplexity
11
+ - kl-divergence
12
+ - gguf
13
+ - quantization
14
+ - llama.cpp
15
+ - deepseek-v4
16
+ - reproducibility
17
+ size_categories:
18
+ - n<1K
19
+ ---
20
+
21
+ # DeepSeek-V4-Flash-0731 — quantization measurements
22
+
23
+ Everything needed to reproduce, audit or extend the numbers published in
24
+ [AtomicChat/DeepSeek-V4-Flash-0731-GGUF](https://huggingface.co/AtomicChat/DeepSeek-V4-Flash-0731-GGUF):
25
+ the reference logits, the evaluation corpus, the raw tool output for every quant we
26
+ measured, and the parsed results.
27
+
28
+ Every GGUF of this model that we could find on the Hub was measured here — ours,
29
+ unsloth's, bartowski's, ggml-org's, antirez's and others — on one machine, against one
30
+ reference, with one command. Publishers normally report numbers from their own harness,
31
+ which makes cross-vendor comparison meaningless. These files exist so that anyone can
32
+ check ours instead of trusting them.
33
+
34
+ > [!IMPORTANT]
35
+ > Measured using `8x5090`
36
+
37
+ ## Files
38
+
39
+ | File | Size | What it is |
40
+ |---|---:|---|
41
+ | `wiki-alt.txt` | 1.29 MB | Evaluation corpus: wikitext-2 test split from `Salesforce/wikitext`, parquet rows concatenated |
42
+ | `ref5632.kld` | 37.1 GB | Reference logits from the lossless `AD-BF16` quant over that corpus at ctx 5632 |
43
+ | `RESULTS-0731.jsonl` | small | Parsed results, AtomicChat and unsloth ladders |
44
+ | `RIVALS-B1.jsonl`, `RIVALS-B2.jsonl`, `RIVALS-B3.jsonl` | small | Parsed results, other publishers, split by the machine that produced them |
45
+ | `logs/*.log` | few MB | Full unedited `llama-perplexity` output for every quant, nothing filtered |
46
+
47
+ The `.kld` file stores the reference model's full probability distribution at every scored
48
+ token position — roughly 258 KB per token at this vocabulary size. It is what makes the
49
+ KL-divergence numbers comparable: every quant is compared against these exact logits.
50
+
51
+ ## Result schema
52
+
53
+ ```json
54
+ {"repo": "bartowski/DeepSeek-V4-Flash-0731-GGUF",
55
+ "name": "MXFP4",
56
+ "bytes": 145678901234,
57
+ "ppl": "4.5446",
58
+ "kld": "0.156403",
59
+ "rms": "12.686",
60
+ "top1": "87.369"}
61
+ ```
62
+
63
+ `ppl` is `Mean PPL(Q)` from the KL-divergence block, `kld` is `Mean KLD`, `rms` is
64
+ `RMS Δp`, `top1` is `Same top p` — the share of positions where the quant picks the same
65
+ next token as the reference. Note that `Mean PPL(Q)` and the standalone `Final estimate:
66
+ PPL` printed by the same tool are different aggregations and do not match; the logs
67
+ contain both.
68
+
69
+ ## Measurement setup
70
+
71
+ | | |
72
+ |---|---|
73
+ | Reference | `AtomicChat/DeepSeek-V4-Flash-0731-GGUF` → `AD-BF16` (bit-exact with the official weights) |
74
+ | Corpus | `Salesforce/wikitext`, `wikitext-2-raw-v1`, test split, rows concatenated |
75
+ | Context | 5632, batch 5632, 51 chunks |
76
+ | llama.cpp | PR [#24162](https://github.com/ggml-org/llama.cpp/pull/24162), commit `f180ae8b2`, built with `-DCMAKE_CUDA_ARCHITECTURES=120` |
77
+ | GPU | 8× RTX 5090 |
78
+
79
+ ## Hardware matters here, and it is not optional
80
+
81
+ The routed experts of this model are 96% of its weights and they are stored in MXFP4.
82
+ llama.cpp has two paths for that format — unpack to BF16 and use a normal tensor-core
83
+ matmul, or feed the packed 4-bit data into block-scaled instructions. The second is gated
84
+ on compute capability ≥ 12.0, which covers consumer Blackwell only. H100 and H200 are 9.0,
85
+ B200 is 10.0, B300 is 10.3; all take the first path despite having FP4 hardware.
86
+
87
+ Same file, same corpus, same commit, reference model:
88
+
89
+ | GPU | ctx 512 | ctx 5632 |
90
+ |---|---:|---:|
91
+ | RTX 5090 | 5.4312 | 4.5381 |
92
+ | H100 | 5.1554 | 4.3406 |
93
+
94
+ A 4–5% difference from the GPU alone. Reproducing these numbers requires consumer
95
+ Blackwell **and** a build that targets it — compiling for `sm_90` on a 5090 gives the
96
+ H100 numbers, because the native kernel never lands in the binary.
97
+
98
+ ## Reproducing
99
+
100
+ ```bash
101
+ git clone https://github.com/ggml-org/llama.cpp && cd llama.cpp
102
+ git fetch origin pull/24162/head:dsv4 && git checkout dsv4
103
+ cmake -B build -DCMAKE_BUILD_TYPE=Release -DGGML_CUDA=ON -DCMAKE_CUDA_ARCHITECTURES=120
104
+ cmake --build build -j --target llama-perplexity
105
+ ```
106
+
107
+ ```bash
108
+ hf download AtomicChat/dsv4-eval-artifacts --repo-type dataset --local-dir .
109
+
110
+ ./build/bin/llama-perplexity \
111
+ -m <any-quant>-00001-of-*.gguf \
112
+ -f wiki-alt.txt --kl-divergence-base ref5632.kld --kl-divergence \
113
+ -ngl 99 -c 5632 -b 5632
114
+ ```
115
+
116
+ To rebuild the reference from scratch instead of downloading it, run the same command
117
+ against `AD-BF16` with only `--kl-divergence-base` and no `--kl-divergence`. Takes about
118
+ ten minutes and should print `Final estimate: PPL = 4.5381`.
119
+
120
+ ## Caveats
121
+
122
+ - Absolute values are not comparable to numbers published elsewhere. Other publishers use
123
+ different corpora, context lengths and hardware. Compare within one table.
124
+ - 51 chunks at ctx 5632 gives roughly ±0.003 on mean KLD. Differences smaller than that
125
+ are noise.
126
+ - Quants of derived models — expert-pruned, abliterated, distilled — are deliberately
127
+ excluded. KL-divergence against this reference would measure the difference between
128
+ models, not the cost of quantization.
129
+
130
+ ## License
131
+
132
+ MIT. Derived from `deepseek-ai/DeepSeek-V4-Flash-0731`. Produced by
133
+ [Atomic Chat](https://huggingface.co/AtomicChat).