-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[ARM] Fix NCHWc int8 dot product schedule lowering #10773
Conversation
dfb4744
to
2425a5c
Compare
name="conv2d_nchw_spatial_pack.arm_cpu", | ||
plevel=10, | ||
) | ||
|
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.
schedule_conv2d_nchw_spatial_pack
has tophub entries, so they are always picked up based on "time cost" even if topi.arm_cpu.is_int8_hw_support
path is taken and the NCHWc int8 schedule is surely faster.
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.
Seems like another good argument for removing tophub. You can disable it for the test by putting it all in an empty ApplyHistoryBest
.
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.
The annoying thing is this happens on only specific input or filter sizes. It took me some time to figure out why the NCHWc schedule is not used when the input shape is (56, 56) and filter size is 3x3. If I use (128, 128) shape or 1x1 filter, I didn't see this issue.
2425a5c
to
b99839a
Compare
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.
Thanks @masahi
b99839a
to
3d86a61
Compare
@vinx13 would you mind taking a look? Thanks a lot! |
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.
Looks good to add this test - thank you for finding and fixing this. ]
4dd3cff
to
a4ac3e1
Compare
LGTM, I'll wait for @vinx13 to take a look 😸 |
* [ARM] Fix NCHWc int8 dot product schedule lowering * fix arm task extraction test not running * skip test on i386
The code path
tvm/python/tvm/topi/arm_cpu/conv2d_int8.py
Lines 154 to 155 in 6c6e873
is broken because (1) we are not passing
dtype
and (2) the intrin description has a bug in the number of arguments tosdot/udot
. For example I get this error if I try to run it:The PR that added this intrin, #3978, didn't add a test so this code path was never tested. The PR added something under
apps/topi_recipe/conv
, https://github.com/apache/tvm/blob/main/apps/topi_recipe/conv/test_conv_int8_arm.py, but this script is broken and needs fixing too.@tkonolige