让700亿参数大模型在低配设备上高效运行,隐私更安全。
TPI-LLM: Serving 70B-scale LLMs Efficiently on Low-resource Edge Devices
- 用张量并行+滑动窗口调度,动态管理模型权重
- 70B模型仅需3.1GB内存,比原版少90%峰值内存
- 适合移动端、边缘设备部署,保护用户数据隐私
大模型推理正从云端向边缘迁移,以应对用户交互数据的隐私担忧。然而,边缘设备普遍存在算力、内存和带宽受限问题,需多设备协作加速推理。现有流水线并行在单用户场景下效率低,张量并行则面临频繁通信瓶颈。本文提出一种高效的张量并行推理系统TPI-LLM,支持70B规模模型在低资源设备上运行。该系统将敏感原始数据保留在用户本地,并引入滑动窗口内存调度器,动态管理层权重,使磁盘I/O延迟与计算通信重叠,实现更大模型在内存受限设备上的流畅运行。分析发现链路延迟是主要瓶颈,因此采用星型全归约算法优化通信。在模拟与真实测试平台上实测表明,TPI-LLM相较Accelerate提升80%以上首令牌延迟和令牌延迟,相较Transformers和Galaxy提升90%以上,同时将Llama 2-70B的峰值内存占用降低90%,仅需3.1GB内存即可运行70B模型。
原文摘要 · Abstract (English)
Large model inference is shifting from cloud to edge due to concerns about the privacy of user interaction data. However, edge devices often struggle with limited computing power, memory, and bandwidth, requiring collaboration across multiple devices to run and speed up LLM inference. Pipeline parallelism, the mainstream solution, is inefficient for single-user scenarios, while tensor parallelism struggles with frequent communications. In this paper, we argue that tensor parallelism can be more effective than pipeline on low-resource devices, and present a compute- and memory-efficient tensor parallel inference system, named TPI-LLM, to serve 70B-scale models. TPI-LLM keeps sensitive raw data local in the users' devices and introduces a sliding window memory scheduler to dynamically manage layer weights during inference, with disk I/O latency overlapped with the computation and communication. This allows larger models to run smoothly on memory-limited devices. We analyze the communication bottleneck and find that link latency, not bandwidth, emerges as the main issue, so a star-based allreduce algorithm is implemented. Through extensive experiments on both emulated and real testbeds, TPI-LLM demonstrated over 80% less time-to-first-token and token latency compared to Accelerate, and over 90% compared to Transformers and Galaxy, while cutting the peak memory footprint of Llama 2-70B by 90%, requiring only 3.1 GB of memory for 70B-scale models.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。