pub enum QuantizationType {
Int8,
Int4,
Int2,
FP8E4M3,
FP8E5M2,
FP16,
BF16,
Binary,
Ternary,
}Expand description
Quantization data types.
Variants§
Int8
8-bit integer quantization
Int4
4-bit integer quantization
Int2
2-bit integer quantization (extreme compression)
FP8E4M3
8-bit floating point (E4M3 or E5M2)
FP8E5M2
FP8 E5M2 format
FP16
16-bit floating point
BF16
16-bit brain float
Binary
Binary quantization (1-bit)
Ternary
Ternary quantization (-1, 0, 1)
Implementations§
Source§impl QuantizationType
impl QuantizationType
Sourcepub fn compression_ratio(&self) -> f64
pub fn compression_ratio(&self) -> f64
Returns the theoretical compression ratio vs FP32.
Sourcepub fn is_floating_point(&self) -> bool
pub fn is_floating_point(&self) -> bool
Returns whether this type supports floating point values.
Trait Implementations§
Source§impl Clone for QuantizationType
impl Clone for QuantizationType
Source§fn clone(&self) -> QuantizationType
fn clone(&self) -> QuantizationType
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for QuantizationType
impl Debug for QuantizationType
Source§impl<'de> Deserialize<'de> for QuantizationType
impl<'de> Deserialize<'de> for QuantizationType
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Hash for QuantizationType
impl Hash for QuantizationType
Source§impl PartialEq for QuantizationType
impl PartialEq for QuantizationType
Source§impl Serialize for QuantizationType
impl Serialize for QuantizationType
impl Copy for QuantizationType
impl Eq for QuantizationType
impl StructuralPartialEq for QuantizationType
Auto Trait Implementations§
impl Freeze for QuantizationType
impl RefUnwindSafe for QuantizationType
impl Send for QuantizationType
impl Sync for QuantizationType
impl Unpin for QuantizationType
impl UnwindSafe for QuantizationType
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more