This type supports a calibrated type with min, max provided. This will be used for importing calibration values of intermediate tensors (e.g. LSTM) which can't be imported with QuantStats op. This type was initially suggested in the following RFC: https://llvm.discourse.group/t/rfc-a-proposal-for-implementing-quantization-transformations-in-mlir/655 Reviewed By: stellaraccident Differential Revision: https://reviews.llvm.org/D91584
29 lines
980 B
MLIR
29 lines
980 B
MLIR
// RUN: mlir-opt %s -split-input-file -verify-diagnostics
|
|
|
|
// -----
|
|
// Unrecognized token: missing calibrated type maximum
|
|
// expected-error@+2 {{calibrated values must be present}}
|
|
// expected-error@+1 {{expected ':'}}
|
|
!qalias = type !quant.calibrated<f32<-0.998>>
|
|
|
|
// -----
|
|
// Unrecognized token: missing closing angle bracket
|
|
// expected-error@+1 {{expected '>'}}
|
|
!qalias = type !quant<"calibrated<f32<-0.998:1.232>">
|
|
|
|
// -----
|
|
// Unrecognized expressed type: integer type
|
|
// expected-error@+2 {{invalid kind of type specified}}
|
|
// expected-error@+1 {{expecting float expressed type}}
|
|
!qalias = type !quant.calibrated<i8<-4:3>>
|
|
|
|
// -----
|
|
// Illegal storage min/max: max - min < 0
|
|
// expected-error@+1 {{illegal min and max: (1.000000e+00:-1.000000e+00)}}
|
|
!qalias = type !quant.calibrated<f32<1.0:-1.0>>
|
|
|
|
// -----
|
|
// Illegal storage min/max: max - min == 0
|
|
// expected-error@+1 {{illegal min and max: (1.000000e+00:1.000000e+00)}}
|
|
!qalias = type !quant.calibrated<f32<1.0:1.0>>
|