Qwen3.8-27B-MIVFP4e-DFlash2 (BF16, SpinQuant $R_1$-Synced .miv)
SpinQuant $R_1$-synchronized BF16 (direct_bf16_v1) companion DFlash2 block-diffusion speculative draft model for scoltzero/Qwen3.8-27B-MIVFP4e, built for ninfer-metal on Apple M5+ Silicon (MTLGPUFamilyApple10+, Metal 4 NAX).
- GitHub & Runtime: https://github.com/scoltzero/ninfer-metal
- Upstream Draft Source:
z-lab/Qwen3.8-27B-DFlash2(5-layerDFlash2DraftModel,block_size=8,sliding_window=2048,target_layer_ids=[5, 19, 33, 47, 61]) - Required Target Model:
scoltzero/Qwen3.8-27B-MIVFP4e(becausedflash2.fc.weightis orthogonally projected with the target model's SpinQuant $R_1$ basis, pair exclusively withscoltzero/Qwen3.8-27B-MIVFP4e) - Quantized Sibling Draft Models (faster & smaller with
100%0-ULPVerify parity):scoltzero/Qwen3.8-27B-MIVFP4e-DFlash2-MIVFP4(1.27 GiB-64.6%,+7.9%β12.7%faster,-2.61 GiBUMA)scoltzero/Qwen3.8-27B-MIVFP4e-DFlash2-Q8(2.07 GiB-42.1%,45.43 dBSQNR,+4.9%β6.1%faster,-1.70 GiBUMA)
Packing & Apple M5 Ultra Optimizations
- Offline SpinQuant $R_1$ Orthogonal Absorption:
dflash2.fc.weightis pre-multiplied offline againstmiv_rotation_basis.safetensors(spinquant.r1) fromscoltzero/Qwen3.8-27B-MIVFP4e, preserving exact draft hidden-state alignment with zero runtime rotation overhead. - Lossless
direct_bf16_v1Layout: All81tensors packed into a single zero-copy.mivcontainer (3.585 GiB/3.849 GB). - Strict Target-KV Isolation &
> 256K / 1MLocal Position Re-Anchoring: DFlash2's2,048-token sliding-window ring KV is isolated fromActKV-Lite/KVMemtarget eviction. When target logical positions exceed262,144(512K / 1M underDynamic YaRN),omlx_m5_draft_cache_reanchor_rope(0 Bregister spill,0 BTG SRAM on Apple10) smoothly re-anchors draft RoPE coordinates back inside[0, 2048)with zero degradation in draft acceptance.
Verified Apple M5 Ultra Benchmarks (Paired with scoltzero/Qwen3.8-27B-MIVFP4e)
Apples-to-Apples Draft Comparison (affine4_g128, 3-prompt 256-tok greedy)
| Speculator | Draft Disk Size | Avg Decode | Peak Decode (Coding / Reasoning / Structured) | Acc / Round (Rate) | Peak UMA | 0-ULP Verify Parity |
|---|---|---|---|---|---|---|
AR (none) |
β | 59.54 tok/s |
59.59 (59.6 / 59.5 / 59.5) |
β | 15.88 GiB |
(T=1 QMV baseline) |
| Native MTP (embedded) | 0 B |
107.78 tok/s |
113.22 (113.2 / 110.2 / 99.9) |
1.75 (48.9%) |
16.27 GiB |
100% (== BF16 == Q8 == MIVFP4) |
DFlash2 (BF16, $R_1$) |
3.585 GiB (3.85 GB) |
110.94 tok/s |
121.03 (121.0 / 116.4 / 95.4) |
2.12 (30.9%) |
20.47 GiB |
100% (3/3 bit-exact) |
DFlash2-Q8 (8.5 bpw, $R_1$) |
2.074 GiB (-42.1%) |
116.38 tok/s (+4.9%) |
125.17 (125.2 / 123.7 / 100.3) |
2.08 (30.3%) |
18.77 GiB (-1.70 GiB) |
100% (3/3 bit-exact) |
DFlash2-MIVFP4 (4.5 bpw, $R_1$) |
1.268 GiB (-64.6%) |
119.71 tok/s (+7.9%) |
127.62 (127.6 / 127.6 / 103.9) |
2.00 (29.1%) |
17.86 GiB (-2.61 GiB) |
100% (3/3 bit-exact) |
Controlled A/B Benchmark Suite (position_coupled_v1, 723 affine_nax kernels 0 B spill)
Draft Variant (position_coupled_v1, T=0, D=7) |
Draft Size | Dim B/C (tok/s) |
Draft Latency | avg_acc |
Dim D B=1 / 2 / 4 (tok/s) |
Dim E 64K | UMA Footprint |
|---|---|---|---|---|---|---|---|
DFlash2 (BF16 + R1) |
3.58 GiB |
134.63 |
6.03 ms |
2.5581 |
121.34 / 195.15 / 239.48 |
33.32 |
20.03 GiB |
DFlash2-Q8 (Q8 + R1) |
2.07 GiB (-42.1%) |
142.88 (+6.1%) |
4.41 ms (-26.9%) |
2.5581 (Ξ 0.0000) |
126.90 / 199.17 / 241.14 |
33.90 |
18.33 GiB (-1.70 GiB) |
DFlash2-MIVFP4 (MIVFP4 + FWHT64 + R1) |
1.27 GiB (-64.6%) |
151.72 (+12.7%) |
2.92 ms (-51.6%) |
2.6085 |
132.56 / 205.41 / 254.85 |
35.50 (+6.5%) |
17.42 GiB (-2.61 GiB) |
Long-Context Scaling (64K / 128K / 512K / 1M)
Scenario (affine4_g128) |
Prefill (tok/s) |
Decode (tok/s) |
Peak UMA | NIAH |
|---|---|---|---|---|
64K (65,573 tok, actkv_lite B=8K) |
34.53s (1,899) |
124.39 T1 / 157.82 T2 (+24.1% vs off) |
26.65 GiB |
3/3 T1 | 2/2 T2 |
128K (131,109 tok, kvmem_actkv B=16K) |
95.60s (1,371) |
97.97 T1 / 140.68 T2 (+20.5% vs off) |
34.15 GiB |
3/3 T1 | 2/2 T2 |
512K (505,626 tok, 2.0x YaRN + actkv_lite) |
223.9s (2,258) |
97.2 T1 / 180.5 T2 (159.4 ms T2 TTFT) |
21.72 GiB |
3/3 T1 | 3/3 T2 |
1M (1,024,032 tok, 4.0x YaRN + kvmem_actkv) |
479.0s (2,138) |
99.7 T1 / 171.3 T2 (373.0 ms T2 TTFT) |
22.58 GiB |
3/3 T1 | 3/3 T2 |
SpinQuant $R_1$ Pairing & Checksums
- Draft
model.miv(3.585 GiB / 3.849 GB) SHA-256:2d1efe1a4f7db410c5bddc245d6c8c9ed68c6263897489bbb00dc2710acd550d - Paired Target
scoltzero/Qwen3.8-27B-MIVFP4emodel.miv(vision-preserved rebuild) SHA-256:c1dec49d8851c27e23756ae82ef6396c4a77fa4232d07a6577be37a90f265e3b - Paired Target
miv_rotation_basis.safetensors(spinquant.r1) SHA-256:9ff1a822c5f70597c6189f67caff763d1286afdea10fda368183ecdb92e489ae
Usage (ninfer-metal-serve)
./serve/scripts/start_ninfer_serve.sh /path/to/Qwen3.8-27B-MIVFP4e \
--spec-backend dflash2 --draft-dir /path/to/Qwen3.8-27B-MIVFP4e-DFlash2 \
--max-context 1048576 --kv-dtype affine4_g128 \
--kv-accel-mode kvmem_actkv --actkv-budget-tokens 16384 --actkv-reserve-tokens 2048 \
--kvmem-disk-gb 32 --kvmem-recall-top-pages 16 --rope-scaling-mode dynamic_yarn
- Downloads last month
- 45
Inference Providers NEW
This model isn't deployed by any Inference Provider. π Ask for provider support