diffusion-perf-opt

Diagnose and optimize vLLM Omni diffusion workloads using profiler traces and parallel strategy analysis.

6.5k|1.6k|Updated Sep 11, 2025
One-click install
npx skills add https://github.com/vllm-project/vllm-omni --skill diffusion-perf-opt
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: diffusion-perf-opt
Source: https://github.com/vllm-project/vllm-omni/tree/main/.claude/skills/diffusion-perf-opt
Command: npx skills add https://github.com/vllm-project/vllm-omni --skill diffusion-perf-opt

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

Optimizing vLLM Omni diffusion serving (Wan, Qwen, Flux-style image and video generation) is hard because profiler traces distort latency, parallel strategies interact in complex ways, and optimizations risk silently degrading output quality. This Skill provides a disciplined workflow that separates real baselines from diagnostic traces and enforces quality gates on every change.

Core Features & Use Cases

  • Baseline and trace discipline: Collect low-overhead latency baselines separately from torch profiler diagnostic traces, then analyze trace.json/trace.json.gz files with the included trace_analyzer.py script to find GPU idle gaps, top operators, and NCCL communication costs.
  • Parallel strategy search: Model and A/B test USP/SP, CFG parallel, HSDP/FSDP, and VAE patch parallelism across 2, 4, or 8 GPU configurations with stage-level timing comparisons.
  • Prioritized optimization plans: Produce P0/P1/P2 candidate tables covering host/runtime fixes, operator fusion, attention optimization, VAE pipeline tuning, and quantization, each with evidence, validation plans, and quality risk.
  • Use Case: Given an 8-GPU Wan2.2 I2V video generation deployment with high latency, use this Skill to compare CFG=2 x USP=4 against USP=8, profile the dominant diffuse stage, and produce a validated optimization plan.

Quick Start

Ask the assistant to analyze and optimize your vLLM Omni diffusion workload by providing your GPU setup, model, server startup command, request command, and benchmark command.

Frequently Asked Questions about diffusion-perf-opt

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I profile vLLM Omni diffusion performance?

Collect a baseline first with profiler disabled using --log-stats and --enable-diffusion-pipeline-profiler for low-overhead stage timings. Then run torch profiler on a few requests and analyze the trace.json.gz files with the included trace_analyzer.py script to find GPU idle gaps and top operators.

How do I choose between USP, CFG, and HSDP parallelism for video diffusion?

Prefer USP/SP for long video token sequences and CFG parallel when CFG doubles transformer forwards on moderate sequence lengths. For 8 GPUs, compare CFG=2 x USP=4 against CFG=1 x USP=8, and treat HSDP primarily as a memory strategy tested with on/off A/B runs.

Why does torch profiler show different latency than my benchmark?

Torch profiler adds overhead such as CUPTI Command Buffer Full events, so profiler latency is diagnostic only and must not be used as a final latency claim. Always report performance numbers from non-profiler baseline and benchmark commands.

What causes GPU idle gaps in diffusion serving traces?

Common causes include torch.cuda.empty_cache calls, explicit synchronizations, Python preprocessing, scheduler small linear algebra, VAE tile split/merge loops, and first-request FSDP/HSDP lazy initialization. Use a host-stack trace with a low --min-gap-ms threshold to map gaps to enclosing CPU code.

When should I avoid FP8 quantization or custom kernels for diffusion models?

Treat FP8, sparsity, approximate attention, and custom Triton/CUDA kernels as P2 high-risk items. Only pursue them after low-risk runtime, parallel, and fusion work is exhausted, and always validate with visual quality metrics, temporal flicker checks, and seed stability tests.