From f74576d19c2fadeec8e102c9a4576e2e8051068a Mon Sep 17 00:00:00 2001 From: Johnson Zhang Date: Fri, 23 Feb 2024 19:21:50 +0800 Subject: [PATCH 1/2] [BugFix] Fix Crash Cases Caused by "__tvm_meta__ = None" --- python/tvm/script/parser/ir/parser.py | 3 +++ ...t_tir_transform_merge_dynamic_shared_memory_allocations.py | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/python/tvm/script/parser/ir/parser.py b/python/tvm/script/parser/ir/parser.py index 4ea57130f1e2..751f2c9a1ca7 100644 --- a/python/tvm/script/parser/ir/parser.py +++ b/python/tvm/script/parser/ir/parser.py @@ -87,6 +87,9 @@ def _visit_assign(self: Parser, node: doc.Assign) -> None: lhs = node.targets[0].id rhs = self.eval_expr(node.value) + if rhs is None: + return + I.decl_function(lhs, rhs) I.def_function(lhs, rhs) diff --git a/tests/python/tir-transform/test_tir_transform_merge_dynamic_shared_memory_allocations.py b/tests/python/tir-transform/test_tir_transform_merge_dynamic_shared_memory_allocations.py index efe2944aaa48..8661843d39c1 100644 --- a/tests/python/tir-transform/test_tir_transform_merge_dynamic_shared_memory_allocations.py +++ b/tests/python/tir-transform/test_tir_transform_merge_dynamic_shared_memory_allocations.py @@ -456,7 +456,7 @@ def func( class TestSimpleAllocNoReuse(tvm.testing.CompareBeforeAfter): """Test alloc and free within the same scope.""" - transform = tvm.tir.transform.MergeDynamicSharedMemoryAllocations() + transform = tvm.tir.transform.MergeSharedMemoryAllocations() def before(self): @T.prim_func @@ -485,7 +485,7 @@ def func(): class TestSimpleAllocReuse(tvm.testing.CompareBeforeAfter): """Test alloc and free within the same scope with a reuse chance.""" - transform = tvm.tir.transform.MergeDynamicSharedMemoryAllocations() + transform = tvm.tir.transform.MergeSharedMemoryAllocations() def before(self): @T.prim_func From b98c67d104beb13f294ec24f322eacbda359bb97 Mon Sep 17 00:00:00 2001 From: Johnson Zhang Date: Mon, 26 Feb 2024 10:58:28 +0800 Subject: [PATCH 2/2] [BugFix] Remove Non-exist Directory "tests/python/usmp" --- tests/scripts/task_python_unittest.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/scripts/task_python_unittest.sh b/tests/scripts/task_python_unittest.sh index 5b07b5256ea5..28a1f5ad1bf0 100755 --- a/tests/scripts/task_python_unittest.sh +++ b/tests/scripts/task_python_unittest.sh @@ -51,7 +51,6 @@ TEST_FILES=( "tir-transform" "tir-usmp" "tvmscript" - "usmp" ) for TEST_FILE in ${TEST_FILES[@]}; do