From 320d760a4dfb7172f64bfbee29f98811a262db88 Mon Sep 17 00:00:00 2001 From: abhikran Date: Tue, 17 Jan 2023 19:59:20 +0530 Subject: [PATCH 1/3] [TESTING] Enable execution of test_packed_8x8x32_resnet50 Resnet 50 is passing now. Need to add below mentioned changes as well for test to pass. - Add condition for IndexMap - Add empty dict while calling tune_conv2d_template to avoid failure --- src/meta_schedule/database/database_utils.cc | 2 ++ .../contrib/test_hexagon/metaschedule_e2e/test_resnet50_int8.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/meta_schedule/database/database_utils.cc b/src/meta_schedule/database/database_utils.cc index 9e563c39d408..0eca0abbb6f0 100644 --- a/src/meta_schedule/database/database_utils.cc +++ b/src/meta_schedule/database/database_utils.cc @@ -77,6 +77,8 @@ void JSONDumps(ObjectRef json_obj, std::ostringstream& os) { JSONDumps(kv.second, os); } os << "}"; + } else if (const auto* idx_map = json_obj.as()) { + os << "\n"; } else { LOG(FATAL) << "TypeError: Unsupported type in JSON object: " << json_obj->GetTypeKey(); } diff --git a/tests/python/contrib/test_hexagon/metaschedule_e2e/test_resnet50_int8.py b/tests/python/contrib/test_hexagon/metaschedule_e2e/test_resnet50_int8.py index 1e01cb28a749..d985d2120936 100644 --- a/tests/python/contrib/test_hexagon/metaschedule_e2e/test_resnet50_int8.py +++ b/tests/python/contrib/test_hexagon/metaschedule_e2e/test_resnet50_int8.py @@ -410,7 +410,7 @@ def test_packed_8x8x32_resnet50(hexagon_launcher): if do_tune: hexagon_lowered = tune_conv2d_template( - mod, _schedule_packed_8x8x32_conv2d, "packed_8x8x32", params, hexagon_launcher + mod, _schedule_packed_8x8x32_conv2d, "packed_8x8x32", params, hexagon_launcher, {} ) else: with tvm.transform.PassContext(opt_level=3): From 47edfafc5bec5117f27442d8d75a149d364aa730 Mon Sep 17 00:00:00 2001 From: abhikran Date: Thu, 19 Jan 2023 13:18:28 +0530 Subject: [PATCH 2/3] Fix unused variable error --- src/meta_schedule/database/database_utils.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/meta_schedule/database/database_utils.cc b/src/meta_schedule/database/database_utils.cc index 0eca0abbb6f0..4855b0608d82 100644 --- a/src/meta_schedule/database/database_utils.cc +++ b/src/meta_schedule/database/database_utils.cc @@ -77,8 +77,9 @@ void JSONDumps(ObjectRef json_obj, std::ostringstream& os) { JSONDumps(kv.second, os); } os << "}"; - } else if (const auto* idx_map = json_obj.as()) { - os << "\n"; + } else if (const auto* index_map = json_obj.as()) { + // Placeholder to avoid compilation error of unused index_map + os << index_map->final_indices; } else { LOG(FATAL) << "TypeError: Unsupported type in JSON object: " << json_obj->GetTypeKey(); } From 91b93cb75eb3dabd8d82d431a8844e2a92dffd2a Mon Sep 17 00:00:00 2001 From: abhikran Date: Thu, 19 Jan 2023 17:37:28 +0530 Subject: [PATCH 3/3] Remove unused variable and change check in if condition --- src/meta_schedule/database/database_utils.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/meta_schedule/database/database_utils.cc b/src/meta_schedule/database/database_utils.cc index 4855b0608d82..1754b304c904 100644 --- a/src/meta_schedule/database/database_utils.cc +++ b/src/meta_schedule/database/database_utils.cc @@ -77,9 +77,8 @@ void JSONDumps(ObjectRef json_obj, std::ostringstream& os) { JSONDumps(kv.second, os); } os << "}"; - } else if (const auto* index_map = json_obj.as()) { - // Placeholder to avoid compilation error of unused index_map - os << index_map->final_indices; + } else if (json_obj->IsInstance()) { + // Do nothing for index maps to start } else { LOG(FATAL) << "TypeError: Unsupported type in JSON object: " << json_obj->GetTypeKey(); }