🧙♂️⚡ Qwen3.8-27B-Kearuga-DFlash2
Kearuga's own DFlash 2 speculative drafter for 0xWhiteMage/Qwen3.8-27B-Kearuga — distilled on Kearuga's own outputs, quantized to NVFP4 (W4A4, ModelOpt layout) with activation scales calibrated on Kearuga's features, and served with a frequency-pruned 64K draft head.
⚡ Overview
On a single NVIDIA DGX Spark (GB10 / Grace-Blackwell, SM121), evaluated against the same Kearuga target served with the stock BF16 z-lab/Qwen3.8-27B-DFlash2 drafter at K = 10, this drafter delivers — paired, in one window, on one clock:
| Serving Configuration | Single Stream (C1) Aggregate | 4 Concurrent Streams (C4) Aggregate | Domains Better (C1 + C4) |
|---|---|---|---|
| Stock BF16 drafter, K = 10 (baseline) | 30.85 tok/s | 98.31 tok/s | — |
| This drafter, K = 12, plain SGLang | 33.30 tok/s (+7.9 %) | 102.57 tok/s (+4.3 %) | 10 / 10 |
| This drafter, K = 12, + 64K draft-head map (overlay) | 35.33 tok/s (+14.5 %) | 108.90 tok/s (+10.8 %) | 10 / 10 |
- 🎯 Lossless up to floating-point numerics: The target verifies every drafted token with its own untouched BF16
lm_head; a drafter can only change speed, not what the target outputs — up to bf16 rounding. Measured (2026-09-23, 40 prompts × 256 greedy tokens, thinking off): continuations from the speculative server and from the same target served without speculation diverge on 28/40 prompts, every first divergence at a top-2 logprob margin ≤ 0.25 (a bf16 near-tie); two runs of the speculative server itself diverge on 6/40 with the same margins — no divergence at a decided position. Fidelity-40 against the BF16 base is identical to the target served alone (mean KL 0.0165, JS 0.0034, top-1 agreement 40/40). - 🗜️ 2.5× Smaller Footprint: 1.55 GB NVFP4 vs 3.85 GB BF16 — because the decode cycle on a GB10 is memory-bandwidth-bound, every byte eliminated from the weight stream directly saves execution time.
- 🏎️ Per-Domain Net Decode Speed (C1 Medians, 20 requests): Code 46.3 → 57.6 tok/s, Math 51.2 → 62.2 tok/s, Tool calls 80.8 → 114.6 tok/s, Prose 19.4 → 21.6 tok/s, Instruction-following 19.9 → 21.8 tok/s.
- 🛡️ Quality-200 Objective Gate: Passes 155 / 180 on the frozen Quality-200 suite (GSM8K 67/80 · HumanEval 38/40 · IFEval 34/40 · agentic coding 16/20), safely inside the pre-registered 154–160 band. (The target alone scores 157; all five candidate drafters landed in 154–159, reflecting the suite's near-tie noise floor rather than a drafter degradation).
[!NOTE] The absolute performance figures are measured on a GB10 with the target's full 262K context enabled and the owner's 2400 MHz SM clock lock active. Re-measuring with the lock lifted showed identical results (the GB10 natively executes this decode loop at 2.40–2.48 GHz; it is memory-bandwidth-bound, not compute-bound). These figures are not comparable to RTX 5090 / B200 setups — the GB10's 273 GB/s unified memory defines the physical ceiling, and this drafter maximizes bandwidth efficiency toward that ceiling.
📊 Paired Empirical Benchmark (Bake-Off, 2026-09-17)
All candidate configurations were evaluated in a single maintenance window, booted back-to-back on the exact same container image, target weights, flags, and hardware clock.
- Battery: 50 prompts (10 prompts × 5 domains) × 2 runs.
- Sampling:
temperature 0(greedy), thinking disabled, domain-calibratedmax_tokens(code 700, math 600, etc.). - Metric Definition: "Net decode tok/s" =
(completion_tokens − 1) / (t_last_token − t_first_token)per request (TTFT excluded). Paired per-prompt deltas evaluated with bootstrap 95% confidence intervals.
1. Per-Domain Breakdown: This Drafter (K = 12, 64K Map) vs. Stock BF16 Baseline (K = 10)
| Cell | Domain | Baseline Med. tok/s | This Drafter Med. tok/s | Paired Δ | 95% CI of Paired Diff (tok/s) | Verdict |
|---|---|---|---|---|---|---|
| C1 | Code | 46.27 | 57.62 | +23.1 % | [+9.52, +12.02] | better |
| C1 | Math | 51.21 | 62.18 | +24.2 % | [+8.22, +13.21] | better |
| C1 | Tool Calls | 80.82 | 114.63 | +26.2 % | [+15.89, +31.97] | better |
| C1 | Prose | 19.45 | 21.64 | +10.8 % | [+1.49, +2.91] | better |
| C1 | Instruction-Following (IFEval) | 19.87 | 21.80 | +9.4 % | [+0.85, +2.39] | better |
| C4 | Code | 38.84 | 45.65 | +16.1 % | [+5.23, +6.70] | better |
| C4 | Math | 41.17 | 47.33 | +13.0 % | [+4.41, +7.82] | better |
| C4 | Tool Calls | 49.02 | 69.25 | +31.5 % | [+9.76, +35.16] | better |
| C4 | Prose | 16.07 | 17.22 | +8.6 % | [+0.95, +2.05] | better |
| C4 | Instruction-Following | 15.42 | 17.68 | +11.0 % | [+0.61, +2.11] | better |
- TTFT Impact: Median TTFT at C1 improved from 0.28–0.30 s down to 0.27–0.28 s (tool prompts accelerated from 0.78 s down to 0.62 s), as the first decode cycle executes a cheaper draft step.
2. Candidate Rankings (Pre-Registered Expected Value Rule)
Candidates were evaluated under the pre-registered ranking criterion: $$\text{EV} = 0.8 \cdot \sum w_d \cdot \Delta C1_d + 0.2 \cdot \sum w_d \cdot \Delta C4_d$$
- Workload Weights ($w_d$): Code: 0.30 · Tool: 0.20 · Math: 0.10 · Prose: 0.25 · Instruction-Following: 0.15 (frozen pre-bakeoff).
- Quality Gates: Fidelity-40 top-1 40/40, mean KL ≤ 0.0170, no C1 domain regression vs baseline, C4 aggregate ≥ −1%.
| Rank | Candidate Configuration | EV | C1 Aggregate | C4 Aggregate | Gates |
|---|---|---|---|---|---|
| 🥇 1 | This Drafter (K = 12, 64K Draft-Head Map) | +18.20 | +14.5 % | +10.8 % | pass |
| 🥈 2 | Spec-AUF Fine-Tune of Stock Drafter, Kearuga-Calibrated NVFP4, K = 12 | +14.11 | +8.9 % | +5.0 % | pass |
| 🥉 3 | This Drafter (K = 12, Plain SGLang, No Overlay) | +11.22 | +7.9 % | +4.3 % | pass |
| 4 | maurienne-ai/Qwen3.8-27B-DFlash2-NVFP4-RTNcal, K = 10 | +7.10 | +7.2 % | +6.2 % | pass |
| 5 | Stock Drafter Weights, Kearuga-Calibrated NVFP4, K = 10 | +6.84 | +6.9 % | +5.1 % | pass |
| — | Stock BF16 z-lab/Qwen3.8-27B-DFlash2, K = 10 | 0 (baseline) | 30.85 tok/s | 98.31 tok/s | baseline |
3. Exact Speculative Acceptance
Measured per request from the server's internal verify-call counter: $\frac{\text{completion_tokens} - 1}{\text{verify_calls}}$ (greedy, thinking off, K = 12, without draft-head map, $n = 5$ per domain):
| Domain | Exact Acceptance (Tokens Committed / Cycle, incl. Bonus) |
|---|---|
| Code | 6.94 tokens |
| Math | 6.96 tokens |
| Tool Calls | 9.87 tokens |
| Prose | 2.54 tokens |
| Instruction-Following | 2.36 tokens |
Sampling and thinking-on (production resident: this drafter, K = 12, with the 64K draft-head map; 2026-09-17; $n = 2$ prompts per domain, sequential, verified free of concurrent traffic):
| Domain | Greedy, thinking off | Model-default sampling (T 1.0 · top-p 0.95 · top-k 20), thinking off | Model-default sampling, thinking on |
|---|---|---|---|
| Code | 7.54 | 6.47 | 3.11 (reasoning trace fills the 700-token budget) |
| Math | 7.68 | 7.37 | 6.18 |
| Tool Calls | 10.53 | 9.70 | — |
| Prose | 2.50 | 2.45 | 3.62 |
| Instruction-Following | 2.41 | 2.32 | — |
-
Sampling costs little acceptance: −0.1 to −1.1 tokens/cycle vs greedy (prose unchanged at ≈ 2.5). The speculative-sampling verify path is exact, so sampled outputs remain the target's own distribution.
-
Thinking-on is the real cost: with reasoning enabled, code acceptance falls from 7.5 to 3.1 tokens/cycle — the reasoning trace behaves like prose — so a thinking-on code request decodes at roughly prose speed (≈ 27 tok/s incl. TTFT on this probe vs ≈ 56–65 thinking off). This is the drafter's largest remaining headroom.
-
Thinking on, paired vs the stock drafter (2026-09-22; same 50-prompt battery × 2 runs,
reasoning_effort=xhigh, model-default sampling, every cell booted with--disable-flashinfer-autotune): this drafter 32.90 tok/s C1 / 102.33 C4 vs stock K = 10 30.61 / 94.00 (−7.0 % / −8.1 %) and stock K = 12 29.61 / 93.96 (−10.0 % / −8.2 %) — faster in all five domains (code 34.6 vs 31.9, math 49.3 vs 43.0, tool 75.2 vs 53.3, prose 23.6 vs 21.9, IFEval 37.8 vs 34.5 tok/s). Thinking-on acceptance at K = 12: code 3.15 · math 5.68 · tool 7.14 · prose 2.50 · IFEval 3.79 tokens/cycle (stock K = 12 accepts up to 0.5 more per cycle on four domains but its cycle costs more). Fidelity-40 40/40 in every cell. -
Reasoning effort matters more than the drafter for thinking-mode latency: the Kearuga chat template — like Qwen3.8's — defaults to
reasoning_effort=xhigh. On the live resident (thinking on, model-default sampling, 2 prompts per domain, 4,096-token cap) both code prompts atxhighspent the whole budget reasoning and never answered (135 s, 3.47 accepted/cycle), whilemediumanswered in ≈ 90 s (5.05 accepted/cycle); on mathmediumcut wall time 53.7 → 20.4 s with acceptance 6.27 → 7.56. Recommendation for coding and agent clients: sendchat_template_kwargs: {"reasoning_effort": "medium"}per request. (Full table in the serving repo README §1.) -
Impact of the 64K Draft-Head Map: Tokens outside the hot set represent only 0.44% of Kearuga's output tokens. In the paired bake-off table above, gauge-based acceptance deltas vs. the stock drafter stay within $\pm 0.1$ tokens on code, math, prose, and instruction-following at C1 (speed on tool calls increases +26% / +31%).
4. Fidelity-40 Verification (vs. Native Unquantized BF16)
| Metric | Target + Stock BF16 Drafter | Target + This Drafter |
|---|---|---|
| Mean KL Divergence (top-20 union) | 0.0165 | 0.0165 |
| Mean Jensen-Shannon Divergence (JS) | 0.0034 | 0.0034 |
| Top-1 Argmax Token Agreement | 40 / 40 | 40 / 40 (100%) |
| Greedy 32-Token Continuations Byte-Identical to BF16 | 20 / 40 | 18 / 40 (bake-off boot) · 22 / 40 (production boot) |
- The target verifies every drafted proposal with its own untouched
lm_head; the first-token distribution is mathematically independent of the drafter. - Continuation identity shifts by $\pm 2\text{--}3$ tokens across boots or drafter profiles purely due to near-tie logits verified in different order; a single drafter reproduces its continuations 40/40 deterministically across reboots.
5. Against No Speculation (2026-09-23)
The same target, image and flags with every --speculative-* flag removed (single tenant, thinking off, temperature 0, the serving repo's 50-prompt battery):
| Configuration | C1 aggregate | C4 aggregate | C1 medians: code · math · tool calls · prose · IFEval |
|---|---|---|---|
| Kearuga target, no drafter | 10.30 tok/s | 39.56 tok/s | 10.4 · 10.4 · 12.7 · 10.4 · 10.5 |
| Kearuga target + this drafter (K = 12, 64K head, FP8 draft KV; paired-sweep cell) | 35.66 tok/s (3.46×) | 108.83 tok/s (2.75×) | 58.2 · 62.4 · 107.6 · 22.0 · 22.0 (5.6× · 6.0× · 8.5× · 2.1× · 2.1×) |
Without a drafter the GB10 decodes this 24.85 GB target at a flat ≈ 10.3 tok/s per stream (weight-streaming bound). The drafter also costs KV capacity: without it the pool hits the 4 × 262,144-token cap with 21 GB unallocated; with it, 932,355 tokens. Method and raw numbers: serving stack v0.6.7, README §1.
🛠️ Build Methodology & Architecture
The drafter was developed across three dedicated optimization stages to maximize speculative decoding speed and minimize unified memory bus traffic on Grace-Blackwell GB10 hardware:
| Optimization Stage | Primary Objective | Baseline / Input | Technical Methodology | Hardware & Serving Impact |
|---|---|---|---|---|
| Stage 1: Distillation | On-Target Distillation | z-lab/Qwen3.8-27B-DFlash2 (81 tensors) | 24,644 greedy Kearuga conversations (8 domains, 80% think-off / 20% think-on), 205 FP8 activation hooks, block-diffusion CE ($\tau=7$) + $0.3 \times \text{selector CE}$ | Unlocks K=12 technical acceptance: Code +7.4%, Math +6.6%, Tools +10.7% (+0.5 to +0.8 tok/cycle) |
| Stage 2: Calibrated NVFP4 | Calibrated Quantization | 3.85 GB native BF16 drafter weights | ModelOpt NVFP4 (E2M1, group 16, FP8 group scales) on 35 linear layers; forward pre-hook activation calibration over 100 multi-domain conversations (a stratified subsample of the 400-conversation Kearuga teacher set: 8 domains, 50% thinking-on); selector and conv kept in BF16 | 2.5× weight compression (3.85 GB → 1.55 GB); Kearuga-calibrated activation scales avoid the ~13% acceptance loss reported for uncalibrated RTN |
| Stage 3: 64K Draft Head | Sub-Vocabulary Acceleration | Full 248,320 × 5,120 BF16 target lm_head (2.54 GB) | FR-Spec frequency census (14.74M tokens / 20K responses) + 114 fusion tokens = 65,650 rows (an even row count — an odd count sent cuBLAS to a 3× slower unaligned kernel); SGLang 5-file read-only overlay | Replaces the 2.54 GB read with a 0.67 GB hot head; tool-call speedup +26.2% C1 / +31.5% C4 |
🎯 Stage 1 Technical Specifications: Distillation on Kearuga Outputs ("Run 2")
| Dimension | Specification | Implementation Detail |
|---|---|---|
| Base Weights | z-lab/Qwen3.8-27B-DFlash2 | Revision 50307d4c (5-layer block diffusion, taps [5, 19, 33, 47, 61], selector rank 256 / top-k 16). Architecture unchanged; all 81 stock tensors exported. |
| Teacher Corpus | Kearuga On-Policy Generations | 24,644 conversations generated greedily by the Kearuga target (19,734 new rows, 80% thinking-off / 20% thinking-on, + 4,910 rows from run 1) across 8 domains (agentic, tool calls, code, math, prose, chat, IF, multilingual). |
| Target Features | Quantized Activation Hooks | BF16 twin of Kearuga equipped with 205 FP8 activation hooks, ensuring training aligns with the exact hidden states emitted by the served quantized target. |
| Objective & Optimization | Block-Diffusion CE + Selector | Teacher-forced block diffusion (block size 16, 512 random anchors/seq, static position decay $\tau=7$) + $0.3 \times \text{selector CE}$. AdamW $1\text{e-}4$, 4% warmup, cosine decay, 6,161 steps (1 epoch, 43.2h on GB10). |
| Served Effect | Verified Speedup | Run-2 weights unlock high acceptance at K = 12: Code +7.4%, Math +6.6%, Tool +10.7% (acceptance +0.5 to +0.8 tokens/cycle higher on technical domains). |
🗜️ Stage 2 Technical Specifications: NVFP4 Weights & Activation Calibration
| Dimension | Specification | Implementation Detail |
|---|---|---|
| Quantization Format | ModelOpt NVFP4 | E2M1 weights, block size 16, FP8-E4M3 group scales, per-tensor FP32 global scale $\frac{\text{amax}}{6 \times 448}$. Fused shards share scale factors (q/k/v; gate/up). RTN rounding. |
| Quantized Scope | 35 Linears (186 Tensors) | Candidate selector (candidate_selector.hidden_projection), feature fusion fc, and 10 conv kernel_projection modules remain in native BF16 (hf_quant_config.json). |
| Activation Calibration | Kearuga Forward Pre-Hooks | Forward pre-hooks on 35 linear layers during reference draft $\to$ verify loops across 100 multi-domain conversations from teacher data (stratified subsample of the 400-conversation set: 8 domains, 50% thinking-on; 29,686 verified draft tokens). Loaded via --speculative-draft-model-quantization modelopt_fp4. |
| Format Selection | Bandwidth Ceiling | Community benchmarks and empirical sweeps show decode speed flattens past FP4 (41.3 BF16 $\to$ 43.8 FP8 $\to$ 44.6 FP4 tok/s). Drafter represents 1.55 GB of a ~25 GB weight stream. |
⚡ Stage 3 Technical Specifications: 64K Draft Head (draft-vocab-v4-top65650.pt + SGLang Overlay)
| Dimension | Specification | Implementation Detail |
|---|---|---|
| Architectural Concept | FR-Spec Sub-Vocabulary Drafting | Draft over a frequency-ranked subset of tokens; verify over full vocabulary (output distribution is unchanged). Eliminates reading the target's full 248,320 × 5120 BF16 lm_head (2.54 GB/cycle). |
| Frequency Census | 14.74M Kearuga Output Tokens | Analyzed across 20,000 responses with tool calls re-rendered through chat templates to surface <function=...> / <parameter=...>. 99,804 vocabulary IDs ever occur; top 65,536 IDs cover 99.56% of emissions. |
| cuBLAS Alignment | 65,650 Rows (Even) | Adds 114 =identifier fusion tokens to the 65,536 hot rows = 65,650, an even row count. An odd row count (a 98,369-row map) sent cuBLAS to an unaligned kernel $3\times$ slower; new maps are now padded to a multiple of 8. |
| Runtime Overlay | SGLang Spec-v2 Integration | 5 read-only overlay files (sglang-overlay/) route candidate drafting through the 65,650 hot rows (0.67 GB) and remap top-k indices to global IDs. Target verify head remains 100% untouched. |
🔬 Empirical Ablations: What Did Not Work
To save future researchers and engineers redundant exploration, the following approaches were evaluated and rejected based on empirical performance:
| Exploration / Strategy | Empirical Result | Root Cause Analysis |
|---|---|---|
| Alternative Training Losses | Neutral served acceptance | Objectives like Spec-AUF, D-PACE, and dual static decay improved offline loss but yielded 2.5–2.7 tokens/cycle on served prose. Kearuga is within KL 0.0165 of stock BF16, leaving little target-mismatch headroom. |
| Extended Draft Length ($K = 14, 16$) | Neutral C1 / −2% to −6% C4 | Additional draft latency degrades multi-stream verification throughput without improving acceptance. |
| Draft Window ($1024 / 4096$) | $\pm 0.2%$ throughput delta | Negligible impact on execution time. |
FP8 Draft KV (--speculative-draft-kv-cache-dtype fp8_e4m3) | +13.6 % KV pool for −1.1 % C1 / −1.3 % C4 (2026-09-22, paired) | A capacity knob, not a speed one: drafter KV 8.45 + 8.45 GB → 4.80 + 4.80 GB; mean KL unchanged, 2 of 40 greedy continuations differ. Adopted as the kearuga-profile default in serving stack v0.6.6 (production pool 818,294 → 932,355 tokens, +13.9 %). |
NVFP4 for the remaining BF16 linears (fc + 10 conv kernel_projection) | +0.58 % C1 / −1.10 % C4 (2026-09-22, paired) | Kearuga-calibrated export (1.27 GB vs 1.55 GB) with fidelity unchanged; ≈ 1 ms of a ≈ 113 ms cycle at M = 12, below the pre-registered +1 % ship gate. They stay BF16 in this release. |
| Aggressive Pruning (32K Vocabulary) | Negative net throughput | Acceptance degradation outweighed the memory bandwidth savings of a smaller draft head. |
| FP8 Quantized Draft Head | −18% throughput loss | Caused SGLang to diverge from the high-throughput native cuBLAS GEMM path. |
| Hardware Roofline Limit | 98.7% GPU utilization | Profiling confirms the GB10 streams ~25 GB weights/cycle at ~76% peak memory bandwidth. The remaining bottleneck is the target model's 2.54 GB BF16 lm_head (9% of cycle), requiring target-side optimization. |
🚀 Serving & Deployment Guide
Validated on pinned Docker container lmsysorg/sglang@sha256:616a3e97f45191af975896cfa644279096cb31bd408a071c2e99ca7209c3cafe, NVIDIA Driver 580, Tensor Parallelism tp = 1.
1. One-Command Launch (Serving Repository)
The simplest deployment method is using the turnkey launcher from the GitHub serving repo:
git clone https://github.com/0xWhiteMage/Qwen3.8-27B-Kearuga-SGLang-DGX-Spark-DFlash2
cd Qwen3.8-27B-Kearuga-SGLang-DGX-Spark-DFlash2
cp .env.sample .env
./start-dflash2.sh
- Automatically verifies hashes against
drafter/SHA256SUMSand launches with K=12 and the 64K draft head overlay. - To run the baseline profile instead, set
DRAFTER_PROFILE=stockin.env.
2. Standalone Docker Deployment Options
Option A: Plain SGLang (+7.9% C1 / +4.3% C4, Zero Code Modifications)
docker run --gpus all --shm-size 32g --ulimit memlock=-1:-1 --cap-add IPC_LOCK -p 8888:8888 \
-v ~/.cache/huggingface:/root/.cache/huggingface \
lmsysorg/sglang@sha256:616a3e97f45191af975896cfa644279096cb31bd408a071c2e99ca7209c3cafe \
python3 -m sglang.launch_server \
--model-path 0xWhiteMage/Qwen3.8-27B-Kearuga \
--served-model-name "Qwen3.8 27B Kearuga" --trust-remote-code \
--speculative-algorithm DFLASH \
--speculative-draft-model-path 0xWhiteMage/Qwen3.8-27B-Kearuga-DFlash2 \
--speculative-draft-model-quantization modelopt_fp4 \
--speculative-num-draft-tokens 12 \
--speculative-draft-window-size 2048 \
--attention-backend flashinfer \
--kv-cache-dtype bf16 --mamba-ssm-dtype bfloat16 \
--context-length 262144 --max-running-requests 4 --max-total-tokens 1048576 \
--mem-fraction-static 0.85 \
--host 0.0.0.0 --port 8888
Option B: With 64K Draft-Head Map & Overlay (+14.5% C1 / +10.8% C4)
Mount the 5 read-only overlay files over the container's sglang directory and provide the precomputed token map:
REPO=/path/to/Qwen3.8-27B-Kearuga-DFlash2 # Local clone of this model repository
OV=$REPO/sglang-overlay
docker run --gpus all --shm-size 32g --ulimit memlock=-1:-1 --cap-add IPC_LOCK -p 8888:8888 \
-v ~/.cache/huggingface:/root/.cache/huggingface \
-v $REPO:$REPO:ro \
-v $OV/sglang/srt/models/dflash.py:/sgl-workspace/sglang/python/sglang/srt/models/dflash.py:ro \
-v $OV/sglang/srt/speculative/dflash_worker_v2.py:/sgl-workspace/sglang/python/sglang/srt/speculative/dflash_worker_v2.py:ro \
-v $OV/sglang/srt/speculative/dflash_utils.py:/sgl-workspace/sglang/python/sglang/srt/speculative/dflash_utils.py:ro \
-v $OV/sglang/srt/speculative/dflash_head_utils.py:/sgl-workspace/sglang/python/sglang/srt/speculative/dflash_head_utils.py:ro \
-v $OV/sglang/srt/server_args.py:/sgl-workspace/sglang/python/sglang/srt/server_args.py:ro \
lmsysorg/sglang@sha256:616a3e97f45191af975896cfa644279096cb31bd408a071c2e99ca7209c3cafe \
python3 -m sglang.launch_server \
--model-path 0xWhiteMage/Qwen3.8-27B-Kearuga \
--served-model-name "Qwen3.8 27B Kearuga" --trust-remote-code \
--speculative-algorithm DFLASH \
--speculative-draft-model-path $REPO \
--speculative-draft-model-quantization modelopt_fp4 \
--speculative-num-draft-tokens 12 \
--speculative-draft-window-size 2048 \
--speculative-dflash-token-map $REPO/draft-vocab-v4-top65650.pt \
--attention-backend flashinfer \
--kv-cache-dtype bf16 --mamba-ssm-dtype bfloat16 \
--context-length 262144 --max-running-requests 4 --max-total-tokens 1048576 \
--mem-fraction-static 0.85 \
--host 0.0.0.0 --port 8888
- Startup Verification: Successful initialization prints confirmation in logs:
[kearuga-drafthead] loaded hot token map: rows=65650 … [kearuga-drafthead] draft head rows=65650 dtype=torch.bfloat16 bytes=672256000 fp8=False hot_map=True
3. Recommended Draft Block Size ($K$)
| Typical Concurrency / Workload | Recommended --speculative-num-draft-tokens | Operational Rationale |
|---|---|---|
| 1–2 Concurrent Streams (Code / Agentic / Math) | 12 (Default) | Verification is memory-bandwidth-bound at low batch size: additional draft tokens have minimal latency penalty while acceptance reaches 7–10 tokens/cycle. |
| 4 Concurrent Streams (Prose / General Chat) | 10 | At C4, K = 12 gives back ~1% on prose/IFEval without the overlay. With the 64K overlay active, K = 12 consistently outperforms stock BF16 K = 10 across all domains. |
| ≥ 8 Saturated Streams | 6–8 | Not measured on this hardware envelope (capped at 4 seats). DFlash acceptance tapers with large batch sizes, making smaller K optimal. |
📦 Model Files & Assets
| File Name | File Size | SHA-256 Checksum | Description & Scope |
|---|---|---|---|
| Release | — | v1.0 · 2026-09-17 | Drafter v1.0 = model.safetensors 9a39463f… + draft-vocab-v4-top65650.pt cadaee01… + sglang-overlay/ (hashes in MANIFEST.json); files revision 4a109695; served by serving stack v0.6.7 (v0.6.4 → v0.6.7 changed measurements, docs and the drafter-KV dtype default only) |
model.safetensors | 1.55 GB | 9a39463f…49da92 | 186 tensors: 35 NVFP4 packed weights + FP8 block scales + FP32 global/input scales; selector, fc, and conv projections in native BF16 |
config.json | 2.6 KB | 9004fc02…9ca60c2 | Hyperparameters: DFlash2DraftModel, dflash_config (block 16, taps [5,19,33,47,61], selector rank 256 / top-k 16), quantization_config |
hf_quant_config.json | 771 B | 1f611db1…16d3dff20 | ModelOpt NVFP4 quantization descriptor (group size 16, module exclusion rules) |
quantize_manifest.json | 20 KB | — | Detailed module-by-module scales (amax, weight_scale_2, input_scale), fusion groups, and source checkpoint commit hash |
draft-vocab-v4-top65650.pt | 527 KB | cadaee01…8e16bebc | PyTorch 1D int64 tensor containing 65,650 hot token IDs for --speculative-dflash-token-map |
draft-vocab-v4-top65650.json | — | — | Equivalent 65,650 hot token IDs exported as a portable JSON array |
sglang-overlay/ | — | MANIFEST.json | 5 SGLang runtime files (4 patched + 1 new), PATCH.diff, and verification checksums for the pinned Docker image |
SHA256SUMS | — | — | Canonical SHA-256 checksums for all repository files and assets |
Note: Speculative drafters do not package a tokenizer; SGLang automatically leverages the target model's tokenizer.
⚠️ Operational Notes & Limitations
- 🎯 Tuned for Kearuga: Distilled and calibrated specifically on Kearuga's activations. While architecturally compatible with other Qwen3.8-27B variants, acceptance on third-party targets has not been benchmarked.
- 🖥️ Hardware Prerequisite: NVFP4 Tensor Core acceleration requires an NVIDIA Blackwell architecture GPU (e.g., GB10 / SM121) and SGLang with
modelopt_fp4support. Validated ontp = 1. - 🎲 Greedy vs. Sampling: The paired bake-off statistics are greedy (
temperature 0). Model-default sampling (T 1.0 · top-p 0.95 · top-k 20) was measured on the production resident at −0.1 to −1.1 tokens/cycle vs greedy (table in §3, $n = 2$ per domain); thinking-on code drops to ≈ 3.1 tokens/cycle. Neither has been through the full 50-prompt paired battery. - 🔀 Near-Tie Continuation Divergence: Greedy continuations differ slightly from the stock drafter at near-tie logits (18/40 vs. 20/40 identical 32-token sequences vs. BF16). The target's underlying output distribution remains identical.
- 🧪 Offline evaluation caveat: the HF/z-lab reference DFlash loop is not lossless on this Gated-DeltaNet hybrid — transformers'
Cache.cropleaves rejected drafts in the recurrent state (huggingface/transformers#49036, z-lab/dflash#172) and inflates offline acceptance (1.9× in our 100-prompt diagnostic). Measure acceptance on SGLang, or snapshot and restore the recurrent states around each verify block. - 🔒 Digest-Pinned Overlay: The optional 64K overlay is verified against image
lmsysorg/sglang@sha256:616a3e97…. Confirm base hashes viasglang-overlay/MANIFEST.jsonbefore applying to other builds. - 📈 Benchmark Context: Performance was measured from a 50-prompt battery on one DGX Spark (GPU clock lock on or off made no measurable difference as the decode loop is memory-bandwidth bound); user prompts, sequence lengths, and cache states will vary.
🔗 Related Resources
- Target Model:
0xWhiteMage/Qwen3.8-27B-Kearuga— Tiered sensitivity hybrid-quantized production checkpoint - Serving Stack & Benchmark Repo:
0xWhiteMage/Qwen3.8-27B-Kearuga-SGLang-DGX-Spark-DFlash2— Production scripts and verification gates (v0.6.7;DRAFTER_PROFILE=kearugapins this drafter release) - Base Drafter & Architecture:
z-lab/Qwen3.8-27B-DFlash2— Block-diffusion speculative decoding - Quantization Reference:
maurienne-ai/Qwen3.8-27B-DFlash2-NVFP4-RTNcal— Reference NVFP4 calibrated layout - Author / Maintainer: The White Mage · @0xWhiteMage on X
🤝 Acknowledgements & Community Credits
This model builds upon key contributions across the open-source community:
Architecture, Base Weights & Benchmarks
- z-lab: For inventing DFlash block-diffusion speculative decoding and releasing the foundation
z-lab/Qwen3.8-27B-DFlash2weights. - Inco /
incoai/Qwen3.8-27B-DFlash2: For public per-task acceptance reference tables and technical analysis. - SGLang (LMSYS / RadixArk): For the high-throughput inference engine, spec-v2 worker, and overlap scheduling architecture.
- NVIDIA TensorRT Model Optimizer: For the standard ModelOpt NVFP4 quantization format.
Drafter Quantization Research
- maurienne-ai: For pioneering calibrated NVFP4 DFlash 2 and demonstrating that activation calibration prevents RTN acceptance collapse.
- tcclaviger: For multi-precision GB10 benchmarks demonstrating the bandwidth flattening curve past FP8/FP4.
- lued, josch15366, syvai, gratex, YourHighnessLA, TechPrototyper, Mia-AiLab: For extensive open quantization recipes, exclusion profiles, and acceptance notes.
Drafter Training & Adaptive-K Methods
- DaoCloud: For the 1.95B-token speculative training corpus and SpecForge training methodology.
- alphakek: For insights on target-distance and drafter adaptation on specialized models.
- mrchuy: For bootstrapping drafter research.
- AEON-7: For dynamic batch-aware K tapering architectures.
- sxuff: For GB10 hardware profiling and FP4 drafter acceleration proofs.
Foundational Research Papers
- FR-Spec: Zhao et al., Accelerating Large-Vocabulary Language Models via Frequency-Ranked Speculative Sampling, ACL 2025 (arXiv:2502.14856, thunlp/FR-Spec).
- Spec-AUF (arXiv:2607.01893), D-PACE (arXiv:2605.18810), and Draft-OPD (arXiv:2605.29343).
📜 Citation
@misc{kearuga-dflash2-2026,
title={Qwen3.8-27B-Kearuga-DFlash2: a Kearuga-distilled, Kearuga-calibrated NVFP4 DFlash 2 drafter with a frequency-pruned draft head for single-GPU DGX Spark serving},
author={0xWhiteMage},
year={2026},
publisher={Hugging Face},
url={https://huggingface.co/0xWhiteMage/Qwen3.8-27B-Kearuga-DFlash2}
}
📄 License
Released under the Apache 2.0 License. Derived from z-lab/Qwen3.8-27B-DFlash2 (Apache-2.0). The underlying base target model Qwen/Qwen3.8-27B is subject to Alibaba Cloud's original license terms.