台灣 AI x AEC 情報BY FBI SICENTER
AI × AEC · CURATED INSIGHT

Streaming MoE Experts from SSD to Transformers Approached Strata Speed on 32GB Mac

Frontier AI models · AI coding

An open-source experiment evaluated running Qwen3.8-Flash-Next on an Apple M5 MacBook with 32GB memory by streaming expert weights directly from SSD. By replacing layer-wide offloading with a slot-pool cache compatible with grouped matrix multiplication and adding custom Metal kernels, the setup achieved 13.9 tokens per second on short decode, trailing specialized engine Strata by approximately 6%.

AI 生成概念示意圖,非實際產品或事件照片。
AI-generated concept illustration; not an event photograph.

Developer Tarek Ziadé tested SSD-based expert streaming for mixture-of-experts (MoE) models using Hugging Face Transformers on a 32GB unified memory Apple M5 system. Standard Transformers offload mechanisms through Accelerate transfer whole expert banks per layer on each token, yielding 0.16 tokens per second on an A10G benchmark. To address this, the project built a shared slot pool representing a bounded on-device cache, enabling PyTorch's native grouped matrix multiplication (grouped_mm) to run directly without custom matmul loops. The setup offloaded 49GB of 3-bit quantized experts and a 51GB n-gram table to disk, keeping active memory to roughly 18GiB and peaking at 25.4GiB on a 6K prompt. Together with prefetching and runtime-compiled Metal kernels, decode speed reached 13.9 tokens per second compared to Strata's 14.8 tokens per second. Host-GPU synchronization in PyTorch MPS remains the main latency bottleneck. The generic implementation was submitted as Transformers PR #50717.

Key takeaways

  • Quantized 121GB of FP8 experts to 3-bit (49GB on disk) and streamed both experts and a 51GB n-gram table from SSD, keeping memory usage within 25.4GiB for a 6K prompt.
  • Mapped routed experts into a device slot pool, allowing PyTorch grouped_mm to execute without custom expert matmul loops.
  • Reached 13.9 tokens per second on 200-token decode (within 6% of Strata at 14.8 tok/s) and 228 tokens per second on prefill using Metal kernels and early MPS commit hooks.
  • Submitted the approach to Hugging Face Transformers as PR #50717; full benchmarks and model-specific code were published in a Hugging Face Space.

Source:Hugging Face / authors Read the original ↗

Prepared, checked and automatically published by AI; not individually reviewed by a human.

← All articles