180B Parameters, 32GB of RAM: Pushing MoE Inference to the Limit with Transformers

Impact 7 Hugging Face Blog

Summary

  • A developer modified Hugging Face Transformers to stream Mixture-of-Experts (MoE) weights directly from SSD to device memory, enabling execution of a 180B parameter model on a 32GB Mac.
  • The approach uses a shared slot pool and custom optimizations to remap router expert IDs so standard grouped matrix multiplication kernels work without custom expert matmuls.
  • Using 3-bit quantization and offloaded disk strategies, the modified Transformers stack achieved approximately 13.9 tokens per second on short decodes, coming within 6% of the Strata inference engine.
  • Performance bottlenecks remain due to Python overhead and host-device round trips on Apple's Metal Performance Shaders (MPS) framework.

Why it matters

Running massive MoE models locally on consumer hardware like a 32GB Mac expands accessibility for AI development, proving that efficient SSD streaming and custom caching can bypass traditional RAM and VRAM limitations.

Who should care