skx618 commited on
Commit
d0755f9
·
verified ·
1 Parent(s): 85ef153

Update primary checkpoint to DSpark v2

Browse files

Replace the v1 serving weights and configuration with the validated v2 Stage 2 step-5500 export from 3bd001d1a32539bd0afeeb07165c393c6adce29b. Update the model card with the v1/v2 acceptance-length and throughput results.

Files changed (3) hide show
  1. README.md +137 -33
  2. config.json +50 -11
  3. model.safetensors +2 -2
README.md CHANGED
@@ -2,68 +2,172 @@
2
  license: other
3
  library_name: transformers
4
  pipeline_tag: text-generation
 
5
  tags:
6
  - speculative-decoding
7
  - dspark
8
- - dflash
9
  - specforge
10
  - sglang
 
11
  inference: false
12
  ---
13
 
14
  # Qwen3.8-27B-DSpark
15
 
16
- A DSpark speculator for [Qwen/Qwen3.8-27B-FP8](https://huggingface.co/Qwen/Qwen3.8-27B-FP8). DSpark extends [DFlash](https://github.com/z-lab/dflash) with target-model auxiliary features and a confidence head that dynamically chooses the number of draft tokens. The model was trained with [SpecForge](https://github.com/sgl-project/SpecForge) and is served with [SGLang](https://github.com/sgl-project/sglang).
17
 
18
- ## Model specifications
19
 
20
- - Target model: [Qwen/Qwen3.8-27B-FP8](https://huggingface.co/Qwen/Qwen3.8-27B-FP8)
21
- - Checkpoint: `epoch_2_step_4166`
22
- - Draft parameters: 1,359,284,737 (1.36B)
 
23
  - Draft weight dtype: BF16
24
  - Hidden size: 5,120
25
- - Transformer layers: 5 full-attention layers
26
- - Attention: GQA with 40 query heads and 8 key/value heads
27
- - Target auxiliary feature layers: 4, 16, 28, 40, 52
28
- - Confidence head: vanilla Markov head, rank 256
29
- - DSpark block size: 7 draft tokens (verify width 8, including the target bonus token)
 
 
30
  - Maximum position embeddings: 262,144
 
 
 
 
 
 
31
 
32
  ## Acceptance length
33
 
34
- Acceptance length is the mean number of tokens accepted per speculative verification step, including the target bonus token. Each workload value below is the unweighted mean of SGLang's per-request `spec_accept_length` values.
 
 
 
 
35
 
36
- Setting: FP8 target and unquantized BF16 draft; DSpark block size 7; sampling temperature 0.6, top-k 20, top-p 0.95; thinking enabled; `max_new_tokens=2048`; seed 0; up to 128 prompts per workload, or the full set when smaller. The prompt construction and measurement loop follow `z-lab/dflash`'s SGLang benchmark path.
37
 
38
- | Workload | Acceptance length |
39
- |---|---:|
40
- | HumanEval | 3.47 |
41
- | GSM8K | 4.57 |
42
- | MATH-500 | 4.08 |
43
- | LiveCodeBench | 2.94 |
44
- | MBPP | 3.67 |
45
- | AIME 2025 | 3.28 |
46
- | LBPP | 3.03 |
47
- | AIME 2026 | 3.07 |
48
- | MT-Bench | 3.10 |
49
- | Arena-Hard-v2 | 2.71 |
50
- | Alpaca | 2.95 |
 
 
 
 
 
 
51
 
52
- The evaluation contains 1,164 requests. The mean across all requests is **3.39**, and the macro mean across the 11 workload means is **3.35**. Every response contained acceptance statistics, and recomputing `completion_tokens / spec_verify_ct` matched `spec_accept_length` exactly.
 
 
 
53
 
54
- ## Serving with SGLang
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
 
56
- Use an SGLang version containing DSPARK support (the results above used the pinned main-branch commit shown in the evaluation setting):
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
 
58
  ```bash
 
 
59
  sglang serve \
60
  --trust-remote-code \
61
  --model-path Qwen/Qwen3.8-27B-FP8 \
62
- --tp-size 1 \
 
 
 
 
 
 
 
 
 
 
63
  --speculative-algorithm DSPARK \
64
  --speculative-draft-model-path RadixArk/Qwen3.8-27B-DSpark \
65
- --speculative-dspark-block-size 7 \
66
  --speculative-draft-model-quantization unquant \
67
- --mamba-scheduler-strategy extra_buffer \
68
- --attention-backend fa3
 
 
 
 
69
  ```
 
 
 
 
 
 
 
 
 
2
  license: other
3
  library_name: transformers
4
  pipeline_tag: text-generation
5
+ base_model: RadixArk/Qwen3.8-27B-NVFP4
6
  tags:
7
  - speculative-decoding
8
  - dspark
 
9
  - specforge
10
  - sglang
11
+ - qwen3.8
12
  inference: false
13
  ---
14
 
15
  # Qwen3.8-27B-DSpark
16
 
17
+ A DSpark speculative-decoding draft model for Qwen3.8-27B target models, trained with [SpecForge](https://github.com/sgl-project/SpecForge) and served with [SGLang](https://github.com/sgl-project/sglang). This repository contains the v2 Stage 2 checkpoint and replaces the earlier v1 checkpoint.
18
 
19
+ The checkpoint has been evaluated with both [RadixArk/Qwen3.8-27B-NVFP4](https://huggingface.co/RadixArk/Qwen3.8-27B-NVFP4) and [Qwen/Qwen3.8-27B-FP8](https://huggingface.co/Qwen/Qwen3.8-27B-FP8) targets. The acceptance-length evaluation below uses the NVFP4 target. The throughput evaluation uses the FP8 target.
20
 
21
+ ## Checkpoint
22
+
23
+ - Version: DSpark v2, Stage 2 optimizer step 5,500
24
+ - Draft parameters: 1,857,358,337 (1.86B)
25
  - Draft weight dtype: BF16
26
  - Hidden size: 5,120
27
+ - Transformer layers: five full-attention layers
28
+ - Attention: GQA with 32 query heads and eight key/value heads
29
+ - Target auxiliary feature layers: 5, 19, 33, 47, 61
30
+ - Markov head: VanillaMarkov, rank 256
31
+ - Training target width: 16 future positions
32
+ - Serving gamma: seven draft proposals
33
+ - Target verification width: eight tokens, including the target bonus token
34
  - Maximum position embeddings: 262,144
35
+ - Positional configuration: YaRN factor 32 with original context 8,192
36
+ - Training corpus: `RadixArk/Qwen3.8-27B-Regen-Mixture-v1@59c7cd36512cf9e8450158fb949295e16d8d0661`
37
+ - v2 source revision: `RadixArk/Qwen3.8-27B-DSpark-v2@3bd001d1a32539bd0afeeb07165c393c6adce29b`
38
+ - Replaced v1 revision: `RadixArk/Qwen3.8-27B-DSpark@85ef153be924f17ce4bf62726954eeaa4a73e854`
39
+
40
+ The serving configuration uses `block_size=7`. The separate `training_block_size=16` records the supervision width used during training.
41
 
42
  ## Acceptance length
43
 
44
+ The primary value follows the Z-lab proposal-weighted definition within each workload:
45
+
46
+ ```text
47
+ proposal_weighted_accept_length = sum(completion_tokens) / sum(spec_verify_ct)
48
+ ```
49
 
50
+ The request-mean value first computes `completion_tokens / spec_verify_ct` for every request, then averages requests equally. Both metrics include the target bonus token in each speculative verification step.
51
 
52
+ | Category | Workload | Prompts | v1 proposal-weighted | v2 proposal-weighted | v1 request-mean | v2 request-mean |
53
+ |---|---|---:|---:|---:|---:|---:|
54
+ | Code | HumanEval | 164 | 3.0437 | **3.8468** | 3.2586 | **4.1300** |
55
+ | Code | MBPP | 257 | 3.2299 | **4.0603** | 3.4998 | **4.4809** |
56
+ | Code | LiveCodeBench | 1,055 | 2.5915 | **3.3462** | 2.8404 | **3.7141** |
57
+ | Code | BigCodeBench | 1,140 | 2.7752 | **3.4678** | 2.8139 | **3.5285** |
58
+ | Math | GSM8K | 1,319 | 3.6030 | **4.5162** | 4.3379 | **5.4168** |
59
+ | Math | MATH-500 | 500 | 3.2559 | **4.2267** | 3.8614 | **5.0496** |
60
+ | Math | AIME 2025 | 30 | 2.9798 | **3.9401** | 3.1612 | **4.2022** |
61
+ | Math | AMC23 | 40 | 3.2111 | **4.1572** | 3.6132 | **4.6945** |
62
+ | Math | GSM-Symbolic | 2,048 | 3.4554 | **4.2716** | 4.1915 | **5.2818** |
63
+ | Chat | MT-Bench | 80 | 2.6075 | **3.2860** | 2.9839 | **3.7579** |
64
+ | Chat | Alpaca | 52,002 | 2.5659 | **3.2337** | 2.8673 | **3.6994** |
65
+ | Chat | Arena-Hard-v2 | 750 | 2.5910 | **3.2536** | 2.7114 | **3.4283** |
66
+ | Chat | IFEval | 541 | 2.9457 | **3.6628** | 2.9392 | **3.6253** |
67
+ | Misc. | MMLU-Pro | 2,048 | 2.8345 | **3.5964** | 3.1140 | **4.0299** |
68
+ | Misc. | GPQA-Diamond | 198 | 2.7634 | **3.5109** | 2.8615 | **3.6709** |
69
+ | Misc. | LongBench-v2 | 503 | 3.2602 | **3.9268** | 3.4132 | **4.0937** |
70
+ | Misc. | RULER-8K | 2,000 | 4.9585 | **6.3009** | 4.5204 | **5.5028** |
71
 
72
+ | Aggregate | v1 proposal-weighted | v2 proposal-weighted | Change | v1 request-mean | v2 request-mean | Change |
73
+ |---|---:|---:|---:|---:|---:|---:|
74
+ | Request-count weighted, 64,675 prompts | 2.721143 | **3.428567** | **+26.00%** | 3.011715 | **3.862789** | **+28.26%** |
75
+ | Workload macro, 17 workloads | 3.098368 | **3.917881** | **+26.45%** | 3.352293 | **4.253331** | **+26.88%** |
76
 
77
+ Acceptance-length protocol:
78
+
79
+ - Target: `RadixArk/Qwen3.8-27B-NVFP4@554ebba9b5f1b79dc11246341960360e6ef05ef4`
80
+ - v1 draft: `RadixArk/Qwen3.8-27B-DSpark@85ef153be924f17ce4bf62726954eeaa4a73e854`
81
+ - v2 draft: `RadixArk/Qwen3.8-27B-DSpark-v2@3bd001d1a32539bd0afeeb07165c393c6adce29b`
82
+ - Runtime: SGLang v0.5.17 at `eec794bce0808ae26cc1dcb84a56b65d2df82af5`
83
+ - Hardware and topology: four NVIDIA GB300 GPUs, DP4 × TP1
84
+ - Sampling: thinking enabled, temperature 1.0, top-p 0.95, top-k 20, seed 980406
85
+ - Generation limit: 8,192 tokens; client concurrency: 128
86
+ - DeepSpec context length: 32,768; extended-suite context length: 262,144
87
+ - Prompt coverage: all source prompts for nine DeepSpec workloads; at most 2,048 prompts for each extended workload; 64,675 completed requests with no request errors per candidate
88
+
89
+ The request-count-weighted aggregate weights each workload value by its prompt count. The workload macro gives each workload equal weight. Alpaca contributes 52,002 of the 64,675 prompts, so the two aggregates answer different weighting questions.
90
+
91
+ ## Throughput
92
+
93
+ Throughput is total output tokens divided by end-to-end timed wall duration. Each DSpark cell is `output tok/s (speedup over autoregressive)`.
94
+
95
+ ### Concurrency 1
96
+
97
+ | Workload | Autoregressive | DSpark v1 | DSpark v2 |
98
+ |---|---:|---:|---:|
99
+ | GSM8K | 94.2 | 238.6 (2.53×) | **297.3 (3.16×)** |
100
+ | MATH-500 | 95.0 | 214.4 (2.26×) | **280.0 (2.95×)** |
101
+ | HumanEval | 95.8 | 205.5 (2.14×) | **254.8 (2.66×)** |
102
+ | MBPP | 93.8 | 208.6 (2.22×) | **261.6 (2.79×)** |
103
+ | MT-Bench | 95.8 | 171.3 (1.79×) | **215.8 (2.25×)** |
104
+
105
+ ### Concurrency 8
106
 
107
+ | Workload | Autoregressive | DSpark v1 | DSpark v2 |
108
+ |---|---:|---:|---:|
109
+ | GSM8K | 602.7 | 1,183.8 (1.96×) | **1,494.0 (2.48×)** |
110
+ | MATH-500 | 635.2 | 1,208.2 (1.90×) | **1,575.1 (2.48×)** |
111
+ | HumanEval | 667.9 | 1,159.2 (1.74×) | **1,435.1 (2.15×)** |
112
+ | MBPP | 635.4 | 1,123.7 (1.77×) | **1,393.7 (2.19×)** |
113
+ | MT-Bench | 647.9 | 958.4 (1.48×) | **1,195.5 (1.85×)** |
114
+
115
+ ### Concurrency 32
116
+
117
+ | Workload | Autoregressive | DSpark v1 | DSpark v2 |
118
+ |---|---:|---:|---:|
119
+ | GSM8K | 1,298.5 | 1,934.2 (1.49×) | **2,268.5 (1.75×)** |
120
+ | MATH-500 | 1,764.2 | 2,014.2 (1.14×) | **2,545.2 (1.44×)** |
121
+ | HumanEval | 1,862.2 | 1,918.5 (1.03×) | **2,472.3 (1.33×)** |
122
+ | MBPP | 1,738.4 | 1,926.3 (1.11×) | **2,413.1 (1.39×)** |
123
+ | MT-Bench | 1,814.2 | 1,593.3 (0.88×) | **1,973.0 (1.09×)** |
124
+
125
+ Throughput protocol:
126
+
127
+ - Target: `Qwen/Qwen3.8-27B-FP8@017b9c7af6b5689d5dd426a76e0bc077eb5ca20a`
128
+ - v1 and v2 revisions match the acceptance-length protocol above
129
+ - Hardware and topology: one NVIDIA H200 per workload, TP1 × DP1
130
+ - 128 prompts per cell, dataset shuffle seed 42, concurrency 1/8/32, `max_tokens=2048`, reasoning effort `xhigh`, temperature 1.0, top-p 0.95, top-k 20
131
+ - Runtime: SGLang v0.5.17 based on `29481685462732237d80d86076d6563e1f658102`; FlashInfer target and draft attention; FP8 E4M3 KV cache; 32,768-token chunked and maximum prefill
132
+ - DSpark serving: gamma 7, target verify width 8, one speculative step, block size 7, Mamba full-memory ratio 11.93, `extra_buffer` radix-cache strategy, float32 Mamba state
133
+ - Autoregressive serving used `mem-fraction-static=0.85`. DSpark used 0.80 with expandable CUDA allocation segments while retaining every prefill and verification CUDA graph.
134
+
135
+ The request protocol follows [`z-lab/dflash/dflash/benchmark.py`](https://github.com/z-lab/dflash/blob/07ebd93db9f472af339b644bb70221ad8428328a/dflash/benchmark.py). Model initialization, CUDA graph capture, and warmup are excluded from timed wall duration. Sampling is intentionally not request-seeded, matching the source benchmark, so completion-token totals can differ between v1 and v2.
136
+
137
+ ## Serving with SGLang
138
 
139
  ```bash
140
+ PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True \
141
+ SGLANG_RAGGED_VERIFY_MODE=static \
142
  sglang serve \
143
  --trust-remote-code \
144
  --model-path Qwen/Qwen3.8-27B-FP8 \
145
+ --kv-cache-dtype fp8_e4m3 \
146
+ --mem-fraction-static 0.80 \
147
+ --attention-backend flashinfer \
148
+ --chunked-prefill-size 32768 \
149
+ --max-prefill-tokens 32768 \
150
+ --reasoning-parser qwen3 \
151
+ --tool-call-parser qwen3_coder \
152
+ --mamba-full-memory-ratio 11.93 \
153
+ --mamba-radix-cache-strategy extra_buffer \
154
+ --mamba-ssm-dtype float32 \
155
+ --max-running-requests 48 \
156
  --speculative-algorithm DSPARK \
157
  --speculative-draft-model-path RadixArk/Qwen3.8-27B-DSpark \
 
158
  --speculative-draft-model-quantization unquant \
159
+ --speculative-draft-attention-backend flashinfer \
160
+ --speculative-dspark-block-size 7 \
161
+ --speculative-num-steps 1 \
162
+ --speculative-eagle-topk 1 \
163
+ --host 127.0.0.1 \
164
+ --port 30000
165
  ```
166
+
167
+ ## Artifact identity
168
+
169
+ | File | Bytes | SHA-256 |
170
+ |---|---:|---|
171
+ | `model.safetensors` | 3,714,723,322 | `2aff025f45823b40ebe726b9dfa40302f3512bd9a11c3a7347de32a567acd9a7` |
172
+ | `config.json` | 2,448 | `dd65fb1b01c2adea69512ff2990a79d58eb7fe2c7ea97375aa66f657a29a5bfd` |
173
+
config.json CHANGED
@@ -4,11 +4,13 @@
4
  ],
5
  "attention_bias": false,
6
  "attention_dropout": 0.0,
 
7
  "auto_map": {
8
  "AutoModel": "dspark.DSparkDraftModel"
9
  },
10
  "block_size": 7,
11
- "bos_token_id": 248044,
 
12
  "confidence_head_with_markov": true,
13
  "dflash_config": {
14
  "attention_mode": "gqa",
@@ -17,24 +19,42 @@
17
  "enable_confidence_head": true,
18
  "markov_head_type": "vanilla",
19
  "markov_rank": 256,
20
- "mask_token_id": 248077,
21
  "projector_type": "dspark",
22
  "target_layer_ids": [
23
- 4,
24
- 16,
25
- 28,
26
- 40,
27
- 52
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  ]
29
  },
30
  "dtype": "bfloat16",
31
  "enable_confidence_head": true,
32
- "eos_token_id": 248046,
33
  "head_dim": 128,
34
  "hidden_act": "silu",
35
  "hidden_size": 5120,
36
  "initializer_range": 0.02,
37
- "intermediate_size": 10240,
38
  "layer_types": [
39
  "full_attention",
40
  "full_attention",
@@ -44,14 +64,16 @@
44
  ],
45
  "markov_head_type": "vanilla",
46
  "markov_rank": 256,
 
47
  "max_position_embeddings": 262144,
48
  "max_window_layers": 5,
49
  "model_type": "qwen3",
50
- "num_attention_heads": 40,
51
  "num_hidden_layers": 5,
52
  "num_key_value_heads": 8,
53
  "num_target_layers": 64,
54
  "pad_token_id": 248044,
 
55
  "rms_norm_eps": 1e-06,
56
  "rope_parameters": {
57
  "beta_fast": 32.0,
@@ -61,9 +83,26 @@
61
  "rope_theta": 10000000,
62
  "rope_type": "yarn"
63
  },
 
 
 
 
 
 
 
 
64
  "sliding_window": null,
 
 
 
 
 
 
 
 
65
  "tie_word_embeddings": false,
66
- "transformers_version": "5.12.1",
 
67
  "use_cache": true,
68
  "use_sliding_window": false,
69
  "vocab_size": 248320
 
4
  ],
5
  "attention_bias": false,
6
  "attention_dropout": 0.0,
7
+ "attention_mode": "gqa",
8
  "auto_map": {
9
  "AutoModel": "dspark.DSparkDraftModel"
10
  },
11
  "block_size": 7,
12
+ "bos_token_id": null,
13
+ "confidence_head_alpha": 1.0,
14
  "confidence_head_with_markov": true,
15
  "dflash_config": {
16
  "attention_mode": "gqa",
 
19
  "enable_confidence_head": true,
20
  "markov_head_type": "vanilla",
21
  "markov_rank": 256,
22
+ "mask_token_id": 248070,
23
  "projector_type": "dspark",
24
  "target_layer_ids": [
25
+ 5,
26
+ 19,
27
+ 33,
28
+ 47,
29
+ 61
30
+ ]
31
+ },
32
+ "draft_vocab_size": 248320,
33
+ "dspark_config": {
34
+ "attention_mode": "gqa",
35
+ "confidence_head_alpha": 1.0,
36
+ "confidence_head_with_markov": true,
37
+ "enable_confidence_head": true,
38
+ "markov_head_type": "vanilla",
39
+ "markov_rank": 256,
40
+ "mask_token_id": 248070,
41
+ "projector_type": "dspark",
42
+ "target_layer_ids": [
43
+ 5,
44
+ 19,
45
+ 33,
46
+ 47,
47
+ 61
48
  ]
49
  },
50
  "dtype": "bfloat16",
51
  "enable_confidence_head": true,
52
+ "eos_token_id": 248044,
53
  "head_dim": 128,
54
  "hidden_act": "silu",
55
  "hidden_size": 5120,
56
  "initializer_range": 0.02,
57
+ "intermediate_size": 17408,
58
  "layer_types": [
59
  "full_attention",
60
  "full_attention",
 
64
  ],
65
  "markov_head_type": "vanilla",
66
  "markov_rank": 256,
67
+ "mask_token_id": 248070,
68
  "max_position_embeddings": 262144,
69
  "max_window_layers": 5,
70
  "model_type": "qwen3",
71
+ "num_attention_heads": 32,
72
  "num_hidden_layers": 5,
73
  "num_key_value_heads": 8,
74
  "num_target_layers": 64,
75
  "pad_token_id": 248044,
76
+ "projector_type": "dspark",
77
  "rms_norm_eps": 1e-06,
78
  "rope_parameters": {
79
  "beta_fast": 32.0,
 
83
  "rope_theta": 10000000,
84
  "rope_type": "yarn"
85
  },
86
+ "rope_scaling": {
87
+ "beta_fast": 32.0,
88
+ "beta_slow": 1.0,
89
+ "factor": 32.0,
90
+ "original_max_position_embeddings": 8192,
91
+ "rope_type": "yarn"
92
+ },
93
+ "rope_theta": 10000000,
94
  "sliding_window": null,
95
+ "target_hidden_size": null,
96
+ "target_layer_ids": [
97
+ 5,
98
+ 19,
99
+ 33,
100
+ 47,
101
+ 61
102
+ ],
103
  "tie_word_embeddings": false,
104
+ "training_block_size": 16,
105
+ "transformers_version": "5.8.1",
106
  "use_cache": true,
107
  "use_sliding_window": false,
108
  "vocab_size": 248320
model.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:9d26d5e637551c244d543c67c790bd0947f360e005c569e5851a185ffe692786
3
- size 2718576122
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2aff025f45823b40ebe726b9dfa40302f3512bd9a11c3a7347de32a567acd9a7
3
+ size 3714723322