How to run Inkling 2 Mini on a Mac: up to 128.8 tok/s on an M5 Max with MTPLX 2.13 (24 GB Macs and up)

#28
by henrydappa - opened

I work with Youssof Al Toukhi, who writes MTPLX. He released 2.13 this morning and I'm posting the numbers here for him.

MTPLX 2.13 runs Inkling 2 Mini on Apple Silicon with the model's own draft head as a speculative decoder (rejection sampling with residual correction, so the output keeps the model's distribution at temperature 1.0) and Metal kernels written for it.

Measured on one MacBook Pro M5 Max with 128 GB, at the model's own sampler:

Pack Size Peak decode First token, new 4,142-token prompt
Bare Speed (4-bit) 16.0 GB 128.8 tok/s 1.69 s
Optimized Speed (4-bit experts, 8-bit attention and head) 17.2 GB 123.8 tok/s 1.73 s
Optimized Quality (these official weights, unchanged) 20.2 GB 103.8 tok/s 1.84 s

On the same Mac, prompt and sampler, decode is 1.6x oMLX 0.8.0 with its draft head and 2.8x plain mlx-lm. These are peak figures on a cool machine, and M1 to M4 Macs run a slower path. The conditions for each number are in the release notes: https://github.com/youssofal/MTPLX/releases/tag/v2.13.0

Every pack keeps the whole vision tower. Bare Speed fits a 24 GB Mac, all three fit from 32 GB, and there are FP16 builds for M1 and M2.

brew install youssofal/mtplx/mtplx
mtplx start

The app and mtplx start read your chip and memory and offer only the packs that fit. There is also a Mac app: https://mtplx.com/download

Open source, Apache 2.0: https://github.com/youssofal/MTPLX

Every number above is from one M5 Max. If you have an M5 Ultra, he would like to see yours.

Update: MTPLX 2.13.1 is out. 2.13.0 failed to load Inkling 2 Mini on an M1 Max with "Thread group size (800) is greater than the maximum allowed threads per threadgroup (704)", and a tester saw the same crash on an M2 Max. 2.13.1 fixes it. The packs did not change, so nothing needs downloading again. Update with brew update && brew upgrade mtplx or pip install -U mtplx. Release notes: https://github.com/youssofal/MTPLX/releases/tag/v2.13.1

Sign up or log in to comment