Expand description
2026-09-25: Maps HuggingFace safetensors tensor names onto the typed per-layer
weight structures, through the weight_map/ sub-modules re-exported here.
Owner: model-layers (weight loading). Invariants: none beyond the types.
Re-exports§
pub use loaders_fp8::*;pub use model_a::*;pub use nemotron::*;pub use nvfp4_detect::*;pub use quantized::*;pub use ssm_qwen35::*;
Modules§
- fp8_
dequant - 2026-09-25: FP8 E4M3 → BF16 dequantization for weights with one per-tensor scale: a GPU path for an FP32 scale, and a host path for an FP32 or BF16 scale.
- fp8_lut
- 2026-09-25: Load-time weight conversions: NVFP4 and NVFP4-with-E8M0 to BF16, the E8M0 lookup, dense-FFN loading, row concatenation and the BA interleave for the GDN gate kernel.
- loaders_
fp8 - 2026-09-25: FP8 block-scaled weight loading, BF16-to-NVFP4 quantization, and the attention, SSM and MoE layer loaders.
- loaders_
moe - 2026-09-25: MoE and MTP-head weight loaders: the
mlpMoE block, the Mistralw1/w2/w3MoE block, and the MTP head. - model_a
- 2026-09-25: Basic store accessors: raw pointers, scalars, KV scales, ModelOpt NVFP4, native MXFP4, and dtype-converting dense loads.
- nemotron
- 2026-09-25: Nemotron-H weight structs and loaders for the Mamba-2 mixer, attention and MoE layers.
- nvfp4_
detect - 2026-09-25: Detection of the on-disk weight format (
Nvfp4Variant) and the variant-dispatching quantized-weight loaders. - quant_
helpers - 2026-09-25: FP8-to-BF16 dequantization, dtype-dispatching dense loads, and the compressed-tensors NVFP4 loader.
- quantized
- 2026-09-25: Device-resident weight types (
QuantizedWeight,DenseWeight,Fp8Weight,PackedQ2Weight) and theWeightQuantFormattag. - ssm_
qwen35 - 2026-09-25: Qwen3.5-family loaders: the separate-projection linear-attention weights and three MoE loaders (NVFP4, native FP8 experts, no shared expert).
- ssm_
qwen35_ more - 2026-09-25: MoE loaders for the MiniMax M2 (
block_sparse_moe,w1/w2/w3) and Gemma-4 (router,moe.experts) layouts.
Structs§
- Attention
Weights - 2026-09-25: Full-attention layer weights.
- Dense
Expert Weight - 2026-09-25: BF16 gate, up and down projections of one expert.
- Expert
Weight - 2026-09-25: One MoE expert’s NVFP4 gate/up/down projections.
- Fp8Expert
Weight - 2026-09-25: FP8 expert weight: gate/up/down projections as
Fp8Weights. - MoeWeights
- 2026-09-25: Weights of one MoE block.
- MtpFp8
Experts - 2026-09-25: Native FP8 block-scaled MTP MoE tables:
experts[e]is routed experte(allnum_expertsare loaded), plus the shared expert. The FP8 bytes belong to the weight store; only the FP32 block scales are owned allocations. - MtpWeights
- 2026-09-25: MTP (multi-token prediction) head weights: one decoder layer
plus the concat projection
fc. - Quant
Expert Weight - 2026-09-25: Per-expert weights in any supported format.
ExpertWeight(NVFP4) andFp8ExpertWeightconvert into it. - SsmWeights
- 2026-09-25: Linear-attention (Gated DeltaNet) layer weights.
Enums§
- Layer
Weights - 2026-09-25: All weights of one attention or linear-attention layer.
- Nvfp4
Variant - 2026-09-25: On-disk weight format, chosen by
detect_nvfp4_variant. - Quant
Weight - 2026-09-25: A weight in any supported format.
ops::quant_gemv/ops::quant_gemmmatch on it to pick the kernel.
Functions§
- load_
fp8_ weight - 2026-09-25: Load an FP8 E4M3 checkpoint weight with per-row scales as an
Fp8WeighttaggedFp8PerRow. - quantize_
to_ fp8 - 2026-09-25: Quantize a BF16 dense weight
[n, k]to FP8 E4M3 (n*kbytes) with one FP32 scale per row. It synchronizesstream, so it belongs at load time, not in a forward pass. - quantize_
to_ fp8_ blockscaled - 2026-09-25: Quantize an
[n, k]BF16 dense weight to block-scaled FP8 E4M3 on the GPU, as anFp8WeighttaggedFp8BlockScaledwith FP32 scales[ceil(n/128), ceil(k/128)].