NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

xDiT: an Inference Engine for Diffusion Transformers (DiTs) with Massive Parallelism

Jiarui Fang, Jinzhe Pan, Xibo Sun, Aoyu Li, Jiannan WangarXiv 2024 · DOI

Introduction

The landscape of generative AI is undergoing a fundamental shift. The backbone of state-of-the-art models is moving from traditional U-Nets to Diffusion Transformers (DiTs), which power industry-leading systems like OpenAI’s Sora, Stable Diffusion 3, and Flux.1. While DiTs offer superior scalability and generation quality, they introduce significant computational challenges. Because DiTs process images and videos as sequences of tokens, the complexity of their attention mechanisms grows quadratically with sequence length. Consequently, generating high-resolution content can take minutes on a single GPU, hindering real-time applications.

Existing parallelization techniques, largely adapted from Large Language Models (LLMs), often struggle with DiTs. These models feature unique architectural traits—such as multi-step denoising—and high communication overheads that standard Ethernet or PCIe interconnects cannot easily handle. To address these bottlenecks, we introduce xDiT, the first comprehensive inference engine designed specifically to scale DiTs across massive GPU clusters.

The xDiT Architecture

xDiT treats DiT inference as a multi-dimensional parallelism problem. Rather than relying on a single scaling method, it employs a hybrid approach that combines inter-image and intra-image parallelism to maximize throughput and minimize latency.

Overview of the xDiT framework, illustrating the DiTs backbone and the hybrid parallelism strategy (CFG+SP+PipeFusion).

As shown in the framework overview, xDiT integrates several core components:

  • CFG Parallelism: This splits the conditional and unconditional generation branches across different devices.
  • Sequence Parallelism (SP): This partitions image or video tokens across GPUs, specifically adapted for "In-Context Conditioning" models like Flux.1.
  • Parallel VAE: To avoid Out-of-Memory (OOM) errors during the final decoding of massive images (e.g., 4096px), xDiT implements a patch-parallel Variational Autoencoder (VAE) that processes the image in discrete chunks.

PipeFusion: Patch-level Pipeline Parallelism

A key innovation within xDiT is PipeFusion, a novel patch-level pipeline parallelism method. Traditional pipeline parallelism often suffers from "bubbles" or idle time where GPUs wait for data. PipeFusion overcomes this by leveraging input temporal redundancy inherent in the diffusion process.

The PipeFusion mechanism, showing how the DiT backbone is partitioned across devices and processed in micro-steps to hide communication latency.

Since activations in diffusion models change slowly between successive denoising steps, PipeFusion uses "stale" activations from the previous step to provide necessary context. This allows multiple GPUs to work on different image patches simultaneously with minimal communication. This approach is particularly effective for scaling on standard Ethernet clusters, as it successfully hides communication latency behind computation.

Key Results and Performance

The researchers evaluated xDiT across five state-of-the-art models, including Pixart-alpha, Stable Diffusion 3, and Flux.1, using hardware ranging from high-speed NVLink A100 nodes to standard Ethernet-connected L40 clusters.

  • Massive Speedups: On a 4096px image task using Pixart, xDiT achieved a 13.29x speedup on 16 GPUs, reducing latency from 245 seconds to just 17 seconds.
  • Video Acceleration: For the CogVideoX-5B model, generation time for a 49-frame video was slashed from over 5 minutes to just 52 seconds.
  • Linear Scaling: On high-bandwidth nodes, xDiT demonstrated nearly linear scaling for high-resolution tasks, effectively eliminating communication bottlenecks.
  • Quality Preservation: Benchmarking against the COCO Captions 2014 dataset confirmed that these parallelization techniques do not degrade image quality, with FID scores remaining consistent with serial inference.

Conclusion and Future Work

xDiT represents a major leap forward in making large-scale DiT inference practical. By exploiting the iterative nature of diffusion through PipeFusion and hybrid parallelism, it enables high-resolution generation in seconds rather than minutes. Future work will focus on further optimizing PipeFusion for the unique temporal redundancies of video models and improving load balancing for complex architectures with skip-connections.

The xDiT engine is open-source and available for the research community to accelerate the next generation of generative AI.

Summary updated

BibTeX
@misc{fang2024xdit,
  author = {Jiarui Fang and Jinzhe Pan and Xibo Sun and Aoyu Li and Jiannan Wang},
  title = {{xDiT: an Inference Engine for Diffusion Transformers (DiTs) with Massive Parallelism}},
  year = {2024},
  eprint = {2411.01738},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2411.01738},
}
Figure