easydiffusion icon indicating copy to clipboard operation
easydiffusion copied to clipboard

Speed ​​with Multiple GPUs in easydiffusion

Open blahole opened this issue 1 year ago • 3 comments

OS: Windows10 Two GPUs,3090 and 4090 Compared to Stable Diffusion with a GPU(4090) and "--precision full --no-half --xformers" , it's the same speed!

blahole avatar May 13 '24 09:05 blahole

can you confirm the same thing I reported here: https://github.com/easydiffusion/easydiffusion/issues/1760

Where the overall speed gets split between two cards for no acceleration?

q5sys avatar May 24 '24 01:05 q5sys

being same speed isn't really that bad of a thing, the fact that easy diffusion can't use split vram is so much worse. I have 2 12gb gpus. I just wish this could actually access all 24gb of ram instead of just 12gb. Koboldcpp can access 24gb of vram. Easy diffusion spawns 2 "python" processes in nvidia-smi, it just only uses all; the vram on one of them instead of 2. Despite having enough vram, I have to shut down all my other ai crap if I want to generate images just because this thing can't use split vram.

Xeraster avatar Jul 21 '24 20:07 Xeraster

@Xeraster You can span an LLM across multiple GPUs because of how they work. LLMs function in a completely different way than the way stable diffusion does. Due to the underlying architecture of how works Stable Diffusion it's not possible to span across GPUs in the same way. That's why no SD UI does this. It's a fundamental issue with the architecture itself.

q5sys avatar Jul 21 '24 21:07 q5sys

Merging into https://github.com/easydiffusion/easydiffusion/issues/1760

This is being worked on in an upcoming version (where each GPU will spawn a separate process). Right now, a single process is used and multiple threads are created (one per GPU), which results in Python's "Global Interpreter Lock (GIL)" becoming a chokepoint.

I'm working on using completely separate python processes, one per GPU.

The other python process noticed by Xeraster isn't meant for rendering, it's just a temporary python process. ED currently uses only one python process.

cmdr2 avatar Sep 01 '25 05:09 cmdr2