Skip to content

Commit cf01650

Browse files
jinchen62monorimet
andauthored
Clear memory after loading external weights (#435)
It fixes OOM if terminating the program by keyboard. --------- Co-authored-by: Ean Garvey <[email protected]>
1 parent a71fb4d commit cf01650

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

models/turbine_models/model_runner.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ def __init__(self, device, vmfb_path, external_weight_path=None):
6060
self.config.vm_instance, index.create_provider(scope="model")
6161
)
6262
vm_modules.insert(i, param_module)
63-
63+
del index
64+
del param_module
6465
self.ctx = ireert.SystemContext(
6566
vm_modules=vm_modules,
6667
config=self.config,

0 commit comments

Comments
 (0)