-
Notifications
You must be signed in to change notification settings - Fork 229
[Feature]Add VSA slurm training example scripts #666
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary of Changes
Hello @BrianChen1129, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request introduces new Slurm training examples for Image-to-Video (I2V) and Text-to-Video (T2V) models that leverage Video Sparse Attention (VSA), enhancing the training capabilities within the project. It also includes a reorganization of existing distillation scripts and a utility for dataset acquisition, streamlining the setup process for users.
Highlights
- New VSA Training Examples: Added dedicated Slurm scripts (
I2V-14B-VSA.slurm,T2V-14B-VSA.slurm) for training Image-to-Video (I2V) and Text-to-Video (T2V) models using Video Sparse Attention (VSA). These scripts are configured with specific VSA-related arguments and environment setups for Slurm clusters. - Slurm Script Reorganization: Renamed and relocated existing distillation Slurm scripts (
distill_dmd_VSA_t2v.slurm,distill_dmd_VSA_t2v_14B_480P.slurm,distill_dmd_t2v.slurm) to a newWan2.1-T2V-480Pdirectory, along with minor argument formatting adjustments within these files. - Dataset Download Utility: Included a new
download_dataset.shscript to simplify the acquisition of 480P and 720P Wan-Syn datasets from Hugging Face, providing necessary data for the new training examples.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments or fill out our survey to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request adds several new example scripts for VSA (Video Sparse Attention) training using Slurm. It also refactors some existing scripts. The new scripts are well-structured but have some minor issues like redundant environment variable exports, non-portable home directory paths, and missing newlines at the end of files. There is also a critical typo in one of the renamed scripts that would break its execution. My review provides suggestions to fix these issues.
| training_args=( | ||
| --tracker_project_name wan_t2v_distill_dmd_VSA | ||
| --output_dir="checkpoints/wan_t2v_finetune" | ||
| --output_dir"checkpoints/wan_t2v_finetune" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There seems to be a typo here. The = was removed but not replaced with a space. This will likely cause the argument to be parsed incorrectly as --output_dircheckpoints/wan_t2v_finetune, which would break the script. Based on other changes in this PR, the intention was likely to separate the argument and its value with a space.
--output_dir "checkpoints/wan_t2v_finetune"
| set -e -x | ||
|
|
||
| # Environment Setup | ||
| source ~/conda/miniconda/bin/activate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| export CUDA_VISIBLE_DEVICES=$SLURM_LOCALID | ||
| export TOKENIZERS_PARALLELISM=false | ||
| export WANDB_BASE_URL="https://api.wandb.ai" | ||
| export WANDB_MODE=online |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| "${optimizer_args[@]}" \ | ||
| "${validation_args[@]}" \ | ||
| "${miscellaneous_args[@]}" \ | ||
| "${vsa_args[@]}" No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| set -e -x | ||
|
|
||
| # Environment Setup | ||
| source ~/conda/miniconda/bin/activate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| export CUDA_VISIBLE_DEVICES=$SLURM_LOCALID | ||
| export TOKENIZERS_PARALLELISM=false | ||
| export WANDB_BASE_URL="https://api.wandb.ai" | ||
| export WANDB_MODE=online |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| "${optimizer_args[@]}" \ | ||
| "${validation_args[@]}" \ | ||
| "${miscellaneous_args[@]}" \ | ||
| "${vsa_args[@]}" No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| python scripts/huggingface/download_hf.py --repo_id "FastVideo/Wan-Syn_77x448x832_600k" --local_dir "FastVideo/Wan-Syn_77x448x832_600k" --repo_type "dataset" | ||
|
|
||
| # 720P dataset | ||
| python scripts/huggingface/download_hf.py --repo_id "FastVideo/Wan-Syn_77x768x1280_250k" --local_dir "FastVideo/Wan-Syn_77x768x1280_250k" --repo_type "dataset" No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a good practice to end files with a newline character for POSIX compatibility.
| python scripts/huggingface/download_hf.py --repo_id "FastVideo/Wan-Syn_77x768x1280_250k" --local_dir "FastVideo/Wan-Syn_77x768x1280_250k" --repo_type "dataset" | |
| python scripts/huggingface/download_hf.py --repo_id "FastVideo/Wan-Syn_77x768x1280_250k" --local_dir "FastVideo/Wan-Syn_77x768x1280_250k" --repo_type "dataset" | |
| training_args=( | ||
| --tracker_project_name wan_t2v_distill_dmd_VSA | ||
| --output_dir="checkpoints/wan_t2v_finetune" | ||
| --output_dir"checkpoints/wan_t2v_finetune" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
space between arg name and arg?
No description provided.