Qwen3.8-27B-MIVFP4e-DFlash2-MIVFP4 (4.5 bpw NAX-Pretiled MIVFP4 + AWQ + FWHT-64, SpinQuant $R_1$-Synced .miv)
Fastest & most compact companion DFlash2 block-diffusion speculative draft model for scoltzero/Qwen3.8-27B-MIVFP4e, quantized to mivfp4_gauss_g64_s16_v1 (4.5 bpw, 1.268 GiB / 1.362 GB) with offline SpinQuant $R_1$ absorption, coupled up_proj <-> down_proj AWQ smoothing across all 5 layers, and local FWHT-64 incoherence transforms for ninfer-metal.
Compared to the 3.58 GiB BF16 draft (scoltzero/Qwen3.8-27B-MIVFP4e-DFlash2), DFlash2-MIVFP4 cuts artifact size by 64.6% (2.83x smaller!), saves -2.61 GiB UMA, slashes draft latency by -51.6% (6.03 ms -> 2.92 ms), and accelerates end-to-end M5 Ultra decode by +7.9% to +12.7% while maintaining 100% 0-ULP bit-exact Verify parity.
- 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(paired via SpinQuant $R_1$ basis) - Sibling Draft Models:
scoltzero/Qwen3.8-27B-MIVFP4e-DFlash2-Q8(2.07 GiB8.5 bpw,45.43 dBSQNR,Ξ 0.0000avg_acc)scoltzero/Qwen3.8-27B-MIVFP4e-DFlash2(3.58 GiBlossless BF16 reference)
Quantization Methodology (dflash2_mivfp4)
Packed offline via encoder/m5_mivfp4_quantize.py (rotate_companion_dflash2_checkpoint(..., dflash2_quant="mivfp4")) and packer/m5_artifact.py:
- Offline SpinQuant $R_1$ Sync: Absorbs
miv_rotation_basis.safetensors(spinquant.r1,5120x5120) fromscoltzero/Qwen3.8-27B-MIVFP4edirectly intodflash2.fc.weightbefore quantization (spinquant_r1_applied: true). - Coupled AWQ Smoothing + Local
FWHT-64: Applies exact coupledup_proj <-> down_projAWQ smoothing across all5draft layers (awq_smoothed_layers: 5) and local register-levelFWHT-64on all10o_proj&down_projprojections (fwht64_objects: 10). - 4-bit NAX-Pretiled
mivfp4_gauss_g64_s16_v1: Quantizes all36large projections intomivfp4_nax_lane_g64_v2(4.5 bpw,21.69 dBaggregate SQNR,1.268 GiB/1.362 GBtotalmodel.mivv2, zero zero-pointraoverhead), while preserving all45norms,attention_conv.*,mlp_conv.*, andcandidate_selector.*tensors in losslessdirect_bf16_v1. - Apple M5 Ultra Optimizations: Fused ZRAM
mivfp4concat kernels (try_mivfp4_zram_concat) cut draft step latency by51.6%(2.92 ms), full> 256K / 1Mlocal sliding-window RoPE re-anchoring (omlx_m5_draft_cache_reanchor_rope,0 Bspill), and strict isolation from targetActKV-Lite/KVMempage eviction.
Verified Apple M5 Ultra Benchmarks (80-GPU / 256 GiB, affine4_g128)
Apples-to-Apples Draft Comparison (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 Dynamic YaRN +
KVMemVerification (95,985tok,orig_max=32K -> 4.0xYaRN,kvmem_actkvB=8K, R=2K): Passed3/3(100%) Multi-Needle NIAH (10% / 50% / 90%) in39.4 sTTFT,127.1 tok/sdecode (+6.4%faster thanDFlash2-Q8's119.4 tok/s, identical4.17acc/round!),1,389stream-evicted pages,1,573.5 MBNVMe offloaded,16Quest-recalled pages,18.97 GiBpeak UMA (-0.90 GiBvsDFlash2-Q8).
SpinQuant $R_1$ Pairing & Checksums
- Draft
model.miv(1.268 GiB / 1.362 GB) SHA-256:eb4e56ed3abc5dd1652cc47db30a2b7cf0d9b813db638fccdd05b52733694524 - 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-MIVFP4 \
--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
- 39