-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Prepare the topi tests for AArch64 CI. #8409
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
Closed
Closed
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,6 +26,7 @@ | |
| import tvm.topi.testing | ||
| from tvm.contrib.pickle_memoize import memoize | ||
| from tvm.topi.utils import get_const_tuple | ||
| import tvm.testing | ||
|
|
||
|
|
||
| def verify_conv2d_1x1_nhwc_pack_int8( | ||
|
|
@@ -51,26 +52,25 @@ def get_ref_data(): | |
|
|
||
| a_np, w_np, b_np = get_ref_data() | ||
|
|
||
| def check_device(device): | ||
| dev = tvm.device(device, 0) | ||
| if not tvm.testing.device_enabled(device): | ||
| print("Skip because %s is not enabled" % device) | ||
| def check_device(target, dev): | ||
| if not tvm.testing.device_enabled(target): | ||
| print("Skip because %s is not enabled" % target) | ||
| return | ||
| print("Running on target: %s" % device) | ||
| print("Running on target: %s" % target) | ||
|
|
||
| with tvm.target.Target(device): | ||
| with tvm.target.Target(target): | ||
| B = topi.nn.conv2d(A, W, stride, padding, dilation, layout="NHWC", out_dtype="int32") | ||
| s = topi.x86.schedule_conv2d_nhwc_pack_int8([B]) | ||
| a = tvm.nd.array(a_np, dev) | ||
| w = tvm.nd.array(w_np, dev) | ||
| b = tvm.nd.array(np.zeros(get_const_tuple(B.shape), dtype=B.dtype), dev) | ||
| func = tvm.build(s, [A, W, B], device) | ||
| func = tvm.build(s, [A, W, B], target) | ||
| func(a, w, b) | ||
| tvm.testing.assert_allclose(b.numpy(), b_np, rtol=1e-5) | ||
|
|
||
| # for device in ['llvm -mcpu=skylake-avx512']: | ||
| for device in ["llvm"]: | ||
| check_device(device) | ||
| for target, dev in tvm.testing.enabled_targets(): | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same question--possible to use tvm.testing.parametrize_targets ? |
||
| check_device(target, dev) | ||
|
|
||
|
|
||
| # TODO(@llyfacebook): Please fix https://github.com/apache/tvm/issues/4122 to enable this test. | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should these become @tvm.testing.requires_?