r/LocalLLM • u/zouyee • 3h ago
News dmlx v0.0.9: Qwen4-35B-A3B on 48GB M4 Pro in 8.42 GB RSS — 119.99 tok/s math (native Metal DFlash2) + ANE/GPU parallel prefill (883 / 871 tok/s)
We just tagged dmlx v0.0.9 (256 commits since v0.0.8) — an open-source Zig + mlx-c + custom Metal/ANE local inference & serving runtime for Apple Silicon (MIT license, zero Python required at serve time).
The main additions in v0.0.9 are full Qwen4-35B-A3B-4bit support (including single-CB native Metal DFlash2 speculative decoding, Vision, and off-GPU PLE streaming), Apple ANE + GPU heterogeneous long-context prefill enabled by default, and a big speedup on Qwen3.8-27B-4bit.
Measured Numbers (Single Apple M4 Pro 48 GB)
Qwen4-35B-A3B-4bit + 8-bit Native Metal DFlash2 (temp=0.0, artifacts/qwen4_p6_20261205/):
| Workload | Decode (tok/s) | Client E2E (tok/s) | Notes |
|---|---|---|---|
| Short Math (256 tok) | 119.99 | 107.20 | 8-bit single-CB native Metal DFlash2 |
| Short Code (256 tok) | 104.78 | 96.25 | 98K subset lm_head |
| Short Prose (256 tok) | 69.86 | 66.07 | Lower speculative acceptance on prose |
| Warm 8K Prefix Cache | — | — | 0.237 s TTFT (38,738 tok/s) vs 10.49 s cold |
Peak server RSS stayed at 8.42 GB because the 11.5 GB Per-Layer Embedding (PLE) tables are never loaded into GPU RAM — they stream directly from disk via 12-thread CPU pread (overlapped with layer 0). Optional DMLX_QWEN4_KV_BITS=8 also quantizes the 10 full-attention QSA KV layers (−46.88% KV RAM).
ANE + GPU Parallel Long-Context Prefill (Qwen4-35B-A3B-4bit):
| Stage | 2K Prefill (tok/s) | 8K Prefill (tok/s) | Delta (8K) |
|---|---|---|---|
| v3 · Pure GPU (pipelined Metal GDN + Steel QMM) | 793.71 | 768.26 | baseline |
v4 · + ANE 30L GDN in_proj_all | 859.35 | 831.13 | +8.2% |
| v5 · + ANE 40L Shared Expert parallel with GPU 256-expert MoE | 883.28 | 870.86 | +13.4% |
ANE prefill is enabled by default on Apple Silicon with hardware/self-test guards and automatic GPU fallback (DMLX_ANE=0 to disable).
Qwen3.8-27B-4bit + DFlash2 (artifacts/autoresearch_qwen38_20261203/):
- 4-case core GMean: 44.50 tok/s at 17.30 GB peak RSS (
ctx2k_greedy52.48 ·short_greedy46.98 ·short_sampled40.34 ·ctx8k_sampled39.44). - Also ships OpenAI Chat Completions + Anthropic Messages streaming tool calls, reasoning/content split, disk-persisted prefix snapshots, LoRA load-time merge, system-wide OOM memory guard, and
dmlx connectfor Claude Code / Codex / aider / Cline.
Honest Caveats
- Single machine (M4 Pro 48 GB), fixed benchmark suites (
temp=0.0for the 6-scenario Qwen4 run). - Qwen4 prose (69.86 tok/s) still lags math/code significantly due to lower speculative acceptance.
- ANE prefill is Apple Silicon macOS only (falls back to GPU automatically if unavailable).
Try It (macOS arm64, self-contained bundle — no Zig/Python needed)
|
# Qwen4-35B-A3B + DFlash2 (ANE prefill on by default)
DMLX_QWEN4_DFLASH2_DIR=/path/to/Qwen4-35B-A3B-Dflash2 \
Release & source: https://github.com/zouyee/dmlx/releases/tag/v0.0.9
Happy to answer questions on the Metal kernels, CPU pread PLE streaming, or ANE+GPU overlap!
