pymllm.layers.base¶
Classes¶
Module Contents¶
- class pymllm.layers.base.MllmBaseLayer¶
Bases:
torch.nn.Module- quant_method: pymllm.layers.quantize_base.QuantizeMethodBase | None = None¶
- weight_loader(param, loaded_weight)¶
Load weights into a parameter.
This is the default implementation that directly copies the loaded weight into the parameter. Subclasses should override this method to implement custom loading logic (e.g., tensor parallelism sharding).
- Parameters:
param (torch.nn.Parameter) – The parameter to load weights into.
loaded_weight (torch.Tensor) – The weight tensor loaded from checkpoint.
- abstractmethod forward(*args, **kwargs)¶