Skip to content

Commit e9f7cda

Browse files
committed
fix: Free cpu_base after storing to avoid duplicate RAM usage
1 parent cffb92a commit e9f7cda

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

nodes/lora_resize.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1790,12 +1790,15 @@ def extract_core_layer_lora(block_name: str) -> str:
17901790
else:
17911791
# No LoRA contribution, copy as-is
17921792
output_sd[base_key] = cpu_base.to(save_dtype).contiguous()
1793+
del cpu_base
17931794
stats["copied"] += 1
17941795
else:
17951796
# Non-weight tensor (bias, norm, etc.), copy as-is
17961797
output_sd[base_key] = cpu_base.to(save_dtype).contiguous()
1798+
del cpu_base
17971799
stats["copied"] += 1
17981800

1801+
17991802
pbar.update(1)
18001803

18011804
if verbose:

0 commit comments

Comments
 (0)