pub enum GgmlDType {
Show 15 variants
F32,
F16,
BF16,
Q4_0,
Q4_1,
Q5_0,
Q5_1,
Q8_0,
Q8_1,
Q2K,
Q3K,
Q4K,
Q5K,
Q6K,
Q8K,
}Expand description
The ggml block-format dtype tag. Mirrors llama.cpp’s ggml_type
@9d57ce456c for the subset fuel supports (the classic 15 — F32/F16/BF16
plus Q4_0..Q8_1 and Q2K..Q8K; NOT the IQ*/TQ*/MXFP4/NVFP4 families).
Geometry checked against that commit (GAP-248 instance 5), and the referee differs by column:
type_size(bytes/block) is ADJUDICATED — upstream’s ownstatic_asserton each block struct is the referee; 12/12 for the quant types here.block_size(elems/block) and the numeric codes are CORROBORATED — both are transcribed upstream (type_traits[].blck_size,enum ggml_type) and agree 12/12 with MLMF’s INDEPENDENT transcription; no referee exists.- per-block alignment is UNANCHORED by both projects; fuel tracks none, so an upstream alignment change is undetectable here.
NO DETECTOR: this pin makes drift ANSWERABLE, not detected — it ages silently.
Re-run the comparison on any llama.cpp bump that touches ggml_type or
type_traits[].
Lives here (rather than in quantized/mod.rs) because per-backend kernel
crates need to name it without depending on fuel-core.
Variants§
Implementations§
Source§impl GgmlDType
impl GgmlDType
pub fn from_u32(u: u32) -> Result<GgmlDType, Error>
pub fn to_u32(self) -> u32
pub fn type_size(&self) -> usize
pub fn block_size(&self) -> usize
Sourcepub fn check_dequant_count(
self,
op_label: &str,
numel: usize,
byte_len: usize,
) -> Result<(), Error>
pub fn check_dequant_count( self, op_label: &str, numel: usize, byte_len: usize, ) -> Result<(), Error>
GAP-333: numel dequantized elements are read from numel / block_size
whole blocks of type_size bytes. Declines a count that is not a whole
number of blocks, or whose blocks do not fit in byte_len.
The one copy every backend’s dequantize calls before it reads, so the predicate cannot drift between them.
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§
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.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