将大模型推理拆分到云端和设备端,显著降低延迟并提升吞吐。
P/D-Device: Disaggregated Large Language Model between Cloud and Devices
- 云端仅处理提示词预填充,设备快速响应首字
- 首字延迟降低60%,云吞吐最高提升15倍
- 适合资源受限设备部署高阶语言模型
服务拆分的大语言模型在工业实践中广泛应用以提升性能。然而,解码阶段生成大量标记导致云端资源长时间占用,实质上限制了云的更高吞吐。同时,由于设备端资源有限,提示词长度增长使首个标记时间(TTFT)急剧上升。为缓解这一资源瓶颈(云端长期占用与设备计算能力不足),我们提出将大语言模型在云端与设备间拆分:云端仅在设备预填充阶段提供部分内容。设备接收到首个标记后,即可脱离自身预填充过程,立即响应用户,实现更低的TTFT。随后,通过速率控制器从云端逐个发送后续标记,实现平滑的每输出标记时间(TPOT),直至设备追上进度。设备利用接收的标记摊销本地预填充开销,同时控制云端资源使用。此外,在云端预填充过程中,可利用已生成的中间数据对提示词进行优化,进一步加速设备端推理。我们实现了该方案P/D-Device,并验证其优于其他方法。我们还提出了一个算法以确定最优配置。真实轨迹实验表明,TTFT至少降低60%,最大TPOT约为数十毫秒,云吞吐最高提升15倍。
原文摘要 · Abstract (English)
Serving disaggregated large language models has been widely adopted in industrial practice for enhanced performance. However, too many tokens generated in decoding phase, i.e., occupying the resources for a long time, essentially hamper the cloud from achieving a higher throughput. Meanwhile, due to limited on-device resources, the time to first token (TTFT), i.e., the latency of prefill phase, increases dramatically with the growth on prompt length. In order to concur with such a bottleneck on resources, i.e., long occupation in cloud and limited on-device computing capacity, we propose to separate large language model between cloud and devices. That is, the cloud helps a portion of the content for each device, only in its prefill phase. Specifically, after receiving the first token from the cloud, decoupling with its own prefill, the device responds to the user immediately for a lower TTFT. Then, the following tokens from cloud are presented via a speed controller for smoothed TPOT (the time per output token), until the device catches up with the progress. On-device prefill is then amortized using received tokens while the resource usage in cloud is controlled. Moreover, during cloud prefill, the prompt can be refined, using those intermediate data already generated, to further speed up on-device inference. We implement such a scheme P/D-Device, and confirm its superiority over other alternatives. We further propose an algorithm to decide the best settings. Real-trace experiments show that TTFT decreases at least 60%, maximum TPOT is about tens of milliseconds, and cloud throughput increases by up to 15x.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。