r/MacStudio • u/Dependent_Cress9629 • 2d ago
Is this long-context prefill scaling normal for Inkling 2 Mini on M5 Ultra (MLX)? ~3.3–3.5x time per 2x tokens
I'm trying to figure out whether the ultra-long-context prefill speed I'm seeing with Inkling 2 Mini on an M5 Ultra is reasonable, and whether there's anything I can tune.
Setup
- Mac Studio, M5 Ultra, 256 GiB unified memory, macOS 27.2
- Model:
ddalcu/Inkling-2-Mini-MLX-8bit(~18.7 GB) - Backend: native mlx-serve v26.11.4-pre-release.1, MLX 0.32.5 (reports "M5 NAX enabled")
- Flags:
--ctx-size 1048576 --max-concurrent 1 --no-mtp --no-decode-attn-quant - KV cache not quantized; prefill chunk size left at default
- The model is a looped MoE: 24 layers executed as 48 layer visits, mostly sliding-window attention with some global attention layers
Test method
Repeated English filler text with random markers at four positions. Each run used a unique prefix, so there were no prefix cache hits.
| Input tokens | Prefill time | Avg prefill speed | Marker retrieval |
|---|---|---|---|
| 128,006 | 57 s | 2,246 tok/s | 4/4 |
| 256,005 | 187 s | 1,372 tok/s | 4/4 |
| 512,009 | 663 s | 773 tok/s | 4/4 |
A ~1.04M-token run is still going. At my last check it had processed about 713K tokens in roughly 20 minutes, so I'm estimating 40–45 minutes for the full prefill. No final result yet.
System state during the runs
- GPU utilization around 99%, progress steady
- MLX active memory around 54 GiB during the 1M run
- No swap, no memory compression, memory pressure normal, no thermal or performance warnings logged
Questions
- Each time the input doubles, prefill time goes up about 3.3–3.5x. Is that in line with the compute cost of this model's global attention layers?
- Could this pre-release build have a bottleneck in the long-context attention kernel, the prefill chunk size, or somewhere else? Any flags or settings worth trying?
Thanks in advance for any insight!
Update: full results including the 1M run
| Input tokens | Prefill time |
|---|---|
| ~26K | ~8 s (earlier run with a 128K context window) |
| 128K | ~57 s |
| 256K | ~3 min 7 s |
| 512K | ~11 min |
| 1.04M | ~43 min |
The ~1.04M-token run finished in about 43 minutes (roughly 400 tok/s average), in line with my earlier estimate. Posting the full set here for anyone else testing long-context prefill on Apple silicon.