Files changed (1) hide show
  1. README.md +11 -38
README.md CHANGED
@@ -16,46 +16,28 @@ tags:
16
 
17
  ## Model Overview
18
 
19
- **Inferact/Kimi-K3-DSpark** is an **MLA-native DSpark** draft model that accelerates [Kimi-K3](https://huggingface.co/moonshotai/Kimi-K3) on **[vLLM](https://github.com/vllm-project/vllm)**, served through vLLM's native `dspark` speculative method.
20
 
21
- The draft trains on **target hidden states extracted from vLLM itself** β€” the same engine that serves it, so the numerics it learns from are the numerics it meets at inference. [TorchSpec](https://github.com/lightseekorg/TorchSpec) provides the loop, streaming those hidden states from live target inference into concurrent FSDP draft training.
22
 
23
- **DSpark** = a block-diffusion backbone of 5 dense layers with non-causal attention, drafting 7 tokens in a single parallel pass, a low-rank sequential **Markov head** supplying the intra-block dependency, and a confidence head for resource-aware scheduling. Mirroring Kimi-K3's own MLA attention means draft and target share one KV layout (a compact 576-element latent per token), so the draft's pages unify with the target's cache β€” KV offloading and P/D disaggregation work with no separate page format.
 
 
24
 
25
  ---
26
 
27
  ## Performance
28
 
29
- ### Peak bs=1 decode: 464 tok/s
30
-
31
- Under low-entropy real reasoning workload β€” Kimi-K3 + DSpark on vLLM can achieve **464 tok/s** using the public `vllm/vllm-openai:kimi-k3` image on 4 Γ— GB300 at `bs=1 & tensor-parallel-size=16`.
32
 
33
- ### Speculator acceptance
34
 
35
- Speculators do best on predictable, low-entropy work like the reasoning workload behind the 464 tok/s above, and worst on open-ended, high-entropy generation. So we measured **14 benchmarks** spanning math, code synthesis, real-world software engineering, multi-turn chat, RAG and QA, multilingual text, creative writing and long-context generation β€” all with the **Kimi-K3 chat template enabled** and production sampling parameters, with `temperature=0` reported alongside for reproducibility. Acceptance stays strong at long context too, verified on AA-LCR's ~95k-token multi-document prompts. That is the most comprehensive view we can give of how the speculator performs on real-world workloads.
36
 
37
- Acceptance length, with 7 speculative tokens:
38
 
39
- | benchmark | `temperature=0` | `temperature=1.0`, `top_p=0.95` | prompts |
40
- |---|---|---|---|
41
- | GSM8K | 5.64 | 5.44 | 1319 |
42
- | HumanEval | 5.34 | 5.07 | 164 |
43
- | MBPP | 4.44 | 4.31 | 256 |
44
- | SPEED-Bench Β· coding | 4.38 | 4.22 | 80 |
45
- | SPEED-Bench Β· multilingual | 4.21 | 4.10 | 80 |
46
- | SPEED-Bench Β· RAG | 4.11 | 3.97 | 80 |
47
- | MATH-500 | 3.82 | 3.77 | 500 |
48
- | SPEED-Bench Β· low-entropy, 10k input | 3.72 | 3.66 | 512 |
49
- | SWE-bench Pro | 3.35 | 3.11 | 128 |
50
- | AA-LCR Β· ~95k input | 3.19 | 3.23 | 100 |
51
- | MT-Bench | 3.14 | 3.06 | 80 |
52
- | SPEED-Bench Β· QA | 3.07 | 2.98 | 80 |
53
- | SPEED-Bench Β· writing | 2.79 | 2.69 | 80 |
54
- | AIME 2026 | 2.72 | 2.64 | 30 |
55
- | **mean** | **3.85** | **3.73** | |
56
 
57
-
58
- **Benchmarks:** [GSM8K](https://huggingface.co/datasets/openai/gsm8k), [MATH-500](https://huggingface.co/datasets/HuggingFaceH4/MATH-500), [AIME 2026](https://huggingface.co/datasets/math-ai/aime26), [HumanEval](https://huggingface.co/datasets/openai/openai_humaneval), [MBPP](https://huggingface.co/datasets/Muennighoff/mbpp), [SWE-bench Pro](https://huggingface.co/datasets/ScaleAI/SWE-bench_Pro), [MT-Bench](https://huggingface.co/datasets/philschmid/mt-bench), [AA-LCR](https://huggingface.co/datasets/ArtificialAnalysis/AA-LCR) β€” 100 multi-document prompts of 71k–115k tokens β€” and six splits of [NVIDIA SPEED-Bench](https://huggingface.co/datasets/nvidia/SPEED-Bench): its `throughput_16k` low-entropy split at 10k-token input, plus five qualitative categories.
59
 
60
  ---
61
 
@@ -67,7 +49,7 @@ Acceptance length, with 7 speculative tokens:
67
  - [`nvidia/OpenCodeInstruct`](https://huggingface.co/datasets/nvidia/OpenCodeInstruct) β€” single-turn coding
68
  - A nine-category prompt pool from the NVIDIA **Nemotron** SFT/RL collections and [`CohereLabs/aya_dataset`](https://huggingface.co/datasets/CohereLabs/aya_dataset), spanning chat, code, multilingual, RAG/QA, math, structured output and safety. Evaluation-set prompts are excluded.
69
 
70
- **Method:** DSpark with block_size=7, trained on a combined CE + L1 distribution-distillation objective against the target's post-final-norm hidden state, bf16. The draft consumes Kimi-K3 auxiliary hidden states from target layers (2, 23, 47, 71, 89) of 93. Roughly **two epochs** in total, on GB300 nodes.
71
 
72
  Draft architecture, block size, sequence length, and loss weights are YAML-configurable β€” see the [TorchSpec repo](https://github.com/lightseekorg/TorchSpec).
73
 
@@ -86,12 +68,3 @@ Add to your Kimi-K3 `vllm serve` command:
86
  ```bash
87
  --speculative-config '{"method": "dspark", "model": "Inferact/Kimi-K3-DSpark", "num_speculative_tokens": 7, "attention_backend": "FLASHINFER_MLA", "draft_sample_method": "probabilistic", "rejection_sample_method": "block"}'
88
  ```
89
-
90
- ### Sampling options
91
-
92
- vLLM offers two knobs on top of the defaults, both used in the `temperature=1.0` column above:
93
-
94
- - **`draft_sample_method`** β€” `probabilistic` samples the draft from its own distribution instead of taking its argmax. Pair it with a sampling client; use `greedy` when serving at `temperature=0` so the draft matches the client.
95
- - **`rejection_sample_method`** β€” `block` verifies the drafted block as a unit rather than token by token. It is a no-op under greedy decoding (at `temperature=0` verification reduces to a deterministic argmax match), so it only applies to the sampling configuration.
96
-
97
- The `temperature=0` column was produced with `{"draft_sample_method": "greedy"}` and no `rejection_sample_method`.
 
16
 
17
  ## Model Overview
18
 
19
+ **Inferact/Kimi-K3-DSpark** is an **MLA-native DSpark** draft model that accelerates inference of [Kimi-K3](https://huggingface.co/moonshotai/Kimi-K3) on **[vLLM](https://github.com/vllm-project/vllm)**, which serves it through its native `dspark` speculative method.
20
 
21
+ The draft is trained on **target hidden states extracted from vLLM itself** β€” the same engine that serves it β€” so it learns from exactly the distribution it will later draft against. [TorchSpec](https://github.com/lightseekorg/TorchSpec) provides the training loop, streaming those hidden states from live vLLM target inference into concurrent FSDP draft training.
22
 
23
+ **DSpark** = a block-diffusion backbone (5 dense layers that consume 5 target auxiliary hidden states and draft a block of 7 tokens in a single parallel pass), plus a low-rank sequential **Markov head** (`rank=256`) that supplies the intra-block token dependency the parallel backbone misses, plus a confidence head.
24
+
25
+ **Why MLA:** the draft mirrors Kimi-K3's own MLA attention, so draft and target share a single KV layout (a compact 576-element latent per token). The draft's pages unify with the target's cache, letting it reuse the same KV management and PD-disaggregated serving paths with no separate page format.
26
 
27
  ---
28
 
29
  ## Performance
30
 
31
+ Measured end-to-end against Kimi-K3 at `tensor-parallel-size=8` (2 Γ— GB300), `num_speculative_tokens=7`. **Sampling matches the production serving setting (`temperature=1.0` / `top_p=0.95`), so acceptance reflects real serving conditions.**
 
 
32
 
 
33
 
34
+ ![Screenshot 2026-07-26 at 8.55.09β€―PM](https://cdn-uploads.huggingface.co/production/uploads/649921b1c789488720308b62/dQv6SqAHA1x_Oo5t6Q22G.png)
35
 
36
+ Acceptance tracks how predictable the output is: it is strongest on deterministic, structured text such as code, and weaker on high-entropy generation such as creative writing. Confidence-based scheduling β€” using the draft's confidence head to prune low-confidence drafted tokens before they are sent for verification β€” is planned future work aimed at lifting the harder categories.
37
 
38
+ **Benchmarks:** [MT-Bench](https://huggingface.co/datasets/philschmid/mt-bench) (80 dialogue prompts) and [NVIDIA SPEED-Bench](https://huggingface.co/datasets/nvidia/SPEED-Bench) β€” its `throughput_16k` low-entropy split (302 prompts at 10k-token input) plus five qualitative categories.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
 
40
+ vLLM supports **block verification** (`rejection_sample_method=block`) and **probabilistic draft sampling** (`draft_sample_method=probabilistic`) β€” verifying the drafted block as a unit, and sampling the draft from its own distribution rather than its argmax. Both are enabled in the numbers above and push acceptance higher at `temperature=1.0`.
 
41
 
42
  ---
43
 
 
49
  - [`nvidia/OpenCodeInstruct`](https://huggingface.co/datasets/nvidia/OpenCodeInstruct) β€” single-turn coding
50
  - A nine-category prompt pool from the NVIDIA **Nemotron** SFT/RL collections and [`CohereLabs/aya_dataset`](https://huggingface.co/datasets/CohereLabs/aya_dataset), spanning chat, code, multilingual, RAG/QA, math, structured output and safety. Evaluation-set prompts are excluded.
51
 
52
+ **Method:** DSpark with `block_size=7`, `max_seq_length=16384`, trained on a combined CE + L1 distribution-distillation objective against the target's post-final-norm hidden state, bf16. The draft consumes Kimi-K3 auxiliary hidden states from target layers (2, 23, 47, 71, 89) of 93. Roughly **two epochs** in total, on GB300 nodes.
53
 
54
  Draft architecture, block size, sequence length, and loss weights are YAML-configurable β€” see the [TorchSpec repo](https://github.com/lightseekorg/TorchSpec).
55
 
 
68
  ```bash
69
  --speculative-config '{"method": "dspark", "model": "Inferact/Kimi-K3-DSpark", "num_speculative_tokens": 7, "attention_backend": "FLASHINFER_MLA", "draft_sample_method": "probabilistic", "rejection_sample_method": "block"}'
70
  ```