Skip to content

Commit c171a1d

Browse files
committed
up
1 parent a4d6ffd commit c171a1d

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/diffusers/modular_pipelines/components_manager.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -164,14 +164,9 @@ def __call__(self, hooks, model_id, model, execution_device):
164164

165165
device_type = execution_device.type
166166
device_module = getattr(torch, device_type, torch.cuda)
167-
try:
168-
mem_on_device = device_module.mem_get_info(execution_device.index)[0]
169-
except AttributeError:
170-
try:
171-
mem_on_device = device_module.recommended_max_memory()
172-
except AttributeError:
173-
raise NotImplementedError(f"Do not know how to obtain memory info for {str(device_module)}.")
167+
mem_on_device = device_module.mem_get_info(execution_device.index)[0]
174168
mem_on_device = mem_on_device - self.memory_reserve_margin
169+
175170
if current_module_size < mem_on_device:
176171
return []
177172

0 commit comments

Comments
 (0)