stable-diffusion-webui icon indicating copy to clipboard operation
stable-diffusion-webui copied to clipboard

multi gpu API via ray serve

Open webcoderz opened this issue 1 year ago • 5 comments

Description

  • a simple description of what you're trying to accomplish Implementing ray serve to use api across multi gpus, and with autoscaling

  • a summary of changes in code a seperate implementation of module/api/api.py thats for use with ray, its the exact same as api.py but instead of using the APIrouter() i just put each route of each function,

the modules/shared_items/shared shared class wouldnt pickleize with ray so i had to restructure and instantiate it and refactor all the uses of it to use the unstance versus the module directly

  • which issues it fixes, if any

Screenshots/videos:

image image

Checklist:

webcoderz avatar Oct 17 '23 18:10 webcoderz

Well, for one, replacing all instance of shared with shared_instance is going to destroy all extensions for sure...

Supporting multiple GPUs is a possibility, but not in a way that would break extensions like this.

And adding a ray server api seems more suited for an extension.

AUTOMATIC1111 avatar Oct 21 '23 10:10 AUTOMATIC1111

Yea the only reason that was done is because of the way the sys.["modules.shared"].class=Shared is set, if that could be changed in a way that can be pickled then No need for that change

webcoderz avatar Oct 21 '23 13:10 webcoderz

Hello, I am currently following this PR. Is there any progress regarding the pickled shared module?

coolmian avatar Dec 12 '23 08:12 coolmian

Hello, I am currently following this PR. Is there any progress regarding the pickled shared module?

In my fork I fixed just changed up the module and seems to work fine for most part haven't been developing on it recently had other stuff pop up but am recircling on it soon as I get it deployed in Kubernetes

webcoderz avatar Dec 12 '23 18:12 webcoderz

Hoping that this is merged soon! Would love to see it. I have an 2080 Ti and 2070S. If there's anyway in which I can help test, let me know.

jxnding avatar Dec 20 '23 04:12 jxnding

jxnding: As I wrote above, support for multi-GPU would probably get merged in, but not if it's written in the way it is now, breaking all extensions. And as for ray api, I would rather it be an extension. Any additions to API that are needed to make it happen can be merged as a separate PR.

AUTOMATIC1111 avatar Dec 30 '23 12:12 AUTOMATIC1111

multi-gpu support for inference would be amazing

i mean like power 2 gpu combined somehow if possible like in llms for inference

FurkanGozukara avatar Dec 30 '23 14:12 FurkanGozukara

closing for reasons in my post above; reopen if there's more

AUTOMATIC1111 avatar Jan 01 '24 14:01 AUTOMATIC1111

new research, may helpful https://hanlab.mit.edu/blog/distrifusion https://github.com/mit-han-lab/distrifuser

Kotori05 avatar Mar 18 '24 09:03 Kotori05

amazing @Kotori05 thanks for sharing

webcoderz avatar Mar 18 '24 13:03 webcoderz