# ltx-bench Profiling and benchmarking tools for LTX-2. ## Running benchmarks ```bash # All benchmarks (requires H100 GPU + model checkpoints at /models/) uv run pytest -m bench --bench # With Nsight Systems profiling uv run pytest -m bench --bench --nsys # Custom output directory and iterations uv run pytest -m bench --bench \ --bench-output=./my_results \ --bench-warmup=3 \ --bench-repeats=10 ``` ## Benchmark types ### Components Individual model components benchmarked in isolation: | Benchmark | What it measures | |-----------|-----------------| | `transformer_forward_video_only` | X0Model forward pass (video only) | | `transformer_forward_av` | X0Model forward pass (video + audio) | | `video_vae_decode` | Video VAE decoder | | `video_vae_encode` | Video VAE encoder | | `audio_decode` | Audio VAE decoder + vocoder | | `audio_encode` | Audio VAE encoder | | `text_encoder_forward` | Gemma text encoder (positive + negative prompt) | | `spatial_upsampler` | Latent spatial upsampler 2x | ### Pipelines End-to-end pipeline benchmarks with per-stage instrumentation: | Benchmark | Pipeline | |-----------|----------| | `distilled` | 8-step distilled inference | | `ti2vid_one_stage` | Text-to-video one-stage | | `ti2vid_two_stages` | Text-to-video two-stage with upsampling | | `keyframe_interpolation` | Keyframe interpolation two-stage | | `ic_lora` | IC-LoRA with depth conditioning | | `a2vid_two_stage` | Audio-to-video two-stage | | `retake` | Video retake with regeneration | ## Trend analysis Generate trend charts from GCS historical data: ```bash python -m ltx_bench.trends --branch main --last 20 --output ./trend_report ``` ## Report output Each run produces a `REPORT.md` with: - Per-component GPU time, peak VRAM, and peak RAM - Per-pipeline total time with stage breakdown (text encoding, denoising, VAE decode, etc.) - Denoising throughput in s/it