[Bugfix][Strategy] Fix arm_cpu
int8 conv2d strategy for dotprod and i8mm targets
#15711
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+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 fordotprod
support. If present, it chose the native scheduleconv2d_gemm.py
: when constructing the compute definition,i8mm
support is checked first, thendotprod
To fix this, I modified the int8 conv2d strategy to prioritize
i8mm
overdotprod
when both are available too. I also added new test cases to cover this situation.cc @ekalda @lhutton1 @leandron @neildhickey