pub enum Nvfp4Variant {
Standard,
CompressedTensors,
Fp8Dequanted,
Bf16Raw,
}Expand description
Weight quantization variant (on-disk format).
Variants§
Standard
Standard ModelOpt: weight, weight_scale, weight_scale_2, input_scale. Attention/SSM projections are BF16 dense.
CompressedTensors
Sehyo/compressed-tensors: weight_packed, weight_global_scale, input_global_scale. Attention/SSM projections are NVFP4 quantized.
Fp8Dequanted
FP8 block-scaled (e.g. Qwen/Qwen3.5-35B-A3B-FP8, Qwen/Qwen3.6-35B-A3B-FP8):
weight (float8_e4m3fn) + weight_scale_inv (BF16 per-[128,128]-block).
Loaded NATIVELY as FP8 in Qwen3 and Qwen3.5/3.6 model families.
Attention uses w8a16_gemv (decode) + w8a16_gemm (prefill).
MoE uses the FP8 fused grouped-GEMM batch1/2/3 path.
SSM uses w8a16_gemv decode + fp8_gemm_n128 prefill (single-scale).
No silent FP8→BF16→NVFP4 triple-conversion.
Historical note: the variant name retains “Dequanted” because the
Bf16Raw cousin and the pre-2026-05-24 NVFP4 detour did dequant on
load. The dispatch tables in qwen35/load_layers.rs (LayerType:: FullAttention if native_fp8) and qwen3.rs (line 176) now branch
to native FP8 paths when quant_format == QuantFormat::Fp8.
Bf16Raw
Raw BF16/FP16 fine-tunes (e.g. samuelcardillo/Carnice-MoE-35B-A3B):
only .weight tensors exist (no quantization metadata). Runtime-quantize
from BF16 to NVFP4 at load time. Quality is suboptimal vs. a
pre-calibrated NVFP4 release — the user gets a warning at startup.
Trait Implementations§
Source§impl Clone for Nvfp4Variant
impl Clone for Nvfp4Variant
Source§fn clone(&self) -> Nvfp4Variant
fn clone(&self) -> Nvfp4Variant
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Nvfp4Variant
impl Debug for Nvfp4Variant
Source§impl PartialEq for Nvfp4Variant
impl PartialEq for Nvfp4Variant
impl Copy for Nvfp4Variant
impl Eq for Nvfp4Variant
impl StructuralPartialEq for Nvfp4Variant
Auto Trait Implementations§
impl Freeze for Nvfp4Variant
impl RefUnwindSafe for Nvfp4Variant
impl Send for Nvfp4Variant
impl Sync for Nvfp4Variant
impl Unpin for Nvfp4Variant
impl UnwindSafe for Nvfp4Variant
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
key and return true if they are equal.