We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4ffb8b3 commit b8aa4e6Copy full SHA for b8aa4e6
py/torch_tensorrt/dynamo/utils.py
@@ -3,6 +3,7 @@
3
import ctypes
4
import gc
5
import logging
6
+import os
7
import platform
8
import warnings
9
from dataclasses import fields, replace
@@ -882,7 +883,7 @@ def release_memory() -> None:
882
883
torch.cuda.ipc_collect()
884
torch.cuda.synchronize()
885
- if platform.system() == "Linux":
886
+ if platform.system() == "Linux" and os.environ.get("TRIM_CPU_MEMORY", "0") == "1":
887
try:
888
libc = ctypes.CDLL("libc.so.6")
889
if libc.malloc_trim(0) != 1:
0 commit comments