[Mlir-commits] [mlir] 36878b5 - [TOSA] Remove i64 from valid element datatypes in validation (#113380)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Fri Nov 1 03:12:46 PDT 2024
Author: Luke Hutton
Date: 2024-11-01T10:12:43Z
New Revision: 36878b55421734c41b0fdb77f9708701a4c7812a
URL: https://github.com/llvm/llvm-project/commit/36878b55421734c41b0fdb77f9708701a4c7812a
DIFF: https://github.com/llvm/llvm-project/commit/36878b55421734c41b0fdb77f9708701a4c7812a.diff
LOG: [TOSA] Remove i64 from valid element datatypes in validation (#113380)
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 <luke.hutton at arm.com>
Added:
Modified:
mlir/lib/Dialect/Tosa/Transforms/TosaValidation.cpp
mlir/test/Dialect/Tosa/invalid.mlir
Removed:
################################################################################
diff --git a/mlir/lib/Dialect/Tosa/Transforms/TosaValidation.cpp b/mlir/lib/Dialect/Tosa/Transforms/TosaValidation.cpp
index e390a613b58077..93e8cac6b84e9c 100644
--- a/mlir/lib/Dialect/Tosa/Transforms/TosaValidation.cpp
+++ b/mlir/lib/Dialect/Tosa/Transforms/TosaValidation.cpp
@@ -543,7 +543,6 @@ bool TosaValidation::isValidElementType(Type type) {
case 16:
case 32:
case 48:
- case 64:
return true;
default:
return false;
diff --git a/mlir/test/Dialect/Tosa/invalid.mlir b/mlir/test/Dialect/Tosa/invalid.mlir
index f1b1707a0c40d9..c7a1e9b8770914 100644
--- a/mlir/test/Dialect/Tosa/invalid.mlir
+++ b/mlir/test/Dialect/Tosa/invalid.mlir
@@ -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 at +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 at +1 {{'func.return' op is not profile-aligned: element type 'i64' is not legal}}
+ return %0 : tensor<1x13x13xi64>
+}
More information about the Mlir-commits
mailing list