Skip to content

Conversation

@Anndrey24
Copy link
Contributor

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.

cc @ekalda @lhutton1 @leandron @neildhickey

… 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.
Copy link
Contributor

@lhutton1 lhutton1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I don't see a way this change can easily be tested. However, functionally both paths should already be covered under

(1, 3, 299, 32, 3, 2, "SAME", 1, False, False),

@lhutton1 lhutton1 merged commit 2032b44 into apache:main Sep 11, 2023
@Anndrey24 Anndrey24 deleted the conv2d-interleaved-padding branch November 8, 2023 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants