Skip to content

Commit a86a58c

Browse files
Fix xpu function not implemented p2. (Comfy-Org#9027)
1 parent 39dda1d commit a86a58c

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

comfy/model_management.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,10 +1107,7 @@ def get_free_memory(dev=None, torch_free_too=False):
11071107
stats = torch.xpu.memory_stats(dev)
11081108
mem_active = stats['active_bytes.all.current']
11091109
mem_reserved = stats['reserved_bytes.all.current']
1110-
if torch_version_numeric < (2, 6):
1111-
mem_free_xpu = torch.xpu.get_device_properties(dev).total_memory - mem_reserved
1112-
else:
1113-
mem_free_xpu, _ = torch.xpu.mem_get_info(dev)
1110+
mem_free_xpu = torch.xpu.get_device_properties(dev).total_memory - mem_reserved
11141111
mem_free_torch = mem_reserved - mem_active
11151112
mem_free_total = mem_free_xpu + mem_free_torch
11161113
elif is_ascend_npu():

0 commit comments

Comments
 (0)