From a957dde49d8c665b3d0df090a353d6b46011ae5f Mon Sep 17 00:00:00 2001 From: Masahiro Masuda Date: Thu, 14 Apr 2022 16:32:43 +0900 Subject: [PATCH] conv2d topi test working --- src/target/target_kind.cc | 2 +- .../topi/python/test_topi_conv2d_int8.py | 20 +++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/target/target_kind.cc b/src/target/target_kind.cc index 2bc792f398cd2..96c193d34aa12 100644 --- a/src/target/target_kind.cc +++ b/src/target/target_kind.cc @@ -306,7 +306,7 @@ TVM_REGISTER_TARGET_KIND("nvptx", kDLCUDA) TVM_REGISTER_TARGET_KIND("rocm", kDLROCM) .add_attr_option("mcpu") .add_attr_option("mtriple") - .add_attr_option("mattr") + .add_attr_option>("mattr") .add_attr_option("system-lib") .add_attr_option("max_num_threads", Integer(256)) .add_attr_option("thread_warp_size", Integer(64)) diff --git a/tests/python/topi/python/test_topi_conv2d_int8.py b/tests/python/topi/python/test_topi_conv2d_int8.py index 5edc3a393fd6a..cb106af7a5718 100644 --- a/tests/python/topi/python/test_topi_conv2d_int8.py +++ b/tests/python/topi/python/test_topi_conv2d_int8.py @@ -361,13 +361,6 @@ def get_ref_data(): # 4, # False, # ), - # ( - # "rocm", - # lambda a, w, s, p, d, l, ol, o: topi.cuda.conv2d_NCHWc_int8(a, w, s, p, d, l, o), - # topi.cuda.schedule_conv2d_NCHWc_int8, - # 4, - # False, - # ), ] build_only_aarch64 = platform.machine() != "aarch64" @@ -383,15 +376,22 @@ def get_ref_data(): ) if in_dtype == "int8": - targets.append( + targets += [ ( "llvm -device arm_cpu -mtriple aarch64-linux-gnu -mattr=+neon", topi.arm_cpu.conv2d_NCHWc_int8, topi.arm_cpu.schedule_conv2d_NCHWc_int8, 8, build_only_aarch64, - ) - ) + ), + ( + "rocm -mattr=+dotprod", + lambda a, w, s, p, d, l, ol, o: topi.cuda.conv2d_NCHWc_int8(a, w, s, p, d, l, o), + topi.cuda.schedule_conv2d_NCHWc_int8, + 4, + False, + ), + ] for target, compute, schedule, oc_block_factor, build_only in targets: check_target(target, compute, schedule, oc_block_factor, build_only)