Skip to content

armgit / Soup

Public Imported from GitHub
0

Fine-tune LLMs from one YAML. Layer streaming trains an 8B model on a 4 GB laptop GPU.

1.3 KB
Raw Blame
  • training.freeze_layers / training.freeze_ratio did nothing on a LoRA run: the freeze was set before get_peft_model, which then attached a fresh trainable adapter to every targeted module in every layer, the frozen ones included (#1432 by @AmirF194 and @VanshSharmaPES in #2145). The SFT trainer now passes the layers the freeze plan left trainable to peft as layers_to_transform, so a frozen layer gets no adapter. On a 2-layer Llama with LoRA on q_proj / v_proj, freeze_layers: 1 (or freeze_ratio: 0.5) takes the trainable LoRA parameters from 1,024 to 512 and layer 0 no longer changes. A config that sets freeze_layers / freeze_ratio together with LoRA now trains fewer layers than it did before, which is what the option always documented. Shapes peft cannot restrict by layer are refused when the model is built rather than ignoring the freeze: a string lora.target_modules (a regex, or all-linear, including the value auto resolves to for some architectures), a list target that resolves only outside a numbered decoder layer (such as embed_tokens), lora.target_parameters, lora.use_vera, and a plan that freezes every layer. A top-level lm_head target is accepted and keeps its adapter. Full fine-tuning (lora.r: 0) is unchanged.