pub enum QuantizationTier {
Full,
Int8,
Int4,
Binary,
}Expand description
Unstable: tier design is under active iteration; tier boundaries may change.
Quantization precision tier, ordered from highest to lowest fidelity.
Variants§
Full
Full f32 precision (4 bytes/dim, 1x baseline).
Int8
INT8 symmetric quantization (1 byte/dim, 4x compression).
Int4
INT4 packed nibble quantization (0.5 bytes/dim, 8x compression).
Binary
Binary sign-bit quantization (0.125 bytes/dim, 32x compression).
Implementations§
Source§impl QuantizationTier
impl QuantizationTier
Sourcepub fn bytes_per_dim(&self) -> f32
pub fn bytes_per_dim(&self) -> f32
Unstable: bytes-per-dimension constant; may change with new tiers.
Sourcepub fn compression_ratio(&self) -> f32
pub fn compression_ratio(&self) -> f32
Unstable: compression ratio; derived from bytes_per_dim, may be removed.
Sourcepub fn storage_bytes(&self, dims: usize) -> usize
pub fn storage_bytes(&self, dims: usize) -> usize
Unstable: storage byte computation; may change with new tiers.
Sourcepub fn from_age_seconds(age_secs: u64) -> Self
pub fn from_age_seconds(age_secs: u64) -> Self
Unstable: age-based tier heuristic; boundaries (HOUR/DAY/WEEK) may be tuned.
- Hot (accessed in last hour): Full
- Warm (accessed in last day): Int8
- Cool (accessed in last week): Int4
- Cold (accessed in last month+): Binary
Trait Implementations§
Source§impl Clone for QuantizationTier
impl Clone for QuantizationTier
Source§fn clone(&self) -> QuantizationTier
fn clone(&self) -> QuantizationTier
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 moreSource§impl Debug for QuantizationTier
impl Debug for QuantizationTier
Source§impl Hash for QuantizationTier
impl Hash for QuantizationTier
Source§impl Ord for QuantizationTier
impl Ord for QuantizationTier
Source§fn cmp(&self, other: &QuantizationTier) -> Ordering
fn cmp(&self, other: &QuantizationTier) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for QuantizationTier
impl PartialEq for QuantizationTier
Source§fn eq(&self, other: &QuantizationTier) -> bool
fn eq(&self, other: &QuantizationTier) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for QuantizationTier
impl PartialOrd for QuantizationTier
impl Copy for QuantizationTier
impl Eq for QuantizationTier
impl StructuralPartialEq for QuantizationTier
Auto Trait Implementations§
impl Freeze for QuantizationTier
impl RefUnwindSafe for QuantizationTier
impl Send for QuantizationTier
impl Sync for QuantizationTier
impl Unpin for QuantizationTier
impl UnsafeUnpin for QuantizationTier
impl UnwindSafe for QuantizationTier
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<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
Compare self to
key and return true if they are equal.