pub enum QuantWeight {
Nvfp4(QuantizedWeight),
Fp8(Fp8Weight),
Dense(DenseWeight),
PackedQ2(PackedQ2Weight),
}Expand description
Quantized weight for any supported format.
Encapsulates all data a GEMV/GEMM kernel needs to dequantize and compute. The forward path matches on this enum to select the correct kernel. Enum branch compiles to ~1 cycle vs GPU kernel launch at ~5000 cycles.
Variants§
Nvfp4(QuantizedWeight)
NVFP4 E2M1: packed nibbles + FP8 group scales + f32 global scale. Kernel: w4a16_gemv (decode) / w4a16_gemm (prefill)
Fp8(Fp8Weight)
FP8 E4M3: byte-packed weights + per-block BF16 scales. Kernel: w8a16_gemv (decode) / w8a16_gemm (prefill)
Dense(DenseWeight)
BF16 dense (unquantized). Kernel: dense_gemv / dense_gemm
PackedQ2(PackedQ2Weight)
Keep-packed ternary Q2_0 (ATLAS_GGUF_NATIVE_Q2): raw block_q2_0 bytes,
2-bit resident. Decode dispatches q2_0_gemv_vec; prefill transient-
dequants to BF16 then runs dense_gemm. Tier-1c attention path.
Implementations§
Source§impl QuantWeight
impl QuantWeight
Sourcepub fn as_packed_q2(&self) -> Option<&PackedQ2Weight>
pub fn as_packed_q2(&self) -> Option<&PackedQ2Weight>
Extract as keep-packed Q2_0, if this weight is that variant.
Sourcepub fn as_nvfp4(&self) -> Option<&QuantizedWeight>
pub fn as_nvfp4(&self) -> Option<&QuantizedWeight>
Extract as NVFP4, if this weight is that variant.
Sourcepub fn as_dense(&self) -> Option<&DenseWeight>
pub fn as_dense(&self) -> Option<&DenseWeight>
Extract as Dense, if this weight 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