Sizing VRAM from DiT parameter count alone
T5-XXL (~9.5 GB BF16) plus 3D video VAE activations and attention intermediates easily double total memory needs.
Operator task guide
Video and image diffusion pipelines (such as Wan 2.1 14B / 1.3B and Flux) hit CUDA OOM in three distinct places: loading the FP16/BF16 T5-XXL text encoder alongside the DiT backbone (~20 to 30+ GB combined), denoising high frame counts or resolutions without attention slicing, and decoding full latent frames inside the 3D/2D VAE.
Check which pipeline stage triggered the OOM first. Offloading or quantizing the T5 text encoder (FP8/GGUF), enabling sequential CPU offload or VAE tiling, and matching resolution/frame count to 8 GB, 16 GB, 24 GB, or 48 GB+ GPUs prevents crashes without degrading output quality.
Reviewed . Reference guidance is not a diagnosis of your workload.
Read the traceback to determine whether OOM occurred during text encoding (T5/CLIP), DiT denoising steps, or final VAE decode (very common in Wan 2.1 video generation).
grep -n -iE 'OutOfMemoryError|vae|t5|transformer|forward' run.log
nvidia-smiFragmentation spikes sharply between text encoding, denoising, and VAE decoding. Enable expandable segments plus VAE tiling/slicing so latent decoding does not allocate gigabytes at once.
export PYTORCH_CUDA_ALLOC_CONF=expandable_segments:TrueOn 8 GB to 16 GB cards, run quantized FP8/INT8/GGUF weights (or Wan 2.1 1.3B instead of 14B) with CPU text-encoder offloading. On 24 GB cards (RTX 4090), FP8 DiT + VAE tiling runs 480p/720p video comfortably.
Log torch.cuda.max_memory_allocated() after the final video/image frame saves so you know true end-to-end peak VRAM before batching multiple requests.
| Signal | What it means | Next action |
|---|---|---|
| OOM immediately during prompt encoding | T5-XXL + DiT weights both loaded onto GPU at BF16. | Offload text encoder to CPU after encoding or use FP8/INT8 T5. |
| Denoising finishes 100%, then crashes with OOM at end | 3D/2D VAE decode peak exceeded remaining VRAM. | Enable VAE tiling (enable_vae_tiling) and VAE slicing. |
| OOM during first denoising step on 8 GB to 12 GB GPU | 14B model or high frame count/resolution exceeds card VRAM. | Use Wan 2.1 1.3B or FP8/GGUF quantized weights and enable model CPU offload. |
| Reserved minus allocated is large in OOM line | Allocator fragmentation across resolution changes. | Set PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True. |
T5-XXL (~9.5 GB BF16) plus 3D video VAE activations and attention intermediates easily double total memory needs.
Temporal attention and 3D VAE memory scale with frame count.
Offloading DiT before VAE decode frees 10 to 28 GB immediately.
Classify fragmentation vs capacity from your OutOfMemoryError line.
Fix expandable_segments and memory retention bugs.
Estimate weight and runtime memory requirements.
Debug illegal memory access, device asserts, and OOMs.
Wan 2.1 1.3B can run on 8 GB to 12 GB GPUs with offloading and FP8/BF16 tuning (480p), while Wan 2.1 14B at full BF16 plus T5-XXL needs 48 GB to 80 GB GPUs unless FP8 quantization and CPU offloading are enabled for 24 GB cards.
At step 100%, the pipeline moves from denoising latents to decoding pixels inside the VAE, which creates a sharp temporary activation peak. Enable VAE tiling and offload the DiT before decoding.
Use the 1.3B checkpoint, quantized weights (FP8/GGUF), CPU offloading for T5-XXL, VAE tiling, and 480p resolution with modest frame counts.
Yes. Diffusion workloads change tensor sizes between text encoding, DiT blocks, and VAE decoding, so expandable segments reduce fragmentation OOMs significantly.
Get the likely cause, supporting evidence, and next safe steps with the same cloud reasoning used by paid plans. A crash the engine recognizes is answered in seconds, then checked by an independent AI review that updates this page when it finishes. A crash it does not recognize waits for the AI's own answer, which can take a few minutes. No account, card, or installation. Logs are masked at Denpex API ingress and are not saved to account history.
Before uploading, review cloud data handling and local options.
Upload your log file. Large files are processed in your browser. Only selected evidence is submitted when you run diagnosis.
No credit card. No automatic subscription. See whether Denpex helps with an incident you already understand.
Up to 50 diagnoses a day for 30 days. Verify your work email to activate an eligible company evaluation, then replay a resolved incident and compare the evidence and next steps with your team's confirmed cause.
Use the three free diagnoses to review your error and relevant evidence. Keep reference guidance separate from the cause and recovery status of your own workload.
Diagnose your incident