My Project
|
Namespaces | |
detail | |
QuantizationFlags | |
Enumeration of bit-mapped flags related to quantized types. | |
QuantizationTypes | |
Classes | |
class | AnyQuantizedType |
struct | ExpressedToQuantizedConverter |
class | QuantizationDialect |
Defines the 'Quantization' dialect. More... | |
class | QuantizedType |
class | UniformQuantizedPerAxisType |
class | UniformQuantizedPerAxisValueConverter |
class | UniformQuantizedType |
class | UniformQuantizedValueConverter |
Functions | |
UniformQuantizedType | fakeQuantAttrsToType (Location loc, unsigned numBits, double rmin, double rmax, bool narrowRange, Type expressedType, bool isSigned=false) |
UniformQuantizedPerAxisType | fakeQuantAttrsToType (Location loc, unsigned numBits, int32_t quantizedDimension, ArrayRef< double > rmins, ArrayRef< double > rmax, bool narrowRange, Type expressedType, bool isSigned=false) |
std::unique_ptr< OpPassBase< FuncOp > > | createConvertSimulatedQuantPass () |
std::unique_ptr< OpPassBase< FuncOp > > | createConvertConstPass () |
Attribute | quantizeAttr (Attribute realValue, QuantizedType quantizedElementType, Type &outConvertedType) |
Attribute | quantizeAttrUniform (Attribute realValue, UniformQuantizedType quantizedElementType, const UniformQuantizedValueConverter &converter, Type &outConvertedType) |
std::unique_ptr< OpPassBase< FuncOp > > mlir::quant::createConvertConstPass | ( | ) |
Creates a pass that converts constants followed by a qbarrier to a constant whose value is quantized. This is typically one of the last passes done when lowering to express actual quantized arithmetic in a low level representation. Because it modifies the constant, it is destructive and cannot be undone.
std::unique_ptr< OpPassBase< FuncOp > > mlir::quant::createConvertSimulatedQuantPass | ( | ) |
Creates a pass that converts quantization simulation operations (i.e. FakeQuant and those like it) to casts into/out of supported QuantizedTypes.
UniformQuantizedType mlir::quant::fakeQuantAttrsToType | ( | Location | loc, |
unsigned | numBits, | ||
double | rmin, | ||
double | rmax, | ||
bool | narrowRange, | ||
Type | expressedType, | ||
bool | isSigned = false |
||
) |
Converts per-layer FakeQuant attributes to the corresponding type. In the event that the parameters cannot be converted, returns a nullptr convertible Type and issues an appropriate error. Note that there are multiple variants of a per-layer FakeQuant op, so this function takes the attributes discretely vs taking a reference to the originating op.
UniformQuantizedPerAxisType mlir::quant::fakeQuantAttrsToType | ( | Location | loc, |
unsigned | numBits, | ||
int32_t | quantizedDimension, | ||
ArrayRef< double > | rmins, | ||
ArrayRef< double > | rmax, | ||
bool | narrowRange, | ||
Type | expressedType, | ||
bool | isSigned = false |
||
) |
Converts per-channel FakeQuant attributes to the corresponding type. In the event that the parameters cannot be converted, returns a nullptr convertible Type and issues an appropriate error.
Attribute mlir::quant::quantizeAttr | ( | Attribute | realValue, |
QuantizedType | quantizedElementType, | ||
Type & | outConvertedType | ||
) |
Converts an attribute from a type based on quantizedElementType.getExpressedType() to one based on quantizedElementType.getStorageType(), where quantizedElementType is as from QuantizedType::getQuantizedElementType(). Returns nullptr if the conversion is not supported. On success, stores the converted type in outConvertedType.
Examples:
Convert an attribute from a type based on quantizedElementType.getExpressedType() to one based on quantizedElementType.getStorageType(). Returns nullptr if the conversion is not supported. On success, stores the converted type in outConvertedType.
Attribute mlir::quant::quantizeAttrUniform | ( | Attribute | realValue, |
UniformQuantizedType | quantizedElementType, | ||
const UniformQuantizedValueConverter & | converter, | ||
Type & | outConvertedType | ||
) |
Converts an attribute from a type based on quantizedElementType.getExpressedType() to one based on quantizedElementType.getStorageType(), where quantizedElementType is as from QuantizedType::getQuantizedElementType() and casted to an UniformQuantizedType. Returns nullptr if the conversion is not supported. On success, stores the converted type in outConvertedType.
Examples:
Converts a real expressed Attribute to a corresponding Attribute containing quantized storage values assuming the given uniform quantizedElementType and converter.