fix(network): sample ignores skip_layers and (+1 more) - #38
fix(network): sample ignores skip_layers and (+1 more)#38andrewwhitecdw wants to merge 2 commits into
Conversation
c68bc84 to
3106945
Compare
Greptile SummaryThe PR adjusts sampling-loop progress reporting, renames the skip-layer activation parameter, and updates Cosmos Predict2 scheduling and conditioned-frame velocity handling.
Confidence Score: 4/5The PR is not yet safe to merge because the previously reported legacy keyword remains silently ignored. The reply says commit Files Needing Attention: fastgen/networks/Wan/network.py, fastgen/networks/WanI2V/network.py, fastgen/networks/cosmos_predict2/network.py Important Files Changed
Reviews (5): Last reviewed commit: "fix(cosmos): correct skip-layer guidance..." | Re-trigger Greptile |
| skip_layers_start_fraction: float = 0.0, | ||
| **kwargs, |
There was a problem hiding this comment.
Old guidance keyword is ignored
When an existing caller passes skip_layers_start_percent, **kwargs silently consumes it while skip_layers_start_fraction remains 0.0, causing skip-layer guidance to activate from the first sampling step instead of the requested point. Preserve the old keyword as an alias or reject it explicitly; the same compatibility break exists in the WanI2V and Cosmos Predict2 samplers.
There was a problem hiding this comment.
Addressed in 3ae2c86. Added a backward-compatibility alias so skip_layers_start_percent is honored in all three samplers (Wan, WanI2V, Cosmos Predict2) by mapping it to skip_layers_start_fraction and popping it from **kwargs before sampling. The docstrings now also note the deprecated alias.
3ae2c86 to
dabb2be
Compare
|
Squashed to a single commit ( |
dabb2be to
3106945
Compare
Signed-off-by: Julius Berner <jberner@nvidia.com>
Skip-layer guidance must degrade only the unconditional branch, matching Wan, WanI2V and dmd2; applying it to the conditional pass as well turns SLG into plain CFG on a truncated network. Supersedes the previous commit's placement. Also in this change: - FlowKarrasUniPCScheduler builds the official Cosmos Karras ramp in flow-matching units, so the schedule is identical on diffusers < 0.37, where sigma_min/sigma_max and the EDM->flow conversion do not yet exist. Verified bitwise equal to diffusers 0.38.0. - Rename skip_layers_start_percent to skip_layers_start_fraction across cosmos_predict2, Wan and WanI2V; it was always compared as a fraction. - Use the initial latents over [0, t_init] for the conditioning-frame velocity instead of the sigma-scaled latents. - Let tqdm derive its total from timesteps rather than a hand-computed value that could drift out of sync with the loop length. Signed-off-by: Julius Berner <jberner@nvidia.com>
3106945 to
0c20d60
Compare
Small fixes in
fastgen/networks/cosmos_predict2/network.py:fix: sample ignores skip_layers and skip_layers_start_percent args
Fix: Replace:
with:
fix: sample stores scaled latents as initial noise for v2w velocity
Fix: Replace:
with:
Files changed
fastgen/networks/cosmos_predict2/network.py