| /llvm-project-15.0.7/mlir/test/Dialect/Quant/ |
| H A D | convert-const.mlir | 17 %1 = "quant.qcast"(%cst) : (tensor<4xf32>) -> tensor<4x!quant.uniform<u8:f32, 7.812500e-03:128>> 18 %2 = "quant.dcast"(%1) : (tensor<4x!quant.uniform<u8:f32, 7.812500e-03:128>>) -> (tensor<4xf32>) 41 %1 = "quant.qcast"(%cst) : (tensor<4xf32>) -> tensor<4x!quant.uniform<i8:f32, 7.812500e-03>> 42 %2 = "quant.dcast"(%1) : (tensor<4x!quant.uniform<i8:f32, 7.812500e-03>>) -> (tensor<4xf32>) 87 // CHECK-NEXT: %0 = "quant.scast"(%c64_i8) : (i8) -> !quant.uniform<i8:f32, 7.812500e-03> 89 %1 = "quant.qcast"(%cst) : (f32) -> !quant.uniform<i8:f32, 7.812500e-03> 90 %2 = "quant.dcast"(%1) : (!quant.uniform<i8:f32, 7.812500e-03>) -> (f32) 156 %1 = "quant.qcast"(%cst) : (tensor<7xf32>) -> tensor<7x!quant.uniform<i8:f32, 1.0>> 157 %2 = "quant.dcast"(%1) : (tensor<7x!quant.uniform<i8:f32, 1.0>>) -> (tensor<7xf32>) 164 %5 = "quant.qcast"(%cst1) : (tensor<7xf32>) -> tensor<7x!quant.uniform<u8:f32, 1.0>> [all …]
|
| H A D | convert-fakequant.mlir | 10 // CHECK-NEXT: "quant.dcast"(%[[qc]]) : (tensor<8x4x3x!quant.uniform<u8:f32, 1.000000e+00>>) 12 %0 = "quant.const_fake_quant"(%arg0) { 25 …// CHECK-NEXT: "quant.dcast"(%[[qc]]) : (tensor<8x4x3x!quant.uniform<u8<1:255>:f32, 1.000000e+00:1… 27 %0 = "quant.const_fake_quant"(%arg0) { 40 …// CHECK-NEXT: %1 = "quant.dcast"(%0) : (tensor<8x4x3x!quant.uniform<u8:f32, 0.0039215686274509803… 42 %0 = "quant.const_fake_quant"(%arg0) { 70 // CHECK-NEXT: %1 = "quant.dcast"(%0) : (tensor<8x4x3x!quant.uniform<u8:f32, 7.812500e-03:128>>) 85 // CHECK-NEXT: "quant.dcast"(%[[qc]]) : (tensor<8x4x3x!quant.uniform<i8:f32, 1.000000e+00:-128>>) 145 // CHECK-NEXT: %1 = "quant.dcast"(%0) : (tensor<8x4x3x!quant.uniform<i8:f32, 7.812500e-03>>) 161 // CHECK-NEXT: %1 = "quant.dcast"(%0) : (tensor<8x4x3x!quant.uniform<i16:f32, 3.0517578125E-5>>) [all …]
|
| H A D | quant_region.mlir | 5 %0 = "quant.region"(%arg0, %arg1, %arg2) ({ 17 %0 = "quant.region"(%arg0, %arg1, %arg2) ({ 22 }) {input_specs = [!quant.uniform<i8:f32, 1.0>, !quant.uniform<i8:f32, 2.0>, f32], 35 …}) {input_specs = [!quant.uniform<i8:f32, 1.0>, !quant.uniform<i8:f32, 2.0>, !quant.uniform<i32:f3… 50 …}) {input_specs = [!quant.uniform<i8:f32, 1.0>, !quant.uniform<i8:f32, 2.0>, !quant.uniform<i32:f1… 65 }) {input_specs = [!quant.uniform<i8:f32, 1.0>, !quant.uniform<i8:f32, 2.0>, i32], 80 …}) {input_specs = [!quant.uniform<i8:f32, 1.0>, !quant.uniform<i8:f32, 2.0>, !quant.uniform<i8:f32… 95 …}) {input_specs = [!quant.uniform<i8:f32, 1.0>, !quant.uniform<i8:f32, 2.0>, !quant.uniform<i32:f3… 110 }) {input_specs = [!quant.uniform<i8:f32, 1.0>, !quant.uniform<i8:f32, 2.0>], 120 %0 = "quant.region"(%arg0, %arg1) ({ [all …]
|
| H A D | parse-uniform.mlir | 26 !qalias = !quant.uniform<u8:f32, 0.99872> 35 !qalias = !quant.uniform<u8:f32, 2.0e-2> 44 !qalias = !quant.uniform<u8:f32, 2.0e+2> 53 !qalias = !quant.uniform<i16:f32, 2.0e+2> 62 !qalias = !quant.uniform<u16:f32, 2.0e+2> 71 !qalias = !quant.uniform<i32:f32, 2.0e+2> 80 !qalias = !quant.uniform<u32:f32, 2.0e+2> 89 !qalias = !quant.uniform<u8:f32, 2.0e+2> 107 !qalias = !quant.uniform<u8:f16, 2.0e+2> 116 !qalias = !quant.uniform<u8:f64, 2.0e+2> [all …]
|
| H A D | parse-uniform-invalid.mlir | 6 !qalias = !quant.foobar 11 !qalias = !quant.__ 21 !qalias = !quant.uniform<i8<16>:f32, 0.99872:127> 26 !qalias = !quant<uniform<i8<-4:3:f32, 0.99872:127>> 31 !qalias = !quant.uniform<i8<-4:3>f32, 0.99872:127> 36 !qalias = !quant.uniform<i8<-4:3>:f32 0.99872:127> 51 !qalias = !quant.uniform<i33:f32, 0.99872:127> 86 !qalias = !quant.uniform<i8<-4:3>:f32, abc:127> 91 !qalias = !quant.uniform<i8<-4:3>:f32, 0.1abc> 96 !qalias = !quant.uniform<i8<-4:3>:f32, 0.1:> [all …]
|
| H A D | parse-any-invalid.mlir | 6 !qalias = !quant.any<i8<16>:f32> 11 !qalias = !quant<any<i8<-4:3:f32>> 16 !qalias = !quant.any<i8<-4:3>f32> 21 !qalias = !quant.any<int8<-4:3>:f32> 26 !qalias = !quant.any<i<-4:3>:f32> 31 !qalias = !quant.any<i33:f32> 36 !qalias = !quant.any<i1024<-4:3>:f32> 46 !qalias = !quant.any<i8<2:1>:f32> 51 !qalias = !quant.any<i8<1:1>:f32> 56 !qalias = !quant.any<i4<-1:9>:f32> [all …]
|
| H A D | parse-ops.mlir | 6 %0 = "quant.const_fake_quant"(%arg0) { 9 %1 = "quant.const_fake_quant"(%0) { 12 %2 = "quant.const_fake_quant"(%1) { 21 %0 = "quant.const_fake_quant_per_axis"(%arg0) { 24 %1 = "quant.const_fake_quant_per_axis"(%0) { 27 %2 = "quant.const_fake_quant_per_axis"(%1) { 36 %0 = "quant.stats_ref"(%arg0) { statsKey = "foobar" } : 44 %0 = "quant.stats"(%arg0) { 47 %1 = "quant.stats"(%0) { 61 %0 = "quant.coupled_ref"(%arg0) { coupledKey = "foobar" } :
|
| H A D | canonicalize.mlir | 9 %1 = "quant.scast"(%cst) : (tensor<4xi8>) -> tensor<4x!quant.uniform<u8:f32, 7.812500e-03:128>> 10 %2 = "quant.scast"(%1) : (tensor<4x!quant.uniform<u8:f32, 7.812500e-03:128>>) -> tensor<4xi8> 17 func.func @non_redundant_scast() -> tensor<4x!quant.uniform<u8:f32, 7.812500e-03:128>> { 22 %1 = "quant.scast"(%cst) : (tensor<4xi8>) -> tensor<4x!quant.uniform<u8:f32, 7.812500e-03:128>> 23 return %1 : tensor<4x!quant.uniform<u8:f32, 7.812500e-03:128>>
|
| H A D | parse-any.mlir | 5 // CHECK: !quant.any<i8<-8:7>:f32> 6 !qalias = !quant.any<i8<-8:7>:f32> 14 // CHECK: !quant.any<i8<-8:7>> 15 !qalias = !quant.any<i8<-8:7>> 23 // CHECK: !quant.any<i8> 24 !qalias = !quant.any<i8>
|
| H A D | parse-calibrated-invalid.mlir | 7 !qalias = !quant.calibrated<f32<-0.998>> 12 !qalias = !quant.calibrated<f32<-0.998:1.232> 18 !qalias = !quant.calibrated<i8<-4:3>> 23 !qalias = !quant.calibrated<f32<1.0:-1.0>> 28 !qalias = !quant.calibrated<f32<1.0:1.0>>
|
| H A D | parse-ops-invalid.mlir | 7 %0 = "quant.stats"(%arg0) { 17 %0 = "quant.stats"(%arg0) { 27 %0 = "quant.stats"(%arg0) { 37 %0 = "quant.stats"(%0) { 52 %0 = "quant.stats"(%arg0) { 68 %0 = "quant.stats"(%arg0) { 82 %1 = "quant.stats"(%arg0) {
|
| H A D | parse-calibrated.mlir | 5 // CHECK: !quant.calibrated<f32<-0.998:1.232100e+00> 6 !qalias = !quant.calibrated<f32<-0.998:1.2321>>
|
| H A D | convert-fakequant-invalid.mlir | 1 // RUN: mlir-opt %s -split-input-file -verify-diagnostics -quant-convert-simulated-quantization 8 %0 = "quant.const_fake_quant"(%arg0) {
|
| /llvm-project-15.0.7/mlir/lib/CAPI/Dialect/ |
| H A D | Quant.cpp | 16 MLIR_DEFINE_CAPI_DIALECT_REGISTRATION(quant, quant, quant::QuantizationDialect) in MLIR_DEFINE_CAPI_DIALECT_REGISTRATION() argument 23 return unwrap(type).isa<quant::QuantizedType>(); in MLIR_DEFINE_CAPI_DIALECT_REGISTRATION() 27 return quant::QuantizationFlags::Signed; in mlirQuantizedTypeGetSignedFlag() 68 .cast<quant::QuantizedType>() in mlirQuantizedTypeGetStorageTypeIntegralWidth() 90 unwrap(type).cast<quant::QuantizedType>())); in mlirQuantizedTypeCastToStorageType() 115 return unwrap(type).isa<quant::AnyQuantizedType>(); in mlirTypeIsAAnyQuantizedType() 138 return wrap(quant::UniformQuantizedType::get( in mlirUniformQuantizedTypeGet() 176 .cast<quant::UniformQuantizedPerAxisType>() in mlirUniformQuantizedPerAxisTypeGetNumDims() 183 .cast<quant::UniformQuantizedPerAxisType>() in mlirUniformQuantizedPerAxisTypeGetScale() 190 .cast<quant::UniformQuantizedPerAxisType>() in mlirUniformQuantizedPerAxisTypeGetZeroPoint() [all …]
|
| /llvm-project-15.0.7/mlir/test/python/dialects/ |
| H A D | quant.py | 4 from mlir.dialects import quant 23 assert not quant.QuantizedType.isinstance(i8) 24 assert quant.QuantizedType.isinstance(any) 25 assert quant.QuantizedType.isinstance(uniform) 26 assert quant.QuantizedType.isinstance(per_axis) 27 assert quant.QuantizedType.isinstance(calibrated) 29 assert quant.AnyQuantizedType.isinstance(any) 44 any = quant.AnyQuantizedType.get(quant.QuantizedType.FLAG_SIGNED, i8, f32, 74 uniform = quant.UniformQuantizedType.get( 94 per_axis = quant.UniformQuantizedPerAxisType.get( [all …]
|
| /llvm-project-15.0.7/mlir/test/Dialect/Tosa/ |
| H A D | quant-test.mlir | 1 // RUN: mlir-opt --tosa-test-quant-utils %s | FileCheck %s 5 …ild_qtype(%arg0 : tensor<16x1x1x8x!quant.uniform<u8<1:255>:f32, 0.015680249780416489:128>>) -> ten… 7 …negate"(%arg0) : (tensor<16x1x1x8x!quant.uniform<u8<1:255>:f32, 0.015680249780416489:128>>) -> ten… 8 return %0 : tensor<16x1x1x8x!quant.uniform<u8<1:255>:f32, 0.015680249780416489:128>> 13 …quant.uniform<i8:f32, 0.015684768557548523>>, %arg1 : tensor<16x1x1x8x!quant.uniform<i8<-127:127>:… 15 …quant.uniform<i8:f32, 0.015684768557548523>>, tensor<16x1x1x8x!quant.uniform<i8<-127:127>:f32, 0.0… 16 return %0 : tensor<1x32x32x16x!quant.uniform<i8:f32, 0.078431375324726104>>
|
| H A D | ops.mlir | 35 ….func @test_avg_pool2d_q8(%arg0: tensor<1x7x7x9x!quant.uniform<i8:f32, 0.01>>) -> tensor<1x7x7x9x!… 36 …0, 1, 0, 1], stride = [1, 1]} : (tensor<1x7x7x9x!quant.uniform<i8:f32, 0.01>>) -> tensor<1x7x7x9x!… 37 return %0 : tensor<1x7x7x9x!quant.uniform<i8:f32, 0.01>> 225 …nc @main(%arg0: tensor<64xi32>, %arg1: tensor<513x!quant.uniform<i16:f32, 1.0:0>>) -> tensor<64x!q… 226 …able"(%arg0, %arg1) : (tensor<64xi32>, tensor<513x!quant.uniform<i16:f32, 1.0:0>>) -> tensor<64x!q… 227 return %0 : tensor<64x!quant.uniform<i16:f32, 1.0:0>> 473 …%0 = "tosa.cast"(%arg0) : (tensor<13x21x3xi32>) -> tensor<13x21x3x!quant.uniform<u8:f32, 0.0784313… 474 return %0 : tensor<13x21x3x!quant.uniform<u8:f32, 0.078431375324726104:128>> 481 return %0 : tensor<13x21x3x!quant.uniform<i16:f32, 0.078431375324726104:128>> 486 …c @test_rescale(%arg0: tensor<13x21x3x!quant.uniform<u8:f32, 0.015655439347028732:127>>) -> tensor… [all …]
|
| /llvm-project-15.0.7/mlir/include/mlir/Dialect/Quant/ |
| H A D | Passes.td | 14 def QuantConvertConst : Pass<"quant-convert-const", "func::FuncOp"> { 17 let constructor = "mlir::quant::createConvertConstPass()"; 21 : Pass<"quant-convert-simulated-quantization", "func::FuncOp"> { 24 let constructor = "mlir::quant::createConvertSimulatedQuantPass()";
|
| H A D | QuantOpsBase.td | 19 let name = "quant"; 20 let cppNamespace = "::mlir::quant"; 39 Type<CPred<"$_self.isa<mlir::quant::QuantizedType>()">, "QuantizedType">;
|
| /llvm-project-15.0.7/mlir/lib/Dialect/Tosa/Utils/ |
| H A D | QuantUtils.cpp | 107 ((input_type).getElementType().dyn_cast<quant::UniformQuantizedType>()) 109 ((input_type).getElementType().dyn_cast<quant::QuantizedType>()) 128 .dyn_cast<quant::UniformQuantizedPerAxisType>(); in buildConvOpQuantizationAttr() 272 quant::QuantizedType retType; in buildQTypeFromMinMax() 275 quant::ExpressedToQuantizedConverter::forInputType(inputDType); in buildQTypeFromMinMax() 308 retType = quant::fakeQuantAttrsToType( in buildQTypeFromMinMax() 316 retType = quant::fakeQuantAttrsToType( in buildQTypeFromMinMax()
|
| /llvm-project-15.0.7/mlir/test/lib/Dialect/Tosa/ |
| H A D | TosaTestPasses.cpp | 58 outputType.getElementType().dyn_cast<mlir::quant::UniformQuantizedType>(); in matchAndRewrite() 135 inputType.getElementType().dyn_cast<mlir::quant::UniformQuantizedType>(); in matchAndRewrite() 137 weightType.getElementType().dyn_cast<mlir::quant::UniformQuantizedType>(); in matchAndRewrite() 139 outputType.getElementType().dyn_cast<mlir::quant::UniformQuantizedType>(); in matchAndRewrite()
|
| /llvm-project-15.0.7/mlir/lib/Dialect/Quant/Utils/ |
| H A D | QuantizeUtils.cpp | 15 using namespace mlir::quant; 99 Attribute mlir::quant::quantizeAttrUniform( in quantizeAttrUniform() 127 Attribute mlir::quant::quantizeAttr(Attribute realValue, in quantizeAttr()
|
| H A D | FakeQuantSupport.cpp | 13 using namespace mlir::quant; 108 mlir::quant::fakeQuantAttrsToType(Location loc, unsigned numBits, double rmin, in fakeQuantAttrsToType() 139 UniformQuantizedPerAxisType mlir::quant::fakeQuantAttrsToType( in fakeQuantAttrsToType()
|
| /llvm-project-15.0.7/mlir/lib/Dialect/Quant/Transforms/ |
| H A D | ConvertConst.cpp | 20 using namespace mlir::quant; 102 mlir::quant::createConvertConstPass() { in createConvertConstPass()
|
| /llvm-project-15.0.7/mlir/test/CAPI/ |
| H A D | CMakeLists.txt | 65 _add_capi_test_executable(mlir-capi-quant-test 66 quant.c
|