Some fixes to generalize CUDA specific functionality to Intel or other GPUs.

This commit is contained in:
Simon Lui
2023-09-02 18:22:10 -07:00
parent 62efc78a4b
commit 4a0c4ce4ef
3 changed files with 38 additions and 26 deletions

View File

@@ -323,8 +323,7 @@ class CrossAttentionDoggettx(nn.Module):
break
except model_management.OOM_EXCEPTION as e:
if first_op_done == False:
torch.cuda.empty_cache()
torch.cuda.ipc_collect()
model_management.soft_empty_cache()
if cleared_cache == False:
cleared_cache = True
print("out of memory error, emptying cache and trying again")