pub enum GgmlDType {
Show 30 variants
F32,
F16,
BF16,
I32,
Q4_0,
Q4_1,
Q5_0,
Q5_1,
Q8_0,
Q8_1,
Q2K,
Q3K,
Q4K,
Q5K,
Q6K,
Q8K,
IQ4_NL,
IQ4_XS,
MXFP4,
IQ2_XXS,
IQ2_XS,
IQ3_XXS,
IQ1_S,
IQ3_S,
IQ2_S,
IQ1_M,
TQ1_0,
TQ2_0,
NVFP4,
Q1_0,
}Variants§
F32
F16
BF16
I32
Raw int32 (GGML type 26) — integer side tables like DeepSeek-V4’s
ffn_gate_tid2eid hash-routing table. Dequantizes by casting to f32.
Q4_0
Q4_1
Q5_0
Q5_1
Q8_0
Q8_1
Q2K
Q3K
Q4K
Q5K
Q6K
Q8K
IQ4_NL
IQ4_XS
MXFP4
IQ2_XXS
IQ2_XS
IQ3_XXS
IQ1_S
IQ3_S
IQ2_S
IQ1_M
TQ1_0
TQ2_0
NVFP4
Q1_0
Implementations§
Source§impl GgmlDType
impl GgmlDType
Sourcepub fn to_u32(self) -> u32
pub fn to_u32(self) -> u32
GGML type id for this dtype. Single source of truth (generated from the
for_each_quant! table); cross-crate callers (e.g. hanzo-quant UQFF
serialization) use this instead of hand-rolled id maps that drift.
Sourcepub fn cpu_zeros(&self, elem_count: usize) -> Box<dyn QuantizedType>
pub fn cpu_zeros(&self, elem_count: usize) -> Box<dyn QuantizedType>
The block dtype
pub fn from_data(&self, data: Cow<'_, [u8]>) -> Box<dyn QuantizedType>
Sourcepub fn type_align(&self) -> usize
pub fn type_align(&self) -> usize
Alignment (bytes) required to reinterpret raw GGUF bytes as this dtype’s block type.
The mmap loader uses it to decide whether a mapped region can be referenced no-copy
(from_mmap) or must fall back to an owned, naturally-aligned copy. Single source of
truth (generated from the for_each_quant! table), so it can’t drift from type_size.
Sourcepub fn block_size(&self) -> usize
pub fn block_size(&self) -> usize
The block size, i.e. the number of elements stored in each block.
Trait Implementations§
impl Copy for GgmlDType
impl Eq for GgmlDType
impl StructuralPartialEq for GgmlDType
Auto Trait Implementations§
impl Freeze for GgmlDType
impl RefUnwindSafe for GgmlDType
impl Send for GgmlDType
impl Sync for GgmlDType
impl Unpin for GgmlDType
impl UnsafeUnpin for GgmlDType
impl UnwindSafe for GgmlDType
Blanket Implementations§
impl<T> Boilerplate for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
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