From 9523a05220cf1b92b1c6541deb4709813e8e4d0e Mon Sep 17 00:00:00 2001 From: Sayak Paul Date: Fri, 10 Jan 2025 07:22:00 +0530 Subject: [PATCH] Shell script to minimally test supported models on a real dataset (#204) * start minimal complete tests * updates * fixes * fixes --- tests/scripts/dummy_cogvideox_lora.sh | 81 +++++++++++++++++++++++ tests/scripts/dummy_hunyuanvideo_lora.sh | 79 ++++++++++++++++++++++ tests/scripts/dummy_ltx_video_lora.sh | 84 ++++++++++++++++++++++++ tests/test_dataset.py | 6 +- tests/test_model_runs_minimally_lora.sh | 48 ++++++++++++++ 5 files changed, 295 insertions(+), 3 deletions(-) create mode 100644 tests/scripts/dummy_cogvideox_lora.sh create mode 100644 tests/scripts/dummy_hunyuanvideo_lora.sh create mode 100644 tests/scripts/dummy_ltx_video_lora.sh create mode 100644 tests/test_model_runs_minimally_lora.sh diff --git a/tests/scripts/dummy_cogvideox_lora.sh b/tests/scripts/dummy_cogvideox_lora.sh new file mode 100644 index 0000000..c1f7bbd --- /dev/null +++ b/tests/scripts/dummy_cogvideox_lora.sh @@ -0,0 +1,81 @@ +#!/bin/bash + +GPU_IDS="0,1" +DATA_ROOT="$ROOT_DIR/video-dataset-disney" +CAPTION_COLUMN="prompt.txt" +VIDEO_COLUMN="videos.txt" +OUTPUT_DIR="cogvideox" +ID_TOKEN="BW_STYLE" + +# Model arguments +model_cmd="--model_name cogvideox \ + --pretrained_model_name_or_path THUDM/CogVideoX-5b" + +# Dataset arguments +dataset_cmd="--data_root $DATA_ROOT \ + --video_column $VIDEO_COLUMN \ + --caption_column $CAPTION_COLUMN \ + --id_token $ID_TOKEN \ + --video_resolution_buckets 49x480x720 \ + --caption_dropout_p 0.05" + +# Dataloader arguments +dataloader_cmd="--dataloader_num_workers 0 --precompute_conditions" + +# Training arguments +training_cmd="--training_type lora \ + --seed 42 \ + --mixed_precision bf16 \ + --batch_size 1 \ + --precompute_conditions \ + --train_steps 10 \ + --rank 128 \ + --lora_alpha 128 \ + --target_modules to_q to_k to_v to_out.0 \ + --gradient_accumulation_steps 1 \ + --gradient_checkpointing \ + --checkpointing_steps 5 \ + --checkpointing_limit 2 \ + --resume_from_checkpoint=latest \ + --enable_slicing \ + --enable_tiling" + +# Optimizer arguments +optimizer_cmd="--optimizer adamw \ + --lr 3e-5 \ + --beta1 0.9 \ + --beta2 0.95 \ + --weight_decay 1e-4 \ + --epsilon 1e-8 \ + --max_grad_norm 1.0" + +# Validation arguments +validation_prompts=$(cat <