Running Qwen3.5-122B on Mac Studio 96GB: Fixed 3 bugs that made long-context inference usable
Mirrored from r/LocalLLaMA for archival readability. Support the source by reading on the original site.
Hey everyone,
I recently switched from DS4 Flash to Qwen3.5-122B on my M3 Ultra Mac Studio for long-context agentic coding. While the model fit better, I hit a wall where follow-up messages took 3-5 minutes to start generating (cold fills) despite having a "warm" context.
Turns out the issue wasn't the model, but three specific bugs in my serving stack (qMLX fork of rapid-mlx):
- Prompt Instability: A unique message ID in the system prompt broke byte-exact KV cache matching, forcing a full re-compute on every turn.
- Interrupt Path: Streaming replies weren't persisted when generation was interrupted, causing history divergence.
- Checkpoint Poison: A background writer created unmatchable checkpoints that crowded out valid ones, triggering aggressive eviction.
After fixing these, prefill time dropped from minutes to sub-seconds (e.g., 53k tokens cached, only 33 prefilled).
I decided to fork rather than PR these changes because the hybrid attention optimizations are very specific to Qwen and likely unpalatable for a general upstream stack. Expect qMLX to continue diverging as we optimize specifically for this architecture.
I've open-sourced the fork and a benchmark script (bench_qmlx.py) that separates prefill/decode metrics. Would love to hear if anyone else is seeing similar issues with hybrid attention caching or has ideas for further optimization.
- Full breakdown: https://mrzk.io/posts/qmlx-maximising-ai-psychosis-minmaxing-mac-studio/
- GitHub (qMLX): https://github.com/marzukia/qMLX
[link] [comments]
More from r/LocalLLaMA
-
NVIDIA shipped OpenShell, an open source sandbox that gives local and open agents real runtime limits instead of prompt rules. Over 100 firms joined the safety stack. OpenAI did not.
Sep 28
-
3090 for $1500???
Sep 28
-
modified qwen 3.8 27b modifies windows credential dumper to bypass EDR detection
Sep 28
-
Minisforum MS-S1 MAX-P495 @ €7.799,00
Sep 28
Discussion (0)
Sign in to join the discussion. Free account, 30 seconds — email code or GitHub.
Sign in →No comments yet. Sign in and be the first to say something.