Closed vladmandic closed 1 year ago
This method has a problem
if you have: using lycos -> disable all lycos
this return will let the extension cannot restore the backup weights
how do you suggest to fix it? as it is, memory leak is pretty big, 390MB on each generate?
@vladmandic How about this
Wait a min I do something wrong
thanks for quick action. btw, this code is pretty much exactly the same as in lora
which is built-in in a1111, so it leaks in both places. once you have your fix in place, i'll modify lora code in my repo to follow the same logic.
@vladmandic I think the code now can resolve it
I'm pretty sure this change caused inference to become at least twice as slow now when a LoRA is in the prompt, as there's a brief pause that keeps occurring. If I disable this extension then speed returns to normal.
Edit: Can confirm as well that rolling back to ce584a0ff863de98233ee135dcc17f2fb44703c3 fixes the speed.
i was about to say the same - this drops the speed by ~40%, even with empty prompt. @KohakuBlueleaf ?
can confirm I had the same issue
+1
if lyco is NOT used, it will still try to allocate memory due to
self.lyco_weights_backup = weights_backup
, but those are then never released as there is no lyco applied.fix is simple early-exit if no lyco model is loaded.
memray before patch shows (must run on cpu so memray can capture memory allocations):