Skip to content

Commit d8b401e

Browse files
Jerry-GeTai78641lhutton1
committed
[mlir][tosa] Add additional input output dtype verifiers for the following operators
- CastOp - ConcatOp - MatMulOp - PadOp - SliceOp - TileOp - ReshapeOp - TransposeOp - GatherOp - ScatterOp - MaxPool2dOp - ReverseOp - SelectOp Change-Id: I1e8a1017f21f617443bc40bae42189915048c750 Co-authored-by: Tai Ly <[email protected]> Co-authored-by: Luke Hutton <[email protected]> Signed-off-by: Jerry Ge <[email protected]>
1 parent 87bf232 commit d8b401e

File tree

3 files changed

+373
-13
lines changed

3 files changed

+373
-13
lines changed

mlir/include/mlir/Dialect/Tosa/IR/TosaOps.td

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@ def Tosa_MatMulOp : Tosa_InferShapedTypeOp<"matmul"> {
283283
];
284284

285285
let builders = [Tosa_MatMulOpQuantInfoBuilder];
286+
let hasVerifier = 1;
286287
}
287288

288289
//===----------------------------------------------------------------------===//
@@ -317,6 +318,7 @@ def Tosa_MaxPool2dOp : Tosa_InferShapedTypeOp<"max_pool2d"> {
317318
];
318319

319320
let hasCanonicalizer = 1;
321+
let hasVerifier = 1;
320322
}
321323

322324
//===----------------------------------------------------------------------===//
@@ -1426,6 +1428,7 @@ def Tosa_SelectOp : Tosa_ElementwiseOp<"select"> {
14261428

14271429
let hasCanonicalizeMethod = 1;
14281430
let hasFolder = 1;
1431+
let hasVerifier = 1;
14291432

14301433
let assemblyFormat = [{
14311434
operands attr-dict `:` `(` type($input1) `,` type($input2) `,` type($input3)
@@ -1804,6 +1807,7 @@ def Tosa_ConcatOp : Tosa_InferTensorTypeOp<"concat"> {
18041807

18051808
let hasCanonicalizer = 1;
18061809
let hasFolder = 1;
1810+
let hasVerifier = 1;
18071811

18081812
let extraClassDeclaration = [{
18091813
/// Returns true when two result types are compatible for this op;
@@ -2061,6 +2065,8 @@ def Tosa_GatherOp : Tosa_InferShapedTypeOp<"gather"> {
20612065
Profile<[Tosa_PRO_INT, Tosa_PRO_FP]>,
20622066
Extension<[Tosa_EXT_FP8E4M3, Tosa_EXT_FP8E5M2, Tosa_EXT_BF16]>,
20632067
];
2068+
2069+
let hasVerifier = 1;
20642070
}
20652071

20662072
//===----------------------------------------------------------------------===//
@@ -2088,6 +2094,8 @@ def Tosa_ScatterOp : Tosa_InferShapedTypeOp<"scatter"> {
20882094
Profile<[Tosa_PRO_INT, Tosa_PRO_FP]>,
20892095
Extension<[Tosa_EXT_FP8E4M3, Tosa_EXT_FP8E5M2, Tosa_EXT_BF16]>,
20902096
];
2097+
2098+
let hasVerifier = 1;
20912099
}
20922100

20932101
//===----------------------------------------------------------------------===//
@@ -2186,6 +2194,7 @@ def Tosa_CastOp: Tosa_Op<"cast", [Pure,
21862194
let assemblyFormat = "operands attr-dict `:` functional-type(operands, results)";
21872195

21882196
let hasFolder = 1;
2197+
let hasVerifier = 1;
21892198
}
21902199

21912200
//===----------------------------------------------------------------------===//

0 commit comments

Comments
 (0)