arXiv:2504.05897cs.LGcs.DC2025-04中稿 · DAC 25被引 21

提出混合CPU-GPU调度框架,提升MoE模型推理效率

HybriMoE: Hybrid CPU-GPU Scheduling and Cache Management for Efficient MoE Inference

  • 动态分层调度平衡CPU与GPU负载
  • 预取和缓存策略降低专家激活不稳定性影响
  • 在3个主流MoE大模型上提速1.33至1.7倍

Mixture of Experts(MoE)架构能显著提升模型容量而无需成比例增加计算量。然而,大型MoE模型仍带来巨大内存需求,通常需在资源受限平台进行专家卸载,带来显著开销。混合CPU-GPU推理被提出以利用CPU计算降低专家加载开销,但面临两大挑战:一是MoE模型的专家激活模式高度不稳定,现有固定映射策略效率低下;二是混合调度因专家规模、结构差异及负载不均而天然复杂。为此,本文提出HybriMoE,一种基于新型CPU-GPU调度与缓存管理的混合推理框架。其创新包括:(i) 动态层内调度策略平衡跨设备负载,(ii) 基于影响驱动的层间预取算法,(iii) 基于评分的缓存策略缓解激活不稳定性。我们在kTransformers框架上实现HybriMoE,并在三个广泛使用的MoE大语言模型上评估。实验结果表明,相比最先进混合MoE推理框架,HybriMoE在prefill阶段平均提速1.33×,decode阶段平均提速1.70×。代码已开源。

原文摘要 · Abstract (English)

The Mixture of Experts (MoE) architecture has demonstrated significant advantages as it enables to increase the model capacity without a proportional increase in computation. However, the large MoE model size still introduces substantial memory demands, which usually requires expert offloading on resource-constrained platforms and incurs significant overhead. Hybrid CPU-GPU inference has been proposed to leverage CPU computation to reduce expert loading overhead but faces major challenges: on one hand, the expert activation patterns of MoE models are highly unstable, rendering the fixed mapping strategies in existing works inefficient; on the other hand, the hybrid CPU-GPU schedule for MoE is inherently complex due to the diverse expert sizes, structures, uneven workload distribution, etc. To address these challenges, in this paper, we propose HybriMoE, a hybrid CPU-GPU inference framework that improves resource utilization through a novel CPU-GPU scheduling and cache management system. HybriMoE introduces (i) a dynamic intra-layer scheduling strategy to balance workloads across CPU and GPU, (ii) an impact-driven inter-layer prefetching algorithm, and (iii) a score-based caching algorithm to mitigate expert activation instability. We implement HybriMoE on top of the kTransformers framework and evaluate it on three widely used MoE-based LLMs. Experimental results demonstrate that HybriMoE achieves an average speedup of 1.33$\times$ in the prefill stage and 1.70$\times$ in the decode stage compared to state-of-the-art hybrid MoE inference framework. Our code is available at: https://github.com/PKU-SEC-Lab/HybriMoE.

MoE推理混合调度大模型优化

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。