Skip to content

Commit 38f0708

Browse files
committed
[mlir][tosa] Finalize profile-based validation for TOSA v1.0
- When the operand type of an operation changes to a profile-dependent type, the compliance metadata must be updated. Update compliance check for the following: - CONV2D, CONV3D, DEPTHWISE_CONV2D, and TRANSPOSE_CONV2D, as zero points have changed to variable inputs. - PAD, because pad_const has been changed to a variable input. - GATHER and SCATTER, as indices has changed to index_t. - Add an int16 extension check for CONCAT. - Add a compliance check for VARIABLE, VARIABLE_READ, and VARIABLE_WRITE. - Correct the profile requirements for IDENTITY, TABLE, MATMUL and LOGICAL-like operations. - Remove unnecessary checks for non-v1.0 operations. - Add condition requirements (anyOf and allOf) to the type mode of metadata for modes that have multiple profile/extension considerations.
1 parent dccc0a8 commit 38f0708

File tree

7 files changed

+282
-131
lines changed

7 files changed

+282
-131
lines changed

mlir/include/mlir/Dialect/Tosa/IR/TosaComplianceData.h.inc

Lines changed: 126 additions & 101 deletions
Large diffs are not rendered by default.

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,7 @@ def Tosa_LogicalAndOp : Tosa_ElementwiseOp<"logical_and", [
801801
);
802802

803803
list<Availability> availability = [
804-
Profile<[Tosa_PRO_INT]>,
804+
Profile<[Tosa_PRO_INT, Tosa_PRO_FP]>,
805805
Extension<[]>,
806806
];
807807
}
@@ -828,7 +828,7 @@ def Tosa_LogicalLeftShiftOp : Tosa_ElementwiseOp<"logical_left_shift",
828828
);
829829

830830
list<Availability> availability = [
831-
Profile<[Tosa_PRO_INT]>,
831+
Profile<[Tosa_PRO_INT, Tosa_PRO_FP]>,
832832
Extension<[]>,
833833
];
834834
}
@@ -856,7 +856,7 @@ def Tosa_LogicalRightShiftOp : Tosa_ElementwiseOp<"logical_right_shift",
856856
);
857857

858858
list<Availability> availability = [
859-
Profile<[Tosa_PRO_INT]>,
859+
Profile<[Tosa_PRO_INT, Tosa_PRO_FP]>,
860860
Extension<[]>,
861861
];
862862
}
@@ -884,7 +884,7 @@ def Tosa_LogicalOrOp : Tosa_ElementwiseOp<"logical_or", [
884884
);
885885

886886
list<Availability> availability = [
887-
Profile<[Tosa_PRO_INT]>,
887+
Profile<[Tosa_PRO_INT, Tosa_PRO_FP]>,
888888
Extension<[]>,
889889
];
890890
}
@@ -912,7 +912,7 @@ def Tosa_LogicalXorOp : Tosa_ElementwiseOp<"logical_xor", [
912912
);
913913

914914
list<Availability> availability = [
915-
Profile<[Tosa_PRO_INT]>,
915+
Profile<[Tosa_PRO_INT, Tosa_PRO_FP]>,
916916
Extension<[]>,
917917
];
918918
}
@@ -1108,7 +1108,7 @@ def Tosa_TableOp : Tosa_InferShapedTypeOp<"table"> {
11081108

11091109
list<Availability> availability = [
11101110
Profile<[Tosa_PRO_INT]>,
1111-
Extension<[Tosa_EXT_BF16]>,
1111+
Extension<[Tosa_EXT_INT16]>,
11121112
];
11131113

11141114
let assemblyFormat = [{
@@ -1910,15 +1910,15 @@ def Tosa_PadOp : Tosa_InferShapedTypeOp<"pad"> {
19101910
Example:
19111911

19121912
```mlir
1913-
%0 = tosa.const_shape { value = dense<[1, 2, 3, 4]> : tensor<4xindex> } : () -> !tosa.shape<4>
1914-
tosa.pad %arg0, %0 : (tensor<1x2xf32>, !tosa.shape<4>) -> (tensor<4x9xf32>)
1913+
%padding = tosa.const_shape { value = dense<[1, 2, 3, 4]> : tensor<4xindex> } : () -> !tosa.shape<4>
1914+
tosa.pad %arg0, %padding, %pad_const: (tensor<1x2xf32>, !tosa.shape<4>, tensor<1xi1>) -> (tensor<4x9xf32>)
19151915
```
19161916

19171917
Example 2:
19181918

19191919
```mlir
1920-
%0 = tosa.const_shape { value = dense<[-1, 2, 3, 4]> : tensor<4xindex> } : () -> !tosa.shape<4>
1921-
tosa.pad %arg0, %0 : (tensor<1x2xf32>, !tosa.shape<4>) -> (tensor<?x9xf32>)
1920+
%padding = tosa.const_shape { value = dense<[-1, 2, 3, 4]> : tensor<4xindex> } : () -> !tosa.shape<4>
1921+
tosa.pad %arg0, %padding, %pad_const : (tensor<1x2xf32>, !tosa.shape<4>, tensor<1xi1>) -> (tensor<?x9xf32>)
19221922
```
19231923
}];
19241924

mlir/include/mlir/Dialect/Tosa/IR/TosaProfileCompliance.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ typedef struct {
2929
} TypeInfo;
3030

3131
enum CheckCondition {
32+
invalid,
3233
// Valid when any of the profile (extension) requirement is meet.
3334
anyOf,
3435
// Valid when all of the profile (extension) requirement are meet.
35-
allOf,
36-
invalid
36+
allOf
3737
};
3838

3939
template <typename T>
@@ -87,7 +87,7 @@ class ProfileInfoDepot {
8787
template <typename T>
8888
void populateProfileInfoConv(T op);
8989

90-
// For pad, reshape, slice, tile, and transpose.
90+
// For reshape, slice, tile, and transpose.
9191
template <typename T>
9292
void populateProfileInfoDataLayout(T op);
9393

mlir/lib/Dialect/Tosa/Transforms/TosaProfileCompliance.cpp

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ void ProfileInfoDepot::populateProfileInfoConv(T op) {
6969
addValue(op.getInput());
7070
addValue(op.getWeight());
7171
addValue(op.getBias());
72+
addValue(op.getInputZp());
73+
addValue(op.getWeightZp());
7274
addType(op.getAccType());
7375
addValue(op.getOutput());
7476
}
@@ -93,15 +95,17 @@ void ProfileInfoDepot::populateProfileInfo(tosa::DepthwiseConv2DOp op) {
9395
populateProfileInfoConv(op);
9496
}
9597

96-
template <typename T>
97-
void ProfileInfoDepot::populateProfileInfoDataLayout(T op) {
98+
template <>
99+
void ProfileInfoDepot::populateProfileInfo(tosa::PadOp op) {
98100
addValue(op.getInput1());
101+
addValue(op.getPadConst());
99102
addValue(op.getOutput());
100103
}
101104

102-
template <>
103-
void ProfileInfoDepot::populateProfileInfo(tosa::PadOp op) {
104-
populateProfileInfoDataLayout(op);
105+
template <typename T>
106+
void ProfileInfoDepot::populateProfileInfoDataLayout(T op) {
107+
addValue(op.getInput1());
108+
addValue(op.getOutput());
105109
}
106110

107111
template <>
@@ -425,7 +429,8 @@ template <typename T>
425429
SmallVector<T> TosaProfileCompliance::findMatchedProfile(
426430
Operation *op, SmallVector<OpComplianceInfo<T>> compInfo,
427431
CheckCondition &condition) {
428-
assert(compInfo.size() != 0);
432+
assert(compInfo.size() != 0 &&
433+
"profile-based compliance information is empty");
429434

430435
// Populate the type of profile/extension relevant operands.
431436
ProfileInfoDepot depot(op);
@@ -437,7 +442,10 @@ SmallVector<T> TosaProfileCompliance::findMatchedProfile(
437442
SmallVector<SmallVector<TypeInfo>> sets = compInfo[i].operandTypeInfoSet;
438443

439444
for (SmallVector<TypeInfo> expected : sets) {
440-
assert(present.size() == expected.size());
445+
assert(present.size() == expected.size() &&
446+
"the entries for profile-based compliance do not match between "
447+
"the generated metadata and the type definition retrieved from "
448+
" the operation");
441449

442450
bool is_found = true;
443451
// Compare the type signature between the given operation and the

mlir/test/Dialect/Tosa/availability.mlir

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ func.func @test_int_div(%arg0: tensor<13x21x1xi32>, %arg1: tensor<13x21x3xi32>)
197197
// -----
198198
// CHECK-LABEL: logical_and
199199
func.func @test_logical_and(%arg0: tensor<13x21x3xi1>, %arg1: tensor<13x21x1xi1>) -> tensor<13x21x3xi1> {
200-
// CHECK: profiles: [ [pro_int] ]
200+
// CHECK: profiles: [ [pro_int, pro_fp] ]
201201
// CHECK: extensions: [ ]
202202
%0 = tosa.logical_and %arg0, %arg1 : (tensor<13x21x3xi1>, tensor<13x21x1xi1>) -> tensor<13x21x3xi1>
203203
return %0 : tensor<13x21x3xi1>
@@ -206,7 +206,7 @@ func.func @test_logical_and(%arg0: tensor<13x21x3xi1>, %arg1: tensor<13x21x1xi1>
206206
// -----
207207
// CHECK-LABEL: logical_left_shift
208208
func.func @test_logical_left_shift(%arg0: tensor<13x21x3xi32>, %arg1: tensor<13x21x1xi32>) -> tensor<13x21x3xi32> {
209-
// CHECK: profiles: [ [pro_int] ]
209+
// CHECK: profiles: [ [pro_int, pro_fp] ]
210210
// CHECK: extensions: [ ]
211211
%0 = tosa.logical_left_shift %arg0, %arg1 : (tensor<13x21x3xi32>, tensor<13x21x1xi32>) -> tensor<13x21x3xi32>
212212
return %0 : tensor<13x21x3xi32>
@@ -215,7 +215,7 @@ func.func @test_logical_left_shift(%arg0: tensor<13x21x3xi32>, %arg1: tensor<13x
215215
// -----
216216
// CHECK-LABEL: logical_right_shift
217217
func.func @test_logical_right_shift(%arg0: tensor<13x21x3xi32>, %arg1: tensor<13x21x1xi32>) -> tensor<13x21x3xi32> {
218-
// CHECK: profiles: [ [pro_int] ]
218+
// CHECK: profiles: [ [pro_int, pro_fp] ]
219219
// CHECK: extensions: [ ]
220220
%0 = tosa.logical_right_shift %arg0, %arg1 : (tensor<13x21x3xi32>, tensor<13x21x1xi32>) -> tensor<13x21x3xi32>
221221
return %0 : tensor<13x21x3xi32>
@@ -224,7 +224,7 @@ func.func @test_logical_right_shift(%arg0: tensor<13x21x3xi32>, %arg1: tensor<13
224224
// -----
225225
// CHECK-LABEL: logical_or
226226
func.func @test_logical_or(%arg0: tensor<13x1x3xi1>, %arg1: tensor<13x21x3xi1>) -> tensor<13x21x3xi1> {
227-
// CHECK: profiles: [ [pro_int] ]
227+
// CHECK: profiles: [ [pro_int, pro_fp] ]
228228
// CHECK: extensions: [ ]
229229
%0 = tosa.logical_or %arg0, %arg1 : (tensor<13x1x3xi1>, tensor<13x21x3xi1>) -> tensor<13x21x3xi1>
230230
return %0 : tensor<13x21x3xi1>
@@ -233,7 +233,7 @@ func.func @test_logical_or(%arg0: tensor<13x1x3xi1>, %arg1: tensor<13x21x3xi1>)
233233
// -----
234234
// CHECK-LABEL: logical_xor
235235
func.func @test_logical_xor(%arg0: tensor<13x1x3xi1>, %arg1: tensor<13x21x3xi1>) -> tensor<13x21x3xi1> {
236-
// CHECK: profiles: [ [pro_int] ]
236+
// CHECK: profiles: [ [pro_int, pro_fp] ]
237237
// CHECK: extensions: [ ]
238238
%0 = tosa.logical_xor %arg0, %arg1 : (tensor<13x1x3xi1>, tensor<13x21x3xi1>) -> tensor<13x21x3xi1>
239239
return %0 : tensor<13x21x3xi1>
@@ -289,7 +289,7 @@ func.func @test_sub(%arg0: tensor<1x21x3xf32>, %arg1: tensor<13x21x3xf32>) -> te
289289
// CHECK-LABEL: table
290290
func.func @test_table(%arg0: tensor<64xi32>, %arg1: tensor<513x!quant.uniform<i16:f32, 1.0:0>>) -> tensor<64x!quant.uniform<i16:f32, 1.0:0>> {
291291
// CHECK: profiles: [ [pro_int] ]
292-
// CHECK: extensions: [ [bf16] ]
292+
// CHECK: extensions: [ [int16] ]
293293
%0 = tosa.table %arg0, %arg1 : (tensor<64xi32>, tensor<513x!quant.uniform<i16:f32, 1.000000e+00>>) -> tensor<64x!quant.uniform<i16:f32, 1.000000e+00>>
294294
return %0 : tensor<64x!quant.uniform<i16:f32, 1.0:0>>
295295
}

mlir/test/Dialect/Tosa/profile_all_unsupported.mlir

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,20 +53,142 @@ func.func @test_add(%arg0: tensor<13x21x1xf32>, %arg1: tensor<13x21x3xf32>) -> t
5353
return %0 : tensor<13x21x3xf32>
5454
}
5555

56+
// -----
57+
func.func @test_add_i32(%arg0: tensor<13x21x1xi32>, %arg1: tensor<13x21x3xi32>) -> tensor<13x21x3xi32> {
58+
// expected-error@+1 {{'tosa.add' op illegal: requires any of [pro_int, pro_fp] but not enabled in target}}
59+
%0 = tosa.add %arg0, %arg1 : (tensor<13x21x1xi32>, tensor<13x21x3xi32>) -> tensor<13x21x3xi32>
60+
return %0 : tensor<13x21x3xi32>
61+
}
62+
63+
// -----
64+
func.func @test_int_div(%arg0: tensor<13x21x1xi32>, %arg1: tensor<13x21x3xi32>) -> tensor<13x21x3xi32> {
65+
// expected-error@+1 {{'tosa.int_div' op illegal: requires any of [pro_int, pro_fp] but not enabled in target}}
66+
%0 = tosa.int_div %arg0, %arg1 : (tensor<13x21x1xi32>, tensor<13x21x3xi32>) -> tensor<13x21x3xi32>
67+
return %0 : tensor<13x21x3xi32>
68+
}
69+
70+
// -----
71+
func.func @test_logical_and(%arg0: tensor<13x21x3xi1>, %arg1: tensor<13x21x1xi1>) -> tensor<13x21x3xi1> {
72+
// expected-error@+1 {{'tosa.logical_and' op illegal: requires any of [pro_int, pro_fp] but not enabled in target}}
73+
%0 = tosa.logical_and %arg0, %arg1 : (tensor<13x21x3xi1>, tensor<13x21x1xi1>) -> tensor<13x21x3xi1>
74+
return %0 : tensor<13x21x3xi1>
75+
}
76+
77+
// -----
78+
func.func @test_logical_left_shift(%arg0: tensor<13x21x3xi32>, %arg1: tensor<13x21x1xi32>) -> tensor<13x21x3xi32> {
79+
// expected-error@+1 {{'tosa.logical_left_shift' op illegal: requires any of [pro_int, pro_fp] but not enabled in target}}
80+
%0 = tosa.logical_left_shift %arg0, %arg1 : (tensor<13x21x3xi32>, tensor<13x21x1xi32>) -> tensor<13x21x3xi32>
81+
return %0 : tensor<13x21x3xi32>
82+
}
83+
84+
// -----
85+
func.func @test_mul(%arg0: tensor<13x21x3xi32>, %arg1: tensor<13x1x3xi32>, %shift: tensor<1xi8>) -> tensor<13x21x3xi32> {
86+
// expected-error@+1 {{'tosa.mul' op illegal: requires any of [pro_int, pro_fp] but not enabled in target}}
87+
%0 = tosa.mul %arg0, %arg1, %shift : (tensor<13x21x3xi32>, tensor<13x1x3xi32>, tensor<1xi8>) -> tensor<13x21x3xi32>
88+
return %0 : tensor<13x21x3xi32>
89+
}
90+
91+
// -----
92+
func.func @test_sub(%arg0: tensor<1x21x3xi32>, %arg1: tensor<13x21x3xi32>) -> tensor<13x21x3xi32> {
93+
// expected-error@+1 {{'tosa.sub' op illegal: requires any of [pro_int, pro_fp] but not enabled in target}}
94+
%0 = tosa.sub %arg0, %arg1 : (tensor<1x21x3xi32>, tensor<13x21x3xi32>) -> tensor<13x21x3xi32>
95+
return %0 : tensor<13x21x3xi32>
96+
}
97+
98+
// -----
99+
func.func @test_logical_not(%arg0: tensor<1x21x3xi1>) -> tensor<1x21x3xi1> {
100+
// expected-error@+1 {{'tosa.logical_not' op illegal: requires any of [pro_int, pro_fp] but not enabled in target}}
101+
%0 = tosa.logical_not %arg0 : (tensor<1x21x3xi1>) -> tensor<1x21x3xi1>
102+
return %0 : tensor<1x21x3xi1>
103+
}
104+
105+
// -----
106+
func.func @test_select(%arg0: tensor<1x1x1xi1>, %arg1: tensor<13x21x3xi1>, %arg2: tensor<13x21x3xi1>) -> tensor<13x21x3xi1> {
107+
// expected-error@+1 {{'tosa.select' op illegal: requires any of [pro_int, pro_fp] but not enabled in target}}
108+
%0 = tosa.select %arg0, %arg1, %arg2 : (tensor<1x1x1xi1>, tensor<13x21x3xi1>, tensor<13x21x3xi1>) -> tensor<13x21x3xi1>
109+
return %0 : tensor<13x21x3xi1>
110+
}
56111
// -----
57112
func.func @test_reduce_all(%arg0: tensor<13x21x3xi1>) -> tensor<1x21x3xi1> {
58113
// expected-error@+1 {{'tosa.reduce_all' op illegal: requires any of [pro_int, pro_fp] but not enabled in target}}
59114
%0 = tosa.reduce_all %arg0 {axis = 0 : i32} : (tensor<13x21x3xi1>) -> tensor<1x21x3xi1>
60115
return %0 : tensor<1x21x3xi1>
61116
}
62117

118+
// -----
119+
func.func @test_reduce_any(%arg0: tensor<13x21x3xi1>) -> tensor<1x21x3xi1> {
120+
// expected-error@+1 {{'tosa.reduce_any' op illegal: requires any of [pro_int, pro_fp] but not enabled in target}}
121+
%0 = tosa.reduce_any %arg0 {axis = 0 : i32} : (tensor<13x21x3xi1>) -> tensor<1x21x3xi1>
122+
return %0 : tensor<1x21x3xi1>
123+
}
124+
63125
// -----
64126
func.func @test_concat(%arg0: tensor<13x21x3xf32>, %arg1: tensor<13x21x3xf32>) -> tensor<26x21x3xf32> {
65127
// expected-error@+1 {{'tosa.concat' op illegal: requires [pro_fp] but not enabled in target}}
66128
%0 = tosa.concat %arg0, %arg1 {axis = 0 : i32} : (tensor<13x21x3xf32>, tensor<13x21x3xf32>) -> tensor<26x21x3xf32>
67129
return %0 : tensor<26x21x3xf32>
68130
}
69131

132+
// -----
133+
func.func @test_concat(%arg0: tensor<13x21x3xi1>, %arg1: tensor<13x21x3xi1>) -> tensor<26x21x3xi1> {
134+
// expected-error@+1 {{'tosa.concat' op illegal: requires any of [pro_int, pro_fp] but not enabled in target}}
135+
%0 = tosa.concat %arg0, %arg1 {axis = 0 : i32} : (tensor<13x21x3xi1>, tensor<13x21x3xi1>) -> tensor<26x21x3xi1>
136+
return %0 : tensor<26x21x3xi1>
137+
}
138+
139+
// -----
140+
func.func @test_pad(%arg0: tensor<13x21x3xi1>) -> tensor<13x21x3xi1> {
141+
// expected-error@+1 {{'tosa.const_shape' op illegal: requires any of [pro_int, pro_fp] but not enabled in target}}
142+
%padding = tosa.const_shape {values = dense<0> : tensor<6xindex>} : () -> !tosa.shape<6>
143+
// expected-error@+1 {{'tosa.const' op illegal: requires any of [pro_int, pro_fp] but not enabled in target}}
144+
%pad_const = "tosa.const"() {values = dense<1> : tensor<1xi1>} : () -> tensor<1xi1>
145+
// expected-error@+1 {{'tosa.pad' op illegal: requires any of [pro_int, pro_fp] but not enabled in target}}
146+
%0 = tosa.pad %arg0, %padding, %pad_const : (tensor<13x21x3xi1>, !tosa.shape<6>, tensor<1xi1>) -> tensor<13x21x3xi1>
147+
return %0 : tensor<13x21x3xi1>
148+
}
149+
150+
// -----
151+
func.func @test_reshape(%arg0: tensor<13x21x3xi1>) -> tensor<1x819xi1> {
152+
// expected-error@+1 {{'tosa.const_shape' op illegal: requires any of [pro_int, pro_fp] but not enabled in target}}
153+
%1 = tosa.const_shape {values = dense<[1, 819]> : tensor<2xindex>} : () -> !tosa.shape<2>
154+
// expected-error@+1 {{'tosa.reshape' op illegal: requires any of [pro_int, pro_fp] but not enabled in target}}
155+
%0 = tosa.reshape %arg0, %1 : (tensor<13x21x3xi1>, !tosa.shape<2>) -> tensor<1x819xi1>
156+
return %0 : tensor<1x819xi1>
157+
}
158+
159+
// -----
160+
func.func @test_reverse(%arg0: tensor<13x21x3xi1>) -> tensor<13x21x3xi1> {
161+
// expected-error@+1 {{'tosa.reverse' op illegal: requires any of [pro_int, pro_fp] but not enabled in target}}
162+
%0 = tosa.reverse %arg0 {axis = 0 : i32} : (tensor<13x21x3xi1>) -> tensor<13x21x3xi1>
163+
return %0 : tensor<13x21x3xi1>
164+
}
165+
166+
// -----
167+
func.func @test_slice(%arg0: tensor<13x21x3xi1>) -> tensor<4x11x1xi1> {
168+
// expected-error@+1 {{'tosa.const_shape' op illegal: requires any of [pro_int, pro_fp] but not enabled in target}}
169+
%0 = tosa.const_shape {values = dense<[4, 11, 1]> : tensor<3xindex>} : () -> !tosa.shape<3>
170+
// expected-error@+1 {{'tosa.const_shape' op illegal: requires any of [pro_int, pro_fp] but not enabled in target}}
171+
%1 = tosa.const_shape {values = dense<[6, 8, 0]> : tensor<3xindex>} : () -> !tosa.shape<3>
172+
// expected-error@+1 {{'tosa.slice' op illegal: requires any of [pro_int, pro_fp] but not enabled in target}}
173+
%2 = tosa.slice %arg0, %0, %1 : (tensor<13x21x3xi1>, !tosa.shape<3>, !tosa.shape<3>) -> tensor<4x11x1xi1>
174+
return %2 : tensor<4x11x1xi1>
175+
}
176+
177+
// -----
178+
func.func @test_tile(%arg0: tensor<13x21x3xi1>) -> tensor<39x21x6xi1> {
179+
// expected-error@+1 {{'tosa.const_shape' op illegal: requires any of [pro_int, pro_fp] but not enabled in target}}
180+
%cst = tosa.const_shape { values = dense<[3, 1, 2]> : tensor<3xindex> } : () -> !tosa.shape<3>
181+
// expected-error@+1 {{'tosa.tile' op illegal: requires any of [pro_int, pro_fp] but not enabled in target}}
182+
%0 = tosa.tile %arg0, %cst: (tensor<13x21x3xi1>, !tosa.shape<3>) -> tensor<39x21x6xi1>
183+
return %0 : tensor<39x21x6xi1>
184+
}
185+
186+
// -----
187+
func.func @test_transpose(%arg0: tensor<13x21x3xi1>) -> tensor<3x13x21xi1> {
188+
// expected-error@+1 {{'tosa.transpose' op illegal: requires any of [pro_int, pro_fp] but not enabled in target}}
189+
%1 = tosa.transpose %arg0 {perms = array<i32: 2, 0, 1>} : (tensor<13x21x3xi1>) -> tensor<3x13x21xi1>
190+
return %1 : tensor<3x13x21xi1>
191+
}
70192
// -----
71193
func.func @test_cast_i32_f32(%arg0: tensor<13x21x3xi32>) -> tensor<13x21x3xf32> {
72194
// expected-error@+1 {{'tosa.cast' op illegal: requires [pro_fp] but not enabled in target}}

mlir/test/Dialect/Tosa/profile_pro_int_unsupported.mlir

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,9 @@ func.func @test_cast_i8_i32(%arg0: tensor<13x21x3xi32>) -> tensor<13x21x3xi8> {
2727

2828
// -----
2929
func.func @test_rescale(%arg0: tensor<13x21x3xi8>) -> tensor<13x21x3xi32> {
30-
// expected-error@+1 {{'tosa.const' op illegal: requires [pro_int] but not enabled in target}}
3130
%multiplier = "tosa.const"() {values = dense<1073741824> : tensor<1xi32>} : () -> tensor<1xi32>
32-
// expected-error@+1 {{'tosa.const' op illegal: requires [pro_int] but not enabled in target}}
3331
%shift = "tosa.const"() {values = dense<30> : tensor<1xi8>} : () -> tensor<1xi8>
34-
// expected-error@+1 {{'tosa.const' op illegal: requires [pro_int] but not enabled in target}}
3532
%input_zp = "tosa.const"() {values = dense<127> : tensor<1xi8>} : () -> tensor<1xi8>
36-
// expected-error@+1 {{'tosa.const' op illegal: requires [pro_int] but not enabled in target}}
3733
%output_zp = "tosa.const"() {values = dense<0> : tensor<1xi32>} : () -> tensor<1xi32>
3834
// expected-error@+1 {{'tosa.rescale' op illegal: requires [pro_int] but not enabled in target}}
3935
%0 = tosa.rescale %arg0, %multiplier, %shift, %input_zp, %output_zp {rounding_mode = "SINGLE_ROUND", scale32 = true, per_channel = false, input_unsigned = false, output_unsigned = false} : (tensor<13x21x3xi8>, tensor<1xi32>, tensor<1xi8>, tensor<1xi8>, tensor<1xi32>) -> tensor<13x21x3xi32>

0 commit comments

Comments
 (0)