arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2603.09216cs.DC
收藏

PIM-SHERPA:一种通过解决PIM内存属性和布局不一致性的软件方法实现设备端LLM推理

PIM-SHERPA: Software Method for On-device LLM Inference by Resolving PIM Memory Attribute and Layout Inconsistencies

Samsung Advanced Institute of Technology(三星先进技术研究院);Samsung Electronics(三星电子);Yonsei University(延世大学)

Sunjung Lee, Sanghoon Cha, Hyeonsu Kim, Seungwoo Seo, Yuhwan Ro, Sukhan Lee, Byeongho Kim, Yongjun Park, Kyomin Sohn, Seungwon Lee, Jaehoon Yu

AI总结:

PIM-SHERPA通过解决PIM内存属性和布局不一致问题,实现了设备端LLM推理的高效性能和内存节省。

摘要:

在移动和边缘平台上,大型语言模型(LLM)的设备端部署正在迅速普及。LLM推理包括计算密集的预填充阶段和内存带宽密集的解码阶段,而解码阶段已被广泛认可为处理在内存(PIM)中处理的合适选择。然而,实际的PIM启用系统在这些阶段之间面临两个障碍,即内存属性不一致,其中预填充倾向于将权重放置在可缓存的区域以供重用,而解码需要权重在不可缓存的区域以可靠地触发PIM,以及主机友好和PIM意识布局之间的权重布局不一致。为了解决这些问题,我们引入了PIM-SHERPA,一种仅基于软件的方法,通过解决PIM内存属性和布局不一致来实现高效的设备端LLM推理。PIM-SHERPA提供了两种方法,DRAM双缓冲(DDB),它在不可缓存的区域保持一个PIM意识的权重,同时预取下一层的交错权重到小的可缓存缓冲区,以及在线权重重排与交错内存复制(OWR),它在GEMM之前立即执行所需的交错内存复制。与基线PIM模拟系统相比,PIM-SHERPA在Llama 3.2模型上实现了约47.8-49.7%的内存容量节省,同时保持与理论最大值相当的性能。据我们所知,这是首次在产品级PIM启用系统中识别内存属性不一致并提出有效解决方案的工作。

英文摘要:

On-device deployments of large language models (LLMs) are rapidly proliferating across mobile and edge platforms. LLM inference comprises a compute-intensive prefill phase and a memory bandwidth-intensive decode phase, and the decode phase has been widely recognized as well-suited to processing-in-memory (PIM) in both academia and industry. However, practical PIM-enabled systems face two obstacles between these phases, a memory attribute inconsistency in which prefill favors placing weights in a cacheable region for reuse whereas decode requires weights in a non-cacheable region to reliably trigger PIM, and a weight layout inconsistency between host-friendly and PIM-aware layouts. To address these problems, we introduce \textit{PIM-SHERPA}, a software-only method for efficient on-device LLM inference by resolving PIM memory attribute and layout inconsistencies. PIM-SHERPA provides two approaches, DRAM double buffering (DDB), which keeps a single PIM-aware weights in the non-cacheable region while prefetching the swizzled weights of the next layer into small cacheable buffers, and online weight rearrangement with swizzled memory copy (OWR), which performs the on-demand swizzled memory copy immediately before GEMM. Compared to a baseline PIM emulation system, PIM-SHERPA achieves approximately 47.8 - 49.7\% memory capacity savings while maintaining comparable performance to the theoretical maximum on the Llama 3.2 model. To the best of our knowledge, this is the first work to identify the memory attribute inconsistency and propose effective solutions on product-level PIM-enabled systems.

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

↑