Repository navigation
Fix Euler velocity coefficients for discrete training timesteps - #15491
Open
mertkayacs wants to merge 1 commit into
Open
mertkayacs wants to merge 1 commit into
mertkayacs wants to merge 1 commit into
Conversation
Contributor
Author
|
@yiyixuxu could you review this when you have time? |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 #15461
EulerDiscreteScheduler.get_velocityindexesalphas_cumprodby the timestep's position in the descending schedule, so timestep999readsalphas_cumprod[0]. The SDXL T2I-Adapter example uses this as itsv_predictionloss target.I now index by the timestep value when it is an integer inside the training range. Fractional timesteps (Karras, exponential, beta sigmas) keep the schedule-position lookup, and continuous
v_predictiontimesteps are left unchanged. The issue repro now matchesDDIMSchedulerexactly.New tests: DDIM parity for the default and a custom schedule, a fractional timestep (
2.5), and a continuous timestep equal to0.0.Verification
SUBFAILED(schedule='training'),SUBFAILED(schedule='custom'),2 failed, 3 passed, 36 deselected(max abs diff1.471and2.902).pytest tests/schedulers/test_scheduler_euler.py:39 passed, 2 subtests passed.ruff checkandruff format --check(0.9.10) on both files,utils/check_copies.py,utils/check_dummies.py: clean.Self-review notes
I used Codex for the patch and tests and ran the
self-reviewskill. Final round: no blocking findings. Left as is: #15300 touches the same coefficient reads for dtype handling; whichever lands second needs a small rebase. No maintainer acknowledgment on the issue yet.Before submitting
self-review, shared the notes above.Who can review?
Scheduler maintainers.