Skip to main content

quant_kind_for

Function quant_kind_for 

Source
pub fn quant_kind_for(dtype: GgmlType) -> Option<QuantKind>
Expand description

Maps a GGUF tensor’s on-disk dtype to the QuantKind a WeightMatrix uses to pick a fused dequant+dot kernel, or None for a dtype with no quantized kernel (F32, or one not implemented at all).

The single source of truth for that question, for the same reason metal_mul_mm_kind_supported is for its own: this table used to be copied into six GGUF loaders, and the copies drifted. Three of them (loader, glm52_gguf_loader, kimi_gguf_loader) listed 21 dtypes while the other three (mla_gguf_loader, gemma4_gguf_loader, hybrid_gguf_loader) listed 17 – missing IQ1_S, IQ2_XXS, IQ3_XXS and MXFP4. A miss is not a slow path, it is LoadError::UnsupportedDtype, so a DeepSeek-MLA checkpoint quantized to IQ2_XXS – an ordinary combination for a model that large – was refused outright while the identical quant loaded fine on the generic path.