[Relay][TOPI] Remove input padding for arm_cpu conv2d int8 native schedule in Legalize pass#15648
Merged
lhutton1 merged 4 commits intoapache:mainfrom Sep 13, 2023
Merged
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
reviewed
Sep 5, 2023
Contributor
lhutton1
left a comment
There was a problem hiding this comment.
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
Contributor
Author
|
Regarding the tests, it seems that all of the padding cases are already checked at least once in: |
Contributor
|
Awesome, thanks for checking! |
lhutton1
approved these changes
Sep 8, 2023
Contributor
lhutton1
left a comment
There was a problem hiding this comment.
Thanks @Anndrey24! Will leave open for a bit incase @ekalda wants to take a look
Contributor
|
Thanks @Anndrey24! |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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: