arXiv:2504.04104cs.LG2025-04被引 6

用推测解码填满流水线,显著降低大模型推理延迟。

SpecPipe: Accelerating Pipeline Parallelism-based LLM Inference with Speculative Decoding

  • 通过动态推测令牌树逐步填充流水线,提升硬件利用率。
  • 在8级流水线上,单请求延迟降低4.19倍至5.53倍。
  • 适合高并发、低延迟需求的大型语言模型部署场景。

大语言模型推理需求快速增长。流水线并行虽具成本优势,但存在服务延迟高的问题。引入推测解码可改善性能,但仍面临硬件利用率低、推测窗口窄的挑战。受指令流水线分支预测启发,我们提出SpecPipe,通过逐步填充推测令牌来填满流水线,理想情况下每步流水线可解码一个新标记。SpecPipe包含动态推测令牌树与流水线推理框架,树动态接收推测源的令牌并输出至推理流水线;因推测窗口放宽,无需微调即可集成高精度草稿模型。推理框架遵循节点计算、剪枝传播和跨节点通信三阶段。我们实现了单请求版SpecPipe与多请求版SpecPipe-DB(支持动态批处理)。在8级流水线上,SpecPipe相比标准流水线并行,在多样单请求负载下,token间隔时间减少4.19倍至5.53倍,比现有基于树的推测解码方法快2.08倍至2.38倍;在多请求场景中,SpecPipe-DB吞吐量提升1.64倍至2.08倍,token间隔时间降低1.61倍至2.06倍,优于vLLM。

原文摘要 · Abstract (English)

The demand for large language model inference is rapidly increasing. Pipeline parallelism offers a cost-effective deployment strategy for distributed inference but suffers from high service latency. While incorporating speculative decoding to pipeline parallelism improves performance, it still faces challenges of low hardware utilization and narrow speculative window. Inspired by branch prediction in instruction pipelining, we introduce SpecPipe, which fills the pipeline with speculative tokens of a request step-by-step. By maximizing the hardware utilization, SpecPipe decodes one token per pipeline step ideally. Specifically, SpecPipe comprises a dynamic speculative token tree and a pipelined inference framework. The tree dynamically accepts tokens from a speculative token source and outputs the tokens to the inference pipeline. Since the speculative window relaxed in our framework, a high-accuracy draft model is integrated without fine-tuning. The pipeline inference framework follows node-wise computation, pruning propagation, and inter-node communication stages. We implement SpecPipe and a variant SpecPipe-DB with dynamic batching for single- and multi-request inference, respectively. On an 8-stage pipeline, SpecPipe improves time between tokens on diverse single-request workloads by $4.19\times$-$5.53\times$ over standard pipeline parallelism and by $2.08\times$-$2.38\times$ over prior tree-based speculative decoding methods. For multi-request workloads, SpecPipe-DB achieves $1.64\times$-$2.08\times$ higher throughput and $1.61\times$-$2.06\times$ lower time between tokens than vLLM.

大模型推理流水线并行推测解码高性能

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。