[TOPI] Ensure vectorization of input padding in arm_cpu int8 conv2d interleaved schedule#15710
Merged
lhutton1 merged 1 commit intoapache:mainfrom Sep 11, 2023
Merged
Conversation
… interleaved schedule When padding the input data, the int8 conv2d interleaved schedule tries to split the `data_im2col` cols axis by a factor of 16 in order to then vectorize over those splits. However, the size of the axis is `n_size = KH x KW x IC` and the `Legalize` pass only pads the number of input channels up to a multiple of 8. Therefore, `n_size` is only guaranteed to be a multiple of 8, not 16. I modified the schedule to check whether a split factor of 16 is appropriate, otherwise use 8 instead, in order to ensure vectorization is performed in all cases.
lhutton1
approved these changes
Sep 8, 2023
Contributor
lhutton1
left a comment
There was a problem hiding this comment.
LGTM! I don't see a way this change can easily be tested. However, functionally both paths should already be covered under
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.
When padding the input data, the int8 conv2d interleaved schedule tries to split the
data_im2colcols axis by a factor of 16 in order to then vectorize over those splits. However, the size of the axis isn_size = KH x KW x ICand theLegalizepass only pads the number of input channels up to a multiple of 8. Therefore,n_sizeis only guaranteed to be a multiple of 8, not 16.I modified the schedule to check whether a split factor of 16 is appropriate, otherwise use 8 instead, in order to ensure vectorization is performed in all cases.
cc @ekalda @lhutton1 @leandron @neildhickey