pub fn detect_nvfp4_variant(
store: &WeightStore,
config: &ModelConfig,
) -> Nvfp4VariantExpand description
Detect the weight quantization variant from the weight store.
Dispatch order matches vLLM / TRT-LLM / SGLang:
- Config-declared scheme (
config.quantization_config.quant_method) wins outright. This is the authoritative signal and the only one that correctly handles checkpoints with anignorelist (e.g.lukealonso/MiniMax-M2.7-NVFP4, whose MLPgate_projis intentionally unquantized and therefore has no.weight_scaletensor — sniffing would mis-detect the whole checkpoint asBf16Rawand then read uint8-packed FP4 as BF16, which is the 4× byte overrun that surfaces asCUDA_ERROR_ILLEGAL_ADDRESSten seconds into load). - Tensor-name sniffing for the many checkpoints in the wild
that ship without a
quantization_configblock.