Skip to content

Commit 6a1c0df

Browse files
committed
[TOSA] Remove i64 from valid element datatypes in validation
Align the validation pass valid element datatypes check more closely to the specification by removing i64 as a supported datatype. The spec does not currently support it. Change-Id: I38b386ee53da168e85a8b6fe4c8378cfbd8f2fe4 Signed-off-by: Luke Hutton <[email protected]>
1 parent 06d1929 commit 6a1c0df

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,6 @@ bool TosaValidation::isValidElementType(Type type) {
543543
case 16:
544544
case 32:
545545
case 48:
546-
case 64:
547546
return true;
548547
default:
549548
return false;

mlir/test/Dialect/Tosa/invalid.mlir

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -609,3 +609,13 @@ func.func @test_transpose_conv2d_invalid_outshape(%arg0: tensor<1x32x32x8xf32>,
609609
%0 = tosa.transpose_conv2d %arg0, %arg1, %arg2 {out_pad = array<i64: 0, 0, 0, 0>, out_shape = array<i64: 1, 32, 32>, stride = array<i64: 1, 1>} : (tensor<1x32x32x8xf32>, tensor<16x1x1x8xf32>, tensor<16xf32>) -> tensor<1x32x32x16xf32>
610610
return %0 : tensor<1x32x32x16xf32>
611611
}
612+
613+
// -----
614+
615+
// CHECK-LABEL: test_unsupported_int64_data_type
616+
func.func @test_unsupported_int64_data_type(%arg0: tensor<1x13x13x5xf32>) -> tensor<1x13x13xi64> {
617+
// expected-error@+1 {{'tosa.argmax' op is not profile-aligned: element type 'i64' is not legal}}
618+
%0 = tosa.argmax %arg0 {axis = 3 : i32} : (tensor<1x13x13x5xf32>) -> tensor<1x13x13xi64>
619+
// expected-error@+1 {{'func.return' op is not profile-aligned: element type 'i64' is not legal}}
620+
return %0 : tensor<1x13x13xi64>
621+
}

0 commit comments

Comments
 (0)