Skip to content

Commit b7e4107

Browse files
committed
workaround metal
1 parent 558b446 commit b7e4107

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,10 @@ endif()
159159
# let libtilelang to search tvm/tvm_runtime in same dir
160160
if(APPLE)
161161
set_target_properties(tilelang PROPERTIES INSTALL_RPATH "@loader_path")
162+
set_target_properties(tilelang_module PROPERTIES INSTALL_RPATH "@loader_path")
162163
else()
163164
set_target_properties(tilelang PROPERTIES INSTALL_RPATH "\$ORIGIN")
165+
set_target_properties(tilelang_module PROPERTIES INSTALL_RPATH "\$ORIGIN")
164166
endif()
165167

166168
install(TARGETS tvm tvm_runtime tilelang_module tilelang LIBRARY DESTINATION tilelang/lib)

tilelang/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,16 @@ def _init_logger():
6767
# Setup tvm search path before importing tvm
6868
from . import libinfo
6969

70+
from .contrib.cc import is_darwin
71+
7072

7173
def _load_tile_lang_lib():
7274
"""Load Tile Lang lib"""
7375
if sys.platform.startswith("win32") and sys.version_info >= (3, 8):
7476
for path in libinfo.get_dll_directories():
7577
os.add_dll_directory(path)
7678
# pylint: disable=protected-access
77-
lib_name = "tilelang" if tvm.base._RUNTIME_ONLY else "tilelang_module"
79+
lib_name = "tilelang" if tvm.base._RUNTIME_ONLY and not is_darwin() else "tilelang_module"
7880
# pylint: enable=protected-access
7981
lib_path = libinfo.find_lib_path(lib_name, optional=False)
8082
return ctypes.CDLL(lib_path), lib_path

0 commit comments

Comments
 (0)