dInfer:面向扩散语言模型的高效推理框架
dInfer: An Efficient Inference Framework for Diffusion Language Models
AI总结:
针对扩散大语言模型缺乏高效标准化推理框架的问题,提出模块化可扩展的dInfer推理框架,结合算法创新与系统优化,在多项基准上实现显著速度提升且不损失性能,代码已开源。
摘要:
基于扩散的大语言模型(dLLMs)凭借基于去噪的生成机制实现了固有并行性,已成为自回归(AR)大语言模型的极具潜力的替代方案。尽管越来越多的开源dLLM模型不断涌现,但由于缺乏标准化且高效的推理框架,其广泛应用仍受到限制。我们提出dInfer,一个高效且可扩展的dLLM推理框架。dInfer将推理流水线分解为四个模块化组件:模型、扩散迭代管理器、解码策略和KV缓存管理器,并为每个组件集成了新颖算法,同时搭配系统级优化。通过算法创新与系统增强的结合,dInfer在LLaDA-MoE上实现了显著的效率提升,且未降低输出质量。在批量大小为1时,它在HumanEval上的推理速度超过1100 token/秒,在8×H800 GPU上的六项基准测试中平均速度超过800 token/秒。与现有系统相比,dInfer的速度是Fast-dLLM的10倍,同时保持了相近的模型性能。即便与采用最新vLLM推理引擎高度优化、激活参数量和性能相当的AR模型QWen2.5-3B相比,dInfer仍能实现2-3倍的速度提升。dInfer的实现已在https://github.com/inclusionAI/dInfer 开源。
英文摘要:
Diffusion-based large language models (dLLMs) have emerged as a promising alternative to autoregressive (AR) LLMs, leveraging denoising-based generation to enable inherent parallelism. Even more and more open-sourced dLLM models emerge, yet their widespread adoption remains constrained by the lack of a standardized and efficient inference framework. We present dInfer, an efficient and extensible framework for dLLM inference. dInfer decomposes the inference pipeline into four modular components--model, diffusion iteration manager, decoding strategy, and KV-cache manager--and integrates novel algorithms for each component alongside system-level optimizations. Through this combination of algorithmic innovations and system enhancements, dInfer achieves substantial efficiency gains without compromising output quality on LLaDA-MoE. At batch size 1, it surpasses 1,100 tokens per second on HumanEval and averages over 800 tokens per second across six benchmarks on $8\times$ H800 GPUs. Compared to prior systems, dInfer delivers a $10\times$ speedup over Fast-dLLM while maintaining similar model performance. Even compared to the AR model (with a comparable number of activation parameters and performance) QWen2.5-3B, which is highly optimized with the latest vLLM inference engine, dInfer still delivers a $2$-$3\times$ speedup. The implementation of dInfer is open-sourced at https://github.com/inclusionAI/dInfer.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。