Add Kimi K3.1 DSpark draft (r2, step 15,983, YaRN-32 serving config) and model card
Browse files- README.md +48 -0
- config.json +76 -0
- model.safetensors +3 -0
README.md
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
tags:
|
| 3 |
+
- speculative-decoding
|
| 4 |
+
- dspark
|
| 5 |
+
- speculators
|
| 6 |
+
- vllm
|
| 7 |
+
---
|
| 8 |
+
|
| 9 |
+
# Kimi K3.1 DSpark
|
| 10 |
+
|
| 11 |
+
DSpark draft model for Kimi K3.1.
|
| 12 |
+
|
| 13 |
+
Five full-causal MLA layers conditioned on hidden states from five of the target's layers,
|
| 14 |
+
trained at `block_size=7`: one forward pass drafts seven tokens. It trained on 32,768-token
|
| 15 |
+
packs; `config.json` declares YaRN factor 32 (as in `Inferact/Kimi-K3-DSpark-Block5`) for
|
| 16 |
+
serving up to 1,048,576 tokens.
|
| 17 |
+
|
| 18 |
+
## Evaluation settings
|
| 19 |
+
|
| 20 |
+
- **Server:** vLLM (Kimi K3.1 build `ab910db623`), target with TP8 on 8 GB300 GPUs, prefix
|
| 21 |
+
caching off. Speculative config
|
| 22 |
+
`{"method":"dspark","model":"Inferact/Kimi-K3.1-DSpark","num_speculative_tokens":7,"draft_sample_method":"probabilistic","rejection_sample_method":"block"}`:
|
| 23 |
+
probabilistic drafts (the draft samples its tokens and passes its probabilities to
|
| 24 |
+
verification) with block verification (Sun et al., 2024).
|
| 25 |
+
- **Client:** `vllm-bench`, chat completions, temperature 1.0, top_p 0.95, chat template
|
| 26 |
+
defaults, one benchmark at a time.
|
| 27 |
+
- **Metric:** acceptance length = 1 + accepted draft tokens / drafts (includes the bonus token),
|
| 28 |
+
from the server's spec-decode counters.
|
| 29 |
+
- **Draft RoPE:** these results used the same weights with the plain RoPE declaration
|
| 30 |
+
(`rope_type: default`), not this repo's YaRN declaration.
|
| 31 |
+
|
| 32 |
+
## Results
|
| 33 |
+
|
| 34 |
+
| Benchmark | Prompts | Max tokens | Acceptance length | Accept rate, positions 1-7 |
|
| 35 |
+
| --- | ---: | ---: | ---: | --- |
|
| 36 |
+
| GSM8K | 256 | 1,024 | **6.020** | 0.94 0.87 0.79 0.71 0.64 0.57 0.50 |
|
| 37 |
+
| HumanEval | 164 | 1,024 | 5.327 | 0.90 0.80 0.69 0.60 0.52 0.45 0.38 |
|
| 38 |
+
| MBPP | 256 | 1,024 | 4.875 | 0.89 0.76 0.64 0.53 0.43 0.35 0.28 |
|
| 39 |
+
| MATH-500 | 500 | 2,048 | 4.188 | 0.82 0.65 0.52 0.41 0.32 0.26 0.21 |
|
| 40 |
+
| SPEED-Bench low entropy (10K-token inputs) | 512 | 1,536 | 3.863 | 0.81 0.62 0.47 0.35 0.27 0.20 0.15 |
|
| 41 |
+
| MT-Bench | 80 | 1,024 | 3.605 | 0.79 0.59 0.42 0.30 0.22 0.16 0.12 |
|
| 42 |
+
| SWE-bench Pro | 128 | 2,048 | 3.417 | 0.77 0.56 0.40 0.28 0.19 0.13 0.09 |
|
| 43 |
+
| AIME 2026 | 30 | 4,096 | 2.912 | 0.70 0.47 0.30 0.19 0.12 0.08 0.05 |
|
| 44 |
+
| **Pooled** | | | **4.012** | 0.82 0.64 0.49 0.38 0.29 0.23 0.18 |
|
| 45 |
+
|
| 46 |
+
On the same benchmarks and settings, `Inferact/Kimi-K3-DSpark-Block5` (5 draft tokens) pools
|
| 47 |
+
3.226. The five-shot GSM8K accuracy check (1,319 problems, temperature 0.7) scored 96.06% exact
|
| 48 |
+
match with zero request errors.
|
config.json
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"attention_bias": false,
|
| 3 |
+
"attention_dropout": 0.0,
|
| 4 |
+
"bos_token_id": 163584,
|
| 5 |
+
"eos_token_id": 163586,
|
| 6 |
+
"head_dim": 64,
|
| 7 |
+
"hidden_act": "silu",
|
| 8 |
+
"hidden_size": 7168,
|
| 9 |
+
"initializer_range": 0.02,
|
| 10 |
+
"intermediate_size": 14336,
|
| 11 |
+
"kv_lora_rank": 512,
|
| 12 |
+
"layer_types": [
|
| 13 |
+
"full_attention",
|
| 14 |
+
"full_attention",
|
| 15 |
+
"full_attention",
|
| 16 |
+
"full_attention",
|
| 17 |
+
"full_attention"
|
| 18 |
+
],
|
| 19 |
+
"num_attention_heads": 96,
|
| 20 |
+
"num_hidden_layers": 5,
|
| 21 |
+
"num_key_value_heads": 96,
|
| 22 |
+
"pad_token_id": 163839,
|
| 23 |
+
"q_lora_rank": 1536,
|
| 24 |
+
"qk_head_dim": 192,
|
| 25 |
+
"qk_nope_head_dim": 128,
|
| 26 |
+
"qk_rope_head_dim": 64,
|
| 27 |
+
"rms_norm_eps": 1e-05,
|
| 28 |
+
"rope_interleave": true,
|
| 29 |
+
"rope_parameters": {
|
| 30 |
+
"rope_type": "yarn",
|
| 31 |
+
"rope_theta": 1000000.0,
|
| 32 |
+
"factor": 32.0,
|
| 33 |
+
"original_max_position_embeddings": 32768,
|
| 34 |
+
"beta_fast": 32,
|
| 35 |
+
"beta_slow": 1,
|
| 36 |
+
"mscale": 1.0,
|
| 37 |
+
"mscale_all_dim": 0.0,
|
| 38 |
+
"attn_factor": 0.7426255848312643
|
| 39 |
+
},
|
| 40 |
+
"sliding_window": null,
|
| 41 |
+
"tie_word_embeddings": false,
|
| 42 |
+
"use_cache": true,
|
| 43 |
+
"use_sliding_window": false,
|
| 44 |
+
"v_head_dim": 128,
|
| 45 |
+
"vocab_size": 163840,
|
| 46 |
+
"architectures": [
|
| 47 |
+
"K3DSparkModel"
|
| 48 |
+
],
|
| 49 |
+
"model_type": "k3_dspark",
|
| 50 |
+
"max_position_embeddings": 1048576,
|
| 51 |
+
"rope_theta": 1000000.0,
|
| 52 |
+
"num_target_layers": 5,
|
| 53 |
+
"target_hidden_size": 7168,
|
| 54 |
+
"target_num_hidden_layers": 93,
|
| 55 |
+
"target_layer_ids": [
|
| 56 |
+
75,
|
| 57 |
+
79,
|
| 58 |
+
83,
|
| 59 |
+
87,
|
| 60 |
+
91
|
| 61 |
+
],
|
| 62 |
+
"mask_token_id": 163839,
|
| 63 |
+
"markov_rank": 512,
|
| 64 |
+
"markov_head_type": "vanilla",
|
| 65 |
+
"enable_confidence_head": true,
|
| 66 |
+
"confidence_head_with_markov": true,
|
| 67 |
+
"sample_from_anchor": true,
|
| 68 |
+
"block_size": 7,
|
| 69 |
+
"sliding_window_non_causal": false,
|
| 70 |
+
"full_attention_causal": true,
|
| 71 |
+
"dflash_config": {
|
| 72 |
+
"causal": true
|
| 73 |
+
},
|
| 74 |
+
"draft_vocab_size": 163840,
|
| 75 |
+
"torch_dtype": "bfloat16"
|
| 76 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:27ad5181c8ea09d125615796b3d7e279dfe4300207b895de84a107611533d027
|
| 3 |
+
size 5373511978
|