Skip to content

Fix EDMEulerScheduler training with integer timesteps #11991

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

brightlikethelight
Copy link

Fix EDMEulerScheduler training with integer timesteps

Fixes #7406

What does this PR do?

EDMEulerScheduler's add_noise method was failing during training because it couldn't handle integer timesteps. The scheduler expected float comparisons but training passes integers, causing an IndexError.

The fix detects integer timesteps and maps them correctly to sigma indices using reverse indexing, since EDM stores sigmas in descending order.

Before submitting

  • This PR fixes a typo or improves the docs (no test needed)
  • Did you write any new tests? Yes, added tests for both integer and float timesteps
  • Did you run the tests locally? Yes
  • Did you run the linter? Yes, ran make style and make quality

Who can review?

@yiyixuxu @sayakpaul @DN6

Training with EDMEulerScheduler was broken due to dtype mismatch when
comparing integer timesteps with float scheduler timesteps. This adds
proper handling for integer timesteps by mapping them to sigma indices
in reverse order to match EDM's descending sigma convention.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

A Possible Bug in EDMEulerScheduler
1 participant