Documentation
¶
Index ¶
- Variables
- type CustomQuantizationMethod
- func (*CustomQuantizationMethod) Descriptor() ([]byte, []int)deprecated
- func (x *CustomQuantizationMethod) GetQuantizationComponentSpec() []*QuantizationComponentSpec
- func (*CustomQuantizationMethod) ProtoMessage()
- func (x *CustomQuantizationMethod) ProtoReflect() protoreflect.Message
- func (x *CustomQuantizationMethod) Reset()
- func (x *CustomQuantizationMethod) String() string
- type PresetQuantizationMethod
- func (*PresetQuantizationMethod) Descriptor() ([]byte, []int)deprecated
- func (x *PresetQuantizationMethod) GetPresetMethod() PresetQuantizationMethod_PresetMethod
- func (*PresetQuantizationMethod) ProtoMessage()
- func (x *PresetQuantizationMethod) ProtoReflect() protoreflect.Message
- func (x *PresetQuantizationMethod) Reset()
- func (x *PresetQuantizationMethod) String() string
- type PresetQuantizationMethod_PresetMethod
- func (PresetQuantizationMethod_PresetMethod) Descriptor() protoreflect.EnumDescriptor
- func (x PresetQuantizationMethod_PresetMethod) Enum() *PresetQuantizationMethod_PresetMethod
- func (PresetQuantizationMethod_PresetMethod) EnumDescriptor() ([]byte, []int)deprecated
- func (x PresetQuantizationMethod_PresetMethod) Number() protoreflect.EnumNumber
- func (x PresetQuantizationMethod_PresetMethod) String() string
- func (PresetQuantizationMethod_PresetMethod) Type() protoreflect.EnumType
- type QuantizationComponentSpec
- func (*QuantizationComponentSpec) Descriptor() ([]byte, []int)deprecated
- func (x *QuantizationComponentSpec) GetBitType() QuantizationComponentSpec_BitType
- func (x *QuantizationComponentSpec) GetBitWidth() QuantizationComponentSpec_BitWidth
- func (x *QuantizationComponentSpec) GetEnableNarrowRange() bool
- func (x *QuantizationComponentSpec) GetEnablePerChannelQuantization() bool
- func (x *QuantizationComponentSpec) GetEnableSymmetric() bool
- func (x *QuantizationComponentSpec) GetQuantizationComponent() QuantizationComponentSpec_QuantizationComponent
- func (*QuantizationComponentSpec) ProtoMessage()
- func (x *QuantizationComponentSpec) ProtoReflect() protoreflect.Message
- func (x *QuantizationComponentSpec) Reset()
- func (x *QuantizationComponentSpec) String() string
- type QuantizationComponentSpec_BitType
- func (QuantizationComponentSpec_BitType) Descriptor() protoreflect.EnumDescriptor
- func (x QuantizationComponentSpec_BitType) Enum() *QuantizationComponentSpec_BitType
- func (QuantizationComponentSpec_BitType) EnumDescriptor() ([]byte, []int)deprecated
- func (x QuantizationComponentSpec_BitType) Number() protoreflect.EnumNumber
- func (x QuantizationComponentSpec_BitType) String() string
- func (QuantizationComponentSpec_BitType) Type() protoreflect.EnumType
- type QuantizationComponentSpec_BitWidth
- func (QuantizationComponentSpec_BitWidth) Descriptor() protoreflect.EnumDescriptor
- func (x QuantizationComponentSpec_BitWidth) Enum() *QuantizationComponentSpec_BitWidth
- func (QuantizationComponentSpec_BitWidth) EnumDescriptor() ([]byte, []int)deprecated
- func (x QuantizationComponentSpec_BitWidth) Number() protoreflect.EnumNumber
- func (x QuantizationComponentSpec_BitWidth) String() string
- func (QuantizationComponentSpec_BitWidth) Type() protoreflect.EnumType
- type QuantizationComponentSpec_QuantizationComponent
- func (QuantizationComponentSpec_QuantizationComponent) Descriptor() protoreflect.EnumDescriptor
- func (x QuantizationComponentSpec_QuantizationComponent) Enum() *QuantizationComponentSpec_QuantizationComponent
- func (QuantizationComponentSpec_QuantizationComponent) EnumDescriptor() ([]byte, []int)deprecated
- func (x QuantizationComponentSpec_QuantizationComponent) Number() protoreflect.EnumNumber
- func (x QuantizationComponentSpec_QuantizationComponent) String() string
- func (QuantizationComponentSpec_QuantizationComponent) Type() protoreflect.EnumType
- type QuantizationMethod
- func (*QuantizationMethod) Descriptor() ([]byte, []int)deprecated
- func (x *QuantizationMethod) GetCustomQuantizationMethod() *CustomQuantizationMethod
- func (x *QuantizationMethod) GetPresetQuantizationMethod() *PresetQuantizationMethod
- func (m *QuantizationMethod) GetQuantizationMethod() isQuantizationMethod_QuantizationMethod
- func (*QuantizationMethod) ProtoMessage()
- func (x *QuantizationMethod) ProtoReflect() protoreflect.Message
- func (x *QuantizationMethod) Reset()
- func (x *QuantizationMethod) String() string
- type QuantizationMethod_CustomQuantizationMethod
- type QuantizationMethod_PresetQuantizationMethod
- type QuantizationOptions
- func (*QuantizationOptions) Descriptor() ([]byte, []int)deprecated
- func (x *QuantizationOptions) GetQuantizationMethod() *QuantizationMethod
- func (*QuantizationOptions) ProtoMessage()
- func (x *QuantizationOptions) ProtoReflect() protoreflect.Message
- func (x *QuantizationOptions) Reset()
- func (x *QuantizationOptions) String() string
Constants ¶
This section is empty.
Variables ¶
var ( PresetQuantizationMethod_PresetMethod_name = map[int32]string{ 0: "METHOD_UNSPECIFIED", 1: "WEIGHT_ONLY", 2: "DYNAMIC_RANGE", } PresetQuantizationMethod_PresetMethod_value = map[string]int32{ "METHOD_UNSPECIFIED": 0, "WEIGHT_ONLY": 1, "DYNAMIC_RANGE": 2, } )
Enum value maps for PresetQuantizationMethod_PresetMethod.
var ( QuantizationComponentSpec_QuantizationComponent_name = map[int32]string{ 0: "COMPONENT_UNSPECIFIED", 1: "COMPONENT_ACTIVATION", 2: "COMPONENT_WEIGHT", 3: "COMPONENT_BIAS", } QuantizationComponentSpec_QuantizationComponent_value = map[string]int32{ "COMPONENT_UNSPECIFIED": 0, "COMPONENT_ACTIVATION": 1, "COMPONENT_WEIGHT": 2, "COMPONENT_BIAS": 3, } )
Enum value maps for QuantizationComponentSpec_QuantizationComponent.
var ( QuantizationComponentSpec_BitWidth_name = map[int32]string{ 0: "BIT_WIDTH_UNSPECIFIED", 1: "BIT_WIDTH_4", 2: "BIT_WIDTH_8", 3: "BIT_WIDTH_16", } QuantizationComponentSpec_BitWidth_value = map[string]int32{ "BIT_WIDTH_UNSPECIFIED": 0, "BIT_WIDTH_4": 1, "BIT_WIDTH_8": 2, "BIT_WIDTH_16": 3, } )
Enum value maps for QuantizationComponentSpec_BitWidth.
var ( QuantizationComponentSpec_BitType_name = map[int32]string{ 0: "BIT_TYPE_UNSPECIFIED", 1: "BIT_TYPE_INT", 2: "BIT_TYPE_FLOAT", 3: "BIT_TYPE_BFLOAT", } QuantizationComponentSpec_BitType_value = map[string]int32{ "BIT_TYPE_UNSPECIFIED": 0, "BIT_TYPE_INT": 1, "BIT_TYPE_FLOAT": 2, "BIT_TYPE_BFLOAT": 3, } )
Enum value maps for QuantizationComponentSpec_BitType.
var File_tensorflow_compiler_mlir_quantization_stablehlo_quantization_options_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type CustomQuantizationMethod ¶
type CustomQuantizationMethod struct { // Specify component name, bit width, and other specs for all compoenents // intended to be quantized. QuantizationComponentSpec []*QuantizationComponentSpec `` /* 138-byte string literal not displayed */ // contains filtered or unexported fields }
Custom option for specifying quantization spec details. If the selected quantization option is not available, StableHLO quantizer will raise an error. NEXT ID: 2
func (*CustomQuantizationMethod) Descriptor
deprecated
func (*CustomQuantizationMethod) Descriptor() ([]byte, []int)
Deprecated: Use CustomQuantizationMethod.ProtoReflect.Descriptor instead.
func (*CustomQuantizationMethod) GetQuantizationComponentSpec ¶
func (x *CustomQuantizationMethod) GetQuantizationComponentSpec() []*QuantizationComponentSpec
func (*CustomQuantizationMethod) ProtoMessage ¶
func (*CustomQuantizationMethod) ProtoMessage()
func (*CustomQuantizationMethod) ProtoReflect ¶
func (x *CustomQuantizationMethod) ProtoReflect() protoreflect.Message
func (*CustomQuantizationMethod) Reset ¶
func (x *CustomQuantizationMethod) Reset()
func (*CustomQuantizationMethod) String ¶
func (x *CustomQuantizationMethod) String() string
type PresetQuantizationMethod ¶
type PresetQuantizationMethod struct { PresetMethod PresetQuantizationMethod_PresetMethod `` /* 164-byte string literal not displayed */ // contains filtered or unexported fields }
Preset model quantization method for optimization.
Common quantization methods are defined as preset methods in this message. Note that the quantization specs (ex: bit width) for preset quantization methods are fixed. To use a different quantization spec for a given method, use CustomQuantizationMethod. NEXT ID: 2
func (*PresetQuantizationMethod) Descriptor
deprecated
func (*PresetQuantizationMethod) Descriptor() ([]byte, []int)
Deprecated: Use PresetQuantizationMethod.ProtoReflect.Descriptor instead.
func (*PresetQuantizationMethod) GetPresetMethod ¶
func (x *PresetQuantizationMethod) GetPresetMethod() PresetQuantizationMethod_PresetMethod
func (*PresetQuantizationMethod) ProtoMessage ¶
func (*PresetQuantizationMethod) ProtoMessage()
func (*PresetQuantizationMethod) ProtoReflect ¶
func (x *PresetQuantizationMethod) ProtoReflect() protoreflect.Message
func (*PresetQuantizationMethod) Reset ¶
func (x *PresetQuantizationMethod) Reset()
func (*PresetQuantizationMethod) String ¶
func (x *PresetQuantizationMethod) String() string
type PresetQuantizationMethod_PresetMethod ¶
type PresetQuantizationMethod_PresetMethod int32
Preset quantization methods that are supported as a stable API. NEXT ID: 3
const ( // TODO(b/266173150): Update preset methods after redefining quantization // pattern matching in DarwiNN. // This should never be used. Using this will generally result in an error. PresetQuantizationMethod_METHOD_UNSPECIFIED PresetQuantizationMethod_PresetMethod = 0 // go/do-include-enum-unspecified // Apply default weight-only quantization. Weights are quantized during // conversion, then dequantized during inference. Data type is as follows: // Weight: i8, Bias: f32, Activation: f32, Input/output: f32 PresetQuantizationMethod_WEIGHT_ONLY PresetQuantizationMethod_PresetMethod = 1 // Apply default dynamic range quantization. Quantized tensor value's // ranges are determined during graph runtime. Data type is as follows: // Weight: i8, Bias: f32, Activation: f32, Input/output: f32 PresetQuantizationMethod_DYNAMIC_RANGE PresetQuantizationMethod_PresetMethod = 2 )
func (PresetQuantizationMethod_PresetMethod) Descriptor ¶
func (PresetQuantizationMethod_PresetMethod) Descriptor() protoreflect.EnumDescriptor
func (PresetQuantizationMethod_PresetMethod) EnumDescriptor
deprecated
func (PresetQuantizationMethod_PresetMethod) EnumDescriptor() ([]byte, []int)
Deprecated: Use PresetQuantizationMethod_PresetMethod.Descriptor instead.
func (PresetQuantizationMethod_PresetMethod) Number ¶
func (x PresetQuantizationMethod_PresetMethod) Number() protoreflect.EnumNumber
func (PresetQuantizationMethod_PresetMethod) String ¶
func (x PresetQuantizationMethod_PresetMethod) String() string
func (PresetQuantizationMethod_PresetMethod) Type ¶
func (PresetQuantizationMethod_PresetMethod) Type() protoreflect.EnumType
type QuantizationComponentSpec ¶
type QuantizationComponentSpec struct { QuantizationComponent QuantizationComponentSpec_QuantizationComponent `` /* 201-byte string literal not displayed */ // Defines the target bit of the data. BitWidth QuantizationComponentSpec_BitWidth `` /* 149-byte string literal not displayed */ // Defines the type of data of the quantized component. BitType QuantizationComponentSpec_BitType `` /* 145-byte string literal not displayed */ // Defines whether quantization is done in narrow range. EnableNarrowRange bool `protobuf:"varint,4,opt,name=enable_narrow_range,json=enableNarrowRange,proto3" json:"enable_narrow_range,omitempty"` // Defines whether quantiation is done per-channel. EnablePerChannelQuantization bool `` /* 150-byte string literal not displayed */ // Defines whether quantization is done symmetrically. EnableSymmetric bool `protobuf:"varint,6,opt,name=enable_symmetric,json=enableSymmetric,proto3" json:"enable_symmetric,omitempty"` // contains filtered or unexported fields }
Quantization spec per each component designated to be quantized. Components whose QuantizationComponentSpec is not specified will not be quantized, and remain f32. NEXT ID: 7
func (*QuantizationComponentSpec) Descriptor
deprecated
func (*QuantizationComponentSpec) Descriptor() ([]byte, []int)
Deprecated: Use QuantizationComponentSpec.ProtoReflect.Descriptor instead.
func (*QuantizationComponentSpec) GetBitType ¶
func (x *QuantizationComponentSpec) GetBitType() QuantizationComponentSpec_BitType
func (*QuantizationComponentSpec) GetBitWidth ¶
func (x *QuantizationComponentSpec) GetBitWidth() QuantizationComponentSpec_BitWidth
func (*QuantizationComponentSpec) GetEnableNarrowRange ¶
func (x *QuantizationComponentSpec) GetEnableNarrowRange() bool
func (*QuantizationComponentSpec) GetEnablePerChannelQuantization ¶
func (x *QuantizationComponentSpec) GetEnablePerChannelQuantization() bool
func (*QuantizationComponentSpec) GetEnableSymmetric ¶
func (x *QuantizationComponentSpec) GetEnableSymmetric() bool
func (*QuantizationComponentSpec) GetQuantizationComponent ¶
func (x *QuantizationComponentSpec) GetQuantizationComponent() QuantizationComponentSpec_QuantizationComponent
func (*QuantizationComponentSpec) ProtoMessage ¶
func (*QuantizationComponentSpec) ProtoMessage()
func (*QuantizationComponentSpec) ProtoReflect ¶
func (x *QuantizationComponentSpec) ProtoReflect() protoreflect.Message
func (*QuantizationComponentSpec) Reset ¶
func (x *QuantizationComponentSpec) Reset()
func (*QuantizationComponentSpec) String ¶
func (x *QuantizationComponentSpec) String() string
type QuantizationComponentSpec_BitType ¶
type QuantizationComponentSpec_BitType int32
NEXT ID: 4
const ( QuantizationComponentSpec_BIT_TYPE_UNSPECIFIED QuantizationComponentSpec_BitType = 0 QuantizationComponentSpec_BIT_TYPE_INT QuantizationComponentSpec_BitType = 1 QuantizationComponentSpec_BIT_TYPE_FLOAT QuantizationComponentSpec_BitType = 2 QuantizationComponentSpec_BIT_TYPE_BFLOAT QuantizationComponentSpec_BitType = 3 )
func (QuantizationComponentSpec_BitType) Descriptor ¶
func (QuantizationComponentSpec_BitType) Descriptor() protoreflect.EnumDescriptor
func (QuantizationComponentSpec_BitType) Enum ¶
func (x QuantizationComponentSpec_BitType) Enum() *QuantizationComponentSpec_BitType
func (QuantizationComponentSpec_BitType) EnumDescriptor
deprecated
func (QuantizationComponentSpec_BitType) EnumDescriptor() ([]byte, []int)
Deprecated: Use QuantizationComponentSpec_BitType.Descriptor instead.
func (QuantizationComponentSpec_BitType) Number ¶
func (x QuantizationComponentSpec_BitType) Number() protoreflect.EnumNumber
func (QuantizationComponentSpec_BitType) String ¶
func (x QuantizationComponentSpec_BitType) String() string
func (QuantizationComponentSpec_BitType) Type ¶
func (QuantizationComponentSpec_BitType) Type() protoreflect.EnumType
type QuantizationComponentSpec_BitWidth ¶
type QuantizationComponentSpec_BitWidth int32
NEXT ID: 4
const ( QuantizationComponentSpec_BIT_WIDTH_UNSPECIFIED QuantizationComponentSpec_BitWidth = 0 QuantizationComponentSpec_BIT_WIDTH_4 QuantizationComponentSpec_BitWidth = 1 QuantizationComponentSpec_BIT_WIDTH_8 QuantizationComponentSpec_BitWidth = 2 QuantizationComponentSpec_BIT_WIDTH_16 QuantizationComponentSpec_BitWidth = 3 )
func (QuantizationComponentSpec_BitWidth) Descriptor ¶
func (QuantizationComponentSpec_BitWidth) Descriptor() protoreflect.EnumDescriptor
func (QuantizationComponentSpec_BitWidth) Enum ¶
func (x QuantizationComponentSpec_BitWidth) Enum() *QuantizationComponentSpec_BitWidth
func (QuantizationComponentSpec_BitWidth) EnumDescriptor
deprecated
func (QuantizationComponentSpec_BitWidth) EnumDescriptor() ([]byte, []int)
Deprecated: Use QuantizationComponentSpec_BitWidth.Descriptor instead.
func (QuantizationComponentSpec_BitWidth) Number ¶
func (x QuantizationComponentSpec_BitWidth) Number() protoreflect.EnumNumber
func (QuantizationComponentSpec_BitWidth) String ¶
func (x QuantizationComponentSpec_BitWidth) String() string
func (QuantizationComponentSpec_BitWidth) Type ¶
func (QuantizationComponentSpec_BitWidth) Type() protoreflect.EnumType
type QuantizationComponentSpec_QuantizationComponent ¶
type QuantizationComponentSpec_QuantizationComponent int32
NEXT ID: 4
const ( QuantizationComponentSpec_COMPONENT_UNSPECIFIED QuantizationComponentSpec_QuantizationComponent = 0 QuantizationComponentSpec_COMPONENT_ACTIVATION QuantizationComponentSpec_QuantizationComponent = 1 QuantizationComponentSpec_COMPONENT_WEIGHT QuantizationComponentSpec_QuantizationComponent = 2 QuantizationComponentSpec_COMPONENT_BIAS QuantizationComponentSpec_QuantizationComponent = 3 )
func (QuantizationComponentSpec_QuantizationComponent) Descriptor ¶
func (QuantizationComponentSpec_QuantizationComponent) Descriptor() protoreflect.EnumDescriptor
func (QuantizationComponentSpec_QuantizationComponent) EnumDescriptor
deprecated
func (QuantizationComponentSpec_QuantizationComponent) EnumDescriptor() ([]byte, []int)
Deprecated: Use QuantizationComponentSpec_QuantizationComponent.Descriptor instead.
func (QuantizationComponentSpec_QuantizationComponent) Number ¶
func (x QuantizationComponentSpec_QuantizationComponent) Number() protoreflect.EnumNumber
func (QuantizationComponentSpec_QuantizationComponent) String ¶
func (x QuantizationComponentSpec_QuantizationComponent) String() string
type QuantizationMethod ¶
type QuantizationMethod struct { // Quantization Method can be either preset or custom. // // Types that are assignable to QuantizationMethod: // // *QuantizationMethod_PresetQuantizationMethod // *QuantizationMethod_CustomQuantizationMethod QuantizationMethod isQuantizationMethod_QuantizationMethod `protobuf_oneof:"quantization_method"` // contains filtered or unexported fields }
NEXT ID: 3
func (*QuantizationMethod) Descriptor
deprecated
func (*QuantizationMethod) Descriptor() ([]byte, []int)
Deprecated: Use QuantizationMethod.ProtoReflect.Descriptor instead.
func (*QuantizationMethod) GetCustomQuantizationMethod ¶
func (x *QuantizationMethod) GetCustomQuantizationMethod() *CustomQuantizationMethod
func (*QuantizationMethod) GetPresetQuantizationMethod ¶
func (x *QuantizationMethod) GetPresetQuantizationMethod() *PresetQuantizationMethod
func (*QuantizationMethod) GetQuantizationMethod ¶
func (m *QuantizationMethod) GetQuantizationMethod() isQuantizationMethod_QuantizationMethod
func (*QuantizationMethod) ProtoMessage ¶
func (*QuantizationMethod) ProtoMessage()
func (*QuantizationMethod) ProtoReflect ¶
func (x *QuantizationMethod) ProtoReflect() protoreflect.Message
func (*QuantizationMethod) Reset ¶
func (x *QuantizationMethod) Reset()
func (*QuantizationMethod) String ¶
func (x *QuantizationMethod) String() string
type QuantizationMethod_CustomQuantizationMethod ¶
type QuantizationMethod_CustomQuantizationMethod struct {
CustomQuantizationMethod *CustomQuantizationMethod `protobuf:"bytes,2,opt,name=custom_quantization_method,json=customQuantizationMethod,proto3,oneof"`
}
type QuantizationMethod_PresetQuantizationMethod ¶
type QuantizationMethod_PresetQuantizationMethod struct {
PresetQuantizationMethod *PresetQuantizationMethod `protobuf:"bytes,1,opt,name=preset_quantization_method,json=presetQuantizationMethod,proto3,oneof"`
}
type QuantizationOptions ¶
type QuantizationOptions struct { QuantizationMethod *QuantizationMethod `protobuf:"bytes,1,opt,name=quantization_method,json=quantizationMethod,proto3" json:"quantization_method,omitempty"` // contains filtered or unexported fields }
Defines arious options to specify and control the behavior of the StableHLO quantizer. NEXT ID: 2
func (*QuantizationOptions) Descriptor
deprecated
func (*QuantizationOptions) Descriptor() ([]byte, []int)
Deprecated: Use QuantizationOptions.ProtoReflect.Descriptor instead.
func (*QuantizationOptions) GetQuantizationMethod ¶
func (x *QuantizationOptions) GetQuantizationMethod() *QuantizationMethod
func (*QuantizationOptions) ProtoMessage ¶
func (*QuantizationOptions) ProtoMessage()
func (*QuantizationOptions) ProtoReflect ¶
func (x *QuantizationOptions) ProtoReflect() protoreflect.Message
func (*QuantizationOptions) Reset ¶
func (x *QuantizationOptions) Reset()
func (*QuantizationOptions) String ¶
func (x *QuantizationOptions) String() string