demon-zombie commited on
Commit
5e50c1e
·
verified ·
1 Parent(s): 0a4f976

Add model card (all-FP4 max-speed variant; quality note; serve + lm_head patch)

Browse files
Files changed (1) hide show
  1. README.md +130 -0
README.md ADDED
@@ -0,0 +1,130 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ base_model: Qwen/Qwen3.5-122B-A10B
4
+ pipeline_tag: image-text-to-text
5
+ tags:
6
+ - nvfp4
7
+ - compressed-tensors
8
+ - quantized
9
+ - vllm
10
+ - dgx-spark
11
+ - gb10
12
+ - moe
13
+ ---
14
+
15
+ # Qwen3.5-122B-A10B-NVFP4-Full-GB10
16
+
17
+ All-NVFP4 (W4A4) quantization of [Qwen/Qwen3.5-122B-A10B](https://huggingface.co/Qwen/Qwen3.5-122B-A10B)
18
+ — the maximum-decode-speed variant for NVIDIA DGX Spark (GB10, SM121). Every Linear layer is
19
+ 4-bit, **including the lm_head**. Vision encoder preserved (BF16) and verified working.
20
+
21
+ This is the most aggressively quantized checkpoint of this model: at GB10's memory bandwidth
22
+ it decodes ~33–35 tok/s single-stream, ~45% faster than the mixed-precision
23
+ [FP8Dense](https://huggingface.co/demon-zombie/Qwen3.5-122B-A10B-NVFP4-FP8Dense-GB10)
24
+ sibling (~23–24 tok/s).
25
+
26
+ ## Quality note
27
+
28
+ The all-FP4 profile carries a **subtle quality degradation** relative to the FP8Dense
29
+ sibling: the dense path (attention + GDN) runs 4-bit *activations*, and the lm_head's 4-bit
30
+ weights flatten the output distribution slightly. It does not show up on simple extraction
31
+ benchmarks (both variants ace detail tests), but in extended real-world use comprehension
32
+ and nuance are noticeably better on FP8Dense. Pick by priority:
33
+
34
+ - **Maximum tok/s** → this checkpoint
35
+ - **Best quality at ~2/3 the speed** → [FP8Dense](https://huggingface.co/demon-zombie/Qwen3.5-122B-A10B-NVFP4-FP8Dense-GB10)
36
+
37
+ ## Layout
38
+
39
+ | | This model | [FP8Dense](https://huggingface.co/demon-zombie/Qwen3.5-122B-A10B-NVFP4-FP8Dense-GB10) | [scottgl](https://huggingface.co/scottgl/Qwen3.5-122B-A10B-NVFP4-GB10) |
40
+ |---|---|---|---|
41
+ | MoE experts (256/layer) | NVFP4 | NVFP4 | NVFP4 |
42
+ | Standard attention | NVFP4 | FP8 W8A8 | BF16 |
43
+ | GDN projections | NVFP4 | FP8 W8A8 | BF16 stored, FP4/FP8 at SGLang runtime |
44
+ | lm_head | **NVFP4** | BF16 | BF16 stored, FP8 at SGLang runtime |
45
+ | Vision | BF16 (preserved) | BF16 (preserved) | — |
46
+ | Serves on | vLLM (lm_head patch, below) | stock vLLM | custom SGLang fork |
47
+ | Checkpoint | 66 GB | 74 GB | — |
48
+ | Decode, GB10 single-stream | **33–35 tok/s** | 23–24 tok/s | ~46 (SGLang + NEXTN spec-dec) |
49
+
50
+ Excluded from quantization (BF16): router gates (`mlp.gate`, `shared_expert_gate`),
51
+ embeddings, vision encoder + merger, norms. No MTP weights in this checkpoint (the config's
52
+ MTP declaration has no corresponding tensors — speculative decoding is not available).
53
+
54
+ ## Quantization details
55
+
56
+ - **Method:** [llm-compressor](https://github.com/vllm-project/llm-compressor) `oneshot()`,
57
+ NVFP4 scheme (W4A4, group 16, FP8-E4M3 scales)
58
+ - **Calibration:** 512 samples, `HuggingFaceH4/ultrachat_200k`, seq_len 2048
59
+ - **Quantized from the full multimodal model** (`AutoModelForImageTextToText`) so the vision
60
+ tower survives — earlier text-only exports of this model lost it
61
+
62
+ ## Benchmarks (DGX Spark GB10, vLLM 0.19.2 from-source SM121 build)
63
+
64
+ Sequential decode, gen=500:
65
+
66
+ | Context | TTFT | Decode tok/s |
67
+ |---|---|---|
68
+ | warmup | 0.84s | 35.2 |
69
+ | 9K | 3.22s | 34.6 |
70
+ | 18K | 3.72s | 33.8 |
71
+ | 27K | 3.69s | 32.9 |
72
+
73
+ Concurrent @ 32K context, gen=500:
74
+
75
+ | Concurrency | Aggregate tok/s | Per-request tok/s |
76
+ |---|---|---|
77
+ | 8× | 78.2 | 12.0 |
78
+ | 16× | 110.6 | 8.0 |
79
+ | 32× | 138.2 | 5.2 |
80
+ | 64× | 166.5 | 3.3 |
81
+ | 128× | 182.8 | 2.8 |
82
+
83
+ KV cache: 5.94× the full 262K context at `--gpu-memory-utilization 0.90` (bf16 KV; page
84
+ size 2,096 tokens, aligned to the GDN/Mamba state size).
85
+
86
+ ## Serving (vLLM)
87
+
88
+ vLLM's stock `ParallelLMHead` cannot load NVFP4-packed lm_head weights (it inherits
89
+ `VocabParallelEmbedding`'s loader). The one-file patch in
90
+ [`vllm-patches/patch_nvfp4_lm_head.py`](./tree/main/vllm-patches) swaps the lm_head to
91
+ `ReplicatedLinear`, which routes through the standard quantized-linear loading path:
92
+
93
+ ```bash
94
+ docker run -d --name vllm --gpus all -p 8000:8000 --ipc host \
95
+ -v /opt/vllm-cache:/root/.cache/huggingface \
96
+ -e CUBLASLT_WORKSPACE_SIZE=33554432 \
97
+ -e PYTORCH_CUDA_ALLOC_CONF=expandable_segments:False \
98
+ vllm/vllm-openai:latest \
99
+ --model demon-zombie/Qwen3.5-122B-A10B-NVFP4-Full-GB10 \
100
+ --served-model-name Qwen3.5-122B-A10B \
101
+ --gpu-memory-utilization 0.90 \
102
+ --enable-prefix-caching \
103
+ --enable-chunked-prefill \
104
+ --enable-auto-tool-choice \
105
+ --tool-call-parser qwen3_coder \
106
+ --reasoning-parser qwen3
107
+
108
+ # apply the lm_head patch, then restart
109
+ docker cp patch_nvfp4_lm_head.py vllm:/tmp/
110
+ docker exec vllm python3 /tmp/patch_nvfp4_lm_head.py
111
+ docker restart vllm
112
+ ```
113
+
114
+ Verified configuration: DGX Spark GB10, from-source vLLM 0.19.2 (SM121, TORCH_CUDA_ARCH_LIST
115
+ 12.1) with the patch applied — all benchmark numbers above are from that build. Newer stock
116
+ images have not been re-verified with this checkpoint's NVFP4 lm_head; if loading fails
117
+ around `lm_head`/`ParallelLMHead`, apply the included patch.
118
+
119
+ ## Architecture
120
+
121
+ Qwen3.5-122B-A10B is a hybrid-attention MoE model: 48 layers (36 GDN/Gated-DeltaNet linear
122
+ attention + 12 full attention, interval 4), 256 routed experts + 1 shared expert per layer
123
+ (8 active), 3,072 hidden, 248,320 vocab, 262K context, plus a ViT vision encoder.
124
+
125
+ ## Credits
126
+
127
+ - Base model: [Qwen/Qwen3.5-122B-A10B](https://huggingface.co/Qwen/Qwen3.5-122B-A10B)
128
+ - Quantized with [llm-compressor](https://github.com/vllm-project/llm-compressor)
129
+ - Sibling checkpoint: [FP8Dense](https://huggingface.co/demon-zombie/Qwen3.5-122B-A10B-NVFP4-FP8Dense-GB10)
130
+ (mixed precision, recommended for quality)