Instructions to use cfontes/qwen3.8-27b-mlx-dflash2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use cfontes/qwen3.8-27b-mlx-dflash2 with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] huggingface-cli download --local-dir qwen3.8-27b-mlx-dflash2 cfontes/qwen3.8-27b-mlx-dflash2
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Atomic Chat
M5 Max results — DFlash2 transfers to differently-quantized targets, 1.5–1.9x measured (corrected)
Corrected 2026-08-22. The first version of this post reported that the repo's dense
baseline understates dense throughput by ~35%, that mxfp4 gets no speedup on this chip, and
that the gain shrinks on faster silicon. All three were measurement artifacts and are
wrong. A 37 GB workload was resident on the GPU during that run, and a later run drifted
25% from thermal throttling. What follows is a clean re-measurement. Details of the error
are in the comment below.
M5 Max results — DFlash2 works on differently-quantized targets, 1.5–1.9× measured
Hardware: Apple M5 Max, 128 GB, macOS 26.4.1, MLX 0.32.0 / mlx-lm 0.31.3.
Three targets, all qwen3_5 / 64 layers / hidden 5120:
mlx-community/Qwen3.8-27B-mxfp4— stock, mxfp4 group 32Qwen3.8-27Babliterated via Heretic (Optuna search,
0 refusals, KL 0.0535) — MLX affine 4-bit group 64tozp/Qwen3.8-27B-OBLITERATED-V2-mlx-4bit(SVD + LEACE blend, MMLU −0.28pp) — same
affine 4-bit g64
Protocol
Nine measurements, interleaved across models, 90 s cooldown before each, one dense
and one DFlash2 run per visit from a single model load. Dense measured withmlx_lm.generate.stream_generate. Greedy, 300 tokens, the bench/test_dflash2.py LRU
prompt. GPU verified idle (oMLX loaded_count=0, GPU memory < 8 GB) before starting.
Results — medians of 3, with the per-round values
| target | dense t/s | DFlash2 K=4 t/s | speedup | accept |
|---|---|---|---|---|
| mxfp4 (stock) | 35.4 (35.4/35.0/35.6) | 54.0 (54.0/54.1/53.8) | 1.52× | 82% |
| Heretic-abliterated | 33.3 (33.0/33.3/33.5) | 62.2 (61.7/62.2/62.3) | 1.87× | 89% |
| OBLITERATED-V2 | 33.3 (33.0/33.3/33.6) | 61.4 (61.2/61.4/61.6) | 1.84× | 88% |
Round-to-round spread is under 2% on every cell, so the cooldown protocol holds. Your M3 Pro
figure is +57%; this chip gives +52% to +87%. The gain does not shrink on faster silicon.
1. The draft transfers to differently-quantized and modified weights
The draft is trained against the stock model. Both alternative targets are (a) abliterated
by completely different methods and (b) quantized with a different scheme (affine
4-bit g64 vs mxfp4 g32). Neither broke it — and acceptance went up, by 6–7 points,
reproducibly across all three rounds.
Two independent abliteration methods landing at 88–89% versus stock's 82% suggests the cause
is removing refusal directions as such, not any particular technique. A plausible mechanism:
lower next-token entropy after the refusal directions are gone, so the draft guesses right
more often. Untested — measuring mean token entropy across the three would settle it.
Greedy token-exactness vs dense, 120 tokens:
- mxfp4: token-exact
- OBLITERATED-V2: token-exact
- Heretic-abliterated: one flip at token 88 (
' index'→' position'in a docstring), then
reconverges — 1 differing token in the following 32. The near-tie behaviour yourLOSSLESS.mddescribes.
2. Two harness notes
Cold-start contamination. The first model load of a session measures far below steady
state — one run produced dense 1.9 t/s / speedup 18.00x. A warm-up generation before
timing would prevent a single-shot run from reporting that as a result.
Thermal drift. Running the three models back-to-back without cooldowns, this machine
decayed monotonically: the same mxfp4 measurement was 34.9 t/s at the start and 26.8 t/s
three minutes later, −23%. Sequential blocks make whichever model runs last look worst.
Your README already documents this for the M3 Pro (~14 t/s after 10 min); it applies to M5
Max too, and it is enough to invert a model-vs-model conclusion. Interleaving with cooldowns
fixed it — spread dropped from 23% to under 2%.
The dense arm of bench/test_dflash2.py also reads ~8% low versus mlx_lm.stream_generate
(30.2 vs 32.8 t/s), from the per-token .item() sync. Minor next to the two above, but it
inflates the reported speedup slightly.
Suggested changes
- Warm-up generation before timing.
- Interleave and cool down between models when comparing more than one.
- Optionally use
mlx_lm.generate.stream_generatefor the dense arm. - Worth noting in the README that the target's quantization scheme is irrelevant to the
draft — it widens the usable model set considerably.
Happy to run more on this hardware — K sweep, the 13.8k-context edit regime, KV-8bit.
Correction — I edited the post above, and I want to be explicit about what changed and why.
The original version claimed three things:
- the repo's dense baseline understates dense throughput by ~35%
- mxfp4 gets no speedup on this chip (~1.00x)
- the speedup shrinks on faster silicon
All three were wrong, and they were wrong because of my measurement environment, not
because of anything in this repo.
What happened: another MLX server on the same machine had 37 GB of models resident and
active on the GPU during that run. I checked Device Utilization % from ioreg and read
it as idle — on this machine that counter is unreliable and reads 100% at rest, so it told
me nothing. A later re-run was clean of that, but drifted 25% downward from thermal
throttling over three minutes of back-to-back benchmarking, which I also did not catch
until I put an A/B/A control around it.
The corrected numbers come from nine interleaved measurements with a 90 s cooldown before
each, GPU verified idle by model-residency and GPU-memory checks rather than the
utilization counter. Round-to-round spread is now under 2%.
Where that leaves the actual findings: the speedup is real and larger than I first
reported (1.52x on mxfp4, 1.84–1.87x on the two abliterated targets, against your +57%
on M3 Pro), the draft transfers to differently-quantized and differently-modified weights
with acceptance going up rather than down, and the two harness suggestions that survive are
about warm-up and cooldown rather than about the dense loop.
Apologies for the noise. Everything above is re-measured.
Thanks for the contribution!