Skip to content

Commit 91886bb

Browse files
committed
del 'arch_utils' and '__triton_launcher' manually
Signed-off-by: Anatoly Myachev <[email protected]>
1 parent d17f843 commit 91886bb

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

third_party/intel/backend/compiler.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import tempfile
1212
import signal
1313
import os
14+
import sys
1415
import shutil
1516
import subprocess
1617
from pathlib import Path
@@ -136,6 +137,12 @@ def __init__(self, target: tuple) -> None:
136137
self.properties = self.parse_target(target.arch)
137138
self.binary_ext = "spv"
138139

140+
def __del__(self):
141+
print("XPUBackend destructor")
142+
if "arch_utils" in sys.modules:
143+
print("XPUBackend: arch_utils will be deleted")
144+
del sys.modules["arch_utils"]
145+
139146
def parse_target(self, tgt_prop) -> dict:
140147
dev_prop = {}
141148
dev_prop['name'] = tgt_prop.get('name', 'xpu')

third_party/intel/backend/driver.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import importlib.metadata
22
import os
3+
import sys
34
import hashlib
45
import shutil
56
import sysconfig
@@ -599,6 +600,12 @@ def __call__(self, *args, **kwargs):
599600
serialize_args(args, self.constants, self.signature)
600601
self.launch(*args, **kwargs)
601602

603+
def __del__(self):
604+
print("XPULauncher destructor")
605+
if "__triton_launcher" in sys.modules:
606+
print("XPULauncher: __triton_launcher will be deleted")
607+
del sys.modules["__triton_launcher"]
608+
602609

603610
class XPUDriver(DriverBase):
604611

0 commit comments

Comments
 (0)