优化大模型推理性能,平衡延迟与吞吐的矛盾。
Parallelization Strategies for Dense LLM Deployment: Navigating Through Application-Specific Tradeoffs and Bottlenecks
- 对比张量并行与流水线并行在延迟和吞吐上的表现差异。
- 实测表明张量并行降低延迟,流水线并行提升吞吐量。
- 混合使用两种并行策略可灵活调控性能权衡,适合不同应用场景。
生成式AI的突破推动了大规模语言模型(LLM)应用的爆发式增长,其工作负载本质上是通过Transformer架构进行的一系列推理操作。在这一快速扩展的生态系统中,密集型LLM——即每个标记生成时激活全部参数的模型——构成了高级专家类变体的基础。由于具备强大的泛化能力、可扩展性、微调便捷性以及跨任务通用性,密集模型仍占主导地位。在LLM推理系统中,性能主要由延迟、响应时间和吞吐量(单位时间生成的标记数)决定。延迟与吞吐量本质上相互耦合:优化一方往往以牺牲另一方为代价。此外,当密集模型参数超出设备内存容量时,批处理策略和并行配置会显著影响延迟和整体系统吞吐量。本文(i)研究了两个代表性密集型LLM——Llama-3.1-70B和Llama-3.1-405B的工作负载,特别关注节点内并行方案;(ii)分析输入特征、批处理方式及并行策略如何影响延迟灵活性和延迟-吞吐权衡;(iii)识别关键性能瓶颈,为满足服务等级协议(SLAs)和维持推理质量提供设计依据。实证评估显示,张量并行(TP)更有利于降低延迟,而流水线并行(PP)更适合吞吐量导向的应用。我们强调,通过控制TP与PP的度数,可实现对延迟-吞吐互斥关系的精细调控。
原文摘要 · Abstract (English)
Breakthroughs in the generative AI domain have fueled an explosion of large language model (LLM)-powered applications, whose workloads fundamentally consist of sequences of inferences through transformer architectures. Within this rapidly expanding ecosystem, dense LLMs--those that activate all model parameters for each token generation--form the foundation for advanced expert-based variants. Dense models continue to dominate because of their strong generalization ability, scalability, ease of fine-tuning, and versatility across diverse tasks. In LLM inference systems, performance is mainly characterized by latency, response time, and throughput (i.e., tokens generated per unit of time). Latency and throughput are inherently coupled: optimizing for one often comes at the expense of the other. Moreover, batching strategies and parallelism configurations, which are essential when dense model parameters exceed device memory capacity, can significantly affect both latency and overall system throughput. This paper (i) investigates the workloads of two representative dense LLMs--Llama-3.1-70B and Llama-3.1-405B, focusing in particular on intra-node parallelization schemes, (ii) analyzes how input characteristics, batching, and parallelism strategies influence latency flexibility and the latency-throughput tradeoff, and (iii) identifies key performance bottlenecks that inform design choices for meeting service-level agreements (SLAs) and sustaining inference quality. Our empirical evaluations reveal that Tensor Parallelism (TP) improves the latency objectives while Pipeline Parallelism (PP) is better-suited for throughput-oriented applications. We highlight that their hybrid usage by controlling the TP and PP degrees provides control over the latency-throughput interplay.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。