Qwen3.8-27B-DSpine-b16-GGUF

aj9o9/Qwen3.8-27B-DSpine-b16-GGUF

作者
aj9o9
任务
文本生成
下载量
2,002
点赞数
32
趋势分
31
许可证
apache-2.0
收录时间
2026/11/10

license: apache-2.0 base_model:

  • tencent/Qwen3.8-27B-DSpine-b16 base_model_relation: quantized pipeline_tag: text-generation library_name: gguf tags:
  • gguf
  • llama.cpp
  • dspine
  • dflash
  • speculative-decoding
  • draft-model
  • qwen3.8

Qwen3.8-27B-DSpine-b16 GGUF

GGUF conversions of tencent/Qwen3.8-27B-DSpine-b16, the DSpine speculative-decoding draft model for Qwen3.8-27B, for use with llama.cpp.

On a single RTX 3090 with a Q4_K_M Qwen3.8-27B target, it runs at ~125 tok/s on code and math and ~90 tok/s on a mixed set of chat tasks. That compares with ~52 tok/s for DFlash2 and ~28 tok/s without speculative decoding (3.2x overall, up to 4.5x on code). See Benchmarks for speed at increasing context depth and the maximum context on 24 GB.

The speedup depends on your GPU and backend. Community results from AMD, Intel and DGX Spark are in Other GPUs and tuning, so check it before you start.

DSpine benchmarks on an RTX 3090: decode speed at increasing context depth, test machine and maximum context

[!IMPORTANT] Upstream llama.cpp does not support DSpine yet. These files need the dspine branch of this fork: https://github.com/Ajay9o9/llama.cpp/tree/dspine

The branch is current llama.cpp master plus DSpine support. Stock llama.cpp refuses to load these files rather than running them incorrectly.

Files

FileSizeNotes
Qwen3.8-27B-DSpine-b16-Q4_K_M.gguf1.26 GBRecommended. The code-bridge tensors stay in BF16.
Qwen3.8-27B-DSpine-b16-Q8_0.gguf2.20 GBSame acceptance as Q4_K_M, but slightly slower and uses more VRAM.
Qwen3.8-27B-DSpine-b16-BF16.gguf4.06 GBFull precision, for re-quantizing.

These files contain the draft model only. You also need a Qwen3.8-27B target GGUF, such as Q4_K_M.

What DSpine is

DSpine extends DFlash. It is a five-layer drafter that reads hidden states from five layers of the target model and drafts a block of 16 tokens in parallel. It adds three things:

  • Causal block attention. Each draft position attends only to earlier positions in its block.
  • A code bridge after every layer. Each position receives a gated message built from its predecessor's predicted token code. This passes causal dependencies through the depth of the network.
  • Serial last-write refinement. For the top 16 candidates at each position, the drafter redoes the last bridge write using each candidate predecessor's exact code. This produces a 16x16 transition table per position. The speculative decoder walks the table from the last accepted token to pick the draft chain, either greedily or by sampling.

See the paper and the original model card for details.

Build

git clone -b dspine https://github.com/Ajay9o9/llama.cpp.git
cd llama.cpp
cmake -B build -DGGML_CUDA=ON
cmake --build build --config Release -j

Run

./build/bin/llama-server \
  -m  Qwen3.8-27B-Q4_K_M.gguf \
  -md Qwen3.8-27B-DSpine-b16-Q4_K_M.gguf \
  --spec-type draft-dflash \
  --spec-draft-n-max 15 \
  -ngl 999 --spec-draft-ngl 999 \
  -fa on --jinja -c 32768 -np 1 \
  --cache-type-k q8_0 --cache-type-v q8_0 \
  --spec-draft-type-k q8_0 --spec-draft-type-v q8_0
  • Set --spec-draft-n-max yourself. The default is 3, which uses only a fraction of the 16-token block. 15 is the best value on NVIDIA CUDA, but on some GPUs a smaller value is faster. See Other GPUs and tuning.
  • Set -c yourself instead of relying on auto-fit. Auto-fit does not leave enough room for the drafter, and with a vision projector (--mmproj) loaded the first image request can crash. If the log shows failed to allocate ... using host copies, lower -c.
  • --spec-draft-sampling probabilistic is optional. It samples the draft chain from the transition table, and helps slightly at temperature > 0.
  • Context on a 24 GB card: with a Q4_K_M target and q8_0 KV cache, DSpine at 15 drafted tokens fits up to -c 65536. For more context, lower --spec-draft-n-max (at 7 it fits up to -c 98304), use a smaller target quant, or use a larger GPU. See Maximum context.
  • On 24 GB cards with -np 2, use --spec-draft-n-max 7. Two slots with 15-token drafts do not fit.

Other GPUs and tuning

How fast DSpine is depends on how quickly your GPU can verify a block of 16 tokens at once. On an RTX 3090 that step is cheap, so long drafts pay off. On GPUs where small batches are slow, a 15-token draft can cost more than it saves.

[!NOTE] Community results. Except for the RTX 3090 row, these numbers were measured and shared by community members on their own hardware, not by me. Each one used its own prompts, settings and baseline (some compare against no speculation, some against MTP or DFlash2), so treat the rows as a guide rather than a direct comparison. Each row links to the full report. Thank you to everyone who tested!

GPUBackendBest n-maxResultReported by
RTX 3090, 24 GBCUDA1590 tok/s on mixed tasks, 3.2x without speculation; 129 tok/s on codeMe, benchmarks below
DGX Spark (GB10), 128 GB unifiedCUDA15Code 76.7 tok/s vs 61.3 for DFlash2. DFlash2 is faster on math, prose and summariesCommunity: Alpaczyk (#2)
Radeon AI PRO R9700, 32 GBROCm / HIP15 (7 was slower)Code about 2.2x faster than the target's MTP, tool calls 3.4x. Prose, chat and images 4-23% slower than MTPCommunity: menace1000 (#3)
Intel Arc Pro B65, 32 GBSYCL15 (3 for prose)Code 116.4 tok/s (5.5x without speculation), tool-call JSON 124.3 (5.9x), math 74.0 (3.5x). Prose is best at 3: 36.2 (1.7x)Community: ashokkumards (#4)
RX 7800 XT, 16 GBVulkan (RADV)247.4 tok/s vs 30.9 without speculation (1.53x). n-max 15 dropped to 19.1Community: howdya (#1)

What to do:

  • Sweep --spec-draft-n-max on your own prompts: try 2, 3, 4, 7 and 15. Starting points:
    • NVIDIA (CUDA), AMD on ROCm / HIP and Intel Arc on SYCL: 15.
    • AMD on Vulkan: 2 or 3.
    • Mostly prose or chat: try 3. Draft acceptance on prose is low, so long drafts are mostly rejected.
  • DSpine is strongest on code, math and tool calls. For prose, chat and image-heavy requests, DFlash2 or the target's built-in MTP (--spec-type draft-mtp --spec-draft-n-max 2, needs a target GGUF that includes the MTP layer) can be faster, especially on slower GPUs.
  • Multiple GPUs: a two-device layer split (the default) was tested and gives the same output as one GPU. Qwen3.8 keeps a copy of its recurrent state for every drafted token, so if one card runs out of memory, lower --spec-draft-n-max or -c.
  • Output can differ from runs without a drafter, even at temperature 0. Verification processes several tokens in one batch, which rounds slightly differently from one token at a time, so near-tied tokens can flip. Code and tool calls usually match; prose and image descriptions can diverge.

If you test on other hardware, please open a discussion with your numbers.

Benchmarks

All numbers were measured on the setup below:

GPURTX 3090, 24 GB (all layers on GPU, --fit off)
CPURyzen 9 9900X
llama.cppdspine branch of Ajay9o9/llama.cpp, CUDA build
TargetQwen3.8-27B-Q4_K_M.gguf (17.1 GB)
KV cacheq8_0 for both target and drafter, -fa on
Slots-np 1
Draft sizesDSpine --spec-draft-n-max 15, DFlash2 --spec-draft-n-max 7 (each drafter's block size minus one)

Maximum context on 24 GB

For each setup, this is the largest -c that loads entirely on the GPU and serves requests with the q8_0 KV cache.

SetupMax -c
No speculative decoding176,128
DFlash2 Q4_K_M, 7 drafted102,400
DSpine Q4_K_M, 15 drafted65,536
DSpine Q4_K_M, 7 drafted98,304
DSpine Q8_0, 15 drafted40,960

The limit comes from the target, not the drafter. Both drafters use a sliding-window KV cache (8k for DSpine), so their own cache stays small. Qwen3.8 is a hybrid model with recurrent layers, though. While it verifies a draft, it keeps a copy of its recurrent state for every drafted token, which comes to about 150 MB per copy. A 16-token DSpine block therefore costs about 1.2 GB more than an 8-token DFlash2 block, and that VRAM comes out of the context budget.

Speed at increasing context depth

These numbers come from llama-benchy, with --pp 0 --tg 256 --runs 1. The context is filled to each depth, and the table shows decode speed for 256 new tokens, in tok/s. Each setup ran with -c set to its maximum, and the last row for each setup is just below that maximum. A dash means the depth does not fit for that setup on 24 GB.

Default corpus (a Sherlock Holmes novel; the model writes prose)

DepthNo speculationDFlash2 (7)DSpine Q4_K_M (15)
029.531.648.0
8,19228.126.635.6
16,38426.226.135.5
32,76823.828.031.1
63,488--35.5
65,53619.523.0-
100,352-25.9-
131,07214.6--
174,08012.5--

Code corpus (llama.cpp C++ sources as context; the model mostly explains the code)

DepthNo speculationDFlash2 (7)DSpine Q4_K_M (15)
028.032.941.6
8,19227.428.435.2
16,38425.625.432.8
32,76822.826.629.5
63,488--47.8
65,53619.122.3-
100,352-24.0-
131,07214.5--
174,08012.2--

Prefill speed for the default corpus, in tok/s:

DepthNo speculationDFlash2 (7)DSpine Q4_K_M (15)
8,1921,1151,092969
32,768975910859
65,536835795741 (at 63,488)
131,072645--

Each cell is a single run of 256 tokens. Prose and code explanations are the hardest content to draft, so expect noise of a few tok/s. On these corpora the drafters average only about 2.5-3.5 tokens per verify step.

Speed by task (short context)

This test used 10 chat prompts, 2 each of math, writing and summarize/translate, plus 4 code prompts in Python, C++, JavaScript and SQL. Each prompt generated up to 1,024 tokens with thinking disabled, about 6,000 tokens per setup. Temperature 1 used top_p 0.95, top_k 20 with probabilistic draft sampling.

SetupTemperature 0 tok/sSpeedupTemperature 1 tok/sSpeedup
No speculative decoding28.21.00x28.21.00x
DFlash2 Q4_K_M, 7 drafted51.71.83x50.61.79x
DSpine Q4_K_M, 15 drafted90.13.19x80.42.85x
DSpine Q8_0, 15 drafted86.33.06x--

DSpine Q4_K_M at temperature 0, by task:

Tasktok/sTokens per verify stepDFlash2 tok/s
Code128.77.663.3
Math122.87.364.2
Summarize / translate62.03.643.0
Prose / story41.62.530.2

Summary: On the RTX 3090, DSpine roughly doubles DFlash2's gain on code and math at short context, and it is still the fastest at every depth it fits. Its trade-off on a 24 GB card is context: about 64k at 15 drafted tokens, compared with about 100k for DFlash2 and 176k without speculation.

Convert it yourself

From the dspine branch:

python convert_hf_to_gguf.py /path/to/Qwen3.8-27B-DSpine-b16 \
  --target-model-dir /path/to/Qwen3.8-27B \
  --outtype bf16 --outfile Qwen3.8-27B-DSpine-b16-BF16.gguf

./build/bin/llama-quantize Qwen3.8-27B-DSpine-b16-BF16.gguf Qwen3.8-27B-DSpine-b16-Q4_K_M.gguf Q4_K_M

--target-model-dir must point to the target model's config.json and tokenizer files. The target's weights are not needed.

License and credit

The weights are from tencent/Qwen3.8-27B-DSpine-b16, released under Apache-2.0. All credit for the model goes to the DSpine authors.

@article{zhang2026dspine,
  title   = {Draft in Parallel, Condition Through Depth: Adjacent Causal Injection for Speculative Decoding},
  author  = {Zhang, Haohui and Chen, Keyu and Sun, Haocheng and Gu, Weibo and Qiao, Ruizhi and Sun, Xing and Jiang, Bo},
  journal = {arXiv preprint arXiv:2609.36173},
  year    = {2026}
}

内容来源:Hugging Face 模型卡

在 Hugging Face 查看