Skip to main content

Module loader

Module loader 

Source
Expand description

WeightLoader trait — unified interface for loading tensor/linear weights into a specific backend.

Implementations (landing in Phase B):

  • SafeTensorsLoader — reads .safetensors files, returns DenseLinear unless quantize_config.json indicates GPTQ/AWQ, in which case it returns GptqLinear / AwqLinear.
  • GgufLoader — reads .gguf files, returns GgufLinear.

The trait is generic over B: Backend so the loader can materialise tensors directly into backend-native buffers (zero-copy on Apple Silicon shared memory, dtoh/htod for CUDA, etc.).

Structs§

PrefixedLoader
Adapter that prepends a fixed prefix to every tensor name before delegating to an underlying loader.

Traits§

WeightLoader