[Mlir-commits] [mlir] [MLIR][TosaValidation] Enable float element-types on default (PR #114376)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Thu Oct 31 05:22:05 PDT 2024


https://github.com/miritb updated https://github.com/llvm/llvm-project/pull/114376

>From 486ca714cffd7d34cd17001eef5debb39b6a7c5a Mon Sep 17 00:00:00 2001
From: Mirit Berg <mirit.berg at mobileye.com>
Date: Thu, 31 Oct 2024 10:26:44 +0200
Subject: [PATCH] [mlir][tosa]: Enable float element-types on default in
 TosaValidation

After change in tosa-validation profiles to list-option, float element
types where no more allowed in default (where profile is/contains
undefined enumeration value). This change allows floats when undefined
value is contained in the profile.
---
 mlir/lib/Dialect/Tosa/Transforms/TosaValidation.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/mlir/lib/Dialect/Tosa/Transforms/TosaValidation.cpp b/mlir/lib/Dialect/Tosa/Transforms/TosaValidation.cpp
index e390a613b58077..03240fb96c3ab7 100644
--- a/mlir/lib/Dialect/Tosa/Transforms/TosaValidation.cpp
+++ b/mlir/lib/Dialect/Tosa/Transforms/TosaValidation.cpp
@@ -521,7 +521,8 @@ LogicalResult TosaValidation::applyVariableCheck(Operation *op) {
 
 bool TosaValidation::isValidElementType(Type type) {
   if (isa<FloatType>(type)) {
-    if (!isEnabledProfile(TosaProfileEnum::MainInference))
+    if (!isEnabledProfile(TosaProfileEnum::Undefined) &&
+        !isEnabledProfile(TosaProfileEnum::MainInference))
       return false;
     return type.isF32() || type.isF16() || type.isBF16();
   }



More information about the Mlir-commits mailing list