-
Notifications
You must be signed in to change notification settings - Fork 2.7k
new OffloadingDevice loads one model at a time, on demand #2596
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
Conversation
…its forward method allowing any associated hooks to run with it.
|
The accelerate feature the previous PR used does this terribly clever thing where the parameters are defined on the That often resulted in In contrast, having models shuffled off to |
|
It's minimally working now, tested for txt2img in text mode only. There are still a few other things to clean up, e.g. web runs in to an error in lowres_estimated_image. |
|
added a workaround for the estimated image function, then moved on to testing inpainting and that has its own bucket of problems. I assumed that And then it's got the usual set of "tensors prepared using vae.device end up on cpu" problems, which we have otherwise but are multiplied because inpainting deals with more stuff (input image, mask, etc). I'm coming to believe that we can't do this completely transparently like this, with the Pipeline class not aware of how the model devices are managed. I think it needs a way to discover what their actual execution device is, whether that's through inquiring with an Offloader instance or some property we add to the models. |
|
This is starting to shape up now, and the usage of it doesn't require nearly so many awkward workarounds as the previous attempt. It's working in many cases, but my troubleshooting is currently impeded by something that's swallowing all the console output. |
# Conflicts: # ldm/invoke/generator/diffusers_pipeline.py
to frame it is the same terms as "FullyLoadedModelGroup"
|
i hit resolve on both of those conversations, thanks for making the naming change |
lstein
left a 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.
Neat! Very elegant solution.
Trying something different in place of #2542.
Fixes #2326.