pub enum QuantScheme {
AffineGroupInt,
BlockScaledFloat,
KQuantMixed,
RtnBlock,
Unquantized,
Unknown,
}Expand description
The numeric format a checkpoint’s weights are stored in.
Deliberately says nothing about which engine serves the file —
ModelSource already carries that, and keying this on the container
instead of the format produces falsehoods: whisper.cpp’s q5_0 ggml
checkpoints use the same round-to-nearest block format as llama.cpp’s, and
a Gguf* variant would assert a GGUF text path that cannot load them.
What it does express is the axis neither the bit width nor the source can:
an MLX 4-bit affine checkpoint and a Q4_K_M are both “4-bit”, were
produced by different algorithms, and do not have the same quality.
Variants§
AffineGroupInt
Integer weights with a scale and bias shared across group_size
elements (4bit, 6bit). MLX’s default and only affine format.
BlockScaledFloat
Block-scaled float — MX formats (mxfp4, mxfp8). A genuinely
different loader path from QuantScheme::AffineGroupInt at the same
nominal width; see the microscaling-mode rejection in backend/mlx.rs,
which currently accepts exactly one of these.
KQuantMixed
Mixed per-tensor bit allocation, optionally importance-weighted
(Q4_K_M, Q5_K_S, IQ4_XS, TQ1_0).
RtnBlock
Uniform round-to-nearest blocks, no per-tensor mixing and no importance
weighting (Q8_0, q5_0, Q4_0_4_4).
Unquantized
Full-precision weights (bf16, f16, f32). Distinct from None at
the ModelSchema::quantization level: a positive claim that the
checkpoint is unquantized, not an absence of information.
Unknown
A format this parser could not identify. The label is still preserved verbatim; only the classification is missing.
Trait Implementations§
Source§impl Clone for QuantScheme
impl Clone for QuantScheme
impl Copy for QuantScheme
Source§impl Debug for QuantScheme
impl Debug for QuantScheme
Source§impl Default for QuantScheme
impl Default for QuantScheme
Source§impl<'de> Deserialize<'de> for QuantScheme
impl<'de> Deserialize<'de> for QuantScheme
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for QuantScheme
Source§impl Hash for QuantScheme
impl Hash for QuantScheme
Source§impl JsonSchema for QuantScheme
impl JsonSchema for QuantScheme
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read moreSource§impl PartialEq for QuantScheme
impl PartialEq for QuantScheme
Source§impl Serialize for QuantScheme
impl Serialize for QuantScheme
impl StructuralPartialEq for QuantScheme
Auto Trait Implementations§
impl Freeze for QuantScheme
impl RefUnwindSafe for QuantScheme
impl Send for QuantScheme
impl Sync for QuantScheme
impl Unpin for QuantScheme
impl UnsafeUnpin for QuantScheme
impl UnwindSafe for QuantScheme
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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