xdit-project/xDiT
xDiT: A Scalable Inference Engine for Diffusion Transformers (DiTs) with Massive Parallelism
What it solves
xDiT addresses the computational bottlenecks of Diffusion Transformers (DiTs), where the Attention mechanism's demand grows quadratically with input context length. This makes real-time high-quality image and video generation difficult on single GPUs, necessitating scalable multi-GPU and multi-machine deployments.
How it works
xDiT is an inference engine that implements several parallelization and acceleration strategies:
- Parallel Inference: It uses a hybrid approach combining Sequence Parallelism (USP), sequence-level pipeline parallelism (PipeFusion), Data Parallelism, and CFG Parallel (Split Batch) to optimize communication across hardware.
- Cache Acceleration: It integrates methods like TeaCache and DiTFastAttn to exploit computational redundancies between diffusion steps.
- Computing Acceleration: It utilizes kernel acceleration,
torch.compile, andonediffto boost single-GPU performance. - Attention Backends: It supports a wide array of backends including FlashAttention (v2, v3, v4), cuDNN, and AITER for AMD GPUs.
Who it’s for
Developers and researchers deploying large-scale Diffusion Transformers for image and video generation who need to reduce latency and increase throughput using multiple computing devices.
Highlights
- Broad Model Support: Compatible with a wide range of DiTs including Flux, HunyuanVideo, Wan2.1, and Stable Diffusion 3.
- Hybrid Parallelism: Ability to combine multiple parallel methods to match the specific number of available devices.
- Flexible Integration: Provides wrappers to adapt models from the
huggingface/diffuserslibrary. - Multi-Hardware Support: Optimized for NVIDIA GPUs, AMD GPUs (via AITER), and Ascend NPUs.
Related
- Project
- Project
- Project
- Dispatch
- Dispatch