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

你的NPU是否适用于大语言模型?剖析移动大语言模型推理中隐藏的效率瓶颈

Is Your NPU Ready for LLMs? Dissecting the Hidden Efficiency Bottlenecks in Mobile LLM Inference

Tsinghua University(清华大学);Beijing Jiaotong University(北京交通大学)

Guanyu Cai, Ruiming Tian, Lang Yang, Zhouhong Ren, Jinliang Yuan, Lingkun Li, Jiliang Wang

AI总结:

研究剖析移动大语言模型推理隐藏的效率瓶颈,通过跨层测量及PowerBench工具,发现框架性能差距在NPU上被放大、不同后端在不同阶段各有优劣及存在调度空间浪费,据此提出配置可降NPU后端能耗54.8%。

摘要:

在移动设备上部署大语言模型可增强隐私并减少延迟,但受硬件效率低下严重制约。我们首次对移动大语言模型推理进行全面的跨层测量研究,涵盖五个主流框架和三个硬件后端。为此开发了PowerBench工具。研究得出三个关键见解:框架导致的性能差距在NPU上大幅放大;NPU在计算密集型预填充阶段表现出色,CPU在内存密集型解码阶段占优;特定后端分析发现先前工作存在调度空间浪费。基于这些发现,我们提出了面向能源的移动大语言模型推理最佳实践配置,估计可使NPU后端能耗降低54.8%。

英文摘要:

Deploying Large Language Models (LLMs) on mobile devices enhances privacy and reduces latency, but is severely constrained by hardware inefficiencies. We present the first comprehensive, cross-layer measurement study of mobile LLM inference, spanning five mainstream frameworks (e.g., llama.cpp and GENIE) and three hardware backends (CPU, GPU, and NPU). To enable this analysis, we develop PowerBench, a fine-grained profiling tool that measures LLM throughput and provides the first backend-specific energy attribution for mobile LLM inference, going beyond traditional device-level measurements. We further conduct hardware microbenchmarks to characterize the memory-system performance and compute capabilities of mobile CPUs, GPUs, and NPUs. Our study yields three critical insights: (1) Framework-induced performance gaps are substantially amplified on NPUs, reaching up to $10\times$ due to differences in offloading strategies, hardware-underutilizing operators, and activation quantization strategies. (2) We identify a distinct ``phase split,'' in which NPUs excel at compute-bound prefilling, while CPUs outperform all other backends in memory-bound decoding. This split is driven by NPUs' preference for large, fixed-shape workloads, which conflicts with the small-kernel, dynamic nature of decoding. (3) Backend-specific profiling uncovers substantial scheduling headroom missed by prior work. Suboptimal thread configurations, uncoordinated NPU sleep latencies, and CPU polling intervals result in unnecessary energy consumption. For example, tuning CPU frequency alone reduces energy consumption by up to $39.7\%$. Leveraging these findings, we estimate that an energy-oriented configuration can reduce energy consumption by up to $53.2\%$ on the NPU backend across three datasets, highlighting the substantial potential for further efficiency improvements in mobile LLM deployment.

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

↑