-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[MLIR][TOSA] Fix Conv3D bias dim check #137296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
verifyConvOpErrorIf() assumes output channel is the 4th dimension of the output type but this is wrong for conv3d which now uses that verifier. Use rank - 1 which works accross the operations using this verifier (conv2d, conv3d and depthwise_conv3d).
@llvm/pr-subscribers-mlir-tosa @llvm/pr-subscribers-mlir Author: Thomas Preud'homme (RoboTux) ChangesverifyConvOpErrorIf() assumes output channel is the 4th dimension of the Full diff: https://github.com/llvm/llvm-project/pull/137296.diff 1 Files Affected:
diff --git a/mlir/lib/Dialect/Tosa/IR/TosaOps.cpp b/mlir/lib/Dialect/Tosa/IR/TosaOps.cpp
index 751ae785bda6f..17873444b2d71 100644
--- a/mlir/lib/Dialect/Tosa/IR/TosaOps.cpp
+++ b/mlir/lib/Dialect/Tosa/IR/TosaOps.cpp
@@ -558,7 +558,8 @@ static LogicalResult verifyConvOpErrorIf(T op) {
return success();
const int64_t biasChannels = biasType.getDimSize(0);
- const int64_t outputChannels = outputType.getDimSize(3);
+ const int64_t outputChannels =
+ outputType.getDimSize(outputType.getRank() - 1);
if (biasChannels == ShapedType::kDynamic ||
outputChannels == ShapedType::kDynamic)
// Skip following checks if biasChannels or outputChannels is dynamic dim
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix @RoboTux!
verifyConvOpErrorIf() assumes output channel is the 4th dimension of the output type but this is wrong for conv3d which now uses that verifier. Use rank - 1 which works accross the operations using this verifier (conv2d, conv3d and depthwise_conv3d).
verifyConvOpErrorIf() assumes output channel is the 4th dimension of the output type but this is wrong for conv3d which now uses that verifier. Use rank - 1 which works accross the operations using this verifier (conv2d, conv3d and depthwise_conv3d).
verifyConvOpErrorIf() assumes output channel is the 4th dimension of the output type but this is wrong for conv3d which now uses that verifier. Use rank - 1 which works accross the operations using this verifier (conv2d, conv3d and depthwise_conv3d).
verifyConvOpErrorIf() assumes output channel is the 4th dimension of the output type but this is wrong for conv3d which now uses that verifier. Use rank - 1 which works accross the operations using this verifier (conv2d, conv3d and depthwise_conv3d).
verifyConvOpErrorIf() assumes output channel is the 4th dimension of the
output type but this is wrong for conv3d which now uses that verifier.
Use rank - 1 which works accross the operations using this verifier
(conv2d, conv3d and depthwise_conv3d).