Skip to main content
QUICK REVIEW

[论文解读] Understanding Large Language Models in Your Pockets: Performance Study on COTS Mobile Devices

Jie Xiao, Qiu-Shui Huang|ArXiv.org|Oct 4, 2024
Topic ModelingComputer Science被引用 3
一句话总结

本文针对高通、海思和联发科的主流SoC芯片,在商用现成移动设备上,使用7B参数模型对设备端大语言模型(LLM)进行了全面的性能基准测试。研究评估了令牌吞吐量、延迟、电池功耗以及CPU/GPU利用率、DVFS和硬件指令集等系统级因素,发现当前LLM推理在移动硬件上存在显著的资源浪费,尤其是GPU资源利用不足,而像Arm的smmla这类专用指令可将性能提升高达4倍。

ABSTRACT

As large language models (LLMs) increasingly integrate into every aspect of our work and daily lives, there are growing concerns about user privacy, which push the trend toward local deployment of these models. There are a number of lightweight LLMs (e.g., Gemini Nano, LLAMA2 7B) that can run locally on smartphones, providing users with greater control over their personal data. As a rapidly emerging application, we are concerned about their performance on commercial-off-the-shelf mobile devices. To fully understand the current landscape of LLM deployment on mobile platforms, we conduct a comprehensive measurement study on mobile devices. While user experience is the primary concern for end-users, developers focus more on the underlying implementations. Therefore, we evaluate both user-centric metrics-such as token throughput, latency, and response quality-and developer-critical factors, including resource utilization, OS strategies, battery consumption, and launch time. We also provide comprehensive comparisons across the mobile system-on-chips (SoCs) from major vendors, highlighting their performance differences in handling LLM workloads, which may help developers identify and address bottlenecks for mobile LLM applications. We hope that this study can provide insights for both the development of on-device LLMs and the design for future mobile system architecture.

研究动机与目标

  • 了解当前商用移动设备上设备端LLM的真实世界性能表现。
  • 识别影响移动平台LLM推理性能的硬件与系统级瓶颈。
  • 分析SoC架构、CPU/GPU利用率以及专用指令对LLM性能的影响。
  • 通过揭示未被充分利用的硬件潜力,为未来移动系统设计和设备端LLM优化提供指导。

提出的方法

  • 在高端移动设备上使用llama.cpp和MLC LLM推理引擎部署7B参数LLM。
  • 利用硬件性能分析工具(Snapdragon Profiler和Arm Streamline)收集详细的性能指标。
  • 测量令牌吞吐量、延迟、电池功耗以及包括CPU/GPU利用率和DVFS行为在内的系统级动态特性。
  • 分析硬件特性(如big.LITTLE CPU架构、缓存大小、内存带宽)以及专用指令(如smmla、sdot)的影响。
  • 在高通、海思和联发科的SoC之间进行性能对比,以评估厂商间的差异。
  • 采用广泛使用的量化方案对模型进行量化,以在速度与精度之间取得平衡,排除会降低性能的低比特量化。

实验结果

研究问题

  • RQ1不同主流厂商的移动SoC在LLM推理性能方面如何比较?
  • RQ2当前移动硬件(尤其是GPU)在设备端LLM推理过程中被利用的程度如何?
  • RQ3CPU线程数量、DVFS和内存带宽等系统级因素如何影响LLM推理性能?
  • RQ4通过利用smmla和sdot等专用硬件指令,可实现多大的性能提升?
  • RQ5硬件加速器(如Hexagon NPU)在设备端LLM的prefill延迟方面,与CPU和GPU相比表现如何?

主要发现

  • 移动GPU显著处于资源闲置状态,LLM推理期间仅有5%–20%的算术单元被实际使用。
  • 尽管Mali-G720 Immortalis MP12拥有更优越的硬件规格,但其性能仍落后于Adreno 750,表明单纯硬件参数无法保证更好的性能表现。
  • 将推理线程数设置为与大核(如prime和性能核)数量相等时可获得最佳性能;增加能效核通常会降低性能。
  • 当权重重构得当时,Arm专用指令如smmla和sdot可将LLM推理速度提升高达4倍。
  • Hexagon NPU在prefill延迟方面相比CPU和GPU实现了50倍的加速,展现出其在设备端LLM加速方面的巨大潜力。
  • SVE2和SME等硬件指令集为未来的Armv9架构移动CPU提供了进一步的优化潜力,尤其在长向量运算和矩阵专用指令方面。

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。