Skip to content
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

TCDScheduler : eta out of range? #8305

Closed
Clement-Lelievre opened this issue May 28, 2024 · 2 comments
Closed

TCDScheduler : eta out of range? #8305

Clement-Lelievre opened this issue May 28, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@Clement-Lelievre
Copy link

Clement-Lelievre commented May 28, 2024

Describe the bug

Hi,

I am starting to play with the relatively recent scheduler TCDScheduler and encountered a bug yesterday.

The thing is, I'm embarrassed to say I am unable to provide the exact details of the bug. Right now I am unable to reproduce it again but I'd like to make sure it gets eradicated.

Here is however information from my memory that may help reproduce it:

  • diffusers version : it was either 0.27.2 or 0.28.0
  • ubuntu 20.04, CUDA 12.2
  • where it crashed: here, indicating that I somehow called TCDScheduler.step with a too high eta (it was a float around 7 if I recall well). I did not call .step directly, it was called under the hood when calling my pipeline
  • what pipeline used: a standard txt2img sd15 or sdxl pipeline
  • doing what: switching schedulers randomly in the below list, to verify that configs work well and that I can infer smoothly while changing scheduler at every inference
_schedulers = [
    DDIMScheduler,
    DDPMScheduler,
    DEISMultistepScheduler,
    DPMSolverMultistepScheduler,
    DPMSolverSinglestepScheduler,
    EulerAncestralDiscreteScheduler,
    EulerDiscreteScheduler,
    HeunDiscreteScheduler,
    KDPM2AncestralDiscreteScheduler,
    KDPM2DiscreteScheduler,
    LCMScheduler,
    LMSDiscreteScheduler,
    PNDMScheduler,
    TCDScheduler,
    UniPCMultistepScheduler,
]

I had a cursory glance at diffusers code and couldn't see how I managed to somehow get an invalid eta value. I saw it defaults to 0.3 in TCDScheduler.step
Do you have a hint? A way to produce the bug when switching schedulers, maybe by being clumsy about the specific config params to use?

This is perhaps best dealt with by either @mhh0318 or @vanakema as they're the main contributors to this scheduler's code. (I am aware that the code originates from an external repo (jabir-zheng)).
cc @yi

Reproduction

as stated above, no MRE unfortunately but some level of detail to help narrow down the problem

Logs

again unfortunately all I know is I ran into the `AssertionError "gamma must be less than or equal to 1.0"`

System Info

  • diffusers version: 0.27.2 or 0.28.0
  • Platform: Linux-5.15.0-1048-aws-x86_64-with-glibc2.31
  • Python version: 3.10.13
  • PyTorch version (GPU?): 2.1.0 (True)
  • Huggingface_hub version: 0.23.1
  • Transformers version: 4.39.3
  • Accelerate version: 0.25.0
  • xFormers version: not installed
  • Using GPU in script?: YES
  • Using distributed or parallel set-up in script?: NO

Who can help?

@yiyixuxu @vanakema @mhh

@Clement-Lelievre Clement-Lelievre added the bug Something isn't working label May 28, 2024
@yiyixuxu yiyixuxu self-assigned this May 28, 2024
@vanakema
Copy link
Contributor

Oh man haha, I only appear like one of the main contributors because I did a huge refactoring of the Tensor type used across the repo. Someone else would definitely be better equip to answer this

@Clement-Lelievre
Copy link
Author

Update: the error came from our implem, not diffusers'.
(FWIW, I had generated a random eta value for DDIMScheduler that was > 1 and then the scheduler was changed to TCDScheduler with the same eta value, triggering the assertionerror I linked above)

I'll close this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants