Schestex commited on
Commit
93c6c32
·
verified ·
1 Parent(s): e911232

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +117 -152
README.md CHANGED
@@ -1,214 +1,179 @@
1
  ---
2
- pipeline_tag: text-generation
3
  tags:
4
- - qwen
5
- - ninfer
6
- - quantization
7
- - nvfp4
8
- - blackwell
9
- - text-generation
 
10
  ---
11
 
12
- # ThinkingCap-Qwen3.8-27B — NInfer D48 NVFP4
13
 
14
- Experimental **NInfer** conversion of **ThinkingCap-Qwen3.8-27B**, optimized for NVIDIA Blackwell GPUs with a quality-first mixed-precision strategy.
 
15
 
16
- The current recommended artifact is the **D48 anchor**.
17
 
18
- It starts from NInfer's standard `qwen3_8_27b` recipe and adds model-specific NVFP4 quantization to selected MLP Down projections. The D48 layers were selected from a complete 64-layer single-change sensitivity sweep and then validated cumulatively with full perplexity and runtime benchmarks.
 
 
19
 
20
  ## Artifact
21
 
22
- Place the model file in the repository root with this name:
23
 
24
- ```text
25
- thinkingcap-qwen3.8-27b-d48.ninfer
26
- ```
27
 
28
- | Property | Value |
29
- |---|---:|
30
- | Model | ThinkingCap-Qwen3.8-27B |
31
- | Runtime format | NInfer |
32
- | Variant | D48 |
33
- | Artifact size | 16,705,529,348 bytes |
34
- | Runtime weight capacity | 16,692,422,656 bytes |
35
- | Workspace | 159,981,568 bytes |
36
- | Target GPU | NVIDIA RTX PRO 4000 Blackwell 24 GB |
37
- | Base NInfer recipe | `qwen3_8_27b` |
38
- | Additional optimization | 48 selected MLP Down projections → NVFP4 |
39
 
40
- The corresponding standard NInfer baseline artifact was **17,106,573,056 bytes**. D48 reduces the artifact by **401,043,708 bytes (~382.5 MiB / 2.34%)**.
41
 
42
- Artifact size note: This build is not directly size-comparable to the full upstream Qwen3.8 NInfer/NVFP4 artifacts. It was converted with --components text and currently does not bundle Vision, MTP or DFlash2 companion weights. D48 also retains NInfer's compact groupwise allocation for most tensors and selectively replaces only 48 MLP Down projections with NVFP4. As a result, the optimized artifact is smaller than its own 17.11 GB text-only NInfer baseline.
43
- The smaller size does not imply that this build uses a more aggressive full-model NVFP4 profile. It is a selective mixed-precision configuration optimized around the measured ThinkingCap sensitivity map.
44
 
45
- ## What D48 means
46
 
47
- D48 does **not** mean “layers 0–47”. Every one of the 64 MLP Down projections was tested individually. The 48 most tolerant layers were selected for the cumulative D48 build.
48
 
49
- ### NVFP4 MLP Down layers
50
 
51
- ```text
52
- 0, 1, 4, 5, 6, 7, 9,
53
- 13, 14, 15, 16, 17, 19, 20, 22, 23, 24,
54
- 28, 29, 30, 31,
55
- 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
56
- 53, 54, 55, 56, 58, 59, 60, 61, 62
57
- ```
58
 
59
- ### Protected MLP Down layers
60
 
61
- ```text
62
- 2, 3, 8, 10, 11, 12, 18, 21,
63
- 25, 26, 27, 32,
64
- 51, 52, 57, 63
65
- ```
66
 
67
- These remain at the precision selected by the standard NInfer recipe.
68
 
69
- ## Quantization strategy
 
 
 
70
 
71
- New artifacts are generated directly from the original BF16/FP16 ThinkingCap checkpoint. Existing `.ninfer` files are **not** requantized.
72
 
73
- ```text
74
- ThinkingCap BF16/FP16 Safetensors
75
- │
76
- ▼
77
- NInfer qwen3_8_27b recipe
78
- │
79
- ▼
80
- standard mixed-precision NInfer baseline
81
- │
82
- ▼
83
- selected MLP Down projections → NVFP4
84
- │
85
- ▼
86
- ThinkingCap D48 NInfer
87
- ```
88
 
89
- D48 is still a mixed-precision model. Only the selected MLP Down projections receive the additional NVFP4 override; all other tensors continue to use the formats chosen by the standard NInfer recipe.
90
 
91
- ## Full perplexity validation
92
 
93
- Development corpus configuration:
94
 
95
- ```text
96
- context: 4096
97
- stride: 2048
98
- KV cache: BF16
99
- scored tokens: 782,535
100
- streams: 12
101
- ```
102
 
103
- The corpus contains English long-form text, English reference text, and code. It is a **development/sensitivity corpus**, not an untouched final holdout.
104
 
105
- | Domain | Standard NInfer baseline | D48 |
106
- |---|---:|---:|
107
- | English long-form | 7.918420 | 7.944685 |
108
- | English reference | 6.264029 | 6.219786 |
109
- | Code | 1.651905 | 1.654696 |
110
- | **Overall** | **4.351060** | **4.348019** |
111
 
112
- Overall D48 delta versus the baseline is approximately **−0.070% PPL** on this development corpus.
113
 
114
- The negative aggregate delta must not be interpreted as evidence that quantization improves the underlying model. The individual domains move in different directions; the result is best read as **no measurable aggregate quality loss on this development corpus at the tested resolution**.
115
 
116
- ## Runtime benchmark
117
 
118
- Measured on an **NVIDIA RTX PRO 4000 Blackwell 24 GB** with FP8 KV cache, prefill chunk 1024, 2 warmups and 5 measured repetitions.
119
 
120
- | Test | Throughput |
121
- |---|---:|
122
- | PP512 | 1293.37 tok/s |
123
- | PP2048 | 1333.02 tok/s |
124
- | PP8192 | 1310.12 tok/s |
125
- | TG256 | 32.46 tok/s |
126
- | TG1024 | 32.03 tok/s |
127
- | PP2048 + TG512 — prefill | 1323.95 tok/s |
128
- | PP2048 + TG512 — decode | 31.92 tok/s |
129
- | PP8192 + TG512 — prefill | 1297.68 tok/s |
130
- | PP8192 + TG512 — decode | 31.43 tok/s |
131
 
132
- These values are intended for comparisons within the same NInfer/hardware/software setup. They should not be treated as directly comparable to unrelated runtimes or benchmark methodologies.
133
 
134
- ## Why D48 is the current anchor
135
 
136
- More aggressive cumulative candidates were also tested:
137
 
138
- | Variant | Extra NVFP4 Down layers | Full PPL | Artifact size |
 
 
 
 
139
  |---|---:|---:|---:|
140
- | Standard baseline | 0 | 4.351060 | 17,106,573,056 B |
141
- | **D48** | **48** | **4.348019** | **16,705,529,348 B** |
142
- | D50 | 50 | 4.350115 | 16,688,818,692 B |
143
- | D53 | 53 | 4.355314 | 16,663,752,708 B |
 
 
 
 
 
 
 
 
 
 
 
 
 
144
 
145
- D50 was only about **16 MiB smaller** than D48 and measured roughly **+0.31% mean prefill / −0.12% mean decode** versus D48 in the same benchmark setup. D53 produced a clearer prefill gain, but also a clearer perplexity regression.
 
146
 
147
- For the current **quality-first** target, D48 is therefore the working Down anchor.
148
 
149
- ## Current optimization status
 
150
 
151
- ```text
152
- 1. Standard NInfer conversion
153
- 2. Full 64-layer MLP Down sensitivity sweep
154
- 3. D48 quality-first Down anchor ← this release
155
- 4. ThinkingCap-specific IMatrix
156
- 5. Gate / Up sensitivity analysis
157
- 6. Combined mixed-precision optimization
158
- 7. Final task-level quality validation
159
- 8. MTP and/or DFlash2 integration
160
- ```
161
 
162
- ### Not yet included
 
163
 
164
- This D48 artifact does **not** yet include:
 
165
 
166
- - ThinkingCap-specific IMatrix optimization
167
- - Agentic-workload importance calibration
168
- - dedicated Gate optimization
169
- - dedicated Up optimization
170
- - final Gate/Up + Down joint optimization
171
- - MTP speculative decoding model
172
- - DFlash2 speculative decoding model
173
- - final task-level evaluation suite
174
 
175
- ## Planned IMatrix work
 
 
176
 
177
- A ThinkingCap-specific importance matrix is planned from the original BF16/FP16 weights using an agentic/code-oriented calibration corpus.
178
 
179
- The IMatrix will be used to prioritize Gate/Up candidates, identify important tensors/channels, reduce the search space, and cross-check the existing empirical sensitivity results. It will **not** replace direct single-change and cumulative-group quality measurements.
180
 
181
- ## Reproducibility
 
 
 
 
 
 
 
182
 
183
- Converter checkout base commit:
184
 
185
- ```text
186
- 9e163eee4b8acec21ab0ac765107b6a3f287b217
187
- ```
188
 
189
- The local build also contains experimental changes required for the NVFP4 path, so exact compatibility can depend on the corresponding NInfer runtime implementation.
 
190
 
191
- See `PROVENANCE.md`, `quantization/d48-layers.txt`, and `benchmarks/` for compact experiment metadata.
 
192
 
193
- ## Intended use
194
 
195
- This release is primarily intended for:
 
196
 
197
- - ThinkingCap-Qwen3.8-27B experiments with NInfer
198
- - NVIDIA Blackwell inference
199
- - mixed-precision / NVFP4 research
200
- - quality/performance trade-off analysis
201
- - further model-specific optimization work
202
 
203
- The optimization priority is:
204
 
205
- ```text
206
- 1. Preserve model quality
207
- 2. Improve real inference throughput
208
- 3. Reduce persistent model/VRAM footprint
209
- 4. Keep experiments reproducible
210
- ```
211
 
212
- ## License and upstream terms
213
 
214
- This repository does not redefine the licenses of the upstream ThinkingCap model, its base model, NInfer, or NVIDIA components. Users should review and comply with the applicable upstream licenses and terms before redistribution or use.
 
 
 
 
 
 
 
1
  ---
2
+ library_name: ninfer
3
  tags:
4
+ - ninfer
5
+ - qwen
6
+ - quantized
7
+ - nvfp4
8
+ - blackwell
9
+ - preview
10
+ license: other
11
  ---
12
 
13
+ # ThinkingCap Qwen3.8 27B — NInfer D48+O44 Preview
14
 
15
+ This repository contains a **preview NInfer quantization candidate** for
16
+ ThinkingCap-Qwen3.8-27B.
17
 
18
+ It is not yet the final quantization release.
19
 
20
+ The cumulative D48+O44 performance candidate has passed conversion and
21
+ target validation. A cumulative Full-PPL evaluation is still pending at
22
+ the time of this preview release.
23
 
24
  ## Artifact
25
 
26
+ `thinkingcap-d48-o44-preview.ninfer`
27
 
28
+ SHA256:
 
 
29
 
30
+ `db5f12b03ddc48d1776179c8564144325d967f4e5d5d36deb34e9bd70d1b5e17`
 
 
 
 
 
 
 
 
 
 
31
 
32
+ Artifact size:
33
 
34
+ `16,575,798,788 bytes`
 
35
 
36
+ Baseline artifact size:
37
 
38
+ `17,106,573,056 bytes`
39
 
40
+ Reduction versus baseline:
41
 
42
+ `530,774,268 bytes` (~506.2 MiB, ~3.10%)
 
 
 
 
 
 
43
 
44
+ ## Quantization layout
45
 
46
+ The candidate was converted directly from the original BF16/FP16 source.
47
+ It was not requantized from another `.ninfer` artifact.
 
 
 
48
 
49
+ It combines:
50
 
51
+ - **D48**: 48 selected MLP Down projections converted to NVFP4.
52
+ - **O44**: 44 selected output projections converted to NVFP4.
53
+ - 35 GDN output projections
54
+ - 9 Attention output projections
55
 
56
+ Total validated NVFP4 conversion jobs:
57
 
58
+ **92**
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59
 
60
+ ### D48 MLP Down layers
61
 
62
+ `0,1,4,5,6,7,9,13,14,15,16,17,19,20,22,23,24,28,29,30,31,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,53,54,55,56,58,59,60,61,62`
63
 
64
+ ### O44 GDN Output layers
65
 
66
+ `0,5,9,12,13,14,16,17,18,20,22,28,32,33,34,36,37,40,41,42,44,45,46,48,49,50,52,53,54,56,57,58,60,61,62`
 
 
 
 
 
 
67
 
68
+ ### O44 Attention Output layers
69
 
70
+ `11,19,27,31,39,51,55,59,63`
 
 
 
 
 
71
 
72
+ ## Size impact
73
 
74
+ D48 artifact:
75
 
76
+ `16,705,529,348 bytes`
77
 
78
+ D48+O44 artifact:
79
 
80
+ `16,575,798,788 bytes`
 
 
 
 
 
 
 
 
 
 
81
 
82
+ O44 therefore removes another:
83
 
84
+ `129,730,560 bytes` (~123.7 MiB)
85
 
86
+ from the D48 candidate.
87
 
88
+ ## Performance
89
+
90
+ The meaningful comparison below uses the same physical GPU0.
91
+
92
+ | Test | D48 | D48+O44 | Change |
93
  |---|---:|---:|---:|
94
+ | pp512 prefill | 774.13 tok/s | 840.81 tok/s | +8.61% |
95
+ | pp2048 prefill | 782.36 tok/s | 850.04 tok/s | +8.65% |
96
+ | pp8192 prefill | 746.28 tok/s | 790.06 tok/s | +5.87% |
97
+ | tg256 decode | 18.74 tok/s | 19.06 tok/s | +1.68% |
98
+ | tg1024 decode | 18.28 tok/s | 18.72 tok/s | +2.44% |
99
+ | pp2048+tg512 prefill | 735.53 tok/s | 765.80 tok/s | +4.11% |
100
+ | pp2048+tg512 decode | 18.53 tok/s | 18.70 tok/s | +0.94% |
101
+ | pp8192+tg512 prefill | 723.44 tok/s | 754.14 tok/s | +4.24% |
102
+ | pp8192+tg512 decode | 18.31 tok/s | 18.52 tok/s | +1.16% |
103
+
104
+ The D48 control used 2 warmups and 3 measured repetitions.
105
+ The D48+O44 run used 2 warmups and 5 measured repetitions.
106
+
107
+ The result is therefore suitable as a performance screening measurement,
108
+ not as the final release benchmark.
109
+
110
+ Approximate mean change over the measured cases:
111
 
112
+ - Prefill: **+6.3%**
113
+ - Decode: **+1.6%**
114
 
115
+ ## Quality status
116
 
117
+ The individual sensitivity sweeps used a 782,535-token English/code
118
+ development corpus with:
119
 
120
+ - context: 4096
121
+ - stride: 2048
122
+ - KV cache: BF16
 
 
 
 
 
 
 
123
 
124
+ D48 previously showed no measurable degradation on this development
125
+ corpus.
126
 
127
+ The individual O44 projections were selected from the completed Output64
128
+ sensitivity map using the `ΔNLL <= 0.0002` boundary.
129
 
130
+ **Important:** individual layer deltas are not assumed to add linearly.
 
 
 
 
 
 
 
131
 
132
+ The cumulative D48+O44 Full-PPL measurement is still pending for this
133
+ preview. This artifact should therefore be treated as an experimental
134
+ performance candidate rather than the final quality-validated release.
135
 
136
+ ## Runtime benchmark configuration
137
 
138
+ The throughput benchmark uses the public NInfer `ninfer_bench` route with:
139
 
140
+ - KV cache: FP8 E4M3 row256
141
+ - maximum context: 16384
142
+ - prefill chunk: 1024
143
+ - prefill tests: 512, 2048, 8192 tokens
144
+ - decode tests: 256, 1024 tokens
145
+ - combined tests:
146
+ - 2048 prompt + 512 generation
147
+ - 8192 prompt + 512 generation
148
 
149
+ Raw JSON benchmark reports are included in `benchmarks/`.
150
 
151
+ ## Tokenizer and chat resources
 
 
152
 
153
+ Tokenizer and chat-template resources are copied from the original
154
+ ThinkingCap-Qwen3.8-27B source directory.
155
 
156
+ They are provided for use with the NInfer artifact and do not imply that
157
+ this repository contains Hugging Face Transformers weights.
158
 
159
+ ## Provenance
160
 
161
+ The conversion was performed from the original BF16/FP16 source using a
162
+ local NInfer development checkout.
163
 
164
+ The conversion metadata, artifact checksum and available build provenance
165
+ are included with this preview.
 
 
 
166
 
167
+ ## Status
168
 
169
+ **Preview / experimental**
 
 
 
 
 
170
 
171
+ Planned before the final release:
172
 
173
+ 1. cumulative D48+O44 Full-PPL
174
+ 2. completed Input64 sensitivity analysis
175
+ 3. cumulative Down + Output + Input candidate
176
+ 4. Full-PPL validation
177
+ 5. final Prefill/Decode benchmark
178
+ 6. frozen final quantization anchor
179
+ 7. MTP work after the final quantization anchor