* [Topi][Testing] Minor cleanup for python reference implementations
- Use input dtype for dilate/conv2d accumulate in python
impl. Previously, the python implementations of dilation and conv2d
would use numpy default dtype in some cases, rather than the input
data's dtype.
- Added fallback for datatypes not supported by scipy.signal.convolve2d (e.g. float16).
- Refactored to avoid duplication, use common get_pad_tuple functionality.
* [Topi][UnitTests] Added float16 tests to test_topi_dense.py
* [Topi][UnitTests] Added float16 to test_topi_conv2d_nchw.py
* [Topi][Float16] Added float16 tests for depthwise conv2d.
* [UnitTests] Explicitly set seed for float16 tests
Intended to avoid flaky test failures later due to rounding errors.
* [UnitTests] Fixed a few failing unit tests.
- ref_data must be a test fixture, not acquired through
request.getfixturevalue, in order to have the random_seed be known.
- dilate_python's return value didn't follow `out_dtype`.
- The test_topi_conv3d tests had the reference results computed in
float64, due to dilate_python() not respecting the input data type.
With the correct dtype, the tolerances needed to be slightly widened.
Co-authored-by: Eric Lunderberg <elunderberg@octoml.ai>
* [UnitTests][Topi] Updated test_topi_conv2d_nchw.py to have parametrized tests.
- Better error messages, displays which workloads/targets failed and why.
- Fixed bug in topi.nn.conv2d._get_workload exposed by the
parametrized tests. Incorrect padding if the "SAME" parameter is
used with dilation>1.
- Fixed bug in tvm.topi.x86.group_conv2d._get_default_config, missing
dilation parameter in call to _get_conv2d_workload.
* [UnitTests][Topi] Parametrized the tests in test_topi_depthwise_conv2d.py
In preparation for parametrizing to test on float16 as well.
- Single test_conv2d test with parameters for layout/input sizes.
- Extended the support for NCHWc layouts, so that they could be
included in the parametrization. (Implemented
topi.testing.depthwise_conv2d_python_nchwc and
topi.nn.scale_shift_nchwc, added layout argument to
topi.nn.depthwise_conv2d._get_workload).
Co-authored-by: Eric Lunderberg <elunderberg@octoml.ai>
* Fix np.int and np.float usage in the tree.
Newer versions of numpy give loads of warnings that suggest
that np.int and np.float will be deprecated. CI uses pytest
and these warning logs clog memory for testing and make it
slower.
* Fix formatting
* added asymmetric padding to conv2d workload
* fixed depthwise conv2d padding
* Added fix to include dilation in workload output width calculation
* Added missing dilation to arm_cpu/conv2d_int8.py workload
* Fixed dilation for x86 conv2d
* Improved dilation workload integration in x86
* Fixed x86 conv2d_alter_op to add dilation
* Local linting not always producing same output as CI, probably my fault
* Fixed bug, tested locally
* Abusing CI until I can figure out how to reproduce the same behaviour of running integration tests locally.
* Ammeded conv2d_int8 test
* Updated workload, improved unit tests
* Added depthwise conv2d workload test