Method Stacking
About
Fine-tuning can combine several methods. The d9d.peft.stack package groups multiple PEFT configurations into a single PeftStack. The stack injects its methods in order and merges them in reverse order.
Usage
This example applies LoRA to attention layers and fully fine-tunes normalization layers.
API Reference
d9d.peft.stack
Stacking of several PEFT methods.
PeftStack
Bases: PeftMethod[PeftStackConfig]
PEFT method that applies a list of PEFT methods in order.
__init__(methods)
Constructs the PeftStack object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
methods
|
list[PeftMethod]
|
The PEFT methods to apply in order. |
required |
PeftStackConfig
Bases: BaseModel
Configuration for applying a stack of multiple PEFT methods sequentially.
Attributes:
| Name | Type | Description |
|---|---|---|
kind |
Literal['stack']
|
Discriminator field. Always |
methods |
list[AnyPeftConfig]
|
The PEFT configurations (e.g. LoRA, full tune) to apply in order. |