You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DDPMScheduler.step() and DDPMParallelScheduler.step() treat fixed_large_log like an ordinary variance and take its square root. _get_variance() returns log(current_beta_t) for this mode, though, so the square root is applied to a negative value and the sample becomes NaN.
The intended scale is exp(0.5 * log_variance), which is equivalent to the sqrt(variance) used by fixed_large.
I have a small fix ready for both scheduler implementations, along with CPU regression tests comparing fixed_large_log against the equivalent fixed_large sampling result. Happy to open the PR if this approach sounds right : )
I reproduced this on current main for both DDPMScheduler and DDPMParallelScheduler. Opened #14571 with the exp(0.5 * log) conversion in step() plus regression tests that check samples are finite and match fixed_large at the same seed.
Reproduced on diffusers 0.43.0, and the mechanism is visible in the shipped code.
DDPMScheduler._get_variance for fixed_large_log returns torch.log(current_beta_t) — a negative number — and does not convert it back. In step(), the noise term for this type falls into the general branch, (_get_variance(...) ** 0.5) * variance_noise: the square root of a negative log-variance, which is NaN. (The two neighbouring log types avoid this in opposite ways: fixed_small_log exponentiates inside _get_variance, and learned_range is exponentiated in step().)
Seeded run (identical protocol for every type, 20 steps, 100 train timesteps, CPU):
variance_type
nonfinite steps
fixed_small
0/20
fixed_small_log
0/20
fixed_large
0/20
fixed_large_log
19/20
learned
0/20
learned_range
0/20
The one finite step under fixed_large_log is the final t=0 step, which adds no noise. Direct probe agrees: _get_variance(t, variance_type="fixed_large_log") returns −9.21 at t=0 through −3.91 at t=99 — log values, all negative.
Fix shape: give fixed_large_log the same treatment as fixed_small_log — return exp(0.5 * log(beta_t)) from _get_variance, or exponentiate this type in step() alongside learned_range. A test that runs each documented variance type for a few steps and asserts finite samples would catch this class.
Activity
lllakshit commentedon Aug 23, 2026
I reproduced this on current main for both DDPMScheduler and DDPMParallelScheduler. Opened #14571 with the exp(0.5 * log) conversion in step() plus regression tests that check samples are finite and match fixed_large at the same seed.
Robertboy18 commentedon Nov 15, 2026
Thanks @lllakshit for #14571, and sorry for the slow reply!
1OF1Research commentedon Nov 16, 2026
Reproduced on diffusers 0.43.0, and the mechanism is visible in the shipped code.
DDPMScheduler._get_varianceforfixed_large_logreturnstorch.log(current_beta_t)— a negative number — and does not convert it back. Instep(), the noise term for this type falls into the general branch,(_get_variance(...) ** 0.5) * variance_noise: the square root of a negative log-variance, which is NaN. (The two neighbouring log types avoid this in opposite ways:fixed_small_logexponentiates inside_get_variance, andlearned_rangeis exponentiated instep().)Seeded run (identical protocol for every type, 20 steps, 100 train timesteps, CPU):
The one finite step under
fixed_large_logis the final t=0 step, which adds no noise. Direct probe agrees:_get_variance(t, variance_type="fixed_large_log")returns −9.21 at t=0 through −3.91 at t=99 — log values, all negative.Fix shape: give
fixed_large_logthe same treatment asfixed_small_log— returnexp(0.5 * log(beta_t))from_get_variance, or exponentiate this type instep()alongsidelearned_range. A test that runs each documented variance type for a few steps and asserts finite samples would catch this class.