pub enum QuantWeight {
Nvfp4(QuantizedWeight),
Fp8(Fp8Weight),
Dense(DenseWeight),
PackedQ2(PackedQ2Weight),
}Expand description
2026-09-25: A weight in any supported format. ops::quant_gemv /
ops::quant_gemm match on it to pick the kernel.
Variants§
Nvfp4(QuantizedWeight)
2026-09-25: NVFP4 E2M1: packed nibbles + FP8 group scales + f32 global
scale. Kernel: w4a16_gemv / w4a16_gemm.
Fp8(Fp8Weight)
2026-09-25: FP8 E4M3 weights and their scale buffer. Kernel: w8a16_gemv /
w8a16_gemm.
Dense(DenseWeight)
2026-09-25: BF16 dense (unquantized). Kernel: dense_gemv / dense_gemm.
PackedQ2(PackedQ2Weight)
2026-09-25: Keep-packed Q2_0: raw block_q2_0 bytes kept 2-bit on the
device. quant_gemv / quant_gemm refuse it: decode runs
q2_0_gemv_vec and prefill dequantizes to BF16 first.
Implementations§
Source§impl QuantWeight
impl QuantWeight
Sourcepub fn as_packed_q2(&self) -> Option<&PackedQ2Weight>
pub fn as_packed_q2(&self) -> Option<&PackedQ2Weight>
2026-09-25: The keep-packed Q2_0 weight, if this is that variant.
Sourcepub fn as_nvfp4(&self) -> Option<&QuantizedWeight>
pub fn as_nvfp4(&self) -> Option<&QuantizedWeight>
2026-09-25: The NVFP4 weight, if this is that variant.
Sourcepub fn as_fp8(&self) -> Option<&Fp8Weight>
pub fn as_fp8(&self) -> Option<&Fp8Weight>
2026-09-25: The FP8 weight, if this is that variant.
Sourcepub fn as_dense(&self) -> Option<&DenseWeight>
pub fn as_dense(&self) -> Option<&DenseWeight>
2026-09-25: The dense weight, if this is that variant.
Trait Implementations§
Source§impl Clone for QuantWeight
impl Clone for QuantWeight
Source§fn clone(&self) -> QuantWeight
fn clone(&self) -> QuantWeight
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more