6 Commits

Author SHA1 Message Date
Tianqi Chen 33dcea1686 [REFACTOR][LINT] Modernize ruff config (#18810)
This PR removes the extra lint violations from the codebase so lint
aligns with the latest style
2026-02-23 07:29:21 -05:00
Tianqi Chen aa2e609136 [LINT] Modernize lint to use pre-commit hooks (#18807)
This PR migrates existing lint to use pre-commit hooks
2026-02-22 11:03:21 -05:00
Lunderberg bf3669d3e3 [Topi][Testing] Float16 unittests for dense, conv2d, depthwise conv2d (#8529)
* [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>
2021-08-07 11:26:22 +09:00
Tianqi Chen c8064b3ca6 [REFACTOR] Remainings of util => utils (#6778) 2020-10-29 13:46:31 -04:00
Jared Roesch f13fed55cf [Format] Convert all Python code w/o CI (#6448)
* Add black setup

* Tweak pyproject.toml

* Fix syntax issues

* Fix

* Tweak

* Black all Python code
2020-09-11 22:17:24 +09:00
Tianqi Chen 0a4ee30da7 [REFACTOR] topi -> tvm/topi (#6186)
This PR migrates the topi library as a sub namespace of tvm.
2020-08-02 09:29:29 -07:00