Qwen3.8-27B-DSpine-b16 · HQ4_G32_M5 · Qwegn native pack

A native weight pack for the Qwegn inference engine, a Swift + Metal 4 runtime for Apple Silicon. A 1.56 GiB block-causal DSpine drafter (arXiv:2609.36173, B = 2..16) that accelerates Qwen3.8-27B decode on Qwegn to 100.5 tok/s geomean (3.09× serial), 144.1 tok/s server streaming, and 148.0 tok/s peak (4.19× serial, up to 12.70 accepted tokens/round) with 100% bit-exact greedy parity.

Qwen3.8-27B + DSpine-b16 speculative decoding and 1M LSA profile on Qwegn

Qwen3.8-27B 64K-1M Long-Context Prefill and Decode Scaling on Qwegn

This pack uses Qwegn's own QWP1 container and loads only in Qwegn. It is not a safetensors, GGUF or MLX checkpoint.

At a glance

Property Value
Upstream model tencent/Qwen3.8-27B-DSpine-b16 @ ea909c0f
Parameters 2.03 B
Architecture 5-layer block-causal DSpine drafter (block_size = 16, D <= 15 drafts/round, 5120 hidden, 32Q / 8KV GQA, 8,192 sliding window, target hidden fusion [1, 16, 31, 46, 61], 248,320 × 1,024 selected-prefix code bridge rank = 512, and topK = 16 exact-sender serial refinement tail); drafts for Qwen3.8-27B
Pack size 1.56 GiB
Weights HQ4_G32_M5 + BF16, 6.61 bits/param
Native context 8,192-token drafter sliding window (max_position_embeddings = 262,144); drafts B = 2..16 blocks for Qwen3.8-27B
LSA / Sparse Attention — (8,192 sliding-window drafter; target Qwen3.8-27B-QWP_4 carries model.qlsa)

Performance on Qwegn

Apple M5 Max (Mac17,6, 128 GB unified memory, 40-core GPU, 585 GB/s), macOS 26+; llmprobe v0.6.16–v0.6.17, --kv-mode q4 --temperature 0.

Metric Result
Target qwegnai/Qwen3.8-27B-QWP_4
Target serial decode baseline 32.1–32.9 tok/s
Speculative decode — peak (B = 8–16) 148.0 tok/s (144.1 tok/s serve · 134.5 tok/s B = 8 v0.14, 4.19× serial, τ = 7.47 tok/round, 92.4% accept)
Speculative decode — default (B = 6, --mtp-drafts 5, 3-workload geomean) 100.5 tok/s (3.09× serial)
Speculative decode — algorithm code / technical prose (B = 6) 93.9 tok/s (2.86×) · 83.3 tok/s (2.54×)
Speculative decode — max block horizon (B = 16, --mtp-drafts 15) 118.5 tok/s (τ = 12.70 tok/round, 83.3% accept)
Prefill / Cold TTFT / Warm-cache TTFT 1,043 tok/s @4K (801 serve · 850–914 @10K–64K) · 94 ms · 7–29.3 ms (2.23M–2.33M tok/s @65.5K)
Core reasoning / Code eval 8 / 10 (80%) · 9 / 10 Code-10
Greedy parity vs serial target (B = 6..16) 100% bit-exact SHA-256 token-stream identity

DSpine throughput and acceptance lengths (τ accepted tokens per verification round, including the bonus token) come from paired, interleaved A/B sweeps against serial Qwen3.8-27B-QWP_4 across B ∈ [6, 16] on Apple M5 Max 128 GB (--kv-mode q4 --temperature 0), verified with 100% bit-exact SHA-256 greedy output parity. Results vary with prompt domain, block size, and thermals.

Block-Causal DSpine Architecture & Qwegn Metal 4 Execution

Unlike non-causal block-diffusion drafters, DSpine (arXiv:2609.36173) propagates predicted predecessor representations across adjacent draft positions as depth advances, sustaining high acceptance up to 16-token blocks (D = 15 drafts/round):

Subsystem Architecture & Qwegn Metal 4 Kernel Execution
5-layer target feature fusion Extracts hidden states from target Qwen3.8-27B layers [1, 16, 31, 46, 61] and fuses 5 × 5,120 → 5,120 via fc.weight (HQ4_G32_M5) + hidden_norm
5-layer GQA decoder 5,120 hidden, 17,408 SwiGLU intermediate, 32Q / 8KV GQA (head_dim = 128, QK-RMSNorm, rope_theta = 10,000,000), 8,192-token sliding window
Selected-prefix code bridge Per-layer causal predecessor propagation across code_size = 1,024 (248,320 × 1,024 BF16 codebook) and rank = 512 (early_read_weights, read_weight, feature_write_weights, gated recurrence qwg_dspine_bridge_state + qwg_dspine_bridge_write_add)
Exact-sender refinement tail Second-pass topK = 16 serial score table (code_bridge_second_pass, first_exact = 4) executed entirely on GPU via qwg_dspine_refine_code_to_msg, qwg_dspine_refine_write, qwg_dspine_refine_scores, and qwg_dspine_refine_chain
M <= 16 target verification Widened target verification (B ∈ [2, 16], D ∈ [1, 15]) using balanced two-half (c0, c1) row-paired HQ4/AQ4 dispatches and 16-row QWGDNReplayCheckpoint Gated-DeltaNet rollback with 100% bit-exact greedy parity

Choosing the draft horizon (--mtp-drafts)

Setting Block size B Measured M5 Max profile (Qwen3.8-27B-QWP_4 target)
--mtp-drafts 5 (default) B = 6 (5 drafts) 100.5 tok/s 3-workload geometric mean (3.09× serial: 93.9 tok/s algorithm code, 83.3 tok/s technical prose)
--mtp-drafts 7 B = 8 (7 drafts) 134.5–148.0 tok/s peak (144.1 tok/s serve, 4.19× serial, τ = 7.47 accepted tokens/round, 92.4% accept)
--mtp-drafts 15 B = 16 (15 drafts) 118.5 tok/s at full trained horizon (τ = 12.70 accepted tokens/round, 83.3% accept)

Latent Sparse Attention

This drafter uses its native 8,192-token sliding-window KV cache and carries no LSA sidecar. The target qwegnai/Qwen3.8-27B-QWP_4 ships a model.qlsa sidecar, and passing --lsa-mode auto enables Latent Sparse Attention on the target's 16 full-attention layers up to 1M tokens. The 64K–1M LSA figures shown in the overview graphic are target-model measurements, not 1M-context DSpine runs.

Quantization: HQ4_G32_M5

6.61 bits per parameter overall. Quantized linear layers use HQ4_G32_M5: each group of 32 weights is rotated by an orthonormal Walsh–Hadamard transform, then stored as 4-bit codes with an FP16 scale and bias (20 bytes per 32 weights = 5 bits per weight).

Tensor class Share of parameters
HQ4_G32_M5 — 5-layer GQA/SwiGLU projections & 5×5120 → 5120 feature fusion (fc) 85.4%
BF16 — 248,320 × 1,024 selected-prefix codebook, bridge read/write/gate weights & RMSNorms 14.6%

Why this format

  • The rotation spreads outliers. A Hadamard rotation mixes each group so one large weight no longer dictates the scale of the other 31. That keeps 4-bit error low without any calibration data.
  • The rotation is fused into the kernels. Qwegn applies the fast Walsh–Hadamard transform to activations inside GEMV/GEMM, avoiding a separate unpacked weight buffer. The arithmetic is not literally free.
  • BF16 stays only where it costs little bandwidth. The 248,320 × 1,024 selected-prefix codebook is row-gathered by token ID (never streamed per step), while the low-rank code-bridge read/write/gate matrices and RMSNorms are small and govern adjacent causal feature propagation across draft slots, so keeping them in BF16 preserves full draft acceptance without bandwidth penalty.

Speed impact on Qwegn

Single-stream decode on Apple Silicon is memory-bandwidth-bound: every generated token streams the active weights once. Shrinking those bytes raises the speed ceiling almost proportionally.

HQ4_G32_M5 BF16 (same model)
Nominal drafter weight scan (est.; not per target token) 1.16 GB 3.55 GB
Bandwidth-only full weight scans/s (not decode tok/s) 502 165

HQ4_G32_M5 reads approximately 3.1× fewer active-weight bytes per token than BF16. These are analytical bandwidth ceilings, not measured BF16 speedups. Attention, routing, activation transforms, KV traffic and speculative verification add work. No paired BF16 quality/speed evaluation is reported here. Embeddings are excluded from the bytes-per-token figures (one row gathered per token). DSpine's 248,320 × 1,024 selected-prefix codebook (0.51 GB in BF16) is also excluded from streamed bytes per pass because Qwegn gathers only active token/candidate rows (qwg_dspine_bridge_state and qwg_dspine_refine_code_to_msg) rather than scanning the table. DSpine drafts blocks in parallel and verifies them on the target; weight-scan ceilings above are not end-to-end output-token rates (measured target-plus-drafter throughput is 100.5 tok/s geomean at B = 6, 144.1 tok/s serve, and 148.0 tok/s peak (134.5 tok/s at B = 8)).

Quick start

Install Qwegn from https://github.com/qwegnai/qwegn, then:

qwg pull qwegnai/Qwen3.8-27B-QWP_4
qwg pull qwegnai/Qwen3.8-27B-DSpine-b16-QWP_4

# OpenAI / Anthropic / Ollama server with DSpine (default B=6 / --mtp-drafts 5; supports 1..15)
qwg serve ~/.qwg/models/Qwen3.8-27B-QWP_4 \
  --kv-mode q4 --lsa-mode auto \
  --mtp-backend dspine --dflash-draft-pack ~/.qwg/models/Qwen3.8-27B-DSpine-b16-QWP_4 --mtp-drafts 5

# Interactive REPL (auto-discovers ~/.qwg/models/Qwen3.8-27B-DSpine-b16-QWP_4 when --mtp-backend dspine is set)
qwg repl --model Qwen3.8-27B-QWP_4 --kv-mode q4 --mtp-backend dspine --mtp-drafts 7

Or download with the Hugging Face CLI: hf download qwegnai/Qwen3.8-27B-DSpine-b16-QWP_4 --local-dir ~/.qwg/models/Qwen3.8-27B-DSpine-b16-QWP_4.

Requirements

  • macOS 26+ on Apple Silicon; M5-class GPUs (Apple10) enable the NAX cooperative-tensor prefill path
  • Unified memory for the 1.56 GiB mapped pack (plus the 18.40 GiB Qwen3.8-27B-QWP_4 target pack), runtime buffers and KV cache; all reported measurements used a 128 GB Mac
  • Qwegn 0.12.0 or newer

Files

File Contents
model.qwp Weights in Qwegn's QWP1 container (tensor index at the end of the file)
model.qwp.sha256 SHA-256 of model.qwp
README.md This model card
media/ Per-model Qwegn infographic (SVG + PNG)
LICENSE Upstream model license
assets/ Upstream drafter config.json, README.md and LICENSE; manifest.json lists their SHA-256 (tokenization uses the target model's assets)

License and attribution

Apache-2.0, inherited from the upstream model. Weights are derived from tencent/Qwen3.8-27B-DSpine-b16 by Qwegn's quantizer; all credit for the model belongs to its original authors. Measurements were taken by the Qwegn team on the hardware listed above and will vary with chip, memory and thermals.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for qwegnai/Qwen3.8-27B-DSpine-b16-QWP_4

Base model

Qwen/Qwen3.8-27B
Quantized
(6)
this model

Paper for qwegnai/Qwen3.8-27B-DSpine-b16-QWP_4