-
Notifications
You must be signed in to change notification settings - Fork 5.9k
[Community Discussion] Scheduler design #311
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
Comments
I agree with your points, creating a generic scheduler here, will complicate a the overall design. In JAX we need to take special care of state, keeping everything scheduler as jnp arrays, avoid device to host communication etc. So I'm also in favor of option b. B is good for both readability and maintainability. |
Having done a bunch of work (maybe the most out of us) on trying to numpy-ify schedulers and the related tests, I think option b) will also result in much more accessible code. If we lay out the directory correct, it'll be very obvious what the different files do, and fitting in with the style designs of the library: one-file one purpose. When trying to make them work with numpy it generally is a lot of I'll go look at the PR now. |
Hello |
Cool let's go for separate schedulers then! |
Just out of curiosity, can I ask how you design the software architectures for the libraries? Do you do that internally or are there sprints where the community gets involved? |
What exactly do you mean by software architectures? Like the whole library here? Usually we start a library internally but try to include the community in design decisions as quickly as possible :-) |
Yes meant the whole library. Okay makes sense. Thank you. |
Cool design taken -> we'll have framework-dependent schedulers :-) |
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread. Please note that issues that do not follow the contributing guidelines are likely to be ignored. |
This is a very nice PR by @pcuenca showing what changes need to be done to the PNDM/PMLS scheduler to make it work with JAX/XLA - it's actually more then anticipated and shows that the scheduler now substantially differs from the original implementation that we use for PyTorch.
In the coming days we will integrate these changes into main
diffusers
to make the library compatible with Flax/JAX. Now the big question is should we:a) Make each
scheduler
very generic and continue theset_format("pt")
logic? While this would make sense logically as the schedulers don't store any trainable weights really - this could potentially lead to quite someif - else
statements and too much abstracted code, e.g. lots ofself.where(...)
functions inscheduler_utils.py
. Also maybe we want schedulers to have trainable weights in the future? Also do we anticipate schedulers to be more or less complex in the future?b) Make one scheduler file for each framework. Instead of trying to fit all frameworks into one scheduler file, we make one scheduler for one framework. The advantage is clearly readability. Also most people probably always only work in one framework so for them it might be nicer to have schedulers seperate. However: Some schedulers will probably be 1-to-1 the same (which also might not be a problem necessarily)
I'm starting to be lean more and more towards b) actually here.
Would love to discuss - cc @anton-l @patil-suraj @natolambert @pcuenca
The text was updated successfully, but these errors were encountered: