Commit Graph

8 Commits

Author SHA1 Message Date
Eric Lunderberg b885362c36 [CI] Refactor of tvm.testing.requires_* annotations (#11313)
* [CI] Improved skip messages when using @tvm.testing.requires_*

Previously, the same message was given regardless of why a test
couldn't be run.  This has been split up into separate checks for TVM
cmake options in `config.cmake`, enabled targets in `TVM_TEST_TARGETS`
environment variable, and checks for available hardware.

* Refactor to specify repeated feature marks, compile-only markers

* Fixed lint errors

* Import from contrib, not from a different import

* Removed use of requires_llvm() as a list of marks

* Corrected mark from requires_gpu to requires_cuda

* Adding missing "not"

* Added USE_CMSISNN as a requirement for corstone300.
2022-06-03 14:03:08 -07:00
Sergei Smirnov 76c78a9d40 [Topi] Cortex-M DSP support (#9233)
Co-authored-by: Sergey Smirnov <Sergey.Smirnov@mir.dev>
Co-authored-by: Ekaterina Bern <Ekaterina.Bern@mir.dev>
Co-authored-by: Mikhail Trubnikov <Mikhail.Trubnikov@mir.dev>
Co-authored-by: German Tretiakov <german.tretiakov@mir.dev>
Co-authored-by: Ilya Gozman <Ilya.Gozman@mir.dev>
Co-authored-by: Alexey.Yazev <Alexey.Yazev@mir.dev>
Co-authored-by: Ilya Gozman <92577591+ilyag-grovety@users.noreply.github.com>
2021-11-15 09:41:18 -08:00
Lunderberg 64b58b1303 [PyTest] Sort by test location, but not parametrization (#9353)
A follow-up from https://github.com/apache/tvm/pull/9188.  The
`item.location` tuple contains `(filename, line_number, test_name)`,
where the `test_name` includes a string representation of all
parameters.  This change preserves pytest's sorting of parametrized
values within a parametrized test, rather than sorting by strings.
2021-10-27 08:14:10 +09:00
Lunderberg 523eb12a1a [Pytest] Sort unit tests before running. (#9188)
* [Pytest] Sort unit tests before running.

By default, pytest will sort tests to maximize the re-use of fixtures.
However, this assumes that all fixtures have an equal cost to
generate, and no caches outside of those managed by pytest.  A fixture
for a `tvm.testing.parameter` is effectively free, while a fixture
maintaining a cache of reference data
`tvm.testing.utils._fixture_cache` be quite large.

Since most of the TVM fixtures are specific to a python function, sort
the test ordering by python function, so that
tvm.testing.utils._fixture_cache can be cleared sooner rather than
later.

* Updated TestTargetAutoParametrization

When sorting the tests, the order of parametrizations may change.
Therefore, the tests checking for automatic target parametrization
shouldn't depend on order.
2021-10-13 21:26:18 -07:00
Krzysztof Parzyszek a2bf430a8a [Hexagon] Pytestify Hexagon unit test (#8955)
* [Hexagon] Pytestify Hexagon unit test

* Fix formatting

* Convert linker registration into pytest fixture

* Use yield in pytest fixture

* Restart CI
2021-09-22 19:11:46 -05:00
Lunderberg 6dea994e43 [UnitTest][Vulkan] Runnable relay unit tests on Vulkan (#8947)
* [UnitTest] Added ids argument to tvm.testing.parameters

This matches the usage in `tvm.testing.parameter`, and allows for
parameter sets to be referred to by a single name.

* [Pytest] Fixed ordering issue of tvm.testing.parametrize_targets and known_failing_targets

If an explicit list of targets is given, then the
`known_failing_targets` decorator would fail to apply.  This commit
resolves the issue, and cleans up all target-specific marks to apply
in `tvm.testing.plugin._add_target_specific_marks`.

* [UnitTest][Vulkan] Runnable relay unit tests on Vulkan

This commit allows the relay test suite to be run targeting Vulkan with
`TVM_TEST_TARGETS="vulkan -from_device=0" pytest tests/python/relay`.  All
tests that require a specific environment are skipped if that environment
isn't present.  All tests that are known to fail when running on Vulkan
are marked as expected failure, and will be tracked in
https://github.com/apache/tvm/issues/8903.

- Failures during code generation
  - Type mismatches, boolean vs int8
    - tests/python/relay/test_any.py::test_any_reduce
    - tests/python/relay/test_op_level3.py::test_sparse_reshape
    - tests/python/relay/test_op_level4.py::test_reduce_functions
    - tests/python/relay/test_vm.py::test_cond
    - tests/python/relay/test_vm.py::test_simple_if

  - Incorrect strategy selection, picks NCHWc implemenation for NHWC layout
    - tests/python/relay/test_op_level2.py::test_conv2d_run

  - Unresolved CallNode operation
    - tests/python/relay/test_op_level1.py::test_unary_op[erf/tan/atan]
    - tests/python/relay/test_op_level3.py::test_scatter_add
    - tests/python/relay/test_op_level3.py::test_segment_sum

  - Generates 64-bit calls to GLSL that have only 16-/32-bit support
    - tests/python/relay/test_op_grad_level1.py::test_log_softmax_grad
    - tests/python/relay/test_op_grad_level1.py::test_softmax_grad
    - tests/python/relay/test_op_grad_level1.py::test_unary_op
    - tests/python/relay/test_op_grad_level10.py::test_cross_entropy_grad

  - Codegen raises error for variable size
    - tests/python/relay/test_any.py::test_any_batch_matmul
    - tests/python/relay/test_any.py::test_any_conv2d_NCHWc
    - tests/python/relay/test_any.py::test_any_dense

- Failures when running
  - Numeric differences (observed on GTX 1650 with NVIDIA driver)
    - tests/python/relay/test_op_level3.py::test_take
    - tests/python/relay/test_op_level5.py::TestCropAndResize
    - tests/python/relay/test_op_level5.py::TestResize1D
    - tests/python/relay/test_op_level5.py::TestResize2D
2021-09-08 07:44:35 +09:00
Lunderberg 3a72d2fe34 [UnitTests][Ethos-N] Mark unit tests as requiring Ethos-N (#8873)
- Adds the decorator `tvm.testing.requires_ethosn`

- Marks all tests in `tests/python/contrib/test_ethosn` as requiring
  ethosn instead of directly checking `ethosn_available()`.  This way,
  they show up as skipped rather than passing.

- Marks test_compile_tflite_module_with_external_codegen as requiring
  ethosn.
2021-09-04 14:15:38 +09:00
Lunderberg 3c86eec10f [UnitTests] Expose TVM pytest helpers as plugin (#8532)
* [UnitTests] Expose TVM pytest helpers as plugin

Previously, pytest helper utilities such as automatic parametrization
of `target`/`dev`, or `tvm.testing.parameter` were only available for
tests within the `${TVM_HOME}/tests` directory.  This PR extracts the
helper utilities into an importable plugin, which can be used in
external tests (e.g. one-off debugging).

* [UnitTests] Refactor the plugin-specific logic out into plugin.py.

* [UnitTests] Moved marker definition out to global variable.
2021-08-27 14:43:49 -07:00