🦙Stalecollected in 5h

20 tok/s Qwen3.5-397B on M5 Max

PostLinkedIn
🦙Read original on Reddit r/LocalLLaMA
#apple-silicon#moe-optimization#ssd-streamingflash-moeqwen3.5-397bflash-moem5-maxunsloth

💡4.7x speedup to 20 tok/s on 397B MoE via SSD on M5 Max—huge for Apple LLM runs

⚡ 30-Second TL;DR

What Changed

16 IO threads + cache-io-split=4 for parallel SSD reads: +1.5 tok/s

Why It Matters

Demonstrates 2x software speedup on massive MoE model via SSD streaming on Apple Silicon, making 397B inference feasible on laptops. Highlights autoresearch efficiency with AI-human collab.

What To Do Next

Clone github.com/Anemll/flash-moe fork and enable 16 IO threads for Qwen3.5-397B on M5 Max.

Who should care:Developers & AI Engineers

Key Points

  • 16 IO threads + cache-io-split=4 for parallel SSD reads: +1.5 tok/s
  • Temporal expert prediction with 27% correlation: +4.3 tok/s
  • Q3-GGUF experts (Unsloth IQ3_XXS/IQ4_XS): +2.3 tok/s, better perplexity
  • Fused Q/K/V kernel and CMD2 pre-encode: +0.44 tok/s

🧠 Deep Insight

AI-generated analysis for this event — not the original article.

🔑 Enhanced Key Takeaways

  • The M5 Max chip architecture utilizes a unified memory fabric that allows the 128GB RAM pool to be dynamically partitioned between the GPU and CPU, a critical factor in enabling the streaming of a 209GB model from SSD without catastrophic latency.
  • The 'flash-moe' optimization framework leverages the sparsity of Qwen3.5-397B by only loading active experts into the high-speed cache, effectively reducing the active parameter count per token to approximately 45B, which fits within the M5 Max's high-bandwidth cache.
  • The implementation of 'Temporal Expert Prediction' utilizes a lightweight heuristic model that analyzes the previous 5 tokens to predict which MoE experts will be triggered next, allowing the system to pre-fetch weights from the SSD into the cache before the compute kernel requires them.

🛠️ Technical Deep Dive

  • Model Architecture: Qwen3.5-397B is a Mixture-of-Experts (MoE) model with 397 billion total parameters and approximately 28 billion active parameters per token.
  • Quantization Strategy: Utilizes Unsloth's IQ3_XXS/IQ4_XS GGUF format, which employs importance-aware quantization to maintain perplexity while reducing the memory footprint of the expert layers.
  • IO Optimization: Employs a custom cache-io-split=4 configuration, which segments the SSD read requests into four concurrent streams to saturate the M5 Max's PCIe 5.0 bus bandwidth.
  • Kernel Fusion: The CMD2 pre-encode kernel reduces the overhead of the KV-cache management by fusing the attention calculation with the positional embedding application, saving approximately 0.44 tok/s.

🔮 Future ImplicationsAI analysis grounded in cited sources

Consumer-grade hardware will achieve sub-100ms latency for 400B+ parameter models by Q4 2026.
The combination of predictive expert loading and improved PCIe throughput will likely bridge the remaining gap between SSD-streaming speeds and real-time interaction requirements.
MoE-specific quantization will become the industry standard for local LLM deployment.
The success of IQ3_XXS/IQ4_XS in maintaining perplexity while enabling massive models on limited VRAM demonstrates that expert-aware compression is more efficient than uniform quantization.

Timeline

2025-09
Release of Qwen3.5 series with enhanced MoE architecture.
2025-12
Introduction of M5 Max silicon featuring unified memory fabric.
2026-02
Initial community experiments on 'flash-moe' optimization for local inference.
📰

Weekly AI Recap

Read this week's curated digest of top AI events →

👉Related Updates

AI-curated news aggregator. All content rights belong to original publishers.
Original source: Reddit r/LocalLLaMA

This is a summary, not the original. Read the source, or get the weekly briefing.

Weekly AI briefing

One email a week. Unsubscribe anytime.