Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@ def pin_weight_to_device(self, key):
mmap_released = False
named_modules_to_munmap = {}

def partially_unload(self, *args, force_patch_weights=False, **kwargs):
return super().partially_unload(*args, force_patch_weights=True, **kwargs)

def partially_load(self, *args, force_patch_weights=False, **kwargs):
return super().partially_load(*args, force_patch_weights=True, **kwargs)

def load(self, *args, force_patch_weights=False, **kwargs):
if not self.mmap_released:
self.named_modules_to_munmap = dict(self.model.named_modules())
Expand Down