动态调度专家模块,让本地电脑高效运行大模型。
DALI: A Workload-Aware Offloading Framework for Efficient MoE Inference on Local PCs
- 根据负载动态分配专家到CPU或GPU,避免资源浪费。
- 利用残差信息预判高负载专家,提升预加载准确率。
- 基于负载变化优化缓存策略,显著提高显存利用率。
混合专家(MoE)架构在不按比例增加计算量的前提下大幅提升大语言模型容量,但带来了庞大的参数量。将专家参数卸载至主机内存并结合CPU与GPU计算,成为在资源受限的本地PC上支持此类模型的有前景方向。然而,现有方法未能匹配专家工作负载的动态特性,导致三大效率问题:(1) 静态专家分配造成严重CPU-GPU负载失衡,资源利用率低下;(2) 现有预加载技术无法准确预测高负载专家,引发代价高昂的误加载;(3) GPU缓存策略忽略负载动态性,命中率低,效果有限。为此,我们提出DALI——一种面向本地PC高效MoE推理的工作负载感知卸载框架。为充分释放硬件性能,DALI将专家分配建模为0-1整数优化问题,并通过运行时贪心分配策略高效求解。为提升预加载精度,提出基于残差信息的预加载方法,可准确预测高负载专家。同时引入负载感知缓存替换策略,利用专家激活的时间相关性提升显存效率。在多种MoE模型与设置下评估表明,相比最先进卸载框架,DALI在预填充和解码阶段均实现显著加速。
原文摘要 · Abstract (English)
Mixture of Experts (MoE) architectures significantly enhance the capacity of LLMs without proportional increases in computation, but at the cost of a vast parameter size. Offloading MoE expert parameters to host memory and leveraging both CPU and GPU computation has recently emerged as a promising direction to support such models on resourceconstrained local PC platforms. While promising, we notice that existing approaches mismatch the dynamic nature of expert workloads, which leads to three fundamental inefficiencies: (1) Static expert assignment causes severe CPUGPU load imbalance, underutilizing CPU and GPU resources; (2) Existing prefetching techniques fail to accurately predict high-workload experts, leading to costly inaccurate prefetches; (3) GPU cache policies neglect workload dynamics, resulting in poor hit rates and limited effectiveness. To address these challenges, we propose DALI, a workloaDAware offLoadIng framework for efficient MoE inference on local PCs. To fully utilize hardware resources, DALI first dynamically assigns experts to CPU or GPU by modeling assignment as a 0-1 integer optimization problem and solving it efficiently using a Greedy Assignment strategy at runtime. To improve prefetching accuracy, we develop a Residual-Based Prefetching method leveraging inter-layer residual information to accurately predict high-workload experts. Additionally, we introduce a Workload-Aware Cache Replacement policy that exploits temporal correlation in expert activations to improve GPU cache efficiency. By evaluating across various MoE models and settings, DALI achieves significant speedups in the both prefill and decoding phases over the state-of-the-art offloading frameworks.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。