Upload README-model-card.md with huggingface_hub
Browse files- README-model-card.md +87 -0
README-model-card.md
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
base_model: deepseek-ai/DeepSeek-V4.1-Flash
|
| 4 |
+
base_model_relation: quantized
|
| 5 |
+
pipeline_tag: text-generation
|
| 6 |
+
tags:
|
| 7 |
+
- deepseek
|
| 8 |
+
- deepseek-v4.1
|
| 9 |
+
- nvfp4
|
| 10 |
+
- modelopt
|
| 11 |
+
- vllm
|
| 12 |
+
- blackwell
|
| 13 |
+
- quantized
|
| 14 |
+
- atomic-chat
|
| 15 |
+
---
|
| 16 |
+
|
| 17 |
+
# DeepSeek-V4.1-Flash-NVFP4
|
| 18 |
+
|
| 19 |
+
[deepseek-ai/DeepSeek-V4.1-Flash](https://huggingface.co/deepseek-ai/DeepSeek-V4.1-Flash) with its routed experts
|
| 20 |
+
re-encoded as NVFP4, calibrated by NVIDIA's DeepSeek-V4 recipe, and **measured against the original**. Everything
|
| 21 |
+
below was produced by one run of [`foundry-nvfp4.sh`](https://github.com/AtomicBot-ai/atomic-quantizer/blob/main/scripts/foundry-nvfp4.sh)
|
| 22 |
+
on a 4×B200 box on 2026-09-10; the logs and the raw measurements are in
|
| 23 |
+
[AtomicChat/DeepSeek-V4.1-Flash-NVFP4-metrics](https://huggingface.co/datasets/AtomicChat/DeepSeek-V4.1-Flash-NVFP4-metrics).
|
| 24 |
+
|
| 25 |
+
## What this is, and what it is not
|
| 26 |
+
|
| 27 |
+
V4.1-Flash ships its routed experts in MXFP4 already. NVFP4 keeps every nibble and rewrites the block scales
|
| 28 |
+
(E4M3 per 16 plus one fp32 per tensor instead of E8M0 per 32). The cast is lossless: **16,986,931,200 of
|
| 29 |
+
16,986,931,200 blocks** transcoded bit-exactly. Engram tables, attention, shared experts, the LM head and the
|
| 30 |
+
MTP/DSpark draft stay in their original FP8 / BF16. The checkpoint is 8 GiB larger than the original, not smaller.
|
| 31 |
+
|
| 32 |
+
What NVIDIA's recipe adds is one calibrated `input_scale` per expert projection: it places the E4M3 window for the
|
| 33 |
+
FP4 activations on Blackwell's W4A4 NVFP4 MoE kernels. Calibration: `cnn_dailymail` + `nvidia/Nemotron-Post-Training-Dataset-v2`,
|
| 34 |
+
64 samples of 512 tokens each, through DeepSeek's reference `inference/model.py` under
|
| 35 |
+
[NVIDIA Model-Optimizer](https://github.com/NVIDIA/Model-Optimizer) at commit `079078de` with two one-line patches for V4.1
|
| 36 |
+
(tokenizer into the Transformer, FP8 block size read from the scale shape). 15,246 of 15,360 routed experts (99.3 %)
|
| 37 |
+
received calibration tokens; the rest got the per-layer fallback scale.
|
| 38 |
+
|
| 39 |
+
This checkpoint does **not** make the model faster on Hopper (NVFP4 runs through Marlin there and the calibrated
|
| 40 |
+
scales are ignored) and it is not smaller than the original. What it offers is the NVFP4 W4A4 path on Blackwell,
|
| 41 |
+
with numbers instead of a promise.
|
| 42 |
+
|
| 43 |
+
## Measured against the original
|
| 44 |
+
|
| 45 |
+
Reference: the original MXFP4 checkpoint served by the same vLLM build on the same 4×B200. Protocol: windows of
|
| 46 |
+
4096 tokens, second half scored, 24 windows per corpus, 49,152 scored positions each, top-512 log probabilities
|
| 47 |
+
(the KLD is a bracket; the numbers below are its lower edge, the upper edge is within 0.0004 on every row).
|
| 48 |
+
`ref-repeat` is the original scored twice and is the noise floor of the stand: MoE routing on non-deterministic
|
| 49 |
+
kernels flips 2–4 % of top-1 tokens between two runs of the same model.
|
| 50 |
+
|
| 51 |
+
| corpus | build | mean KLD | median KLD | p99 KLD | top-1 agree | ppl |
|
| 52 |
+
| --- | --- | --- | --- | --- | --- | --- |
|
| 53 |
+
| neutral (30 languages) | **this checkpoint** | 0.0353 | 0.00277 | 0.458 | 94.12 % | 2.9950 |
|
| 54 |
+
| | cast, no calibration | 0.0344 | 0.00276 | 0.433 | 94.39 % | 2.9928 |
|
| 55 |
+
| | original vs itself (noise) | 0.0159 | 0.00131 | 0.205 | 96.07 % | 2.9677 |
|
| 56 |
+
| code | **this checkpoint** | 0.0199 | 0.000037 | 0.316 | 96.76 % | 1.8955 |
|
| 57 |
+
| | cast, no calibration | 0.0191 | 0.000036 | 0.296 | 96.84 % | 1.9013 |
|
| 58 |
+
| | original vs itself (noise) | 0.0101 | 0.000022 | 0.160 | 97.69 % | 1.8895 |
|
| 59 |
+
| agentic | **this checkpoint** | 0.0089 | 0.000006 | 0.128 | 98.32 % | 1.3868 |
|
| 60 |
+
| | cast, no calibration | 0.0085 | 0.000005 | 0.127 | 98.40 % | 1.3871 |
|
| 61 |
+
| | original vs itself (noise) | 0.0055 | 0.000004 | 0.083 | 98.63 % | 1.3846 |
|
| 62 |
+
|
| 63 |
+
Two honest readings of this table:
|
| 64 |
+
|
| 65 |
+
1. **The calibrated checkpoint and a plain cast with `input_scale = 1.0` are indistinguishable** within the noise of
|
| 66 |
+
the stand: medians agree to the sixth decimal, mean KLD differs by 0.001 against a floor of 0.016. For this
|
| 67 |
+
model that is expected: DeepSeek trained it with SwiGLU clamps that bound the expert inputs at 189 and 150, and
|
| 68 |
+
the flat window already covers that range at full scale precision. The calibration is what NVIDIA's recipe
|
| 69 |
+
prescribes, and it costs nothing, but it does not buy anything measurable here.
|
| 70 |
+
2. **The cost of W4A4 itself is real and small**: about 1.7 points of top-1 agreement beyond the noise on general
|
| 71 |
+
text, 0.8 % perplexity on text, 0.5 % on code, 0.2 % on agentic dialogue, relative to the original served
|
| 72 |
+
natively. The original MXFP4 path does not pay this.
|
| 73 |
+
|
| 74 |
+
Speed is not measured and not claimed.
|
| 75 |
+
|
| 76 |
+
## Running it
|
| 77 |
+
|
| 78 |
+
Needs Blackwell (B200/B300/GB200/GB300, or RTX PRO 6000) and a vLLM that knows `deepseek_v41`. As of 2026-09-10
|
| 79 |
+
that is branch `dsv41-feat` of vllm-project/vllm ([PR #56214](https://github.com/vllm-project/vllm/pull/56214)),
|
| 80 |
+
built from source at `e47aa780`; the loader keys on `moe_quant_algo: NVFP4` in `config.json` and routes the experts
|
| 81 |
+
to the FlashInfer TRT-LLM NVFP4 MoE backend. Measured with `tensor_parallel_size=4`, `max_model_len=4097`, no
|
| 82 |
+
speculative decoding: the DSpark draft experts are left in MXFP4 and that combination has not been exercised.
|
| 83 |
+
|
| 84 |
+
## Reproduce
|
| 85 |
+
|
| 86 |
+
Runbook, toolbox and the exact commands: [atomic-quantizer/docs/runbook-nvfp4.md](https://github.com/AtomicBot-ai/atomic-quantizer/blob/main/docs/runbook-nvfp4.md).
|
| 87 |
+
The upstream reference code, encoding and license files are DeepSeek's, copied unchanged.
|