pub enum GgmlType {
Show 18 variants
F32,
F16,
Bf16,
Q4_0,
Q4_1,
Q5_0,
Q5_1,
Q8_0,
Q8_1,
Q2K,
Q3K,
Q4K,
Q5K,
Q6K,
Q8K,
Tq1_0,
Tq2_0,
Q2_0 {
group: usize,
},
}Expand description
A GGML block-quantization type.
The PrismML-private Q2_0 (ggml id 42) is polymorphic in its group size
(128 in the shipped Ternary-Bonsai file, 64 in the fork master), so the
group is carried in the variant rather than hardcoded. Standard Tq2_0
(id 35, group-256, scale-at-end) is a separate entry and must not be
conflated with it.
Variants§
F32
F16
Bf16
Q4_0
Q4_1
Q5_0
Q5_1
Q8_0
Q8_1
Q2K
Q3K
Q4K
Q5K
Q6K
Q8K
Tq1_0
Tq2_0
Q2_0
PrismML id 42: 2-bit, symmetric, scale-at-front, contiguous codes.
group ∈ {64, 128}; block = 2 + group/4 bytes.
Implementations§
Source§impl GgmlType
impl GgmlType
Sourcepub fn from_id(id: u32, q2_0_group: usize) -> Result<Self>
pub fn from_id(id: u32, q2_0_group: usize) -> Result<Self>
Map a raw ggml type id to a GgmlType. q2_0_group supplies the group
size for the id-42 PrismML type (ignored for every other id); pass the
value read from the fork’s GGUF metadata (128 default, 64 fork-master).
Sourcepub fn block_size(self) -> usize
pub fn block_size(self) -> usize
Number of dequantized elements produced by one block (QK / QK_K).
Sourcepub fn block_bytes(self) -> Result<usize>
pub fn block_bytes(self) -> Result<usize>
On-disk byte size of one block.
Trait Implementations§
impl Copy for GgmlType
impl Eq for GgmlType
impl StructuralPartialEq for GgmlType
Auto Trait Implementations§
impl Freeze for GgmlType
impl RefUnwindSafe for GgmlType
impl Send for GgmlType
impl Sync for GgmlType
impl Unpin for GgmlType
impl UnwindSafe for GgmlType
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.