AdapMoE: Adaptive Sensitivity-based Expert Gating and Management for Efficient MoE Inference

Shuzhang Zhong, Ling Liang, Yuan Wang, Runsheng Wang, Ru Huang, Meng Li

Introduction

Large Language Models (LLMs) utilizing Mixture-of-Experts (MoE) architectures, such as Mixtral-8x7b, have emerged as a powerful solution for balancing model capacity with computational efficiency. By activating only a subset of parameters (experts) for each token, MoE models achieve high performance with the inference cost of much smaller dense models. However, deploying these massive models on edge devices—such as consumer GPUs or laptops—presents a significant memory challenge. While only a fraction of parameters are "active" at any moment, the entire model must typically reside in memory to be accessible.

The Offloading Bottleneck

On devices with limited Video RAM (VRAM), the standard approach is offloading: storing expert weights in system RAM (CPU) and swapping them into the GPU on-demand. As shown in Figure 1, this creates a severe performance bottleneck. In a typical edge setup (e.g., NVIDIA RTX 4090), memory transfer from Host to Device (HtoD) can account for over 86% of the total GPU time distribution. The actual kernel execution and launch times are dwarfed by the latency of moving data across the PCIe bus, leading to significant idle periods for the compute units.

The offloading bottleneck: memory transfer (HtoD) dominates GPU time distribution and creates idle compute periods.

The AdapMoE Framework

To address this, we present AdapMoE, an algorithm-system co-design framework designed to minimize data movement and hide transfer latency. AdapMoE rests on three primary pillars: adaptive gating, intelligent prefetching, and optimized cache management.

Overview of the AdapMoE framework, illustrating the integration of adaptive gating, prefetching, and cache management.

1. Adaptive Sensitivity-based Gating

Standard MoE models often employ a fixed "Top-K" gating strategy (e.g., Top-2), regardless of whether the second expert significantly contributes to the output. AdapMoE introduces a dynamic gating mechanism based on "sensitivity." By utilizing a Taylor expansion and the Fisher Information Matrix to approximate the Hessian, the system calculates the mathematical importance of each expert for a specific token. If the sensitivity of the second expert falls below a threshold, the system activates only the primary expert. This approach reduces the average number of experts loaded by approximately 25% without sacrificing model accuracy.

2. Adaptive Expert Prefetching

The framework exploits the high cosine similarity (often >0.9) between activations in successive transformer layers. Because the model's "intent" remains relatively stable across several layers, AdapMoE uses the gating decisions of the current layer to predict and prefetch the experts required for the next 2–3 layers. For the very first layer, a lightweight "predictive gate" guesses requirements based on the previous token's state. This mechanism achieves roughly 90% accuracy, allowing the system to overlap memory transfers with computation effectively.

3. Adaptive Cache Allocation and Tiling

Not all layers are equally sensitive to errors or equally predictable. AdapMoE treats GPU cache allocation as a "knapsack problem," employing Dynamic Programming (DP) to prioritize cache space for layers that yield the highest performance gains. Furthermore, the system implements tile-wise scheduling. By breaking expert weight matrices into smaller tiles, computation can begin as soon as the first tile arrives in GPU memory, rather than waiting for the entire matrix to load.

Key Results and Evaluation

The researchers evaluated AdapMoE using Mixtral-8x7b and Mixtral-8x22b models on NVIDIA RTX 4090 and A6000 hardware. Key findings include:

  • Performance: A 1.35x speedup in generation speed compared to state-of-the-art offloading baselines.
  • Efficiency: A 25% reduction in active experts with zero degradation in accuracy on benchmarks like MMLU and ARC-Challenge.
  • Robustness: Unlike previous adaptive methods that required fine-tuning to maintain accuracy, AdapMoE works "out of the box" on pre-trained models.

Conclusion and Future Directions

AdapMoE demonstrates that the offloading bottleneck in MoE inference can be significantly mitigated through intelligent, sensitivity-aware management. Future work may involve per-layer threshold tuning for even finer control over the accuracy-latency trade-off and exploring the scalability of these techniques in high-throughput server environments with larger batch sizes.

Summary updated

BibTeX
@inproceedings{zhong2024adapmoe,
  author = {Shuzhang Zhong and Ling Liang and Yuan Wang and Runsheng Wang and Ru Huang and Meng Li},
  title = {{AdapMoE: Adaptive Sensitivity-based Expert Gating and Management for Efficient MoE Inference}},
  booktitle = {ICCAD},
  year = {2024},
  url = {https://openreview.net/forum?id=UO2ILQOadR},
}
Figure