Add info() method to TemplateProject class so it's possible to query all
available options for a given template project without creating a new
one. This is necessary because TVMC will query the available options for
a given template project to show them to the user so the user can use
them to finally create a new project dir.
That is also useful in general to query the available options for any
project type. For example, one can query all boards available on the
Zephyr platform with:
import tvm.micro.project as project_api
template = project_api.TemplateProject.from_directory(ZEPHYR_TEMPLATE_DIR)
boards = template.info()["project_options"][8]["choices"]
where 8 element refers to the "zephyr_board" option.
Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
* [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
* [Hexagon] Add support for linked-in model parameters
* Remove entry_func, since it's not used anywhere
* Simplify linked-param codegen preparation a bit
* Detect multiple linked-params functions
* Add testcase to check for linked-param codegen
* Empty commit to restart build
* Fixed LowerThreadallreduce not remapping Store buffer var
* reenable warp reduction schedule for softmax with fused ops
Co-authored-by: masa <masa@pop-os.localdomain>
* Change softmax op pattern to OUT_ELEMWISE_FUSABLE
* Softmax is fused but x86 schedule is suboptimal
* fusion properly done
* Updating GPU schedule for fusion
* update softmax warp shuffle schedule
* fix compute_at
* Bug fix in lower_thread_all_reduce when reduction storage is reused by storage_rewrite
* Temp disable softmax warp reduction schedule when softmax is fused
* Revert "Bug fix in lower_thread_all_reduce when reduction storage is reused by storage_rewrite"
This reverts commit 8aa340e23438a922905b1e247afa8f223f284a9c.
* lint fix
* try make diff smaller
* fix tests
* fixed another broken test
* Fix flaky uTVM templating test
* fix equality check on output op
Co-authored-by: masa <masa@pop-os.localdomain>
Co-authored-by: Gavin Uberti <gavin.uberti@gmail.com>
- 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.
* Sanitize names of input tensors in interface header
Change-Id: I7f02a993887bf84316262cd2586a734a9079c338
* Update tensor name sanitizer tests to parameterize them.
Change-Id: I157d8d8d607de2904285e403893f146e97b510d5
* Only test unpacked, C interface API, AOT case
Change-Id: I9082ae32079a1a3924c06c7f26c757aafa46dec2
* [UnitTests][CoreML] Marked test_annotate as a known failure.
The unit tests in `test_coreml_codegen.py` haven't run in the CI
lately, so this test wasn't caught before. (See tracking issue
- Added `pytest.mark.xfail` mark to `test_annotate`.
- Added `tvm.testing.requires_package` decorator, which can mark tests
as requiring a specific python package to be available. Switched
from `pytest.importorskip('coremltools')` to
`requires_package('coremltools')` in `test_coreml_codegen.py` so
that all tests would explicitly show up as skipped in the report.
- Added `uses_gpu` tag to all tests in `test_coreml_codegen.py`, since
only ci_gpu has coremltools installed. In the future, if the ci_cpu
image has coremltools installed, this mark can be removed.
* [Pytest][TensorRT] Mark the TensorRT tests with tvm.testing.requires_cuda
Previously, the tests had an early bailout if tensorrt was disabled,
or if there was no cuda device present. However, the tests were not
marked with `pytest.mark.gpu` and so they didn't run during
`task_python_integration_gpuonly.sh`. This commit adds the
`requires_cuda` mark, and maintains the same behavior of testing the
tensorrt compilation steps if compilation is enabled, and running the
results if tensorrt is enabled.
In addition, some of the tests result in failures when run. These
have been marked with `pytest.mark.xfail`, and are being tracked in
issue #8901.
* Set default value of p in LpPool as 2
* Update test_forward.py
Fix bug in test.
* Update test_forward.py
update with correct shape.
* Update onnx.py
* Update python/tvm/relay/frontend/onnx.py
Co-authored-by: Wuwei Lin <vincentl13x@gmail.com>
Co-authored-by: luyaor <luyaor@luyaordeMacBook-Pro.local>
Co-authored-by: Wuwei Lin <vincentl13x@gmail.com>
* cmsis graph partitioner for softmax
Change-Id: I80ecd7bc5351f241b4674ef53b36e4398c8adb83
* Updated docstring in the partioning function
Change-Id: Ieb4b623e5929cfdb6aa0235db64c825fac8d7055
* [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.
Add benchmarking that includes ovearhead of transfering inputs and
outputs to and from the device. This should give an accurate measurement
of the runtime a user would see when using the model. This is
accomplished by adding functions that run from inputs to return values
into the graph executor and the VM.
* fix some problems for matmul
* fix some problems for matmul
* add alpha parameter for matmul
* remove unnecessary condition
* add TranslatedLayer which support model loaded by jit.load
* add mul operator support
* Add padding mode support for conv/pool2d
* support 4 two-tuples
* add paddle test case
* add paddle conv2d case
* update test_forward.py
* fix paddle convert_matmul
* add paddle multiply and matmul op test case
* add test case and fix bug
* delete import pandas
* add paddlepaddle tests
* modify the variable name of convert_reshape
* formatting
* formatting
* use black to format python code
* pylint check
* Remove fluid api
* black format
Co-authored-by: root <root@bjyz-sys-gpu-kongming3.bjyz.baidu.com>
Co-authored-by: wjj19950828 <wjjisloser@163.com>
Co-authored-by: heliqi <1101791222@qq.com>
Co-authored-by: Junru Shao <junrushao1994@gmail.com>
* [Pattern matching] Add an option to rewrite the graph only once
If the graph returned from the callback consists of the original
pattern, the rewriter will run in the loop, which is not always desired.
So this patch proposes an option to run the rewriter only once.
Change-Id: I85cf0a055b8961d52394f21c1e4d7aad0a7e1d06
* Make rewrite_once default to false
Change-Id: Idf6f01f254c403158883681e75c2a5978efbd2d0
* [Hexagon] Rework tvm.target.hexagon() interface
Make the tvm.target.hexagon() function take most options as keyword
parameters. This will allow adding additional parameters without changing
the interface.
No changes are required to existing code, except for changing positional
parameters following the CPU version to keyword parameters, and updating
the names of the keyword parameters:
sim_args -> sim_options,
llvm_args -> llvm_options,
although the old names will be accepted for the time being.
* formatting
* change ' to "
* Rename 'args' to 'config' for clarity
* Use 'strip' instad of 'replace'
* Restart build
* [Relay][TOPI] Support of depthwise conv2d NHWC for Mali/Bifrost.
Added initial tunable autotvm templates for depthwise conv2d with
NHWC layout for Mali and Bifrost.
* [Relay][TOPI] Misc fixes for depthwise conv2d Mali/Bifrost.
- Fix assert for Bifrost.
- Set reasonable default axis splits to avoid using tophub for NHWC.
- Fixed typo: arm cpu -> Mali.
* [Relay][TOPI] Fixed formatting in depthwise conv2d Mali/Bifrost.
* [GRAPH EXECUTOR,VM] Add benchmarking function to graph executor and vm
This new benchmarking function is just a convenience function for
calling time_evaluator on the underlying module. Hopefully this should
make it easier for users to get good benchmarks of their code.
* formatting
* import order
* more test, more comments, more precision
* fix tests
* add seconds descriptions to doc
* GRU cell was implemented in common.py. GRU was supported on pytorch frontend side
* update GRU in common.py and onnx frontend
* fix issue related to GRU accuracy in pytorch and ONNX frontend
* small fixes and remove excess
* common GRU was additionaly updated. tuned pytorch GRU was strongly accelerated
* GRU cell in ONNX frontend was used from common.py. previous implementation was removed
* small fixes in comments
* fixes after review. GRU test was implemented for pytorch frontend
* tests for RNN layers was unified for pytorch frontend
Co-authored-by: Valery Chernov <valery.chernov@deelvin.com>