MoE-Infinity: Efficient MoE Inference on Personal Machines with Sparsity-Aware Expert Cache

Leyang Xue, Yao Fu, Zhan Lu, Luo Mai, Mahesh Marina
1/25/2024
cs.LGcs.PF

Official code: EfficientMoE/MoE-Infinity (373 stars, Apache-2.0, PyTorch, last commit 2026-04-17).

Abstract

This paper presents MoE-Infinity, an efficient MoE inference system designed for personal machines with limited GPU memory capacity. The key idea for MoE-Infinity is that on personal machines, which are often single-user environments, MoE-based LLMs typically operate with a batch size of one. In this setting, MoE models exhibit a high degree of activation sparsity, meaning a small number of experts are frequently reused in generating tokens during the decode phase. Leveraging this idea, we design a sparsity-aware expert cache, which can trace the sparse activation of experts during inference and carefully select the trace that represents the sparsity pattern. By analyzing these selected traces, MoE-Infinity guides the replacement and prefetching of the expert cache, providing 3.1-16.7x per-token latency improvements over numerous state-of-the-art systems, including vLLM, Ollama, DeepSpeed and BrainStorm across various MoE models (DeepSeek and Mixtral) when handling different LLM tasks. MoE-Infinity's source code is publicly available at https://github.com/EfficientMoE/MoE-Infinity

View on arXivView PDF

Code Implementations(1)

PyTorchApache-2.0

PyTorch library for cost-effective, fast and easy serving of MoE models.

37346C, C++Jan 22, 20246 months agoApache-2.0
huggingfaceinference-enginelarge-language-modelsllm-inferencemixture-of-experts+1 more

Similar Papers

Cite this paper

@article{xue2024moeinfinity,
  title  = {MoE-Infinity: Efficient MoE Inference on Personal Machines with Sparsity-Aware Expert Cache},
  author = {Leyang Xue and Yao Fu and Zhan Lu and Luo Mai and Mahesh Marina},
  year   = {2024},
  eprint = {2401.14361},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2401.14361v3}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2401.14361.svg)](https://codeofpaper.com/paper/2401.14361)

Discussion