diff --git a/python/tvm/__init__.py b/python/tvm/__init__.py index 6599b2a842e8..5d298ab79268 100644 --- a/python/tvm/__init__.py +++ b/python/tvm/__init__.py @@ -72,11 +72,11 @@ # support infra from . import support -# tvm.relay -from . import relay - -# tvm.relax -from . import relax +# Relay and Relax contain modules that are only available in compiler package +# Do not import them if TVM is built with runtime only +if not _RUNTIME_ONLY: + from . import relay + from . import relax # Contrib initializers from .contrib import rocm as _rocm, nvcc as _nvcc, sdaccel as _sdaccel diff --git a/tests/python/tir-base/test_debug_info.py b/tests/python/tir-base/test_debug_info.py index 83fcd8fe32cf..8bd22f1bb6bd 100644 --- a/tests/python/tir-base/test_debug_info.py +++ b/tests/python/tir-base/test_debug_info.py @@ -155,9 +155,7 @@ def test_llvm_ir_debug_accuracy(): locations = find_di_locations(source) # Find the 'assert' from MyModule - debug_dir_match = re.search( - r"tail call void %0\(i8\* getelementptr inbounds .* !dbg !(\d+)\n", source - ) + debug_dir_match = re.search(r"tail call void %0\(.* !dbg !(\d+)\n", source) # Extract out the debug directive line directive_idx = debug_dir_match.groups()[0]