[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:01:57 PDT 2024


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

>From 1777df39df129e3659c80517e11e75c1a4da958c 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][TosaValidation] Enable float element-types on default
 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 | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

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



More information about the Mlir-commits mailing list