Qwen3.5-9B for the Apple Neural Engine (16K context), research release

Research release from Luoke Labs: an experiment in running Qwen3.5-9B on the ANE, not a model used in our products. No support or update guarantees.

The original Qwen3.5-9B, compiled for the Apple Neural Engine through Core AI (macOS 27), with two speculative drafters. Only the target's weights are quantized; greedy output is the target's own. Code, build recipe and full results: github.com/luokelabs/qwen3.5-9b-ane.

On a Mac mini (M6, 32 GB), greedy, thinking off, same OpenAI-style harness for every column:

ANE (this model) GPU MLX 4-bit + DFlash GPU MLX 4-bit
Chinese chat, 40 prompts: tok/s 40.7 38.3 30.8
Chinese chat: J/token (whole machine) 0.47 1.10 0.78
code / JSON, short prompts: tok/s 135 / 160 96 / 103 ~32
English prose, short prompts: tok/s 37.3 46.3 ~32
decode after 8K / 16K prompt: tok/s 143โ€“148 / 137โ€“141 65โ€“76 / 56โ€“66 29.5 / 27.9
prefill 8K / 16K: tok/s 1157 / 1127 1130 / 1050 1027 / 996
CMMLU (335 q) 81.5% 81.5% 81.5% (bf16: 81.5%)

Long-context decode is about 2.2ร— the GPU + DFlash speed (1.9โ€“2.5ร— across runs) at 72โ€“80% less energy per token. Ranges, sampling / thinking mode, IFEval / HumanEval+ and limits: RESULTS.md.

On a Mac mini (M4, 24 GB) with the M4 target (target_m4/), same harness:

ANE (M4 target) GPU MLX 4-bit + DFlash GPU MLX 4-bit
Chinese chat, 40 prompts: tok/s 18.8 23.3 21.3
code / JSON, short prompts: tok/s 72.9 / 78.8 62.4 / 64.0 ~21.5
decode after 8K / 16K prompt: tok/s 68.2 / 67.0 44.2 / 32.5 20.1 / 19.2
decode after 8K: J/token (whole machine) 0.21 0.75 1.52
prefill 8K / 16K: tok/s 419 / 416 223 / 209 223 / 209
CMMLU (335 q, measured on the ANE) 80.3% 81.5% 81.5%

On an M4 the ANE wins on long context and structured output; the GPU is faster for short Chinese chat and English prose.

Contents

path what size
target_m6/ the M6 target: 8 chunks of 4 layers + LM head, 8K and 16K contexts, 8- / 16-row verify. GPTQ LUT4 (one 16-entry table per matrix + per-row scale, online block-Hadamard basis); layers 8โ€“15 INT8 per-channel 4.8 GB
target_m4/ the M4 (H16) target: same GPTQ LUT4 base, written in forms the M4 ANE compiler accepts (channel-major DeltaNet conv, signs + shared Hadamard matmul, no FP8); layers 8โ€“15 and the layer-0 mixer LUT6 instead of INT8 / bf16 4.5 GB
dflash/ DFlash drafter (block 16), knowledge-distilled from this exact target, LUT4, 98,304-row head subset 0.8 GB
mtp/ Qwen3.5's own MTP head, LUT4, 32,768-row head subset 0.2 GB
gh_packed/ layers 16โ€“31 in packed form for the optional ANE + GPU pipelined prefill; rebuilt bit-exactly to fp16 (6.7 GB) on first start 1.6 GB
embed_tokens_fp16.npy token embeddings (fp16 of the original) 2.0 GB
config.json, tokenizer, chat_template.jinja from Qwen/Qwen3.5-9B
model.safetensors only the final norm (read by the MTP drafter) โ€” not a full checkpoint 8 KB

Use

Requires an Apple silicon Mac with macOS 27 (Core AI). Tested on an M6 Mac mini (32 GB) with target_m6/ and an M4 Mac mini (24 GB) with target_m4/; other chips are untested. The first load compiles the packages for your Mac (a few minutes); later loads come from the Core AI cache.

git clone https://github.com/luokelabs/qwen3.5-9b-ane q9 && cd q9
# set up anemll-forge with the patches in patches/ (see the repo README), then:
hf download luokelabs/Qwen3.5-9B-CoreAI-ANE --local-dir models/Qwen3.5-9B-CoreAI-ANE
HF_DIR=$PWD/models/Qwen3.5-9B-CoreAI-ANE runtime/serve_q9.sh 16384   # OpenAI API on 127.0.0.1:8775

PP=0 turns pipelined prefill off (no GPU weights, ~6.5 GB less memory).

On an M4, serve target_m4/ (pipelined prefill is off by default there; it does not pay on an M4):

M4=1 HF_DIR=$PWD/models/Qwen3.5-9B-CoreAI-ANE runtime/serve_q9.sh 16384

To download only what one machine needs, add --exclude "target_m4/*" (M6) or --exclude "target_m6/*" --exclude "gh_packed/*" (M4) to hf download.

License and attribution

Apache-2.0, as the sources:

Changes from the sources: GPTQ LUT4 / INT8 (LUT6 in target_m4/) quantization with a Hadamard basis, compilation to Core AI packages, vocabulary-subset drafter heads, and knowledge distillation of the DFlash drafter on this target's outputs.

Downloads last month
781
Safetensors
Model size
4.1k params
Tensor type
BF16
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for luokelabs/Qwen3.5-9B-CoreAI-ANE

Finetuned
Qwen/Qwen3.5-9B
Quantized
(794)
this model

Collection including luokelabs/Qwen3.5-9B-CoreAI-ANE