#Invoke is killing my SSD 😭

37 messages · Page 1 of 1 (latest)

worn slate
#

My MacBook Pro (M1) has only 16 GB RAM (yeah, cheaped out on that...damn) and every time I use Invoke, it eats a ton of RAM and causes a lot of swap.

Recently I noticed that the swapping occurs at every image rendered, thus causing 30 Terabytes (!) of data being written to the drive in a matter of days, maybe a week or two (within one uptime).

I can't use the software like that. DiffusionBee is working differently, I know, but at least it doesn't eat 12 GB+ for that app alone.

Is there any way to reduce the RAM consumption for me?

limber gyro
#

@full crow is there an option to not cache models in RAM, but only in VRAM?

bright viper
#

what is getting swapped

#

ooh .. is this a unified memory thing .. ? @limber gyro

limber gyro
#

I'm guessing swapfile. RAM fills up and the OS uses a swapfile to temporarily move less recently used data from RAM to disk.

#

My guess is that the models being held in memory (even though they've been pushed to the GPU's VRAM) might be causing memory pressure.

worn slate
#

Yes, I am talking about the RAM swapfile. I am not sure if not caching models would help, because I got swapping already with only one default model being loaded

worn slate
#

I just tried to quit all possible programs, even system stuff like Spotlight which is usually on, and loaded up Invoke. It jumped to 11 GB for the Python process, writing 2 GB of swap data to the SSD just for starting up 😩

balmy tapir
balmy tapir
#

this is on start

#

nothing

halcyon crane
#

is there an easy way to compress the normal 1.5 into 2.13 gb?

worn slate
#

Thanks for the input, @balmy tapir! So you never encountered Activity Monitor displaying ridiculous write amounts on the drive tab? I got 80 GB after 5 days of use - sure, but 30 TB is a whole different level 😅 Can I shrink model files? Won't I lose quality then? Or are they being unpacked to RAM when loaded anyway, so it won't matter?

balmy tapir
worn slate
balmy tapir
worn slate
hybrid phoenix
# limber gyro <@522941968452419584> is there an option to not cache models in RAM, but only in...

I believe the M1 / M2 architecture uses the very same RAM for both CPU and GPU. 16GB is just not enough to run Stable Diffusion without generating a swap file. The best you can do is set up a second user account with every extra feature turned off, then run InvokeAI in the most efficient web browser you can find, and run no other apps at the same time. I have the M1 Pro PowerBook (16GB / 10 CPU cores / 16 GPU cores) and the M1 Ultra Mac Studio (64GB / 20 CPU cores / 48 GPU cores) and on the Ultra those 48 cores use up over 40GB of RAM during generation, sometimes leading to swapfiles. (Interestingly, not 3x faster than the M1 Pro, but definitely faster.) When I got the Mac Studio I thought I would never have any use for its full power, and already I want to upgrade to whatever comes next and hurry up with the one that's 10x faster Apple.

sturdy hemlock
hybrid phoenix
worn slate
#

Definitely looking forward to the native solution by Apple which apparently is very memory efficient and produces almost zero swapfiles.

#

I made a test comparison between A1111 (Pytorch), InvokeAI (Pytorch) and Diffusion Bee (some CoreML?) and A1111 is terribly inefficient, causing about 500 MB of swapfile write to the SSD PER ITERATION. So generating one image 512x512 writes about 18 GB of data to the SSD. Ouch. Invoke also writes a lot of data, but much less. I counted about 3 GB for a generated image. DiffusionBee? Almost nothing.

indigo kiln
#

I only have an 8GB M2 MacBook Air, so I don't expect much. But in DiffusionBee, I get about 1s/it, while with InvokeAI, I get only about 20s/it. Ouch!

So I hope that those recent Apple optimzations make it into InvokeAI some day soon!

indigo kiln
balmy tapir
indigo kiln
# balmy tapir did you tried coreml version?

There isn't currently a way to use those optimizations with InvokeAI, is there?

I haven't tried out Apple's fork yet. If I need speed, I just use DiffusionBee. It's fast enough. If I want certain features I use InvokeAI and must be very patient.

balmy tapir
indigo kiln
left vine
worn slate
past axle
#

And i generate 512px only

balmy tapir
indigo kiln
# left vine 20s/it... what size ? I get 512x512 @ 4 s/it on a 8Gb M1 mac Mini ?

512x512. I switched to DDIM and it usually settles down to 10s/it.

I probably just have too much other junk running, I have a lot of menubar things installed on my Mac, etc. And I'm using Chrome, which is a hog. I should probably just do batch generation of images via the command line, or shut down Chrome, and everything else, once it's started generating a batch of images.

Which sampler do you use?