Repository navigation
v0.5.0 — Performance improvements across every trainer
A focused performance release. Most trainers in the project got faster, ORPO at 4096 context fits on a 48 GB Mac for the first time, and a handful of long-standing internal inefficiencies are gone. Everything is under the hood — existing scripts get the speedups with no code changes. A few new optional knobs are introduced for tuning unusual workloads.
Headline numbers (M4 Pro)
| Workload | Before (0.4.25) | After (0.5.0) | Δ |
|---|---|---|---|
GRPO (Qwen3.5-0.8B-4bit, 8 iters × 4 gen × 128 tok) |
363.78 s | 38.43 s | 9.5× |
DPO per-sample, Qwen3.5-0.8B-MLX-4bit (long-prompt, bs=1) |
811 ms | 539 ms | 1.50× |
ORPO per-sample, Qwen3.5-0.8B-MLX-4bit (long-prompt, bs=1) |
804 ms | 432 ms | 1.86× |
ORPO at ctx=4096, Qwen3-0.6B-bf16 (bs=1) |
OOM on 48 GB | 9.23 GB peak (with GC) | first version that fits |
| RNN-T value_and_grad (B=2 T=128 U=32 V=64) | 491 ms | 330 ms | 1.49× (bit-exact) |
| Embedding training (16 steps, post-bucketing) | eager baseline | 1.84× | compile + bucketing |
What to expect on M4 Pro 48 GB
Rough indicators from our own benches — not a comparison with other tools, just "what we've measured on this Mac." LoRA rank 8–16 unless noted.
| Workload | Model | Ctx | Batch | Speed | Peak GB | Notes |
|---|---|---|---|---|---|---|
| SFT | Qwen3-0.6B-bf16 | 1024 | 1 | ~2.2 it/s | 2.6 | mlx-lm defaults (16 layers, q/v, no GC) |
| SFT | Qwen3-0.6B-bf16 | 4096 | 1 | ~0.28 it/s | 18 | full layers + q/v, no GC; matches direct mlx-lm |
| DPO | Qwen3.5-0.8B-MLX-4bit | 512 | 1 | ~540 ms/sample | ~1 | shared-prefix fast path |
| DPO | Qwen3.5-0.8B-MLX-4bit | 512 | 2 | ~810 ms/sample | ~1.2 | compile + bucket |
| ORPO | Qwen3.5-0.8B-MLX-4bit | 512 | 1 | ~430 ms/sample | ~1 | shared-prefix fast path |
| ORPO | Qwen3-0.6B-bf16 | 4096 | 1 | ~0.09 it/s | 9.2 | GC opt-in required |
| ORPO | Qwen3-0.6B-bf16 | 2048 | 1 | ~0.41 it/s | 16.8 | no GC |
| GRPO | Qwen3-0.6B-bf16 | 4096 | 1 (×4 gen × 256 tok) | ~0.11 it/s | 5.3 | reasoning bench |
| GRPO | Qwen3.5-0.8B-4bit | ~128–512 | 1 (×4 gen × 128 tok) | ~4.8 s/iter | 15.9 | quantized; Phase 2 backward through 0.8B-4bit |
| Embedding | MiniLM-L6-v2-bf16 (22M) | 128 | 32 | ~25 ms/step | <0.5 | InfoNCE contrastive |
Full reference table and tuning knobs at docs/performance.html.
Full Changelog: https://github.com/arahim3/mlx-tune/commits/v0.5.0