This is an automated email from the ASF dual-hosted git repository.

csullivan pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git


The following commit(s) were added to refs/heads/main by this push:
     new 6424f1fec1 [Hexagon] Disable broken test on physical device (#11960)
6424f1fec1 is described below

commit 6424f1fec174557510bf94edb4882e952f3e9541
Author: Mehrdad Hessar <[email protected]>
AuthorDate: Thu Jun 30 15:14:55 2022 -0700

    [Hexagon] Disable broken test on physical device (#11960)
---
 tests/python/contrib/test_hexagon/test_thread_pool.py  |  5 ++++-
 .../test_hexagon/topi/test_add_subtract_multiply.py    | 10 +++++-----
 .../contrib/test_hexagon/topi/test_argmax_slice.py     |  4 ++++
 .../contrib/test_hexagon/topi/test_avg_pool2d_slice.py |  5 ++---
 .../contrib/test_hexagon/topi/test_batch_matmul.py     |  1 -
 tests/python/contrib/test_hexagon/topi/test_clip.py    |  1 -
 .../contrib/test_hexagon/topi/test_conv2d_nchw.py      |  2 --
 .../contrib/test_hexagon/topi/test_conv2d_nhwc.py      |  2 --
 .../contrib/test_hexagon/topi/test_conv2d_transpose.py |  4 ++++
 tests/python/contrib/test_hexagon/topi/test_dense.py   |  1 -
 .../contrib/test_hexagon/topi/test_depthwise_conv2d.py |  4 +++-
 tests/python/contrib/test_hexagon/topi/test_pooling.py |  2 --
 tests/python/contrib/test_hexagon/topi/test_reduce.py  |  4 ----
 .../python/contrib/test_hexagon/topi/test_resize2d.py  | 17 +++++++----------
 tests/python/contrib/test_hexagon/topi/test_softmax.py |  1 -
 .../test_hexagon/{ => topi}/test_softmax_slice.py      | 18 ++++++++----------
 16 files changed, 37 insertions(+), 44 deletions(-)

diff --git a/tests/python/contrib/test_hexagon/test_thread_pool.py 
b/tests/python/contrib/test_hexagon/test_thread_pool.py
index d95c4120b7..fa53cdc068 100644
--- a/tests/python/contrib/test_hexagon/test_thread_pool.py
+++ b/tests/python/contrib/test_hexagon/test_thread_pool.py
@@ -16,7 +16,6 @@
 # under the License.
 
 import numpy as np
-import pytest
 
 import tvm
 import tvm.contrib.hexagon
@@ -92,3 +91,7 @@ def test_elemwise_sum_parallel(hexagon_session: Session):
     (a, b, c, n) = generate_add_test_data(hexagon_session)
     mod["elemwise_sum_parallel"](a, b, c, n)
     tvm.testing.assert_allclose(c.numpy(), a.numpy() + b.numpy())
+
+
+if __name__ == "__main__":
+    tvm.testing.main()
diff --git 
a/tests/python/contrib/test_hexagon/topi/test_add_subtract_multiply.py 
b/tests/python/contrib/test_hexagon/topi/test_add_subtract_multiply.py
index 4d595f7e82..0d81260729 100755
--- a/tests/python/contrib/test_hexagon/topi/test_add_subtract_multiply.py
+++ b/tests/python/contrib/test_hexagon/topi/test_add_subtract_multiply.py
@@ -19,11 +19,8 @@
 import pytest
 import numpy as np
 
-from tvm import te, topi
-
-import tvm.testing
-from tvm.topi import testing
-from tvm.contrib.hexagon.build import HexagonLauncher
+import tvm
+from tvm import te
 import tvm.topi.hexagon.slice_ops as sl
 from ..infrastructure import allocate_hexagon_array, transform_numpy
 
@@ -161,6 +158,9 @@ class TestAddSubtractMultiplyBroadcast2d:
         input_B_layout,
         op_name,
     ):
+        if hexagon_session._launcher._serial_number != "simulator":
+            pytest.skip(msg="Due to 
https://github.com/apache/tvm/issues/11957";)
+
         target_hexagon = tvm.target.hexagon("v69")
         A = te.placeholder(input_shape_A, name="A", dtype=dtype)
         B = te.placeholder(input_shape_B, name="B", dtype=dtype)
diff --git a/tests/python/contrib/test_hexagon/topi/test_argmax_slice.py 
b/tests/python/contrib/test_hexagon/topi/test_argmax_slice.py
index 4cbd524f4a..5431054d2c 100644
--- a/tests/python/contrib/test_hexagon/topi/test_argmax_slice.py
+++ b/tests/python/contrib/test_hexagon/topi/test_argmax_slice.py
@@ -15,6 +15,7 @@
 # specific language governing permissions and limitations
 # under the License.
 """ Tests for Hexagon slice argmax op """
+import pytest
 import numpy as np
 
 import tvm
@@ -76,6 +77,9 @@ class TestArgMaxSlice:
         working_scope,
     ):
         """Top level testing function for argmax"""
+        if hexagon_session._launcher._serial_number != "simulator":
+            pytest.skip(msg="Due to 
https://github.com/apache/tvm/issues/11957";)
+
         target_hexagon = tvm.target.hexagon("v69")
         target = tvm.target.Target(target_hexagon, host=target_hexagon)
         argmax_input = te.placeholder(input_shape, name="A", dtype=dtype)
diff --git a/tests/python/contrib/test_hexagon/topi/test_avg_pool2d_slice.py 
b/tests/python/contrib/test_hexagon/topi/test_avg_pool2d_slice.py
index 3154f7d7e7..5b1f59c897 100644
--- a/tests/python/contrib/test_hexagon/topi/test_avg_pool2d_slice.py
+++ b/tests/python/contrib/test_hexagon/topi/test_avg_pool2d_slice.py
@@ -18,8 +18,7 @@
 import pytest
 import numpy as np
 
-from tvm import te, topi
-
+from tvm import te
 import tvm.testing
 from tvm.topi import testing
 from tvm.contrib.hexagon.build import HexagonLauncher
@@ -369,4 +368,4 @@ class TestAvgPool2dSlice:
 
 
 if __name__ == "__main__":
-    sys.exit(pytest.main(sys.argv))
+    tvm.testing.main()
diff --git a/tests/python/contrib/test_hexagon/topi/test_batch_matmul.py 
b/tests/python/contrib/test_hexagon/topi/test_batch_matmul.py
index 467ebd06b9..c644773439 100644
--- a/tests/python/contrib/test_hexagon/topi/test_batch_matmul.py
+++ b/tests/python/contrib/test_hexagon/topi/test_batch_matmul.py
@@ -17,7 +17,6 @@
 """Test code for matmul"""
 import numpy as np
 import pytest
-import sys
 
 import tvm
 import tvm.testing
diff --git a/tests/python/contrib/test_hexagon/topi/test_clip.py 
b/tests/python/contrib/test_hexagon/topi/test_clip.py
index 37146b55dc..ac6890171d 100755
--- a/tests/python/contrib/test_hexagon/topi/test_clip.py
+++ b/tests/python/contrib/test_hexagon/topi/test_clip.py
@@ -17,7 +17,6 @@
 
 # pylint: disable=invalid-name
 
-import pytest
 import numpy as np
 
 from tvm import te, topi
diff --git a/tests/python/contrib/test_hexagon/topi/test_conv2d_nchw.py 
b/tests/python/contrib/test_hexagon/topi/test_conv2d_nchw.py
index c755a4d018..01c20601b6 100644
--- a/tests/python/contrib/test_hexagon/topi/test_conv2d_nchw.py
+++ b/tests/python/contrib/test_hexagon/topi/test_conv2d_nchw.py
@@ -16,8 +16,6 @@
 # under the License.
 """Test code for convolution."""
 import numpy as np
-import pytest
-import sys
 
 import tvm
 import tvm.testing
diff --git a/tests/python/contrib/test_hexagon/topi/test_conv2d_nhwc.py 
b/tests/python/contrib/test_hexagon/topi/test_conv2d_nhwc.py
index 96062aa1b4..9acffff358 100644
--- a/tests/python/contrib/test_hexagon/topi/test_conv2d_nhwc.py
+++ b/tests/python/contrib/test_hexagon/topi/test_conv2d_nhwc.py
@@ -16,8 +16,6 @@
 # under the License.
 """Test code for convolution."""
 import numpy as np
-import pytest
-import sys
 
 import tvm
 import tvm.testing
diff --git a/tests/python/contrib/test_hexagon/topi/test_conv2d_transpose.py 
b/tests/python/contrib/test_hexagon/topi/test_conv2d_transpose.py
index 629403965e..8536603a3c 100644
--- a/tests/python/contrib/test_hexagon/topi/test_conv2d_transpose.py
+++ b/tests/python/contrib/test_hexagon/topi/test_conv2d_transpose.py
@@ -154,3 +154,7 @@ class TestConv2DTranspose(BaseConv2DTransposeTests):
 
     padding = tvm.testing.parameter((0, 0, 0, 0))
     output_padding = tvm.testing.parameter((0, 0))
+
+
+if __name__ == "__main__":
+    tvm.testing.main()
diff --git a/tests/python/contrib/test_hexagon/topi/test_dense.py 
b/tests/python/contrib/test_hexagon/topi/test_dense.py
index 967278251c..929108bb14 100644
--- a/tests/python/contrib/test_hexagon/topi/test_dense.py
+++ b/tests/python/contrib/test_hexagon/topi/test_dense.py
@@ -17,7 +17,6 @@
 """Test code for dense"""
 import numpy as np
 import pytest
-import sys
 
 import tvm
 import tvm.testing
diff --git a/tests/python/contrib/test_hexagon/topi/test_depthwise_conv2d.py 
b/tests/python/contrib/test_hexagon/topi/test_depthwise_conv2d.py
index 63ae0e7b32..5e09e691f7 100644
--- a/tests/python/contrib/test_hexagon/topi/test_depthwise_conv2d.py
+++ b/tests/python/contrib/test_hexagon/topi/test_depthwise_conv2d.py
@@ -18,7 +18,6 @@
 import sys
 
 import numpy as np
-import pytest
 
 import tvm
 from tvm.contrib.hexagon.session import Session
@@ -296,3 +295,6 @@ class TestDepthwiseConv2D(BaseDepthwiseConv2D):
 
 
 # TODO(hexagon-team): add TestDepthwiseConv2D_NCHWc test.
+
+if __name__ == "__main__":
+    tvm.testing.main()
diff --git a/tests/python/contrib/test_hexagon/topi/test_pooling.py 
b/tests/python/contrib/test_hexagon/topi/test_pooling.py
index ededdad267..45e558e1b6 100644
--- a/tests/python/contrib/test_hexagon/topi/test_pooling.py
+++ b/tests/python/contrib/test_hexagon/topi/test_pooling.py
@@ -16,8 +16,6 @@
 # under the License.
 """Test code for pooling"""
 import numpy as np
-import pytest
-import sys
 
 import tvm
 import tvm.testing
diff --git a/tests/python/contrib/test_hexagon/topi/test_reduce.py 
b/tests/python/contrib/test_hexagon/topi/test_reduce.py
index c806964545..a844e1d512 100644
--- a/tests/python/contrib/test_hexagon/topi/test_reduce.py
+++ b/tests/python/contrib/test_hexagon/topi/test_reduce.py
@@ -16,15 +16,11 @@
 # under the License.
 """Test code for reduce"""
 import numpy as np
-import pytest
-import sys
 
 import tvm
-import tvm.testing
 from tvm import topi
 from tvm import te
 from tvm.contrib.hexagon.session import Session
-import tvm.topi.testing
 
 
 in_shape, axis, keepdims, reduce_type, dtype = tvm.testing.parameters(
diff --git a/tests/python/contrib/test_hexagon/topi/test_resize2d.py 
b/tests/python/contrib/test_hexagon/topi/test_resize2d.py
index caedc7b7b3..109eb5c436 100755
--- a/tests/python/contrib/test_hexagon/topi/test_resize2d.py
+++ b/tests/python/contrib/test_hexagon/topi/test_resize2d.py
@@ -14,16 +14,12 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-
-
 import pytest
 import numpy as np
 
-from tvm import te, topi
-
-import tvm.testing
-from tvm.topi import testing
-from tvm.contrib.hexagon.build import HexagonLauncher
+import tvm
+from tvm import te
+from tvm.topi.testing import resize2d_python
 import tvm.topi.hexagon as s1
 from ..infrastructure import allocate_hexagon_array, transform_numpy
 
@@ -34,9 +30,7 @@ def expected_output_np(
 ):
     scale_h = out_height / in_height
     scale_w = out_width / in_width
-    return tvm.topi.testing.resize2d_python(
-        input_np, (scale_h, scale_w), layout, method, coord_trans
-    )
+    return resize2d_python(input_np, (scale_h, scale_w), layout, method, 
coord_trans)
 
 
 @tvm.testing.fixture
@@ -108,6 +102,9 @@ class TestResize2d:
         method,
         hexagon_session,
     ):
+        if hexagon_session._launcher._serial_number != "simulator":
+            pytest.skip(msg="Due to 
https://github.com/apache/tvm/issues/11957";)
+
         target_hexagon = tvm.target.hexagon("v69")
         A = te.placeholder(input_shape, name="A", dtype=dtype)
 
diff --git a/tests/python/contrib/test_hexagon/topi/test_softmax.py 
b/tests/python/contrib/test_hexagon/topi/test_softmax.py
index 7a2435e8dc..d1c78842b5 100644
--- a/tests/python/contrib/test_hexagon/topi/test_softmax.py
+++ b/tests/python/contrib/test_hexagon/topi/test_softmax.py
@@ -17,7 +17,6 @@
 """Test code for softmax"""
 import numpy as np
 import pytest
-import sys
 
 import tvm
 import tvm.testing
diff --git a/tests/python/contrib/test_hexagon/test_softmax_slice.py 
b/tests/python/contrib/test_hexagon/topi/test_softmax_slice.py
similarity index 91%
rename from tests/python/contrib/test_hexagon/test_softmax_slice.py
rename to tests/python/contrib/test_hexagon/topi/test_softmax_slice.py
index a4745d62a7..a39c6cd516 100644
--- a/tests/python/contrib/test_hexagon/test_softmax_slice.py
+++ b/tests/python/contrib/test_hexagon/topi/test_softmax_slice.py
@@ -14,17 +14,14 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-
 import pytest
 import numpy as np
-from tvm import te, topi
-
-import tvm.testing
-from tvm.topi import testing
-from tvm.contrib.hexagon.build import HexagonLauncher
 
+import tvm
+from tvm import te
+from tvm.topi.testing import softmax_python
 import tvm.topi.hexagon.slice_ops as sl
-from .infrastructure import allocate_hexagon_array
+from ..infrastructure import allocate_hexagon_array
 
 
 def transform_numpy(arr_np, layout):
@@ -63,7 +60,7 @@ class TestSoftmax2d(Basesoftmax2d):
     @tvm.testing.fixture
     def expected_output_np(self, input_np):
         if len(input_np.shape) == 2:
-            ref_np_2d = tvm.topi.testing.softmax_python(input_np)
+            ref_np_2d = softmax_python(input_np)
             return ref_np_2d
         raise RuntimeError(f"Unexpected input shape '{input_np.shape}'")
 
@@ -82,6 +79,8 @@ class TestSoftmax2d(Basesoftmax2d):
         axis_sep,
         hexagon_session,
     ):
+        if hexagon_session._launcher._serial_number != "simulator":
+            pytest.skip(msg="Due to 
https://github.com/apache/tvm/issues/11957";)
 
         target_hexagon = tvm.target.hexagon(
             "v69",
@@ -136,5 +135,4 @@ class TestSoftmax2d(Basesoftmax2d):
 
 
 if __name__ == "__main__":
-
-    sys.exit(pytest.main(sys.argv))
+    tvm.testing.main()

Reply via email to