Fix duplicate timesteps in DPMSolverMultistepScheduler with sigma conversion methods #12788
+75
−9
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.
What does this PR do?
Fixes duplicate timesteps issue in
DPMSolverMultistepSchedulerwhen using various sigma conversion methods (Karras, Lu, exponential, beta) combined withbeta_schedule="squaredcos_cap_v2".Before this PR
squaredcos_cap_v2scheduleAfter this PR
Changes Made
_ensure_unique_timesteps()helper method to handle duplicate timesteps consistentlyuse_karras_sigmasuse_lu_lambdasuse_exponential_sigmasuse_beta_sigmastest_no_duplicate_timesteps_with_sigma_methodsTesting
✅ All 42 existing tests pass
✅ New test passes
✅ No regression detected
✅ Tested with multiple sigma methods and beta schedules
Fixes #12771
Before submitting
DPMSolverMultistepScheduler out-of-bounds error when using beta_schedule="squaredcos_cap_v2" + use_karras_sigmas=True #12771
Who can review?
@yiyixuxu