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

[Hexagon]Use requires_hexagon instead of requires_hexagon_toolchain if running on hexagon target #11294

Merged
merged 4 commits into from
May 17, 2022

Conversation

mehrdadh
Copy link
Member

We use requires_hexagon test fixture when we want to run on hexagon target. requires_hexagon_toolchain is used only for cases where we want to build it but not running it.

@requires_hexagon_toolchain
def test_speedup(hexagon_session, capsys):
@tvm.testing.requires_hexagon
def test_speedup(hexagon_session: Session, capsys):
if hexagon_session is None:
Copy link
Contributor

Choose a reason for hiding this comment

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

Since hexagon_session will be non-null whenever ANDROID_SERIAL_NUMBER is set, and tvm.testing.requires_hexagon requires that ANDROID_SERIAL_NUMBER is set, should we also use this to remove the if hexagon_session is None checks?

Copy link
Member Author

Choose a reason for hiding this comment

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

make sense, removed the if condition.

Copy link
Contributor

@Lunderberg Lunderberg left a comment

Choose a reason for hiding this comment

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

LGTM! One question for clean-ups made possible by this change, which could go in this or a future PR.

Copy link
Contributor

@Lunderberg Lunderberg left a comment

Choose a reason for hiding this comment

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

Though, double-checking the test results themselves, it looks like the tests are being skipped in CI. (example link). We should investigate why these are being skipped.

@Lunderberg
Copy link
Contributor

At first glance, nothing is obviously standing out as the cause of the skipped CI tests. The ANDROID_SERIAL_NUMBER is being set in task_python_hexagon.sh, and TVM_TEST_TARGETS is not being overridden.

@mehrdadh mehrdadh force-pushed the hexagon/fix_require_hexagon branch from 34d32e6 to d229814 Compare May 16, 2022 17:09
Copy link
Member Author

@mehrdadh mehrdadh left a comment

Choose a reason for hiding this comment

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

@Lunderberg thanks for the review. The issue was the is_enabled condition which I forgot to change correctly. Not it is fixed:

is_enabled = tvm.support.libinfo()["USE_HEXAGON"].lower() in ["on", "true", "1"]

@requires_hexagon_toolchain
def test_speedup(hexagon_session, capsys):
@tvm.testing.requires_hexagon
def test_speedup(hexagon_session: Session, capsys):
if hexagon_session is None:
Copy link
Member Author

Choose a reason for hiding this comment

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

make sense, removed the if condition.

@mehrdadh
Copy link
Member Author

testing on hardware CI to see how many test are failing there.

Copy link
Contributor

@Lunderberg Lunderberg left a comment

Choose a reason for hiding this comment

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

LGTM, and I've confirmed that the tests are running on the CI. Some are marked as "unconditional skip", but those are tests being run on a different shard. I've left it approved and ready to merge based on your hardware tests.

@mehrdadh
Copy link
Member Author

Hardware test passes and I don't see any skip for Hexagon target. Only one test failed:

[ctypes.tests.python.contrib.test_hexagon.test_2d_physical_buffers.TestElementWise.test_execute[nhwc-nhwc-int8-16-32-8x8-nhwc-global-hexagon]](https://jenkins.hwe.octoml.ai/job/hexagon/job/staging/job/main/29/testReport/junit/ctypes.tests.python.contrib.test_hexagon.test_2d_physical_buffers/TestElementWise/test_execute_nhwc_nhwc_int8_16_32_8x8_nhwc_global_hexagon_/)

We should investigate that in a follow up PR.

@Lunderberg Lunderberg merged commit b03f11d into apache:main May 17, 2022
@mehrdadh mehrdadh deleted the hexagon/fix_require_hexagon branch May 17, 2022 16:49
shingjan pushed a commit to shingjan/tvm that referenced this pull request May 17, 2022
…f running on hexagon target (apache#11294)

* refactor requires_hexagon_toolchain

* trigger

* lint
Lunderberg added a commit to Lunderberg/tvm that referenced this pull request Jun 7, 2022
These were enabled in apache#11294, then
erroneously disabled in apache#11313.
This applies the same fix as in
apache#11294, checking the
`ANDROID_SERIAL_NUMBER` to determine if Hexagon tests can execute at
runtime, but using the refactored `pytest.skipif` messages introduced
in apache#11313.
Lunderberg added a commit to Lunderberg/tvm that referenced this pull request Jun 7, 2022
These were enabled in apache#11294, then
erroneously disabled in apache#11313.
This applies the same fix as in
apache#11294, checking the
`ANDROID_SERIAL_NUMBER` to determine if Hexagon tests can execute at
runtime, but using the refactored `pytest.skipif` messages introduced
in apache#11313.
kparzysz-quic pushed a commit that referenced this pull request Jun 7, 2022
* [Hexagon][CI] Re-enable Hexagon tests in CI

These were enabled in #11294, then
erroneously disabled in #11313.
This applies the same fix as in
#11294, checking the
`ANDROID_SERIAL_NUMBER` to determine if Hexagon tests can execute at
runtime, but using the refactored `pytest.skipif` messages introduced
in #11313.

* Fixed circular dependency, but feels somewhat ugly
Kathryn-cat pushed a commit to Kathryn-cat/tvm that referenced this pull request Jun 10, 2022
* [Hexagon][CI] Re-enable Hexagon tests in CI

These were enabled in apache#11294, then
erroneously disabled in apache#11313.
This applies the same fix as in
apache#11294, checking the
`ANDROID_SERIAL_NUMBER` to determine if Hexagon tests can execute at
runtime, but using the refactored `pytest.skipif` messages introduced
in apache#11313.

* Fixed circular dependency, but feels somewhat ugly
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