Home
last modified time | relevance | path

Searched refs:tosa (Results 1 – 25 of 48) sorted by relevance

12

/external/tensorflow/tensorflow/compiler/mlir/tosa/tests/
Dtf-to-tosa-pipeline.mlir1 // RUN: tf-opt --tf-to-tosa-pipeline --verify-each %s | FileCheck %s
3 // Operations for testing tf-to-tosa-pipeline
9 // CHECK: tosa.const
10 // CHECK: tosa.const
11 // CHECK: tosa.transpose
12 // CHECK: tosa.conv2d
21 // CHECK: tosa.const
22 // CHECK: tosa.depthwise_conv2d
32 // CHECK-DAG: "tosa.const"() {value = dense<[2, 0, 1, 3]> : tensor<4xi32>}
33 // CHECK-DAG: "tosa.const"() {value = dense<0.000000e+00> : tensor<16xf32>}
[all …]
Dtfl-to-tosa-pipeline.mlir1 // RUN: tf-opt --tfl-to-tosa-pipeline --verify-each %s | FileCheck %s
3 // Operations for testing tfl-to-tosa-pipeline
13 // CHECK: tosa.const
14 // CHECK: tosa.conv2d
24 // CHECK: tosa.conv2d
33 // CHECK: tosa.const
34 // CHECK: tosa.transpose_conv2d
45 // CHECK: tosa.const
46 // CHECK: tosa.const
47 // CHECK: tosa.conv2d
[all …]
Dfuse-bias-tf.mlir1 // RUN: tf-opt --tosa-fuse-bias-tf --verify-each %s | FileCheck %s
3 // Operations for testing --tosa-fuse-bias-tf
8 // CHECK: tosa.const
9 // CHECK: tosa.transpose
10 // CHECK: tosa.conv2d
Dconvert-tfl-uint8.mlir1 // RUN: tf-opt --tosa-convert-tfl-uint8 --verify-each %s | FileCheck %s
3 // Operations for testing --tosa-convert-tfl-uint8
8 // CHECK: tosa.rescale
9 // CHECK: tosa.rescale
11 // CHECK: tosa.rescale
/external/llvm-project/mlir/test/Dialect/Tosa/
Dops.mlir8 %0 = "tosa.argmax"(%arg0) {axis = 1 : i64} : (tensor<14x19xf32>) -> tensor<14xi32>
15 …%0 = "tosa.avg_pool2d"(%arg0) {kernel = [2, 2], pad = [0, 1, 0, 1], stride = [1, 1]} : (tensor<1x7…
22 …%0 = "tosa.conv2d"(%arg0, %arg1, %arg2) {dilation = [1, 1], pad = [0, 0, 0, 0], stride = [1, 1]} :…
29 …%2 = "tosa.depthwise_conv2d"(%arg0, %arg1, %arg2) {dilation = [1, 1], pad = [0, 0, 0, 0], stride =…
36 …%0 = "tosa.fully_connected"(%arg0, %arg1, %arg2) : (tensor<14x19xf32>, tensor<19x28xf32>, tensor<2…
43 %0 = "tosa.matmul"(%arg0, %arg1) : (tensor<14x19xf32>, tensor<19x28xf32>) -> tensor<14x28xf32>
50 …%0 = "tosa.max_pool2d"(%arg0) {kernel = [1, 1], pad = [0, 0, 0, 0], stride = [1, 1]} : (tensor<1x3…
57 …%0 = "tosa.transpose_conv2d"(%arg0, %arg1, %arg2) {dilation = [1, 1], out_pad = [0, 0], out_shape …
64 …%0 = "tosa.clamp"(%arg0) {min_fp = 0.0 : f32, max_fp = 1.0: f32, min_int = 0 : i64, max_int = 1 : …
71 …%0 = "tosa.reluN"(%arg0) {max_fp = 3.40282347E+38 : f32, max_int = 0 : i64} : (tensor<13x21x3xf32>…
[all …]
Dbroadcast.mlir1 // RUN: mlir-opt --tosa-make-broadcastable %s | FileCheck %s
7 %0 = "tosa.add"(%arg0, %arg1) : (tensor<1xf32>, tensor<1xf32>) -> tensor<1xf32>
15 %0 = "tosa.add"(%arg0, %arg1) : (tensor<1xf32>, tensor<2x1xf32>) -> tensor<2x1xf32>
23 %0 = "tosa.add"(%arg0, %arg1) : (tensor<2x1xf32>, tensor<1xf32>) -> tensor<2x1xf32>
31 %0 = "tosa.add"(%arg0, %arg1) : (tensor<2x1x1x1xf32>, tensor<1xf32>) -> tensor<2x1x1x1xf32>
39 %0 = "tosa.add"(%arg0, %arg1) : (tensor<1x1x1x2xf32>, tensor<1xf32>) -> tensor<1x1x1x2xf32>
47 %0 = "tosa.add"(%arg0, %arg1) : (tensor<1x1x2x1xf32>, tensor<1xf32>) -> tensor<1x1x2x1xf32>
55 …%0 = "tosa.add"(%arg0, %arg1) : (tensor<17x16x15x14xf32>, tensor<1xf32>) -> tensor<17x16x15x14xf32>
63 …%0 = "tosa.add"(%arg0, %arg1) : (tensor<17x16x1x14xf32>, tensor<1x1xf32>) -> tensor<17x16x1x14xf32>
71 …%0 = "tosa.add"(%arg0, %arg1) : (tensor<17x16x15x14xf32>, tensor<1x1xf32>) -> tensor<17x16x15x14xf…
[all …]
Dinlining.mlir11 %0 = "tosa.cond_if"(%arg2, %arg0, %arg1) ( {
14 "tosa.yield"(%1) : (tensor<f32>) -> ()
18 "tosa.yield"(%1) : (tensor<f32>) -> ()
23 %0 = "tosa.add"(%arg0, %arg1) : (tensor<f32>, tensor<f32>) -> tensor<f32>
27 %0 = "tosa.sub"(%arg0, %arg1) : (tensor<f32>, tensor<f32>) -> tensor<f32>
37 %1:4 = "tosa.while_loop"(%arg0, %arg1, %arg2, %arg3) ( {
40 "tosa.yield"(%2) : (tensor<i1>) -> ()
44 …"tosa.yield"(%2#0, %2#1, %2#2, %2#3) : (tensor<i32>, tensor<i32>, tensor<i32>, tensor<10xi32>) -> …
49 %1 = "tosa.add"(%arg0, %arg1) : (tensor<i32>, tensor<i32>) -> tensor<i32>
50 %2 = "tosa.add"(%arg3, %1) : (tensor<10xi32>, tensor<i32>) -> tensor<10xi32>
[all …]
Dquant-test.mlir1 // RUN: mlir-opt --tosa-test-quant-utils %s | FileCheck %s
6 // CHECK: tosa.negate
7 …%0 = "tosa.negate"(%arg0) : (tensor<16x1x1x8x!quant.uniform<u8<1:255>:f32, 0.015680249780416489:12…
14 // CHECK: tosa.conv2d
15 …%0 = "tosa.conv2d"(%arg0, %arg1, %arg2) {pad = [1, 1, 2, 2], dilation = [2, 1], stride = [1, 1], q…
Dconstant_folding.mlir5 // CHECK: "tosa.const"
6 %0 = "tosa.const"() {value = dense<[3, 0, 1, 2]> : tensor<4xi32>} : () -> tensor<4xi32>
/external/llvm-project/mlir/lib/Dialect/Tosa/Transforms/
DTosaMakeBroadcastable.cpp22 using namespace mlir::tosa;
149 auto reshapeLower = rewriter.create<tosa::ReshapeOp>( in reshapeLowerToHigher()
192 struct ConvertTosaOp<tosa::MulOp> : public OpRewritePattern<tosa::MulOp> {
193 using OpRewritePattern<tosa::MulOp>::OpRewritePattern;
195 LogicalResult matchAndRewrite(tosa::MulOp tosaBinaryOp, in matchAndRewrite()
209 rewriter.replaceOpWithNewOp<tosa::MulOp>(tosaBinaryOp, outputType, in matchAndRewrite()
220 struct ConvertTosaOp<tosa::ArithmeticRightShiftOp>
221 : public OpRewritePattern<tosa::ArithmeticRightShiftOp> {
222 using OpRewritePattern<tosa::ArithmeticRightShiftOp>::OpRewritePattern;
224 LogicalResult matchAndRewrite(tosa::ArithmeticRightShiftOp tosaBinaryOp, in matchAndRewrite()
[all …]
/external/tensorflow/tensorflow/compiler/mlir/tosa/g3doc/
Dlegalization.md36 %&lt;output\_value&gt; = tosa.&lt;OPERATOR&gt;(%&lt;input\_value&gt;)
108 %out = tosa.RESHAPE(%a, new_a_shape)
126 … %out = tosa.RESHAPE(%a) {new_shape=new_a_shape} (tensor<%a.type>) -> tensor<new_a_shape, %a.dtype>
315 …%a1_reshape = tosa.RESHAPE(%input) {new_shape=a1_shape} : (tensor<%input.type>) -> tensor<a1_shape…
316 …%a2_transpose = tosa.TRANSPOSE(%a1_reshape) {perms=a2_perm} : (tensor<%a1_reshape.type>) -> tensor…
317 …%a3_reshape = tosa.RESHAPE(%a2_transpose) {new_shape=a3_shape} : (tensor<%a2_transpose.type>) -> t…
318 …%output = tosa.SLICE(%a3_reshape) {begin=a4_begin, size=a4_size} : (tensor<%a3_reshape.type>) -> t…
336 …%values:i = tosa.RESHAPE(%values:i) {new_shape=1} : (tensor<{}, %values:i.dtype>) -> tensor<{1}, %…
342 …%concat_op = tosa.CONCAT(%values:0, %values:1) {axis=tosa_axis} : (tensor<%values:0.type>, tensor<…
346 …%concat_op = tosa.CONCAT(%concat_op, %values:i) {axis=tosa_axis} : (tensor<%concat_op.type>, tenso…
[all …]
/external/tensorflow/tensorflow/compiler/mlir/tosa/transforms/
Dlegalize_common.cc40 namespace tosa { namespace
132 auto a0_reshape_op = rewriter.create<tosa::ReshapeOp>( in convertPackOp()
220 auto a1_concat_op = rewriter.create<tosa::ConcatOp>( in convertPackOp()
229 a1_concat_op = rewriter.create<tosa::ConcatOp>(op->getLoc(), concat_type, in convertPackOp()
242 auto a2_reshape_op = rewriter.create<tosa::ReshapeOp>( in convertPackOp()
249 get1DConstTensor<tosa::ConstOp, int32_t>(rewriter, op, perm); in convertPackOp()
252 .create<tosa::TransposeOp>(op->getLoc(), result_type, in convertPackOp()
294 get1DConstTensor<tosa::ConstOp, int32_t>(rewriter, op, perm_vec); in convertUnpackOp()
300 auto a1_transpose_op = rewriter.create<tosa::TransposeOp>( in convertUnpackOp()
337 auto a2_slice_op = rewriter.create<tosa::SliceOp>( in convertUnpackOp()
[all …]
Dlegalize_tf.cc37 namespace tosa { namespace
147 rewriter.replaceOpWithNewOp<tosa::ReluNOp>( in matchAndRewrite()
151 rewriter.replaceOpWithNewOp<tosa::ReluNOp>( in matchAndRewrite()
169 rewriter.replaceOpWithNewOp<tosa::ReluNOp>( in matchAndRewrite()
173 rewriter.replaceOpWithNewOp<tosa::ReluNOp>( in matchAndRewrite()
189 rewriter.replaceOpWithNewOp<tosa::EqualOp>(op, output_type, tf_equal_op.x(), in matchAndRewrite()
203 auto op1_equal_in = rewriter.create<tosa::EqualOp>( in matchAndRewrite()
206 auto op2_not_op1 = rewriter.create<tosa::LogicalNotOp>( in matchAndRewrite()
223 rewriter.replaceOpWithNewOp<tosa::GreaterOp>( in matchAndRewrite()
237 rewriter.replaceOpWithNewOp<tosa::GreaterEqualOp>( in matchAndRewrite()
[all …]
Dlegalize_utils.cc26 namespace tosa { namespace
38 auto rescale_op = rewriter.create<tosa::RescaleOp>( in buildRescale()
107 auto rescale_op = rewriter.create<tosa::RescaleOp>( in buildRescaleOpConvOutput()
148 auto rescale_op = rewriter.create<tosa::RescaleOp>( in buildRescaleOpConvOutput()
186 rewriter.create<tosa::ConstOp>(op->getLoc(), const_type, const_attr); in getTosa1DConstTensorTable()
197 rewriter.create<tosa::ConstOp>(op->getLoc(), const_type, const_attr); in getTosaConstTensorSingleF32()
208 rewriter.create<tosa::ConstOp>(op->getLoc(), const_type, const_attr); in getTosaConstTensorSingleI32()
365 Value get1DConstTensor<tosa::ConstOp, float>(PatternRewriter& rewriter, in get1DConstTensor()
374 rewriter.create<tosa::ConstOp>(op->getLoc(), const_type, const_attr); in get1DConstTensor()
378 template Value get1DConstTensor<tosa::ConstOp, int32_t>(
[all …]
Dlegalize_tfl.cc50 namespace tosa { namespace
178 auto op2_relun_op1 = rewriter.create<tosa::ReluNOp>( in matchAndRewrite()
188 auto op1_relun_in = rewriter.create<tosa::ReluNOp>( in matchAndRewrite()
237 auto op2_relun_op1 = rewriter.create<tosa::ReluNOp>( in matchAndRewrite()
246 auto op1_relun_in = rewriter.create<tosa::ReluNOp>( in matchAndRewrite()
305 auto op3_equal_op1_op2 = rewriter.create<tosa::EqualOp>( in matchAndRewrite()
310 auto op1_equal_in = rewriter.create<tosa::EqualOp>( in matchAndRewrite()
369 auto op3_equal_op1_op2 = rewriter.create<tosa::EqualOp>( in matchAndRewrite()
371 auto op4_not_op3 = rewriter.create<tosa::LogicalNotOp>( in matchAndRewrite()
376 auto op1_equal_in = rewriter.create<tosa::EqualOp>( in matchAndRewrite()
[all …]
Dpasses.td18 def TosaLegalizeTFPass : Pass<"tosa-legalize-tf", "FuncOp"> {
23 def TosaLegalizeTFLPass : Pass<"tosa-legalize-tfl", "FuncOp"> {
28 def TosaFusebiasTFPass : Pass<"tosa-fuse-bias-tf", "FuncOp"> {
33 def TosaConvertTFLUint8Pass : Pass<"tosa-convert-tfl-uint8", "FuncOp"> {
/external/llvm-project/mlir/lib/Dialect/Tosa/Utils/
DQuantUtils.cpp17 using namespace mlir::tosa;
77 void mlir::tosa::computeMultiplierAndShift(double scale, int32_t &multiplier, in computeMultiplierAndShift()
102 mlir::tosa::buildConvOpQuantizationAttr(OpBuilder &builder, Value input, in buildConvOpQuantizationAttr()
136 auto quantAttr = tosa::ConvOpQuantizationAttr::get( in buildConvOpQuantizationAttr()
151 mlir::tosa::buildMatMulOpQuantizationAttr(OpBuilder &builder, Value a, in buildMatMulOpQuantizationAttr()
172 auto quantAttr = tosa::MatMulOpQuantizationAttr::get( in buildMatMulOpQuantizationAttr()
187 mlir::tosa::buildUnaryOpQuantizationAttr(OpBuilder &builder, Value input, in buildUnaryOpQuantizationAttr()
208 auto quantAttr = tosa::UnaryOpQuantizationAttr::get( in buildUnaryOpQuantizationAttr()
220 PadOpQuantizationAttr mlir::tosa::buildPadOpQuantizationAttr(OpBuilder &builder, in buildPadOpQuantizationAttr()
234 auto quantAttr = tosa::PadOpQuantizationAttr::get( in buildPadOpQuantizationAttr()
[all …]
/external/llvm-project/mlir/test/lib/Dialect/Tosa/
DTosaTestPasses.cpp26 using namespace mlir::tosa;
33 : RewritePattern(tosa::NegateOp::getOperationName(), 1, context) {} in ConvertTosaNegateOp()
42 auto tosaNegateOp = cast<tosa::NegateOp>(op); in matchAndRewrite()
90 rewriter.create<tosa::ConstOp>(op->getLoc(), dstQConstType, inputElems); in matchAndRewrite()
91 auto newNegateOp = rewriter.create<tosa::NegateOp>( in matchAndRewrite()
103 : RewritePattern(tosa::Conv2DOp::getOperationName(), 1, context) {} in ConvertTosaConv2DOp()
112 auto tosaConv2DOp = cast<tosa::Conv2DOp>(op); in matchAndRewrite()
148 auto newTosaConv2DOp = rewriter.create<tosa::Conv2DOp>( in matchAndRewrite()
167 auto newTosaRescaleOp = rewriter.create<tosa::RescaleOp>( in matchAndRewrite()
/external/tensorflow/tensorflow/compiler/mlir/tosa/
Dtfl_passes.cc23 namespace tosa { namespace
43 pm.addPass(mlir::tosa::createConvertTFLUint8Pass()); in createTFLtoTOSALegalizationPipeline()
44 pm.addPass(mlir::tosa::createLegalizeTFLPass()); in createTFLtoTOSALegalizationPipeline()
49 pm.addPass(mlir::tosa::createTosaMakeBroadcastablePass()); in createTFLtoTOSALegalizationPipeline()
Dtf_passes.cc24 namespace tosa { namespace
45 pm.addPass(mlir::tosa::createFuseBiasTFPass()); in createTFtoTOSALegalizationPipeline()
46 pm.addPass(mlir::tosa::createLegalizeTFPass()); in createTFtoTOSALegalizationPipeline()
51 pm.addPass(mlir::tosa::createTosaMakeBroadcastablePass()); in createTFtoTOSALegalizationPipeline()
Dtf_passes.h23 namespace tosa {
/external/llvm-project/mlir/include/mlir/Dialect/Tosa/IR/
DTosaOpBase.td21 let name = "tosa";
27 https://developer.mlplatform.org/w/tosa/ .
40 let cppNamespace = "mlir::tosa";
52 // https://developer.mlplatform.org/w/tosa/ . TOSA leverages MLIR's built in
60 // For example: tosa.negate.
70 // this case, a tosa.rescale is used to express the inputs to the same scale.
79 // tosa.rescale operator that scales the accumulator result to output scale.
98 // Its functional application is described in the tosa.pad() operator
123 // Handles tosa.transpose_conv2d which has an outpad and output shape attribute.
135 // The tosa.fully_connected op has its own builder as it does not have
[all …]
DTosaOps.h28 namespace tosa {
/external/llvm-project/mlir/lib/Dialect/Tosa/IR/
DTosaOps.cpp24 using namespace mlir::tosa;
52 return (isa<tosa::IfOp>(dest->getParentOp()) || in isLegalToInline()
53 isa<tosa::WhileOp>(dest->getParentOp())); in isLegalToInline()
63 Region &tosa::WhileOp::getLoopBody() { return body(); } in getLoopBody()
65 bool tosa::WhileOp::isDefinedOutsideOfLoop(Value value) { in isDefinedOutsideOfLoop()
97 return builder.create<tosa::ConstOp>(loc, type, value.cast<ElementsAttr>()); in materializeConstant()
/external/llvm-project/mlir/docs/Dialects/
DTOSA.md8 specification](https://developer.mlplatform.org/w/tosa/). This document
66 tosa.IDENTITYN is used to form a list of Operator results during
67 lowering of operations such as tf.Split from a sequence of tosa.SLICE
69 tosa.IDENTITYN op, the tosa.IDENTITYN op could be removed from TOSA.
89 …%output[i] = tosa.SLICE(%value) {start=begin_vals, size=size_vals} (tensor<%value.type>) -> tensor…
94 %output_list = tosa.IDENTITYN(%output) (tensor<%output:*.type>) -> tensor<%output_list:*.type>

12