improve offloading

Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
Vladimir Mandic
2025-12-25 10:24:02 +00:00
parent 76aae17e6f
commit 0b1e6d2d3c
8 changed files with 47 additions and 15 deletions
+2 -2
View File
@@ -238,8 +238,8 @@ def torch_gc(force:bool=False, fast:bool=False, reason:str=None):
torch.cuda.synchronize()
torch.cuda.empty_cache() # cuda gc
torch.cuda.ipc_collect()
except Exception:
pass
except Exception as e:
log.error(f'GC: {e}')
else:
return gpu, ram
t1 = time.time()