-
Notifications
You must be signed in to change notification settings - Fork 15
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
Add TOSA to TTIR conversions for some simple ops #1445
Conversation
module attributes {} { | ||
func.func @test_maximum(%arg0: tensor<13x21x3xf32>, %arg1: tensor<13x21x3xf32>) -> tensor<13x21x3xf32> { | ||
%0 = tosa.maximum %arg0, %arg1 : (tensor<13x21x3xf32>, tensor<13x21x3xf32>) -> tensor<13x21x3xf32> | ||
// CHECK: %[[C:.*]] = tensor.empty[[C:.*]] |
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 add more detailed tests (with detailed regexes), for some examples, take a look at test/ttmlir/Conversion/StableHLOToTTIR/exponential_minus_one_op.mlir
Similar comments for all tests, I'm leaving this on just this one for brevity.
%0 = tosa.maximum %arg0, %arg1 : (tensor<13x21x3xf32>, tensor<13x21x3xf32>) -> tensor<13x21x3xf32> | ||
// CHECK: %[[OP_OUT:[0-9]+]] = tensor.empty() : tensor<13x21x3xf32> | ||
// CHECK: %{{[0-9]+}} = "ttir.maximum"(%arg{{[0-9]+}}, %arg{{[0-9]+}}, %[[OP_OUT]]){{.+}} -> tensor<13x21x3xf32> | ||
return %0 : tensor<13x21x3xf32> |
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.
Add also the return check, something like:
// CHECK: return [[VAL1]] : [[TENSOR_SIZE]]
patterns.add<TosaToTTIRDefaultDPSOpConversionPattern< | ||
tosa::SelectOp, mlir::tt::ttir::WhereOp>>(typeConverter, ctx); | ||
} | ||
} // namespace |
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.
Extra spacing here
@sgligorijevicTT please resolve conversations before merging. This way it looks like they have been ignored. Also, I think you can just say |
This adds TOSA to TTIR conversions for:
tosa.maximum
tosa.minimum
tosa.reciprocal
tosa.rsqrt
tosa.sigmoid
tosa.sin
tosa.select
Additionally, this adds tests for:
tosa.negate
tosa.sub
closes #1380 closes #1411 closes #1412 closes #1413 closes #1414 closes #1415 closes #1431 closes #1429 closes #1444