stable-diffusion-webui-colab
stable-diffusion-webui-colab copied to clipboard
🚨 Proposed (Ugly) workaround for the weird memory usage issue
So I've recently tried using the below code in both your notebooks (With your sed lines removed), as well as with other affected non-SD notebooks (Specifically aadnk's OpenAI Whisper notebook), and this seems to fully correct the strange memory behaviour that cropped up when Colab upgraded from Ubuntu 18.04 to 20.04.
!wget http://launchpadlibrarian.net/367274644/libgoogle-perftools-dev_2.5-2.2ubuntu3_amd64.deb
!wget https://launchpad.net/ubuntu/+source/google-perftools/2.5-2.2ubuntu3/+build/14795286/+files/google-perftools_2.5-2.2ubuntu3_all.deb
!wget https://launchpad.net/ubuntu/+source/google-perftools/2.5-2.2ubuntu3/+build/14795286/+files/libtcmalloc-minimal4_2.5-2.2ubuntu3_amd64.deb
!wget https://launchpad.net/ubuntu/+source/google-perftools/2.5-2.2ubuntu3/+build/14795286/+files/libgoogle-perftools4_2.5-2.2ubuntu3_amd64.deb
!apt install -qq libunwind8-dev
!dpkg -i *.deb
%env LD_PRELOAD=libtcmalloc.so
!rm *.deb
Given how obnoxiously big this is, I'd recommend hiding it away as a .sh file (Minus the env, I've never used one of those within a script, so I don't know if they work like that), but this allows things like @Mikubill's ControlNet extension to work reliably, even with copious model switching, which before would almost always ^c (With the rare exception of the first run, thanks for the false hope Colab). It'd be nice if Google held back these depends on their end, but for me, this is good enough ATM.
thank @Daviljoe193 ❤ please tell the colab team maybe they fix
thank @Daviljoe193 heart please tell the colab team maybe they fix
I'm still waiting on a response from them. I originally made a thread on the Colabtools GH as a direct response to them closing every other thread about the issue (First all of them being duplicates of a main thread, and then closing the main thread with a "Well it may not work for most, but it works for him" type response 😞), and recently edited in the workaround so they can see exactly why the current behavior isn't normal.
@Daviljoe193 it's working bro, thx a lot
thanks @Daviljoe193 ❤ now we are using your method 🥳