Skip to content
data

TunerModelStatus

TunerModelStatus(base_model_type: str, adapter_model_type: str, peft_types: dict[str, str], trainable_params: int, total_params: int, num_adapter_layers: int, enabled: bool | Irregular, active_adapters: list[str] | Irregular, merged_adapters: list[str] | Irregular, requires_grad: dict[str, GradState], available_adapters: list[str], devices: dict[str, list[str]])

The state of the adapters of a whole model, folded from its layers.

Attributes

base_model_typestr
The class name of the model that was adapted ("other" for a model not wrapped in a PeftModel).
adapter_model_typestr
The class name of the tuner ("LoraModel"), "None" when unwrapped.
peft_typesdict
Each adapter's method by name, e.g. {"default": "LORA"}.
trainable_params, total_paramsint
Parameter element counts, each shared parameter once.
num_adapter_layersint
How many adapter layers the model holds.
enabledbool or irregular
Whether every layer applies adapters.
active_adapterslist of str or "irregular"
The adapters in use, if every layer agrees.
merged_adapterslist of str or "irregular"
The adapters merged into the base, unless one is merged on a layer and not on another that holds it.
requires_graddict
Per adapter, whether its parameters train in every layer (True), in none (False) or in some ("irregular").
available_adapterslist of str
Every adapter any layer holds, sorted.
devicesdict
Per adapter, the device types its parameters are on, sorted.

Used by 2

Class methods

1
of(layers: Sequence[TunerLayerStatus], base_model_type: str, adapter_model_type: str, peft_types: dict[str, str], parameter_counts: tuple[int, int])

The model's status from its layers (at least one) and what the wrapper knows.