Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Hexagon] Disable broken test on physical device #11960

Merged
merged 6 commits into from
Jun 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion tests/python/contrib/test_hexagon/test_thread_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
# under the License.

import numpy as np
import pytest

import tvm
import tvm.contrib.hexagon
Expand Down Expand Up @@ -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()
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -161,6 +158,9 @@ def test_transform(
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)
Expand Down
4 changes: 4 additions & 0 deletions tests/python/contrib/test_hexagon/topi/test_argmax_slice.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -76,6 +77,9 @@ def test_argmax_slice(
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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -369,4 +368,4 @@ def test_avg_pool2d_slice(


if __name__ == "__main__":
sys.exit(pytest.main(sys.argv))
tvm.testing.main()
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"""Test code for matmul"""
import numpy as np
import pytest
import sys

import tvm
import tvm.testing
Expand Down
1 change: 0 additions & 1 deletion tests/python/contrib/test_hexagon/topi/test_clip.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

# pylint: disable=invalid-name

import pytest
import numpy as np

from tvm import te, topi
Expand Down
2 changes: 0 additions & 2 deletions tests/python/contrib/test_hexagon/topi/test_conv2d_nchw.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
# under the License.
"""Test code for convolution."""
import numpy as np
import pytest
import sys

import tvm
import tvm.testing
Expand Down
2 changes: 0 additions & 2 deletions tests/python/contrib/test_hexagon/topi/test_conv2d_nhwc.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
# under the License.
"""Test code for convolution."""
import numpy as np
import pytest
import sys

import tvm
import tvm.testing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
1 change: 0 additions & 1 deletion tests/python/contrib/test_hexagon/topi/test_dense.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"""Test code for dense"""
import numpy as np
import pytest
import sys

import tvm
import tvm.testing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import sys

import numpy as np
import pytest

import tvm
from tvm.contrib.hexagon.session import Session
Expand Down Expand Up @@ -296,3 +295,6 @@ class TestDepthwiseConv2D(BaseDepthwiseConv2D):


# TODO(hexagon-team): add TestDepthwiseConv2D_NCHWc test.

if __name__ == "__main__":
tvm.testing.main()
2 changes: 0 additions & 2 deletions tests/python/contrib/test_hexagon/topi/test_pooling.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
# under the License.
"""Test code for pooling"""
import numpy as np
import pytest
import sys

import tvm
import tvm.testing
Expand Down
4 changes: 0 additions & 4 deletions tests/python/contrib/test_hexagon/topi/test_reduce.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
17 changes: 7 additions & 10 deletions tests/python/contrib/test_hexagon/topi/test_resize2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down Expand Up @@ -108,6 +102,9 @@ def test_resize2d(
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)

Expand Down
1 change: 0 additions & 1 deletion tests/python/contrib/test_hexagon/topi/test_softmax.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"""Test code for softmax"""
import numpy as np
import pytest
import sys

import tvm
import tvm.testing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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}'")

Expand All @@ -82,6 +79,8 @@ def test_softmax_f32(
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",
Expand Down Expand Up @@ -136,5 +135,4 @@ def test_softmax_f32(


if __name__ == "__main__":

sys.exit(pytest.main(sys.argv))
tvm.testing.main()