grokuku / stable-diffusion

Easy Image Generation
GNU General Public License v3.0
28 stars 10 forks source link

Slow startup times? #53

Open BillDStrong opened 1 month ago

BillDStrong commented 1 month ago

So, this Docker takes a bit to load up with the Automattic1111 UI option. (I haven't tested the others yet.)

When trying to see why in the logs, I noticed it is uninstalling and reinstalling the torch framework through pip at each startup?

Installing collected packages: triton, torch, torchvision Attempting uninstall: triton Found existing installation: triton 2.3.0 Uninstalling triton-2.3.0: Successfully uninstalled triton-2.3.0 Attempting uninstall: torch Found existing installation: torch 2.3.0+cu121 Uninstalling torch-2.3.0+cu121: Successfully uninstalled torch-2.3.0+cu121 Attempting uninstall: torchvision Found existing installation: torchvision 0.18.1 Uninstalling torchvision-0.18.1: Successfully uninstalled torchvision-0.18.1

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. xformers 0.0.26.post1 requires torch==2.3.0, but you have torch 2.1.2+cu121 which is incompatible. Successfully installed torch-2.1.2+cu121 torchvision-0.16.2+cu121 triton-2.1.0

Is this the main culprit to the slow startup times? Why is it doing this and how would I go about fixing it? Or is this expected behavior.

I notice right before this, thee logs are saying it is using the already available 2.3.1 version of torch.

grokuku commented 1 month ago

I think it's a conflict in the dependencies, I really struggle with it. It will certainly make boot time longer, but since it should have all that is needed in cache I believe that it shouldn't take not too long either. I'll try to have a look at it.

grokuku commented 3 weeks ago

@BillDStrong I removed all additional dependencies that I installed in my scripts. Should fixe the uninstall/reinstall of torch at each boot. If you need to add some packages you can do it by creating a "requirements.txt" file next to the parameters file. it will be parsed at each startup.

I hope it will help with the slow startup times.