-
Notifications
You must be signed in to change notification settings - Fork 3
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
feat: adding verifiers for some tosa operators #90
base: feature/fused-ops
Are you sure you want to change the base?
feat: adding verifiers for some tosa operators #90
Conversation
The tosa.mul verifier is causing failures to the onnx.ReduceMeanV13 to tosa conversion, as it is leading to a tosa.mul with unequal ranks. |
How about splitting the verifier for tosa.mul into a different PR? Then this PR with the rest of the verifiers can already merge, |
Sure, i will do it. |
mlir/lib/Dialect/Tosa/IR/TosaOps.cpp
Outdated
@@ -276,9 +384,9 @@ static void buildMatMulOpWithQuantInfo(OpBuilder &builder, | |||
} | |||
} | |||
|
|||
/// Both the tosa.avg_pool2d and unary ops use the same UnaruOpQuantizationAttr |
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.
Can you please revert the formatting differences here and elsewhere? We try to keep the diff small to help upstreaming the changes into llvm/llvm-project later.
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.
sure.
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.
Done
mlir/test/Dialect/Tosa/ops.mlir
Outdated
|
||
// ----- | ||
// CHECK-LABEL: select | ||
func.func @test_select_boardcastable(%arg0: tensor<1x2xi1>, %arg1: tensor<3x2xf32>, %arg2: tensor<3x2xf32>) -> tensor<3x2xf32> { |
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.
func.func @test_select_boardcastable(%arg0: tensor<1x2xi1>, %arg1: tensor<3x2xf32>, %arg2: tensor<3x2xf32>) -> tensor<3x2xf32> { | |
func.func @test_select_broadcastable(%arg0: tensor<1x2xi1>, %arg1: tensor<3x2xf32>, %arg2: tensor<3x2xf32>) -> tensor<3x2xf32> { |
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.
Done
mlir/lib/Dialect/Tosa/IR/TosaOps.cpp
Outdated
auto input3ETy = | ||
llvm::cast<ShapedType>(getOperand(2).getType()).getElementType(); | ||
auto resultETy = getElementTypeOrSelf(getResult()); | ||
// auto resultETy = llvm::cast<ShapedType>(getResult()).getElementType(); |
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.
Please remove commented code
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.
Done
…d incorporating the review comments
I have removed the mul verifier |
@mgehre-amd I have done the changes suggested. The test is now failing with broadcast.mlir tests. This is the only pending one. |
Thank you! We will discuss a way forward regarding the broadcasting issue with upstream llvm. Until this is resolved, I suggest that you split the affected verifiers (add, mul, select, greater_equal) into a separate PR, so that the remainder of this PR can move forward. |
@mgehre-amd I have removed the add,mul, select and greater_equal. |
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.
Looks good! Please don't merge here, but instead open a PR upstream as discussed.
For upstreaming I suggest to make a separate PR for each op (except the pooling ones, they can go together of course).
@mgehre-amd Sure. Thanks |
Added verifiers for max_pool2d
Changes done to make the verification code work for transpose1. transpose
Improved the verifier for avg_pool2d