Skip to content

Commit

Permalink
[TOSA] Remove i64 from valid element datatypes in validation (llvm#11…
Browse files Browse the repository at this point in the history
…3380)

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.

Signed-off-by: Luke Hutton <[email protected]>
  • Loading branch information
lhutton1 authored and smallp-o-p committed Nov 3, 2024
1 parent e38ca25 commit 399f87e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 0 additions & 1 deletion mlir/lib/Dialect/Tosa/Transforms/TosaValidation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,6 @@ bool TosaValidation::isValidElementType(Type type) {
case 16:
case 32:
case 48:
case 64:
return true;
default:
return false;
Expand Down
10 changes: 10 additions & 0 deletions mlir/test/Dialect/Tosa/invalid.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -618,3 +618,13 @@ func.func @test_mul_invalid_shift(%arg0: tensor<13x21x3xf32>, %arg1: tensor<13x1
%0 = tosa.mul %arg0, %arg1 {shift = 1 : i8} : (tensor<13x21x3xf32>, tensor<13x1x3xf32>) -> tensor<13x21x3xf32>
return %0 : tensor<13x21x3xf32>
}

// -----

// CHECK-LABEL: test_unsupported_int64_data_type
func.func @test_unsupported_int64_data_type(%arg0: tensor<1x13x13x5xf32>) -> tensor<1x13x13xi64> {
// expected-error@+1 {{'tosa.argmax' op is not profile-aligned: element type 'i64' is not legal}}
%0 = tosa.argmax %arg0 {axis = 3 : i32} : (tensor<1x13x13x5xf32>) -> tensor<1x13x13xi64>
// expected-error@+1 {{'func.return' op is not profile-aligned: element type 'i64' is not legal}}
return %0 : tensor<1x13x13xi64>
}

0 comments on commit 399f87e

Please sign in to comment.