[Bugfix][Strategy] Fix arm_cpu int8 conv2d strategy for dotprod and i8mm targets#15711
Merged
lhutton1 merged 1 commit intoapache:mainfrom Sep 11, 2023
Merged
[Bugfix][Strategy] Fix arm_cpu int8 conv2d strategy for dotprod and i8mm targets#15711lhutton1 merged 1 commit intoapache:mainfrom
arm_cpu int8 conv2d strategy for dotprod and i8mm targets#15711lhutton1 merged 1 commit intoapache:mainfrom
Conversation
… i8mm targets Whenever both dotprod and i8mm were available together on a target (e.g. `"llvm --device=arm_cpu --mtriple=aarch64-linux-gnu -mattr=+v8.2a,+dotprod,+i8mm"`), the native int8 conv2d implementation corresponding to the `+dotprod` attribute would be selected, but the compute definition of the conv2d operation would be constructed for the `+i8mm` attribute and its related interleaved schedule instead. The reason for this was a different order of conditional statements being used in 2 separate files: - `arm_cpu.py`: When selecting the conv2d implementation, the program first checked for `dotprod` support. If present, it chose the native schedule - `conv2d_gemm.py`: when constructing the compute definition, `i8mm` support is checked first, then `dotprod` To fix this, I modified the int8 conv2d strategy to prioritize `i8mm` over `dotprod` when both are available too.
lhutton1
approved these changes
Sep 8, 2023
Contributor
lhutton1
left a comment
There was a problem hiding this comment.
Thanks @Anndrey24, LGTM!
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.
Whenever both dotprod and i8mm were available together on a target (e.g.
"llvm --device=arm_cpu --mtriple=aarch64-linux-gnu -mattr=+v8.2a,+dotprod,+i8mm"), the native int8 conv2d implementation corresponding to the+dotprodattribute would be selected, but the compute definition of the conv2d operation would be constructed for the+i8mmattribute and its related interleaved schedule instead.The reason for this was a different order of conditional statements being used in 2 separate files:
arm_cpu.py: When selecting the conv2d implementation, the program first checked fordotprodsupport. If present, it chose the native scheduleconv2d_gemm.py: when constructing the compute definition,i8mmsupport is checked first, thendotprodTo fix this, I modified the int8 conv2d strategy to prioritize
i8mmoverdotprodwhen both are available too. I also added new test cases to cover this situation.cc @ekalda @lhutton1 @leandron @neildhickey