tdrussell/diffusion-pipe

A pipeline parallel training script for diffusion models.

What it solves

It enables the training of massive diffusion models that are too large to fit on a single GPU. By utilizing pipeline parallelism, it allows users to distribute the model's workload across multiple GPUs, making high-end model training accessible on more limited hardware.

How it works

The project uses a hybrid of data and pipeline parallelism powered by DeepSpeed. It splits the model into stages across GPUs and can run multiple instances of the model simultaneously. To optimize memory and speed, it pre-caches latents and text embeddings to disk using the Huggingface Datasets library, removing the need to keep VAEs and text encoders in VRAM during the actual training process.

Who it’s for

Developers and AI researchers who want to train or fine-tune large-scale image and video diffusion models (such as Flux, SDXL, and HunyuanVideo) using multi-GPU setups.

Highlights

  • Broad Model Support: Compatible with a vast array of models including SDXL, Flux, LTX-Video, HunyuanVideo, Cosmos, and many others.
  • Unified Framework: Supports both image and video models within a single pipeline.
  • Memory Efficiency: Includes VRAM-reducing features like AdamW8BitKahan optimizer, block swapping, and Unsloth activation checkpointing.
  • Flexible Training: Supports training LoRAs directly on quantized models and provides full state checkpointing for resuming interrupted sessions.

Related

  • Dispatch
  • Project
  • Project
  • Project
  • Project