-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[Relay][TOPI] Remove input padding for arm_cpu conv2d int8 native schedule in Legalize pass #15648
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
Conversation
…edule in Legalize pass The Legalize pass was unnecessarily padding the input channels for conv2d int8 native implementations. Since the conv2d schedule itself can add padding more efficiently, I skipped padding during the pass and further optimised the schedule to deal with it. For the int8 interleaved implementation, I kept the Legalize pass padding, which transforms the input channels into a multiple of 8, and modified the schedule to ensure vectorization of the input data. I also added a test to check whether or not the Legalize pass pads the conv2d input data.
lhutton1
left a comment
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.
Overall LGTM! I just had a couple of comments to improve readability of the schedules. It would also be good to check the schedule tests cover the cases that have been added
|
Regarding the tests, it seems that all of the padding cases are already checked at least once in:
|
|
Awesome, thanks for checking! |
lhutton1
left a comment
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 @Anndrey24! Will leave open for a bit incase @ekalda wants to take a look
|
Thanks @Anndrey24! |
The Legalize pass was unnecessarily padding the input channels for conv2d int8 native implementations. Since the conv2d schedule itself can add padding more efficiently, I skipped padding during the pass and further optimised the schedule to deal with it.
I also added a test to check whether or not the Legalize pass pads the conv2d input data.
The benchmark results of a single int8 conv2d operation where input padding along the K axis is necessary, with input = (1 x 224 x 224 x 3), filter = (16 x 3 x 3 x 3), output = (1 x 112 x 112 x 16), tested for the following target
"llvm --device=arm_cpu --mtriple=aarch64-linux-gnu -mattr=+v8.2a,+dotprod", before and after the changes, is given below: