pub enum TargetFormat {
Q4_K_M,
Q5_K_M,
Q8_0,
F16,
PiQ3,
PiQ2,
}Expand description
Target quantization format
Variants§
Q4_K_M
4-bit K-quant with medium quality (best quality/size tradeoff)
Q5_K_M
5-bit K-quant with medium quality (higher quality)
Q8_0
8-bit symmetric quantization (near-lossless)
F16
FP16 (no quantization, half precision)
PiQ3
Pi-constant 3-bit quantization (ADR-090)
Uses pi-scaled step sizes: step = alpha * pi / k Provides ~0.5 effective bits better precision than uniform 3-bit. Storage: 3.0625 bits/weight (including scale overhead)
PiQ2
Pi-constant 2-bit quantization (ADR-090)
Ultra-low-bit format for extreme compression. Uses pi-scaled step sizes: step = alpha * pi / k Storage: 2.0625 bits/weight (including scale overhead)
Implementations§
Source§impl TargetFormat
impl TargetFormat
Sourcepub fn to_gguf_type(&self) -> GgufQuantType
pub fn to_gguf_type(&self) -> GgufQuantType
Get the GGUF quantization type
Sourcepub fn bits_per_weight(&self) -> f32
pub fn bits_per_weight(&self) -> f32
Get bits per weight (including scale overhead)
Sourcepub fn block_size(&self) -> usize
pub fn block_size(&self) -> usize
Get the block size (number of weights per quantization block)
Sourcepub fn is_pi_quant(&self) -> bool
pub fn is_pi_quant(&self) -> bool
Check if this is a pi-quantization format
Trait Implementations§
Source§impl Clone for TargetFormat
impl Clone for TargetFormat
Source§fn clone(&self) -> TargetFormat
fn clone(&self) -> TargetFormat
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TargetFormat
impl Debug for TargetFormat
Source§impl PartialEq for TargetFormat
impl PartialEq for TargetFormat
impl Copy for TargetFormat
impl Eq for TargetFormat
impl StructuralPartialEq for TargetFormat
Auto Trait Implementations§
impl Freeze for TargetFormat
impl RefUnwindSafe for TargetFormat
impl Send for TargetFormat
impl Sync for TargetFormat
impl Unpin for TargetFormat
impl UnsafeUnpin for TargetFormat
impl UnwindSafe for TargetFormat
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more