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

[Refactor] Avoid Override Generic Op Strategy in "hls.py" #8614

Merged
merged 2 commits into from
Aug 3, 2021

Conversation

Johnson9009
Copy link
Contributor

This is a very obvious issue, now "hls.py" directly call decorator "override_native_generic_func" to operator "conv2d", "conv2d_NCHWc", it should call decorator "conv2d_strategy" like conv2d_strategy.register("hls").

If new target is added, and there isn't define the new target specific "conv2d" op strategy, then the strategy will use that of "hls.py", this is not expected, it should use that of "generic.py".

@Johnson9009
Copy link
Contributor Author

Below two CI test cases failed, the root cause are all CUDA hasn't implemented and register "conv2d_NCHWc_strategy", so these test cases are testing wrong target. Before this PR, the default "conv2d_NCHWc_strategy" will use "hls.py", in another words, CUDA conv2d_NCHWc_strategy use that of "hls.py" implicitly, so it will not report the error.

1. tests/python/relay/test_any.py::test_any_conv2d_NCHWc
2. tests/python/relay/test_pass_alter_op_layout.py::test_alter_layout_strided_slice

All of these 2 test cases are decorated by "@tvm.testing.uses_gpu", the 1st one is decorated by PR #6598, the 2nd is decorated by PR #6331.

@zhiics, @comaniac, @tkonolige, @tqchen, please help to see how should we change these test cases.

Thanks.

Copy link
Contributor

@comaniac comaniac left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for the fix.

@comaniac comaniac merged commit 4b9d43e into apache:main Aug 3, 2021
@comaniac
Copy link
Contributor

comaniac commented Aug 3, 2021

Thanks @Johnson9009

@Johnson9009 Johnson9009 deleted the override_generic branch August 4, 2021 02:13
ylc pushed a commit to ylc/tvm that referenced this pull request Sep 29, 2021
* [Refactor] Avoid Override Generic Op Strategy in "hls.py"

* Fix The Broken CI Test Cases
ylc pushed a commit to ylc/tvm that referenced this pull request Jan 13, 2022
* [Refactor] Avoid Override Generic Op Strategy in "hls.py"

* Fix The Broken CI Test Cases
yuanzhaoti pushed a commit to TexasInstruments/tvm that referenced this pull request Jun 24, 2022
* [Refactor] Avoid Override Generic Op Strategy in "hls.py"

* Fix The Broken CI Test Cases
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