diff --git a/python/tvm/_ffi/libinfo.py b/python/tvm/_ffi/libinfo.py index fdd888a470..b27d4247fd 100644 --- a/python/tvm/_ffi/libinfo.py +++ b/python/tvm/_ffi/libinfo.py @@ -165,9 +165,11 @@ def find_include_path(name=None, search_path=None, optional=False): include_path : list(string) List of all found paths to header files. """ - ffi_dir = os.path.dirname(os.path.abspath(os.path.expanduser(__file__))) - source_dir = os.path.join(ffi_dir, "..", "..", "..") - + if os.environ.get("TVM_HOME", None): + source_dir = os.environ["TVM_HOME"] + else: + ffi_dir = os.path.dirname(os.path.abspath(os.path.expanduser(__file__))) + source_dir = os.path.join(ffi_dir, "..", "..", "..") third_party_dir = os.path.join(source_dir, "3rdparty") header_path = [] diff --git a/src/relax/transform/attach_global_symbol.cc b/src/relax/transform/attach_global_symbol.cc index be779e97bc..cd771c607d 100644 --- a/src/relax/transform/attach_global_symbol.cc +++ b/src/relax/transform/attach_global_symbol.cc @@ -39,6 +39,8 @@ class GlobalSymbolAttacher { func = WithAttr(GetRef(prim_func), "global_symbol", p.first->name_hint); } else if (auto* relax_func = func.as()) { func = WithAttr(GetRef(relax_func), "global_symbol", p.first->name_hint); + } else if (auto* extern_func = func.as()) { + func = WithAttr(GetRef(extern_func), "global_symbol", p.first->name_hint); } else { LOG(FATAL) << "Unsupported function type: " << func->GetTypeKey(); throw;