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.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix a bug in 2nd order schedulers when using in ensemble of experts config #5511
fix a bug in 2nd order schedulers when using in ensemble of experts config #5511
Changes from 6 commits
4b1e7d2
8ea162b
5a0ac58
443aa6b
de85e0b
ceb0f45
62a9b6e
a424a3f
ea590b8
2b959df
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think
num_inference_steps
will always be even. Consider the case where the scheduler has been set up by callingset_timesteps(25)
and then supplieddenoising_start = 0.6
. The following code prints an even number:This prints 20. For denoising_start=0.5, it prints 25. So
num_inference_steps
may be either odd or even depending onnum_inference_steps
anddenoising_start
passed into the pipeline call.I think we should add 1 to it only if it's even, and not if it's odd. No?
@yiyixuxu @patrickvonplaten
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah DPM2 can actually be different indeed if it interpolates, (Heun can't)
Nice catch! I'll open a PR to fix it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the result I get with hnf = 0.5 and steps = 25 with DPM2 with the code from this PR:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#5526 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @patrickvonplaten, all testcases I threw at it now produce good images.
I am just curious why we don't need to do any logic in the base step (where denoising_end is supplied to the base SDXL pipeline without img2img) since I would expect that we would want to ensure that the final timestep there is a second order timestep, and as far as I can tell it still has the odd/even issue when splitting. Maybe I am wrong!
In any case, latest
main
now produces good images for all my testcases like I said. Thank you! 🙏