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

[Topi][UnitTests] Parameterize conv2d and depthwise_conv2d tests #8433

Merged
merged 2 commits into from
Jul 22, 2021

Conversation

Lunderberg
Copy link
Contributor

Along similar lines to #8336, parametrizing and cleaning up unit tests for conv2d and depthwise_conv2d unit tests.

[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.

[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).

@Lunderberg
Copy link
Contributor Author

@tmoreau89 This refactoring of tests is to make it easier to extend support for float16, and to make sure that the existing features are as tested as possible. In the next day or two, I'll be sending a separate PR based on this one that adds the float16 parametrization to these tests.

…ed 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.
…d.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).
Copy link
Member

@masahi masahi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks very clean, thanks @Lunderberg

@masahi masahi merged commit 45497bd into apache:main Jul 22, 2021
@Lunderberg Lunderberg deleted the topi_conv2d_parametrize branch July 22, 2021 13:16
ylc pushed a commit to ylc/tvm that referenced this pull request Sep 29, 2021
…che#8433)

* [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 <[email protected]>
ylc pushed a commit to ylc/tvm that referenced this pull request Jan 13, 2022
…che#8433)

* [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 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants