AlibabaResearch/SparkDiffusion
arXiv:2612.04263 ↗A Wan video DiT toolkit for faster inference with sparse attention and few-step students
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
SparkDiffusion is a Python/PyTorch research stack for accelerating Wan video diffusion transformers. A typical workflow starts with a native Wan checkpoint, finetunes the backbone with RoLa sparse low-rank attention, and uses CrossDistill's trajectory-level hybrid distillation to train a few-step student. The inference CLI pairs that student DiT with native VAE, T5 and tokenizer assets, plus the native CLIP vision encoder for Wan 2.1 I2V. Wan 2.2 uses a shared asset root with separate high- and low-noise DiT experts.
sparkdiffusion/ contains models, samplers, checkpoint handling and operators; imaginaire/ provides training and configuration utilities, with Hydra and OmegaConf in the dependency manifest. A sparse-attention registry lets attention variants plug in without rewriting the core loops. The kernel boundary matters: sparkdiffusion/ops/fused_kernel/ supplies inference operators on the CUDA/Triton stack, while RoLa training launched through torchrun requires an external SLA backward kernel.
Key Capabilities & Differentiators
The common inference wrappers compare dense, sparse and distilled checkpoints for Wan text-to-video (T2V) and image-to-video (I2V) workflows. Released students cover specific combinations: Wan 2.1 T2V has 1.3B and 14B 480p four-step checkpoints at 0.90 sparsity, plus 14B 720p variants at 0.97/four steps and 0.95/three steps. Wan 2.1 I2V has a 14B 720p release at 0.97/four steps, and Wan 2.2 T2V has a 14B 480p release at 0.95/four steps. Treat those entries as validated configurations to try, not as interchangeable settings for any checkpoint.
Wan 2.2 finetuning can target either noise expert, train both sequentially, or train them jointly; the joint distillation launcher loads both experts in one process. Standard launchers accept native Wan directories or safetensors, supported .pt/.pth files, and distributed checkpoint (DCP) directories without a separate conversion step. The finetuning loader rejects a zero-parameter backbone match and warns on partial matches, while new RoLa parameters are expected to start uninitialized by the stock checkpoint.
Trade-offs & Limitations
Native dense Wan is the most useful baseline: it avoids the need for a matching RoLa student and preserves the original denoising path. SparkDiffusion trades that simplicity for less attention work and fewer denoising steps, with optional weight–activation quantization when the hardware supports it. The fp8 path calls for FP8 Tensor Cores; bf16 is the fallback. High sparsity and a short schedule are not substitutes for checking motion, prompt adherence and diversity on your own clips.
Do not treat the headline 265× over a dense multi-step baseline as an expected deployment result. The CLI times CUDA-synchronized denoising: later serial samples avoid first-sample warmup, the measured interval includes expert transfers during denoising, and video decoding and writing are excluded. Compare that metric separately from complete job latency and throughput. Released students avoid the training kernel dependency; reproducing or extending training adds local dataset preparation, an SLA checkout and teacher/student configuration.
Hardware & Deployment Guide
Run on Linux with Python 3.10 or newer and a CUDA-capable GPU. Install CUDA-matched PyTorch, torchvision and a compatible flash-attn build before the remaining requirements, which specify Triton ≥3.4.0. The manifest also flags removal of megatron-core for training setup. Source scripts/env.sh to set PYTHONPATH, repository-relative roots and offline defaults for Hugging Face and W&B. Stage native Wan assets and the matching student weights separately; training also needs local data and SLA_SRC set to a valid external checkout.
Use scripts/inference/ for local CLI inference or scripts/sparse_finetune/ and scripts/distill/ for training. The inference path accepts one prompt per process and saves videos locally; no serving API is shown. Size the GPU against the actual checkpoint, output resolution, precision, expert configuration and intended concurrency, rather than extrapolating from serial samples. No GitHub release is listed. For reproducible runs, record the repository revision alongside the exact checkpoint and CUDA/PyTorch/Triton versions.
GPU-equipped research or infrastructure teams benchmarking dense versus sparse and distilled Wan, or adapting RoLa and CrossDistill to their own data.
You need a managed generation API, CPU-only inference, or turnkey multi-prompt serving rather than a local, single-prompt CLI workflow.
Quick Start & Installation
pip install -r requirements.txt source scripts/env.sh
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/AlibabaResearch/SparkDiffusion.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about SparkDiffusion
How do I run a released student, and when do I need the external SLA checkout?
How should I size GPU memory and measure runtime overhead?
Can I self-host SparkDiffusion commercially?
When should I choose SparkDiffusion over a native dense Wan workflow?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy