arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2605.27435cs.ARcs.AI
收藏

当NPU并非总是更快:移动LLM推理的阶段级分析

When NPUs Are Not Always Faster: A Stage-Level Analysis of Mobile LLM Inference

Leiden Institute of Advanced Computer Science (LIACS)(莱顿先进计算机科学研究所)

Pu Li, Jiawen Qi, Qinyu Chen

AI总结:

通过OPMASK控制管道分解方法,在CPU-NPU异构SoC上对移动LLM推理进行阶段感知的多级基准测试,发现Prefill阶段CPU比NPU快1.6倍,Decode阶段NPU仅提供1.05-1.2倍加速,且NPU卸载增加能耗高达51%。

摘要:

在移动设备上部署大型语言模型(LLM)越来越依赖于异构执行,然而,尚无先前研究在算子和管道级别系统性地描述NPU的有效性。我们首次在CPU-NPU异构SoC上对移动LLM推理进行了阶段感知的多级基准测试研究。我们引入了一种基于OPMASK的受控管道分解方法,该方法隔离了NPU执行路径中的通信、量化和计算开销。我们的结果揭示了反直觉的阶段级性能反转:在计算密集型的Prefill阶段,CPU性能优于NPU(高达1.6倍),而在内存受限的Decode阶段,NPU仅提供有限的加速(1.05-1.2倍)。我们进一步表明,调度开销和跨后端回退降低了NPU卸载的实际收益。在能耗趋势方面,增加NPU卸载会导致更高的能耗(高达51%)。基于这些发现,我们为面向设备上LLM推理的NPU架构师推导出了设计指南。

英文摘要:

Deploying large language models (LLMs) on mobile devices increasingly relies on heterogeneous execution, yet no prior study has systematically characterized NPU effectiveness at the operator and pipeline level. We present the first stage-aware, multi-level benchmarking study of mobile LLM inference on a CPU-NPU heterogeneous SoC. We introduce an OPMASK-based controlled pipeline decomposition methodology that isolates communication, quantization, and computation overheads within the NPU execution path. Our results reveal a counter-intuitive stage-level performance reversal: CPUs outperform NPUs in the compute-intensive Prefill stage (up to 1.6x), while NPUs provide only limited acceleration in the memory-bound Decode stage (1.05-1.2x). We further show that scheduling overhead and cross-backend fallback reduce the practical benefits of NPU offloading. For the energy trend, increasing NPU offloading leads to higher energy consumption (up to 51%). Based on these findings, we derive design guidelines for NPU architects targeting on-device LLM inference.

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

↑