pub enum WeightQuantization {
Affine(AffineQuantization),
MxFp4,
GgufIQuant {
ggml_type: GgmlType,
endian: Endian,
},
}Expand description
Packed physical encoding of a model weight. Dense storage is represented
by None at the use site.
Variants§
Affine(AffineQuantization)
Per-group affine integer storage.
MxFp4
Microscaling FP4 with E2M1 values and E8M0 scales.
GgufIQuant
Checkpoint-native GGML blocks.
Implementations§
Source§impl WeightQuantization
impl WeightQuantization
Sourcepub const MXFP4_GROUP_SIZE: i32 = 32
pub const MXFP4_GROUP_SIZE: i32 = 32
MXFP4 group size fixed by the format.
Sourcepub const MXFP4_BITS: i32 = 4
pub const MXFP4_BITS: i32 = 4
MXFP4 packed value width fixed by the format.
Sourcepub fn group_size(self) -> i32
pub fn group_size(self) -> i32
Returns the grouping used by packed execution.
Sourcepub const fn has_biases(self) -> bool
pub const fn has_biases(self) -> bool
Returns whether the encoding stores affine bias companions.
Sourcepub const fn gguf_iquant(self) -> Option<(GgmlType, Endian)>
pub const fn gguf_iquant(self) -> Option<(GgmlType, Endian)>
Returns checkpoint-native GGML metadata, when present.
Trait Implementations§
Source§impl Clone for WeightQuantization
impl Clone for WeightQuantization
Source§fn clone(&self) -> WeightQuantization
fn clone(&self) -> WeightQuantization
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for WeightQuantization
Source§impl Debug for WeightQuantization
impl Debug for WeightQuantization
Source§impl<'de> Deserialize<'de> for WeightQuantization
impl<'de> Deserialize<'de> for WeightQuantization
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
impl Eq for WeightQuantization
Source§impl From<AffineQuantization> for WeightQuantization
impl From<AffineQuantization> for WeightQuantization
Source§fn from(value: AffineQuantization) -> Self
fn from(value: AffineQuantization) -> Self
Converts to this type from the input type.
Source§impl From<WeightQuantization> for LinearFormat
impl From<WeightQuantization> for LinearFormat
Source§fn from(value: WeightQuantization) -> Self
fn from(value: WeightQuantization) -> Self
Converts to this type from the input type.
Source§impl PartialEq for WeightQuantization
impl PartialEq for WeightQuantization
Source§impl Serialize for WeightQuantization
impl Serialize for WeightQuantization
impl StructuralPartialEq for WeightQuantization
Auto Trait Implementations§
impl Freeze for WeightQuantization
impl RefUnwindSafe for WeightQuantization
impl Send for WeightQuantization
impl Sync for WeightQuantization
impl Unpin for WeightQuantization
impl UnsafeUnpin for WeightQuantization
impl UnwindSafe for WeightQuantization
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