diff --git a/examples/distill/SFWan2.1-T2V/distill_dmd_t2v_1.3B.sh b/examples/distill/SFWan2.1-T2V/distill_dmd_t2v_1.3B.sh index a50741ec7..f0d3d1c43 100644 --- a/examples/distill/SFWan2.1-T2V/distill_dmd_t2v_1.3B.sh +++ b/examples/distill/SFWan2.1-T2V/distill_dmd_t2v_1.3B.sh @@ -16,7 +16,7 @@ export NCCL_P2P_DISABLE=1 export TORCH_NCCL_ENABLE_MONITORING=0 # different cache dir for different processes export TRITON_CACHE_DIR=/tmp/triton_cache_${SLURM_PROCID} -export MASTER_PORT=29502 +export MASTER_PORT=29503 export TOKENIZERS_PARALLELISM=false export WANDB_API_KEY="50632ebd88ffd970521cec9ab4a1a2d7e85bfc45" export WANDB_BASE_URL="https://api.wandb.ai" @@ -24,11 +24,11 @@ export WANDB_MODE=online export FASTVIDEO_ATTENTION_BACKEND=FLASH_ATTN # Configs -NUM_GPUS=1 +NUM_GPUS=4 # Model paths for Self-Forcing DMD distillation: GENERATOR_MODEL_PATH="wlsaidhi/SFWan2.1-T2V-1.3B-Diffusers" -REAL_SCORE_MODEL_PATH="Wan-AI/Wan2.1-T2V-1.3B-Diffusers" # Teacher model +REAL_SCORE_MODEL_PATH="Wan-AI/Wan2.1-T2V-14B-Diffusers" # Teacher model FAKE_SCORE_MODEL_PATH="Wan-AI/Wan2.1-T2V-1.3B-Diffusers" # Critic model DATA_DIR="data/crush-smol_processed_t2v/combined_parquet_dataset/" @@ -58,11 +58,11 @@ training_args=( # Parallel arguments parallel_args=( - --num_gpus 1 # 64 + --num_gpus $NUM_GPUS # 64 --sp_size 1 --tp_size 1 --hsdp_replicate_dim 1 # 64 - --hsdp_shard_dim 1 + --hsdp_shard_dim $NUM_GPUS ) # Model arguments @@ -84,7 +84,7 @@ dataset_args=( validation_args=( --log_validation --validation_dataset_file "$VALIDATION_DATASET_FILE" - --validation_steps 20 + --validation_steps 50 --validation_sampling_steps "4" --validation_guidance_scale "6.0" # not used for dmd inference ) @@ -93,8 +93,8 @@ validation_args=( optimizer_args=( --learning_rate 1e-5 --mixed_precision "bf16" - --training_state_checkpointing_steps 200 - --weight_only_checkpointing_steps 200 + --training_state_checkpointing_steps 500 + --weight_only_checkpointing_steps 500 --weight_decay 0.01 --betas '0.0,0.999' --max_grad_norm 1.0 diff --git a/examples/inference/basic/basic.py b/examples/inference/basic/basic.py index f12a4969e..316621eaf 100644 --- a/examples/inference/basic/basic.py +++ b/examples/inference/basic/basic.py @@ -9,9 +9,9 @@ def main(): # If a local path is provided, FastVideo will make a best effort # attempt to identify the optimal arguments. generator = VideoGenerator.from_pretrained( - "Wan-AI/Wan2.1-T2V-1.3B-Diffusers", + "Wan-AI/Wan2.1-T2V-14B-Diffusers", # FastVideo will automatically handle distributed setup - num_gpus=1, + num_gpus=4, use_fsdp_inference=True, dit_cpu_offload=False, vae_cpu_offload=False, @@ -25,9 +25,7 @@ def main(): # sampling_param.image_path = "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/astronaut.jpg" # Generate videos with the same simple API, regardless of GPU count prompt = ( - "A curious raccoon peers through a vibrant field of yellow sunflowers, its eyes " - "wide with interest. The playful yet serene atmosphere is complemented by soft " - "natural light filtering through the petals. Mid-shot, warm and cheerful tones." + "A watermelon wearing a helmet is crushed by a hydraulic press, causing it to flatten and burst open." ) video = generator.generate_video(prompt, output_path=OUTPUT_PATH, save_video=True) # video = generator.generate_video(prompt, sampling_param=sampling_param, output_path="wan_t2v_videos/") @@ -35,11 +33,7 @@ def main(): # Generate another video with a different prompt, without reloading the # model! prompt2 = ( - "A majestic lion strides across the golden savanna, its powerful frame " - "glistening under the warm afternoon sun. The tall grass ripples gently in " - "the breeze, enhancing the lion's commanding presence. The tone is vibrant, " - "embodying the raw energy of the wild. Low angle, steady tracking shot, " - "cinematic.") + "The video shows a green and orange object being flattened as if it were under a hydraulic press, with the press moving down and compressing the object") video2 = generator.generate_video(prompt2, output_path=OUTPUT_PATH, save_video=True)