arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2604.18788cs.LG
收藏

高效混合专家LLM推理与Apple Silicon NPUs

Efficient Mixture-of-Experts LLM Inference with Apple Silicon NPUs

University of Virginia(弗吉尼亚大学)

Afsara Benazir, Felix Xiaozhu Lin

AI总结:

本文提出NPUMoE,通过将密集静态计算卸载到Apple Silicon NPUs,提升混合专家LLM推理效率,减少延迟、能耗和CPU使用率。

摘要:

Apple Neural Engine (ANE) 是每颗Apple Silicon芯片中的专用神经处理单元 (NPU)。混合专家 (MoE) LLMs 通过稀疏激活提高推理效率,但对NPUs带来三大挑战:专家路由不可预测导致动态张量形状与NPUs形状特定约束冲突;多个不规则操作符如top-k、散列/收集等不友好;启动多个小专家内核带来显著调度和同步开销。NPUs旨在将AI计算从CPU和GPU卸载;我们的目标是使MoE推理实现此类卸载,特别是在prefill阶段,长上下文工作负载消耗大量系统资源。本文提出NPUMoE,一个运行时推理引擎,通过将密集静态计算卸载到NPU,同时保留CPU/GPU回退路径以处理动态操作。NPUMoE利用离线校准估计专家容量和流行度,驱动三种关键技术:(1) 静态层级处理专家容量以应对动态专家路由;(2) 分组专家执行以缓解NPUs并发限制;(3) 负载感知专家计算图驻留以减少CPU-NPU同步开销。实验表明,NPUMoE在Apple M系列设备上使用三种代表性MoE LLMs和四个长上下文工作负载,持续优于基线,通过有效NPU卸载减少延迟1.32x-5.55x,提高能效1.81x-7.37x,减少CPU周期使用1.78x-5.54x。

英文摘要:

Apple Neural Engine (ANE) is a dedicated neural processing unit (NPU) present in every Apple Silicon chip. Mixture-of-Experts (MoE) LLMs improve inference efficiency via sparse activation but are challenging for NPUs in three ways: expert routing is unpredictable and introduces dynamic tensor shapes that conflict with the shape-specific constraints of NPUs; several irregular operators, e.g., top-k, scatter/gather, etc., are not NPU-friendly; and launching many small expert kernels incurs substantial dispatch and synchronization overhead. NPUs are designed to offload AI compute from CPU and GPU; our goal is to enable such offloading for MoE inference, particularly during prefill, where long-context workloads consume substantial system resources. This paper presents NPUMoE, a runtime inference engine that accelerates MoE execution on Apple Silicon by offloading dense, static computation to NPU, while preserving a CPU/GPU fallback path for dynamic operations. NPUMoE uses offline calibration to estimate expert capacity and popularity that drives three key techniques: (1) Static tiers for expert capacity to address dynamic expert routing (2) Grouped expert execution to mitigate NPU concurrency limits (3) Load-aware expert compute graph residency to reduce CPU-NPU synchronization overhead. Experiments on Apple M-series devices using three representative MoE LLMs and four long-context workloads show that NPUMoE consistently outperforms baselines, reducing latency by 1.32x-5.55x, improving energy efficiency by 1.81x-7.37x, and reducing CPU-cycle usage by 1.78x-5.54x through effective NPU offloading.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑