From 3d5e1ddd2145ba8aaa71748c2a4a516c33c8dd2f Mon Sep 17 00:00:00 2001 From: Krzysztof Parzyszek Date: Thu, 6 Oct 2022 14:45:19 -0700 Subject: [PATCH 1/2] [Hexagon] Fix chunk address table generation in chunkify_hwio_16b The filter data is contiguous, the iteration is over 16-bit elements, not pointers. --- src/runtime/hexagon/ops/conv_utils.cc | 4 ++-- .../contrib/test_hexagon/topi/test_conv2d_fp16_intrin.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/runtime/hexagon/ops/conv_utils.cc b/src/runtime/hexagon/ops/conv_utils.cc index e1ec1e17277d..b10f7cc315b2 100644 --- a/src/runtime/hexagon/ops/conv_utils.cc +++ b/src/runtime/hexagon/ops/conv_utils.cc @@ -141,7 +141,7 @@ void deblockize_hwc_16b(void* out_flat, void* inp, int height, int width, int de void chunkify_hwio_16b(void** out_ptr, int out_ptr_size, void* out, void* inp, int height, int width, int idepth, int odepth) { auto inp_data = static_cast(inp); - auto out_data = static_cast(out); + auto out_data = static_cast(out); const int stride_i = odepth; const int stride_x = stride_i * idepth; const int stride_y = stride_x * width; @@ -158,7 +158,7 @@ void chunkify_hwio_16b(void** out_ptr, int out_ptr_size, void* out, void* inp, i int max_i = std::min(32, idepth - ci); int max_o = std::min(32, odepth - co); - auto chunk = reinterpret_cast(out_data); + auto chunk = out_data; for (int y = 0; y < max_y; ++y) { for (int x = max_x - 1; x >= 0; --x) { for (int i = 0; i < max_i; ++i) { diff --git a/tests/python/contrib/test_hexagon/topi/test_conv2d_fp16_intrin.py b/tests/python/contrib/test_hexagon/topi/test_conv2d_fp16_intrin.py index 3f88a6e432b7..5066a532df9b 100644 --- a/tests/python/contrib/test_hexagon/topi/test_conv2d_fp16_intrin.py +++ b/tests/python/contrib/test_hexagon/topi/test_conv2d_fp16_intrin.py @@ -197,7 +197,7 @@ class TestConv2dIntrin: inp_offset = tvm.testing.parameter((0, 0), ids=["offset0x0"]) @tvm.testing.requires_hexagon - def DISABLED_test_conv2d(self, act_shape, wgt_shape, inp_stride, inp_offset, hexagon_session): + def test_conv2d(self, act_shape, wgt_shape, inp_stride, inp_offset, hexagon_session): """Test conv2d intrinsic implementation""" assert act_shape[3] == wgt_shape[2] From 3d581f6f26b8fc3df36a14d43b103cba541ba459 Mon Sep 17 00:00:00 2001 From: Krzysztof Parzyszek Date: Fri, 7 Oct 2022 07:14:04 -0700 Subject: [PATCH 2/2] Re-disable the conv2d_fp16 test, since it still fails on hardware --- .../python/contrib/test_hexagon/topi/test_conv2d_fp16_intrin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/python/contrib/test_hexagon/topi/test_conv2d_fp16_intrin.py b/tests/python/contrib/test_hexagon/topi/test_conv2d_fp16_intrin.py index 5066a532df9b..3f88a6e432b7 100644 --- a/tests/python/contrib/test_hexagon/topi/test_conv2d_fp16_intrin.py +++ b/tests/python/contrib/test_hexagon/topi/test_conv2d_fp16_intrin.py @@ -197,7 +197,7 @@ class TestConv2dIntrin: inp_offset = tvm.testing.parameter((0, 0), ids=["offset0x0"]) @tvm.testing.requires_hexagon - def test_conv2d(self, act_shape, wgt_shape, inp_stride, inp_offset, hexagon_session): + def DISABLED_test_conv2d(self, act_shape, wgt_shape, inp_stride, inp_offset, hexagon_session): """Test conv2d intrinsic implementation""" assert act_shape[3] == wgt_shape[2]