动态分配专家位宽,让手机端高效运行大模型。
D$^{2}$MoE: Dual Routing and Dynamic Scheduling for Efficient On-Device MoE-based LLM Serving
- 按任务需求动态分配专家位宽,实现灵活压缩。
- 在真实设备上提升1.39倍吞吐,内存减少53%。
- 适合移动端部署高精度大模型的开发者。
混合专家(MoE)模型是大型语言模型的一种稀疏变体,旨在平衡智能能力与计算开销。尽管有优势,但MoE在资源受限的边缘设备上部署仍成本过高,尤其在本地推理服务场景下。现有研究多采用量化、剪枝和融合等模型压缩技术降低复杂度,但其预设的静态优化策略难以应对多请求场景下的质量-开销权衡,最终影响本地服务质量。为此,我们提出D²MoE——一种算法-系统协同设计框架,通过动态为每个专家分配最合适的位宽来匹配多样任务需求。受套娃结构启发,提出套娃式权重量化(MWQ),以位嵌套方式逐步压缩专家权重,减少运行时内存占用。在此基础上,优化输入输出-计算流水线,并设计基于热点专家位优先(HEBF)原则的启发式调度算法,在有限内存预算下最大化专家并行性,显著减少等待加载的空闲时间。在真实边缘设备上的评估表明,相较于最新本地推理框架,D²MoE将整体推理吞吐提升最高达1.39倍,峰值内存占用降低最高达53%,同时保持与INT8基准相当的服务准确率。
原文摘要 · Abstract (English)
The mixture of experts (MoE) model is a sparse variant of large language models (LLMs), designed to hold a better balance between intelligent capability and computational overhead. Despite its benefits, MoE is still too expensive to deploy on resource-constrained edge devices, especially with the demands of on-device inference services. Recent research efforts often apply model compression techniques, such as quantization, pruning and merging, to restrict MoE complexity. Unfortunately, due to their predefined static model optimization strategies, they cannot always achieve the desired quality-overhead trade-off when handling multiple requests, finally degrading the on-device quality of service. These limitations motivate us to propose the D$^2$MoE, an algorithm-system co-design framework that matches diverse task requirements by dynamically allocating the most proper bit-width to each expert. Specifically, inspired by the nested structure of matryoshka dolls, we propose the matryoshka weight quantization (MWQ) to progressively compress expert weights in a bit-nested manner and reduce the required runtime memory. On top of it, we further optimize the I/O-computation pipeline and design a heuristic scheduling algorithm following our hottest-expert-bit-first (HEBF) principle, which maximizes the expert parallelism between I/O and computation queue under constrained memory budgets, thus significantly reducing the idle temporal bubbles waiting for the experts to load. Evaluations on real edge devices show that D$^2$MoE improves the overall inference throughput by up to 1.39$\times$ and reduces the peak memory footprint by up to 53% over the latest on-device inference frameworks, while still preserving comparable serving accuracy as its INT8 counterparts.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。