xDiT:一种具备大规模并行能力的扩散Transformer(DiTs)推理引擎
xDiT: an Inference Engine for Diffusion Transformers (DiTs) with Massive Parallelism
AI总结:
针对扩散Transformer(DiTs)长序列推理延迟高、单并行方法大规模可扩展性差的问题,提出混合序列并行、Patch级流水线并行PipeFusion及CFG并行的xDiT推理引擎,在多类GPU集群上实现了优异的可扩展性,且首次验证了DiTs在以太网GPU集群的可扩展性。
摘要:
扩散模型是生成高质量图像和视频的关键技术。受OpenAI的Sora成功启发,扩散模型的骨干网络正从U-Net向Transformer演进,即扩散Transformer(Diffusion Transformers,DiTs)。然而,生成高质量内容需要更长的序列长度,这会使注意力机制的计算量呈指数级增长,进而加剧DiTs的推理延迟。并行推理对DiTs的实时部署至关重要,但仅依赖单一并行方法并不现实,因为其在大规模场景下的可扩展性较差。本文提出xDiT,一款面向DiTs的综合性并行推理引擎。在深入研究现有DiTs并行方法后,xDiT选择序列并行(Sequence Parallel,SP)和PipeFusion(一种新型的Patch级流水线并行方法)作为图像内并行策略,同时采用CFG并行实现图像间并行。xDiT能够灵活地以混合方式组合这些并行方法,提供鲁棒且可扩展的解决方案。在通过以太网互连的两个8xL40 GPU(PCIe)节点以及一个8xA100(NVLink)节点上的实验结果表明,xDiT在五种最先进的DiTs上均表现出卓越的可扩展性。值得注意的是,我们首次验证了DiTs在以太网连接的GPU集群上的可扩展性。xDiT可在https://github.com/xdit-project/xDiT获取。
英文摘要:
Diffusion models are pivotal for generating high-quality images and videos. Inspired by the success of OpenAI's Sora, the backbone of diffusion models is evolving from U-Net to Transformer, known as Diffusion Transformers (DiTs). However, generating high-quality content necessitates longer sequence lengths, exponentially increasing the computation required for the attention mechanism, and escalating DiTs inference latency. Parallel inference is essential for real-time DiTs deployments, but relying on a single parallel method is impractical due to poor scalability at large scales. This paper introduces xDiT, a comprehensive parallel inference engine for DiTs. After thoroughly investigating existing DiTs parallel approaches, xDiT chooses Sequence Parallel (SP) and PipeFusion, a novel Patch-level Pipeline Parallel method, as intra-image parallel strategies, alongside CFG parallel for inter-image parallelism. xDiT can flexibly combine these parallel approaches in a hybrid manner, offering a robust and scalable solution. Experimental results on two 8xL40 GPUs (PCIe) nodes interconnected by Ethernet and an 8xA100 (NVLink) node showcase xDiT's exceptional scalability across five state-of-the-art DiTs. Notably, we are the first to demonstrate DiTs scalability on Ethernet-connected GPU clusters. xDiT is available at https://github.com/xdit-project/xDiT.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。