Qwen2.5-72B-Instruct-lecore-mlx

MLX mixed-precision quantization of Qwen/Qwen2.5-72B-Instruct, with the bit width of every linear layer picked by leCore Unicron requantize (per-tensor bits chosen by measurement), ported to GPU for this model size.

How the bits were chosen

  1. Each decoder linear tensor was quantized alone (MLX affine, group 64) at 2, 3 and 4 bits; the damage was measured as KL(fp16 || quantized) on next-token distributions over a calibration mix (3066 WikiText-2 train tokens, 1022 Python-source tokens, and leCore's structured probe: prose, code, SQL, markdown).
  2. Bits were assigned greedily: start at 4 bits everywhere, repeatedly take the downgrade with the least measured damage per byte saved until the predicted file size fit the budget. Embeddings 4-bit, lm_head 6-bit, group size 64.
  3. Converted with mlx_lm.convert and a per-layer quant_predicate. Bit histogram (linear tensors): {'2': 295, '3': 174, '4': 91, '8': 0}.

Measured results (held-out: WikiText-2 test + a different Python-source slice, seq 512)

Perplexity was computed on the exact shipped weights (MLX tensors dequantized with mx.dequantize, run in bf16 on GPU). "bpw" = integer bits + 0.5 for the bf16 scale/bias per group of 64.

Model Size (GB, weights) bpw WikiText-2 ppl (32704 tok) Python-code ppl (8176 tok)
bf16 reference โ€“ 16 5.0688 2.5563
this repo (leCore Unicron mix) 26.80 2.948 7.8869 3.5566

Benchmarks (lm-eval-harness 0.4.9, run on the shipped weights dequantized to bf16 on GPU)

MMLU 5-shot on the first 10 questions of each of the 57 subjects; GSM8K 5-shot on the first 100 test problems (greedy, 320 new tokens, no chat template). These are subsets, so expect about ยฑ2โ€“4 points of sampling noise.

Model MMLU (5-shot) GSM8K strict GSM8K flexible
leCore mix (this repo) 82.1% 83.0% 75.0%
stock 3-bit affine, group 64 (simulated) 84.0% 92.0% 76.0%

Only measured numbers are reported. No downstream-task benchmarks were run. Short-context perplexity does not tell you everything about quality, so check outputs for your own use case.

Files in this repo

file size what it is
model-00001-of-00006.safetensors โ€ฆ (6 safetensors shards) 26.80 GB total quantized weights, sharded
tokenizer.json 11.4 MB tokenizer
vocab.json 2.8 MB config / tokenizer
merges.txt 1.7 MB support file
model.safetensors.index.json 178.7 KB config / tokenizer
config.json 121.5 KB model config
tokenizer_config.json 4.7 KB config / tokenizer
chat_template.jinja 2.5 KB chat template
special_tokens_map.json 613 B config / tokenizer

Usage (Apple Silicon)

pip install -U mlx-lm
mlx_lm.generate --model staccs/Qwen2.5-72B-Instruct-lecore-mlx --prompt "Hello" --max-tokens 256 --max-kv-size 8192

Weights are ~26.80 GB. On a 36 GB Mac you may need to raise the GPU wired-memory limit, e.g. sudo sysctl iogpu.wired_limit_mb=30000.

License

Base model: Qwen/Qwen2.5-72B-Instruct, released under the Qwen License Agreement (https://huggingface.co/Qwen/Qwen2.5-72B-Instruct/blob/main/LICENSE). This quantized derivative is distributed under the same agreement, including its commercial-use terms. Only quantization was done here: no retraining.

Related builds

Same base model, other formats in the lecore set:

repo format size
Qwen2.5-72B-Instruct-lecore-GGUF GGUF (llama.cpp) 78.41 GB
Qwen2.5-72B-Instruct-lecore-hrr gated-HRR gates 5.4 MB
Downloads last month
364
Safetensors
Model size
73B params
Tensor type
U32
ยท
BF16
ยท
MLX
Hardware compatibility
Log In to add your hardware

3-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for staccs/Qwen2.5-72B-Instruct-lecore-mlx

Base model

Qwen/Qwen2.5-72B
Quantized
(97)
this model