#!/bin/bash # Latent + text-encoder caches for the quick run. # Latents: batch capped at 4 (video VAE VRAM); TE: batch capped at 4 (32B VL encoder + first-frame image). # Cache TOML has batch_size=8 in [general]; the CLI flag lowers it per stage. set -Eeuo pipefail source /venv/main/bin/activate cd /workspace/projects/musubi-tuner M=/workspace/models/MiniMax-H3 P=/workspace/projects/h3_loop CFG="${1:-$P/configs/dataset_quick_cache.toml}" echo "=== latent cache ($CFG) ===" python src/musubi_tuner/minimax_h3_cache_latents.py \ --dataset_config "$CFG" \ --vae "$M/vae/minimax_h3_video_vae_fp16.safetensors" \ --device cuda --batch_size 24 --num_workers 16 \ --skip_existing --keep_cache echo "=== text encoder cache (task i2va, guidance empty) ===" python src/musubi_tuner/minimax_h3_cache_text_encoder_outputs.py \ --dataset_config "$CFG" \ --text_encoder "$M/text_encoders/qwen3vl_32b_minimax_h3_nvfp4_awq.safetensors" \ --text_encoder_quantization nvfp4_awq \ --task i2va --cache_guidance_empty \ --device cuda --batch_size 24 --num_workers 16 \ --skip_existing --keep_cache echo "=== cache sizes ===" du -sh /workspace/cache/quick/* 2>/dev/null