[Mlir-commits] [mlir] 4a899a3 - [TOSA] Add QuantizationDialect to TOSA's dependentDialects

Eric Kunze llvmlistbot at llvm.org
Mon May 15 15:14:03 PDT 2023


Author: Tai Ly
Date: 2023-05-15T15:09:02-07:00
New Revision: 4a899a35182be83ba46ae7906f0ce80ae800ef35

URL: https://github.com/llvm/llvm-project/commit/4a899a35182be83ba46ae7906f0ce80ae800ef35
DIFF: https://github.com/llvm/llvm-project/commit/4a899a35182be83ba46ae7906f0ce80ae800ef35.diff

LOG: [TOSA] Add QuantizationDialect to TOSA's dependentDialects

This adds QuantizationDialect to the dependent dialects of TOSA
This fixes the intermittent bug when creating uniform quantized type when none was parsed in.

LLVM ERROR: can't create type 'mlir::quant::UniformQuantizedType' because storage uniquer isn't initialized: the dialect was likely not loaded, or the type wasn't added with addTypes<...>() in the Dialect::initialize() method.

This happens, for example, in convert-tfl-uint8 pass when trying to create uniform quantized type i8 with zero-point=-128 to convert from ui8 type.

Signed-off-by: Tai Ly <tai.ly at arm.com>
Change-Id: I204248a45fd728d0cec8dc20214cb0b74de81e7b

Reviewed By: eric-k256

Differential Revision: https://reviews.llvm.org/D149354

Added: 
    

Modified: 
    mlir/include/mlir/Dialect/Tosa/IR/TosaOpBase.td

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/Dialect/Tosa/IR/TosaOpBase.td b/mlir/include/mlir/Dialect/Tosa/IR/TosaOpBase.td
index 5d25f8d0a4041..41fbdcaea0956 100644
--- a/mlir/include/mlir/Dialect/Tosa/IR/TosaOpBase.td
+++ b/mlir/include/mlir/Dialect/Tosa/IR/TosaOpBase.td
@@ -40,7 +40,7 @@ def Tosa_Dialect : Dialect {
     there will be tools to lower from the ML frameworks into TOSA.
   }];
 
-  let dependentDialects = ["tensor::TensorDialect"];
+  let dependentDialects = ["tensor::TensorDialect", "quant::QuantizationDialect"];
 
   let cppNamespace = "mlir::tosa";
   let hasConstantMaterializer = 1;


        


More information about the Mlir-commits mailing list