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

[FIX]: split attention V1 fixes vram OOM issues

Open 2blackbar opened this issue 1 year ago • 2 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues and checked the recent builds/commits

What happened?

--opt-split-attention-v1 --xformers This solved it and that v1 split attention should be used by default imo I can do 2048x2048 on 3090 like before or even 4048x640, probably even higher cause it reserves about 8gb only Use it and forget about all the OOM crap Wow 3090 can even do 4048x4048 but it is quite slow, doesnt OOM tho so it works !

Steps to reproduce the problem

.

What should have happened?

.

Commit where the problem happens

https://github.com/AUTOMATIC1111/stable-diffusion-webui/commits/master

What platforms do you use to access the UI ?

Windows

What browsers do you use to access the UI ?

Google Chrome

Command Line Arguments

--opt-split-attention-v1 --xformers

List of extensions

.

Console logs

.

Additional information

No response

2blackbar avatar Mar 07 '23 12:03 2blackbar

Do xformers do anything here? I think that only first optimization is applied

FNSpd avatar Mar 07 '23 13:03 FNSpd

Do xformers do anything here? I think that only first optimization is applied

yeh they speedup the generation from 15 seconds to 6 seconds but they dont affect VRAM cause i was able to do same sizes without them

2blackbar avatar Mar 07 '23 14:03 2blackbar

why --opt-split-attention-v1? and not --opt-split-attention

elen07zz avatar Mar 07 '23 18:03 elen07zz

V1 uses less memory, iirc

FNSpd avatar Mar 07 '23 18:03 FNSpd

Are you sure you're measuring the VRAM usage accurately? I thought the 3090 had 24GB of vram, but you mentioned 8GB of usage using --opt-split-attention-v1, and out-of-memory problems without it, leaving 16GB on the table. I probably misunderstand what you meant by 'reserves' 8GB.

I do believe it helped memory problems, though! I'm jealous, my max limit on 2070super 8GB seems to be 1280x1280 (but without anything that takes extra memory like ControlNet, which drops the max resolution a bit). [Edit: not counting --medvram option]

I recommend using MSI Afterburner's hardware monitor graphs. It's pretty interesting to see the fluctuations with 100ms resolution.

Here's an example where I just did 15steps at 1280x1280:

oJnSEUPNNM

EfourC avatar Mar 07 '23 22:03 EfourC