1
mirror of https://github.com/comfyanonymous/ComfyUI.git synced 2025-08-02 15:04:50 +08:00

MLU memory optimization (#7470)

Co-authored-by: huzhan <huzhan@cambricon.com>
This commit is contained in:
BiologicalExplosion
2025-04-03 07:24:04 +08:00
committed by GitHub
parent ab5413351e
commit 2222cf67fd

View File

@@ -1237,6 +1237,8 @@ def soft_empty_cache(force=False):
torch.xpu.empty_cache()
elif is_ascend_npu():
torch.npu.empty_cache()
elif is_mlu():
torch.mlu.empty_cache()
elif torch.cuda.is_available():
torch.cuda.empty_cache()
torch.cuda.ipc_collect()