CoolFace
Modelpublic

Brooooooklyn/Qwen3.5-35B-A3B-UD-Q2_K_XL-mlx

sourceHugging Faceapache-2.0updated 6mo agoView on Hugging Face
0likes77downloads
Model Card

Qwen3.5-35B-A3B — UD-Q2KXL (mlx-node)

2-bit base mixed-precision quantization of Qwen/Qwen3.5-35B-A3B for Apple Silicon, using the **Unsloth Dynamic** quantization strategy via mlx-node.

Original (BF16)This Model
Size~72 GB13 GB
FormatSafeTensors (sharded)SafeTensors (single file)
PrecisionBF16 uniformMixed 2/3/4/5/8-bit + BF16

All Variants

RepoGGUF EquivalentSizeDecode (tok/s)Speedup vs BF16
Brooooooklyn/Qwen3.5-35B-A3B-UD-Q2_K_XL-mlxUD-Q2KXL13 GB86.12.1x
Brooooooklyn/Qwen3.5-35B-A3B-UD-Q3_K_XL-mlxUD-Q3KXL17 GB79.72.0x
Brooooooklyn/Qwen3.5-35B-A3B-UD-Q4_K_XL-mlxUD-Q4KXL21 GB73.41.8x
Brooooooklyn/Qwen3.5-35B-A3B-UD-Q5_K_XL-mlxUD-Q5KXL25 GB70.01.7x
Brooooooklyn/Qwen3.5-35B-A3B-UD-Q6_K_XL-mlxUD-Q6KXL30 GB64.91.6x
Brooooooklyn/Qwen3.5-35B-A3B-UD-Q8_K_XL-mlxUD-Q8KXL35 GB63.51.6x

Benchmarked on Apple M3 Max 128GB, multi-turn chat (Turn 4 decode, steady-state).

Performance

ModelSizeDecode (tok/s)Speedup
BF16 (unquantized)65 GB40.5baseline
This model (UD-Q2_K_XL)13 GB86.12.1x faster

Decode is memory-bandwidth bound on Apple Silicon — fewer bytes per token directly translates to higher throughput. The MoE architecture activates only 8 of 256 experts per token (~3B active out of 35.9B total).

Per-Tensor Bit Assignments (N=2)

WeightBitsRationale
embed_tokens4-bitKLD ~0.15 — very low sensitivity
lm_head5-bitKLD ~0.05 — safest tensor
self_attn.q/k/v_proj4-bit + AWQKLD ~1.5–2.9, AWQ via layernorm
linear_attn.in_proj_qkv/z4-bit + AWQKLD ~2.9, AWQ via layernorm
self_attn.o_projbf16NOT AWQ-correctable
linear_attn.out_projbf16KLD ~6.0 — worst tensor
down_proj3-bit"Slightly more sensitive"
gate_proj, up_proj2-bit"Generally ok" at low bits
Router gates8-bitMoE routing accuracy
GDN params (A_log, etc)bf16State-space dynamics

Quantization Strategy

Based on Unsloth Dynamic 2.0 per-tensor KLD analysis. Sensitive layers get higher bits with AWQ correction, while the bulk of FFN expert weights are aggressively quantized. imatrix AWQ pre-scaling amplifies important weight channels and fuses inverse scales into preceding layer norms (zero inference overhead).

AWQ-correctable projections (q/k/v, inprojqkv/z) are quantized at 4-bit via input_layernorm. Non-AWQ-correctable projections (oproj, outproj) are kept at bf16 — their inputs come from attention/GDN computation, not from a norm layer.

Architecture

ParameterValue
Total parameters35.9B (3B active per token)
Hidden size2,048
Layers40 (30 linear + 10 full attention)
Attention heads16 (2 KV heads, GQA 8:1)
Head dimension256
Experts256 per MoE layer, top-8 routing
Vocab size248,320
Max context262,144 tokens

Usage

typescript
import { loadModel } from '@mlx-node/lm';

const model = await loadModel('./Qwen3.5-35B-A3B-UD-Q2_K_XL-mlx');

const result = await model.chat(
  [{ role: 'user', content: 'Explain the hybrid attention mechanism in Qwen3.5.' }],
  { maxNewTokens: 2048, temperature: 0.6, enableThinking: false },
);
console.log(result.text);

How It Was Made

bash
mlx convert \
  -i Qwen3.5-35B-A3B \
  -o Qwen3.5-35B-A3B-UD-Q2_K_XL-mlx \
  -q --q-bits 2 --q-recipe unsloth \
  --imatrix-path imatrix_unsloth.gguf

Acknowledgments

  • —[Unsloth](https://unsloth.ai) — Quantization strategy based on their per-layer KLD benchmarks and Dynamic 2.0 methodology
  • —[Qwen Team](https://huggingface.co/Qwen) — For the Qwen3.5 model family
  • —[Apple MLX](https://github.com/ml-explore/mlx) — For the Metal-accelerated ML framework

License

Apache 2.0 (inherited from base model).