Module weight_loader

Module weight_loader 

Source
Expand description

Weight loading traits and per-model loader implementations.

Translates flat WeightStore into typed TransformerLayer objects. Each model architecture has its own ModelWeightLoader implementation that knows the HuggingFace weight name patterns.

Submodules contain per-family loaders:

  • qwen3: Qwen3-Next (NVFP4, hybrid SSM+Attention+MoE)
  • qwen35: Qwen3.5 MoE (35B, 122B)
  • qwen35_dense: Qwen3.5 Dense (27B)
  • qwen3_vl: Qwen3-VL (vision-language)
  • nemotron: Nemotron-H (Mamba-2 + MoE + Attention)
  • gemma4: Gemma-4 (pure attention, GeGLU, sliding + full attention)

Re-exports§

pub use dflash_loader::DflashConfig;
pub use dflash_loader::DflashLayerWeights;
pub use dflash_loader::DflashSubConfig;
pub use dflash_loader::DflashWeights;
pub use dflash_loader::load_dflash_weights;
pub use dflash_loader::store_has_dflash_weights;
pub use glm5_next_load::Glm5NextWeightLoader;
pub use kimi_k3::KimiK3WeightLoader;

Modules§

dflash_loader
DFlash drafter weight loader.
fp8_residency
The native-FP8 dense loader’s derived-copy decision table and the shape arithmetic that prices it (#915). Which derived weight copies the native-FP8 dense route actually needs, and a tally of the ones it still builds.
glm5_next
GLM-5.3-Flash tensor accounting (Slice 1: classification only). GLM-5.3-Flash (glm5_next) tensor accounting.
glm5_next_load
Glm5NextWeightLoader — assembles the 45-layer GLM-5.3 text stack from a WeightStore.
glm5_next_vision
Bind GLM-5.3-Flash’s vision tower: 347 tensors under model.visual.*.
kimi_k3
Kimi K3 weight loader — C1: BF16 0.40B twin bind. Packed experts bind to DSV4 E8M0 (quantized_k3_mxfp4_e8m0) only when K3_ALLOW_MXFP4=1. Default refuse so an accidental official download cannot silently land.
predicted_residency
That table evaluated BEFORE the checkpoint loads, so preflight can size the SSM decode ring against the predicted post-load KV headroom (#915). The derived-weight residency of the native-FP8 dense route, predicted from config.json alone — BEFORE the checkpoint loads.

Structs§

DeepSeekV4WeightLoader
Gemma4WeightLoader
LagunaWeightLoader
LongcatWeightLoader
MinimaxM2WeightLoader
NemotronHWeightLoader
NllbWeightLoader
Qwen3VLWeightLoader
Qwen3WeightLoader
Qwen4ExpWeightLoader
Qwen35DenseWeightLoader
Qwen35WeightLoader
Step3p7WeightLoader

Enums§

QuantFormat
Runtime quantization format for weight dispatch.
WeightFormat
Checkpoint weight format, detected from safetensors metadata.

Traits§

ModelWeightLoader
Loads weights from a WeightStore into typed layer objects.