pub enum WeightQuantFormat {
Bf16,
Fp8PerRow,
Fp8BlockScaled,
Fp8SingleScale,
Nvfp4,
Mxfp4E8m0,
PackedQ2_0,
}Expand description
2026-09-25: The format of a weight buffer in device memory, as opposed to
the on-disk format (Nvfp4Variant). A kernel call site checks it with
WeightQuantFormat::expect, because a kernel cannot tell one layout
from another by its pointer.
Variants§
Bf16
2026-09-25: BF16, not quantized.
Fp8PerRow
2026-09-25: FP8 E4M3 with one F32 scale per row ([N]), as
load_fp8_weight returns.
Fp8BlockScaled
2026-09-25: FP8 E4M3 with one F32 scale per 128x128 block, as
load_fp8_block_scaled_as_fp8weight and quantize_to_fp8_blockscaled return.
Fp8SingleScale
2026-09-25: FP8 E4M3 with no scale buffer.
Nvfp4
2026-09-25: NVFP4: packed E2M1 nibbles, one FP8 scale per 16 weights, and an F32 per-tensor scale.
Mxfp4E8m0
2026-09-25: Native MXFP4: packed E2M1 nibbles and one E8M0 scale per 32
weights, with no per-tensor scale. The DeepSeek-V4 loader tags its routed
experts with it (MoeLayer::experts_scale_kind).
PackedQ2_0
2026-09-25: Keep-packed ternary Q2_0 (ggml id 42): raw block_q2_0
blocks, each an fp16 scale and 2-bit codes, as PackedQ2Weight holds them.
Implementations§
Source§impl WeightQuantFormat
impl WeightQuantFormat
Sourcepub fn expect(self, expected: WeightQuantFormat, context: &str)
pub fn expect(self, expected: WeightQuantFormat, context: &str)
2026-09-25: Panic, naming context, when self is not expected.
Trait Implementations§
Source§impl Clone for WeightQuantFormat
impl Clone for WeightQuantFormat
Source§fn clone(&self) -> WeightQuantFormat
fn clone(&self) -> WeightQuantFormat
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WeightQuantFormat
impl Debug for WeightQuantFormat
Source§impl PartialEq for WeightQuantFormat
impl PartialEq for WeightQuantFormat
impl Copy for WeightQuantFormat
impl Eq for WeightQuantFormat
impl StructuralPartialEq for WeightQuantFormat
Auto Trait Implementations§
impl Freeze for WeightQuantFormat
impl RefUnwindSafe for WeightQuantFormat
impl Send for WeightQuantFormat
impl Sync for WeightQuantFormat
impl Unpin for WeightQuantFormat
impl UnwindSafe for WeightQuantFormat
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
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
§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
key and return true if they are equal.