[new-model] Add Cosmos Predict2.5 distilled T2W and DFD V2W inference - #1767
Mister-Raggs wants to merge 28 commits into
Conversation
Merge Protections🔴 1 of 1 protections blocking · waiting on 👀 reviews and 🤖 CI
🔴 PR merge requirementsWaiting for
This rule is failing.
|
|
This PR has merge conflicts with the base branch. Please rebase: git fetch origin main
git rebase origin/main
# Resolve any conflicts, then:
git push --force-with-lease |
Cosmos-Predict2.5 2B text encoding crashes on load because
`apply_chat_template(tokenize=True)` returns a transformers `BatchEncoding`
-- a `collections.UserDict`, i.e. a `Mapping` but NOT a `dict` -- which the
`isinstance(tokenizer_output, dict)` check missed, so the id extraction fell
through to `raise RuntimeError("Unexpected chat_template output type")`.
Match on `Mapping` instead (every `dict` is a `Mapping`, so existing
plain-dict and list outputs are unchanged) and lift the normalization into a
tested `_normalize_chat_template_ids` helper. Add weight-free parametrized
regression tests over every shape apply_chat_template can return.
Address review: the helper documents a flat list[int] contract, but a nested list with batch>1 slipped through the len==1 unwrap guard and was returned as-is, violating the contract and breaking downstream padding. Raise on batch>1 instead of silently returning a nested list; add tests.
72f25e4 to
69da225
Compare
Pre-commit checks failedHi @Mister-Raggs, the pre-commit checks have failed. To fix them locally: # Install pre-commit if you haven't already
uv pip install pre-commit
pre-commit install
# Run all checks and auto-fix what's possible
pre-commit run --all-filesCommon fixes:
After fixing, commit and push the changes. The checks will re-run automatically. For future commits, |
Pre-commit checks failedHi @Mister-Raggs, the pre-commit checks have failed. To fix them locally: # Install pre-commit if you haven't already
uv pip install pre-commit
pre-commit install
# Run all checks and auto-fix what's possible
pre-commit run --all-filesCommon fixes:
After fixing, commit and push the changes. The checks will re-run automatically. For future commits, |
Pre-commit checks failedHi @Mister-Raggs, the pre-commit checks have failed. To fix them locally: # Install pre-commit if you haven't already
uv pip install pre-commit
pre-commit install
# Run all checks and auto-fix what's possible
pre-commit run --all-filesCommon fixes:
After fixing, commit and push the changes. The checks will re-run automatically. For future commits, |
Pre-commit checks failedHi @Mister-Raggs, the pre-commit checks have failed. To fix them locally: # Install pre-commit if you haven't already
uv pip install pre-commit
pre-commit install
# Run all checks and auto-fix what's possible
pre-commit run --all-filesCommon fixes:
After fixing, commit and push the changes. The checks will re-run automatically. For future commits, |
Purpose
Add FastVideo inference support for two complementary public Cosmos Predict2.5 2B students:
The implementations preserve each release's inference equations and checkpoint layout instead of routing either student through the full model's UniPC path. Existing Cosmos Predict2.5 inference remains unchanged.
Changes
Cosmos25DistilledSchedulerfor the official fixed-noise TrigFlow rollout.Cosmos25DFDSchedulerfor the released DFD rectified-flow ODE schedule:[0.999, 0.937, 0.833, 0.624, 0.0].Media
Distilled T2W output
cosmos25_distilled_full.mp4
Native FastVideo DFD output
fastvideo_dfd_i2w.mp4
Test plan and results
Distilled T2W
0.000655, final relative mean0.038397, final mean absolute0.037414.256x448x9generation and decoded-frame return passed.704x1280x77generation passed in 143.53 seconds after load and passed visual inspection.DFD V2W
0.15625, mean absolute0.01315392, relative mean0.01986194.704x1280x81generation passed: 145.20 seconds generation, 147.66 seconds end to end.2.845237; input to frame 80 control52.130680.2.694and2.459, versus unrelated control39.142; both boundaries were visually seamless and the prompt-directed right pivot succeeded.Static and regression checks
git diff --checkpasses.Runtime contracts and limitations
Checklist