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.

docs: credit the Fast-LoRA configuration and wiring contribution (#2017)

Alpamys Makazhan497f8d149004
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md
index ca39a574..80791e3e 100644
--- a/CONTRIBUTORS.md
+++ b/CONTRIBUTORS.md
@@ -891,6 +891,7 @@ Listed by first contribution. PR numbers link the work.
- Took the `dpo` / `ipo` half of #1425 (the issue stays open): a `preference_loss_weights` blend naming either loss stopped at step 0, because both build trl's `DPOTrainer`, which computes its log-probs inline and keeps only their means. They measured trl's own losses on the issue's tiny Llama first (5.8290 for `ipo` against 6.8886 from the summed kernel), then wrapped the trainer's `compute_loss` so the policy sums come from its own forward pass and the reference sums from `compute_ref_log_probs`, and made the blend's `ipo` term divide by response length as trl does. **The part worth copying is the test design**: every term is rebuilt in the test from a separate forward pass with a plain `log_softmax`, so no test reads the capture to check the capture, and the blend's `ipo` term is compared with trl's own IPO loss. They reported 38 mutations of the first version, three of which survived and each got a test, and after review added the missing `_truncate_inputs` probe with a test per method name, so a trl that renames one gets the refusal instead of an `AttributeError`. 60 tests; 212 passed with the neighbouring preference files on the final head, and 19 mutations rerun on that head each fail a named test. Item 3 follows as its own PR ([#1425](https://github.com/MakazhanAlpamys/Soup/issues/1425), [#1785](https://github.com/MakazhanAlpamys/Soup/pull/1785))
- Closed #1768, reported by @bobbonauta: a resumed `dpo`, `ipo` or `grpo` run restored the optimizer and the step counter but trained a freshly initialised adapter, because TRL adds a frozen `ref` adapter beside the trained `default` one and `Trainer._load_from_checkpoint`, finding an adapter subfolder (`ref/`), never reads the adapter at the checkpoint root. They claimed the issue with a CPU reproduction on a tiny Llama, measured every task that hands a `PeftModel` to TRL (dpo, ipo, `preference` with either loss and grpo are affected; `grpo_beta: 0`, orpo, simpo, bco, kto, sft and reward_model are not), and added `reload_root_adapter_on_resume`, installed in the three wrappers before the dtype restore of #1660. **The part worth copying is the premise test**: one test runs PEFT and the real `Trainer._load_from_checkpoint` without TRL and asserts that the Trainer alone leaves `default` new, with a failure message that says to remove the helper when transformers starts reading the root itself. They report 27 mutations that all fail a test, two surviving conditions removed from the code, and what they could not run (any GPU, `online_dpo`, unsloth, `stream_layers`). A review round on `718e5aed` got 11 of 11 mutations failing a named test and 176 passed with 1 skipped over the four related files ([#1768](https://github.com/MakazhanAlpamys/Soup/issues/1768), [#1797](https://github.com/MakazhanAlpamys/Soup/pull/1797))
- Closed #1425 with its last half: a `preference_loss_weights` blend with a `simpo` or `orpo` primary and a `dpo` or `ipo` term stopped at the first step, because trl's CPO and ORPO trainers run no frozen reference. They made the blend build the reference from the trainer's own forward with the LoRA adapter switched off (no private trl toggle, PEFT's `requires_grad` flags saved and restored even when the forward raises, no extra forward for a blend without `dpo` or `ipo`). **The part worth copying is what they did when review showed the reference could be wrong**: with `pissa`, `olora`, `loftq`, `use_olora` or `relora_steps` the adapter-off model is not the starting model (policy minus reference was 0.08 at step 0 instead of 0), so the term would have trained against another model without an error; they measured it, refused that combination before the model loads with the reason and the way out, and after a second review pinned that the guard follows the largest weight and not the first key of the blend, in the guard and in the trainer build. The PR says plainly that `loftq` was not measured ([#1425](https://github.com/MakazhanAlpamys/Soup/issues/1425), [#1828](https://github.com/MakazhanAlpamys/Soup/pull/1828))
+ - Added the default-off `training.fast_lora` switch and compatibility validators for Transformers text SFT with zero LoRA dropout, wiring the existing q/k/v, SwiGLU MLP and single-projection kernels into resident and streamed setup. They added per-kernel counts, patch rollback when no supported module can run, streamed-runtime cleanup on patch failure, float64 CPU gradchecks and float32 forward/backward and streamed parity coverage. CUDA validation, speedup and model-quality claims remain outside the evidence ([#792](https://github.com/MakazhanAlpamys/Soup/issues/792), [#1973](https://github.com/MakazhanAlpamys/Soup/pull/1973)).
- **Nariman Abdikarim** ([@Nari-Ab](https://github.com/Nari-Ab))
- First contribution: `soup data generate --template preference` appended every preference row before the dedup check, so rows repeating a `--dedup-with` file and repeats within the same run were all written. They claimed that one item of the #1448 audit, routed preference rows through the shared dedup check, and built an order-independent key from the DPO and KTO fields. **Review found that nothing pinned which fields make up the key: a prompt-only key passed every test and would have dropped every later row for the same prompt. They added the proposed test and the exact duplicate count within minutes.** The new file is 4 failed on `main`, 11 of 11 mutations are caught, and 507 related tests pass ([#1448](https://github.com/MakazhanAlpamys/Soup/issues/1448), [#1605](https://github.com/MakazhanAlpamys/Soup/pull/1605))