[TOPI] Fix dtype legalize logic for CPU dot product instruction #12865
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 logic in
tvm/python/tvm/topi/generic/conv2d.py
Lines 480 to 499 in 52d6b59
But the logic is incorrect (two cases are flipped) and leads to incorrect result in the following case:
sdotintrinsic which only supports int8 activations.The first case also applies to the Hexagon
vrmpyintrinsic. I found this bug while testingvrmpyconv2d on int8 input.To test this on CI, we need to be running on a cascadelake or ARM v8.2 (with dot product support) instance. I cannot find a way to detect such cpu feature from a python script.
try / catchdoesn't work because the error is raised from LLVM (LLVM ERROR: Do not know how to split the result of this operator) that I don't know how to catch. So for now the test is skipped. Any suggestion on this? @areusch @driazaticc @tkonolige @mbrookhart