feat(diffusion): support Wan2.2 TI2V Flow-GRPO training - #228
Open
wwwsctvcom wants to merge 1 commit into
Open
Conversation
wwwsctvcom
requested review from
Rockdu,
guapisolo and
zhihengy
as code owners
September 3, 2026 16:13
Collaborator
|
Hi, thanks for your PR, do you have a curve for verification? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add Wan2.2-TI2V Flow-GRPO Training with FSDP and LoRA
Summary
This PR adds a general Wan2.2-TI2V-5B training recipe based on the existing Miles training framework.
Supported features:
Main Changes
Add the wan2_2_ti2v training pipeline configuration.
Add TI2V masked timestep construction for video latent tokens.
Add the Wan2.2-TI2V FSDP precision plan.
Forward conditioning image paths from dataset metadata to SGLang rollout.
Parse and preserve TI2V rollout metadata required by the training forward pass.
Add a complete training script:
scripts/run_diffusion_grpo_wan22_ti2v.py
Add a regression test for TI2V mask normalization and timestep shape handling.
Dataset Format
The training data uses the existing Miles metadata format:
{
"input": "A camera moves around the subject.",
"metadata": {
"image_path": "/data/images/frame.jpg"
}
}
The image path must be available to all Ray workers.
Training Example
python3 scripts/run_diffusion_grpo_wan22_ti2v.py
--model /models/Wan2.2-TI2V-5B-Diffusers
--data-jsonl /data/train.jsonl
--num-gpus 2
--cuda-visible-devices 0,1
The script enables the following training components by default:
Evaluation Example
python3 scripts/run_diffusion_grpo_wan22_ti2v.py
--model /models/Wan2.2-TI2V-5B-Diffusers
--data-jsonl /data/train.jsonl
--eval-data-jsonl /data/validation.jsonl
--eval-interval 20
--num-gpus 2
Validation Results
Unit and configuration tests:
7 passed
git diff --check passed
The complete training recipe was also passed through the native train_diffusion.py argument validation.
A real two-GPU execution validated the following path:
The real execution also confirmed that:
Scope
This PR only contains the general Wan2.2-TI2V training support and its required tests.
It does not include:
The existing training paths for other model families are unchanged.