Fine-tune LLMs from one YAML. Layer streaming trains an 8B model on a 4 GB laptop GPU.
Python cliconsumer-gpudpofine-tuningggufhuggingfacellmllmopslocal-ailocal-llmloralow-vrammachine-learningollamapeftpythonpytorchqlorasfttransformers
docs(contributors): #1639, #1648, #1640, #1649, #1658, #1659, #1660 [skip ci]
Alpamys7dfa7356b550
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.mdindex 958b5cea..44c5f58d 100644--- a/CONTRIBUTORS.md+++ b/CONTRIBUTORS.md@@ -211,6 +211,10 @@ Listed by first contribution. PR numbers link the work.- `training.warmup_ratio` was turned into absolute warmup steps from the raw row count in all 15 trainer wrappers, so GRPO's warmup shrank by `num_generations` (to 0 on small sets) and packed SFT and pretrain warmed up for longer than the whole run, never reaching their peak learning rate. They routed every wrapper through one helper that hands the ratio to transformers, which applies it to the real optimizer steps. **What made it mergeable was what they removed**: a second commit had patched `TrainingArguments.get_warmup_steps` process-wide to hide a rounding difference, and on review they deleted the patch. They then adopted tests that run all 15 wrappers instead of skipping 12, fixed the three seed tests the honest rounding exposed, and wrote the one-step change into the changelog. On the merged tree the issue's own reproduction reaches the configured peak with packing (3 of 6 warmup steps, where `main` used 20 of 6), GRPO resolves 20/40, 20/40 and 2/16 (`main`: 5, 2, 0), and 329 tests pass; every wiring mutation tried across two rounds is caught ([#1431](https://github.com/MakazhanAlpamys/Soup/issues/1431), [#1507](https://github.com/MakazhanAlpamys/Soup/pull/1507))- `soup diagnose` measured catastrophic forgetting on the first 12 rows of `--dataset`, the adapter's own training data, so an adapter that had lost everything else still scored `OK 1.000`. They added `--holdout` and a built-in general-knowledge prompt set, kept `--dataset` for the probes that need training rows, and validate the holdout path before any model loads. **The rounds were about the cases that measured nothing**: an unusable holdout and a probe that raised became `NOT_RUN` instead of a neutral OK, and when review showed that #1489's `--dataset` fallback loop overwrote a measured forgetting score, they fixed that too. 2809 tests pass on the merged tree, the issue's own mutation fails 5 tests, every other mutation across three rounds is caught, and the new tests fail 12 of 52 on `main` ([#1436](https://github.com/MakazhanAlpamys/Soup/issues/1436), [#1508](https://github.com/MakazhanAlpamys/Soup/pull/1508))- Wired `dpo_ref_regen_epochs` under LoRA, the half that their own #1294 had to refuse. trl keeps the reference as a frozen `ref` adapter and leaves `trainer.ref_model` as `None`, so the callback never copied anything. Now every Nth epoch it copies `.default.` into `.ref.` under `no_grad` with the `materialize_meta_adapter_copy` name mapping. It warns when there is no ref adapter or no source, and full fine-tuning is still refused by name. The tests run real CPU `train()` over all four DPO-family task/loss combinations, and a 999-sentinel test is the only one that catches a reversed copy. When review found two lines no test could see (the copied-count guard and the re-freeze), they pinned each with its own test in one push. 80 tests pass, 17 of them fail on `main`, and 6 of 6 mutations are killed ([#1345](https://github.com/MakazhanAlpamys/Soup/issues/1345), [#1636](https://github.com/MakazhanAlpamys/Soup/pull/1636))+ - `soup train --profile` announced a torch.profiler trace and wrote none, because nothing ever called `profiler.step()` and the schedule never left step 0. They added a lazily resolved `ProfileStepCallback` that steps it from `on_step_end` (the CLI stays import-light, startup test green) and a real tiny CPU training test that parses the Chrome trace. In one review round they removed an unreachable registration branch, made a trainer without a step hook say that no trace will be written, and added a one-time warning on a failing step. 60 tests passed; 10 mutations, 10 killed ([#1448](https://github.com/MakazhanAlpamys/Soup/issues/1448), [#1639](https://github.com/MakazhanAlpamys/Soup/pull/1639))+ - Made `soup train`'s custom auto-eval treat a `soup eval custom` that exits with its own message as a skip, as the benchmark branch already did, instead of printing a traceback and `Auto-eval custom failed: 1`. They also added the missing test for the benchmark branch's exit clause. Four mutations, each killed by exactly its own test ([#1641](https://github.com/MakazhanAlpamys/Soup/issues/1641), [#1658](https://github.com/MakazhanAlpamys/Soup/pull/1658))+ - The Auto-Eval section of `docs/evaluation.md` showed the `eval` extra's install command with no lead-in while the benchmark bullet still said "install the dependencies required by your environment", and its `trust_remote_code` bullet stated only half the rule. They added the lead-in, pointed the bullet at the extra, and made the trust bullet say it holds even with `soup train --trust-remote-code` and how to evaluate a custom-code base by hand, plus a pointer in the `--trust-remote-code` Coverage list; docs only, and the behaviour it describes is pinned by an existing test that fails if auto-eval opts in ([#1642](https://github.com/MakazhanAlpamys/Soup/issues/1642), [#1659](https://github.com/MakazhanAlpamys/Soup/pull/1659))+ - Carried #1504's resume fix to the other TRL trainers: resuming DPO, IPO, GRPO or Reward on a quantized base upcast the bf16 adapter to fp32 because only SFT restored the dtype after `_load_from_checkpoint`. One guarded `keep_trainable_dtype_on_resume` call per wrapper, and tests that drive each wrapper's own `train()` so a removed call is caught per wrapper; 4 of the new cases fail on main, 12 mutations (three per wrapper), 12 killed ([#1573](https://github.com/MakazhanAlpamys/Soup/issues/1573), [#1660](https://github.com/MakazhanAlpamys/Soup/pull/1660))- **AmixDigital** ([@Amix29](https://github.com/Amix29))- Gave `soup monitor` a real Apple Silicon path, where it had reported nothing but an NVIDIA-shaped blank since v0.44.1. The security work is the part worth naming: fixed absolute executable paths so `PATH` cannot influence what runs, `sudo -n` that never prompts and never reads a password, stderr pattern-matched for permission markers but never printed, and a parser that returns `[]` against a billion-laughs entity bomb, an XXE `file:///` reference, 5,000-deep nesting and embedded NUL bytes. **Three guards had no test holding them up and they closed all three in twenty minutes** — most importantly the call site that decides which implementation every Linux and Windows user gets, where `if True or detect_apple_silicon()` had left 126 tests passing. Their oversize-payload test had also been asserting on `b"x" * (CAP + 1)`, which is not a valid plist and returns `[]` whether the cap exists or not; they rebuilt it around a valid oversized document. The test file shrank by 18 lines and **every deletion was an upgrade** — membership assertions became adjacency assertions. Asked to confirm the live plist schema, they said plainly that the Mac is not theirs and they cannot authenticate `sudo`, rather than guessing — while confirming the two things they could check against the real binary ([#481](https://github.com/MakazhanAlpamys/Soup/pull/481))@@ -468,6 +472,7 @@ Listed by first contribution. PR numbers link the work.- `training.freeze_layers` and `training.freeze_ratio` loaded on all 23 tasks but are read in exactly one place, `SFTTrainerWrapper._setup_transformers`. On the other 21 tasks a `freeze_layers: 2` run trained every layer and said nothing. They refused the fields at load on those tasks and kept `tts` on the applying side, because its wrapper inherits the SFT setup. They tied the refused list to the trainers with an AST scan of `trainer/dispatch.py` instead of a hand-kept table, pinned the refusal on every backend, and filed the remaining within-`sft` gap as #1581. 106 tests; every reachable mutation killed ([#1497](https://github.com/MakazhanAlpamys/Soup/issues/1497), [#1532](https://github.com/MakazhanAlpamys/Soup/pull/1532))- `soup ab` reached `accept_h0` slowly when there was no difference: under their own #1265 statistic the Bayes factor had to fall to `log(beta / (1 - alpha))`, which took 621 pairs per arm on average at 0.3 standard deviations. They read the same mixture the other way, as an always-valid confidence sequence for the difference, and accept once it lies inside +-effect_size: 307 pairs at 0.3 sd and 117 at 0.5, with the reject rule unchanged byte for byte. **The part worth copying is how the decision was made**: both readings of `--beta` were measured on the same replayed runs and put in the PR with their costs (level beta was faster, 220 pairs against 307 at 0.3 sd, but took power at effect_size from 0.997 to 0.964). The maintainer chose level alpha, and the record keeps the option not taken. `--beta` is retired through the existing one-release deprecation staging: it warns once and changes no verdict. 466 passed across the `soup ab`, deprecation, fragment, startup and ANSI-guard tests; 27 of 30 mutations killed, the survivors an exact float tie and an unpinned `--beta 0` warning ([#1418](https://github.com/MakazhanAlpamys/Soup/issues/1418), [#1575](https://github.com/MakazhanAlpamys/Soup/pull/1575))- Kept their own #1419 release-note entry true after #1575 retired `--beta`: the entry said the `--alpha` + `--beta` < 1 check "stays" although it is in no tagged release and #1575 removes it, and pointed at #1418 instead of quoting the new 117-pair figure. Changelog-only; verified that neither v0.75.1 nor v0.75.2 carries the check, fragment test 21 passed, and every fragment assembled cleanly on main + #1575 + this PR; they flagged the matching #1378 sentence instead of editing another contributor's entry ([#1575](https://github.com/MakazhanAlpamys/Soup/pull/1575), [#1635](https://github.com/MakazhanAlpamys/Soup/pull/1635))+ - `training.freeze_layers` / `training.freeze_ratio` still loaded silently on the `sft` / `tts` paths that never read them: MLX, unsloth, vision, audio and layer streaming, plus `tts` on unsloth. Each of those setups attaches an adapter, so the run trained every layer. They filed the per-path table themselves, waited for their own #1532 to merge, then extended its validator so both refusals live in one place. **The part worth copying:** when two settings leave the text path, both are named in the trainer's dispatch order, and an AST scan pins that order and keeps every refused setup free of a freeze read, so the refusal cannot drift from the code. 40 new tests (18 fail on `main`); 12 of 13 mutations killed, the survivor being the `getattr` limit the PR states; 983 passed across 13 related files ([#1581](https://github.com/MakazhanAlpamys/Soup/issues/1581), [#1649](https://github.com/MakazhanAlpamys/Soup/pull/1649))- **GitFromRatatouille** ([@swalla02](https://github.com/swalla02))- First contribution, and it is the third instance of this repo's most persistent bug class found by someone else ([#363](https://github.com/MakazhanAlpamys/Soup/issues/363), [#423](https://github.com/MakazhanAlpamys/Soup/issues/423), [#659](https://github.com/MakazhanAlpamys/Soup/issues/659)): `soup migrate` refused **any** input named `*.jsonl`, a valid LLaMA-Factory YAML config included, because the guard branched on the filename while the content sniff written to gate it had **zero call sites in `src/`**. The diagnosis is worth more than the one-line fix — the test was named after the command and its body called the helper, so it passed on a codebase where `migrate` never imported it. **Then review found a regression their own fix introduced, and the way they closed it is the part to copy**: the sniff read `utf-8`, so a UTF-8 BOM survived as U+FEFF, which `str.strip()` does not remove, and a real BOM'd JSONL silently lost the friendly error it used to get — on a project with three Windows CI cells where PowerShell's `Out-File` writes that BOM by default. Their BOM test **guards its own fixture** (asserting the file really contains a BOM before asserting behaviour) and their bounded-read test measures the property with `tracemalloc` rather than pinning the spelling of the loop. Six mutations, six killed; zero assertions removed. They also **declined to widen the fix** to files whose name gives no hint, correctly citing the `.ipynb` case the original comment warns about, and left that as an open question rather than guessing ([#672](https://github.com/MakazhanAlpamys/Soup/issues/672), [#675](https://github.com/MakazhanAlpamys/Soup/pull/675))@@ -787,6 +792,7 @@ Listed by first contribution. PR numbers link the work.- First contribution: a hand-written `use_dora: true` on a GPTQ, AWQ, AQLM or EETQ base loaded and then failed inside peft when the adapter was attached, after the checkpoint download and the model load. They claimed the item on the issue first, then added a `SoupConfig` validator that refuses the pairing at config load with a message naming both settings and the fix, and moved the four formats into one set that Autopilot's `decide_peft` now reads too, so the schema and Autopilot cannot drift apart. **The part worth copying is the controls**: every test uses the same GPTQ-named base and flips only `quantization`, so a refusal keyed on the model name would have failed their own tests. 17 tests (5 fail on `main`), 11 of 12 mutations killed, and across 14,904 config loads nothing is newly accepted and the 404 new refusals are all `use_dora: true` with one of the four formats ([#1466](https://github.com/MakazhanAlpamys/Soup/issues/1466), [#1555](https://github.com/MakazhanAlpamys/Soup/pull/1555))- `training.quantization: mxfp4` passed config validation and then failed at the model load, because Soup built a bitsandbytes config for a format that belongs to transformers' own `Mxfp4Config`; the MXFP4 base Autopilot passes through failed the same way. They reproduced both on `main` and posted what transformers' quantizer says before writing code, then mapped `mxfp4` to `Mxfp4Config(dequantize=True)`, took it out of the k-bit prep path of all 15 trainer sites (it would cast the dequantized model to fp32), refused a local base that is not MXFP4 and the bitsandbytes-only `bnb_4bit_quant_storage`, and priced the base as the bf16 model it loads. **The part worth copying is the "not run" list**: no CUDA, no real MXFP4 weights, no training run, each with what it leaves unproven. 13 new tests (all fail on `main`, 26 across their test files), 26 of 26 mutations killed ([#1466](https://github.com/MakazhanAlpamys/Soup/issues/1466), [#1558](https://github.com/MakazhanAlpamys/Soup/pull/1558))- First contribution: disk-tier layer streaming turned direct I/O off for the whole store when torch's caching host allocator handed back a pinned staging arena off a 4096-byte boundary, and said so only in a log line. They aligned the placements inside the arena or took the next power of two, measured the shift again on the replacement, made `pinned_bytes` count the arenas actually held, and put the remaining page-cache fallback on the console. 12 CPU tests with a forced 512-byte offset (4 fail and 5 error on main), 12 of 12 mutations killed ([#1531](https://github.com/MakazhanAlpamys/Soup/issues/1531), [#1621](https://github.com/MakazhanAlpamys/Soup/pull/1621))+ - Follow-up to their own judge-down fix: its "N of M not judged" counts had only ever been tested with a judge that was dead from the first request, so the subtraction of the work already done was never observed. They added a test for each caller that stops the judge part-way, and one sentence in the data guide saying what a judge that stops answering does to `soup data from-traces`. **The part worth copying is the plain report**: when review found that the pair test (taken from the reviewer's own snippet) used only ties, so one of the two subtracted terms was never seen, they said they had run only the whole-subtraction mutation, switched to a kept pair first, and reran all three variants themselves. 2 new tests, 5 of 5 mutations killed ([#1522](https://github.com/MakazhanAlpamys/Soup/issues/1522), [#1648](https://github.com/MakazhanAlpamys/Soup/pull/1648))- **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))@@ -796,6 +802,9 @@ Listed by first contribution. PR numbers link the work.- **John Coplin** ([@johncoplin](https://github.com/johncoplin))- First contribution: the friendly-error formatter's `HTTP 401`/`HTTP 403` text patterns let two whitespace groups compete for the same run, so an exception message with `HTTP` followed by a long whitespace run and no status took about 13 s to print at 50,000 spaces. Since #1366, that check runs for every exception in the chain. They claimed the issue, rewrote both patterns so the optional whitespace is consumed only after a `:`/`=` separator, and added a timing test that fails on `main`. **The part worth copying is the equivalence test**: all 15 phrasings from the issue run against the old and the new pattern for both 401 and 403, so the speed-up provably changes nothing about what gets classified. 31 tests (1 fails on main), 7 of 7 mutations killed ([#1367](https://github.com/MakazhanAlpamys/Soup/issues/1367), [#1594](https://github.com/MakazhanAlpamys/Soup/pull/1594))+- **Jay Song** ([@deximple](https://github.com/deximple))+ - First contribution: a `soup sweep` arm whose trainer construction or `setup()` raised stayed `running` in the experiment tracker forever, because both calls ran before the `try` that marks a run failed. They moved them inside it, recorded the reason through the formatter `soup train` already uses, and tested both failure stages against the real SQLite tracker, including that the original exception propagates and training never starts. 2 tests (both fail on `main`), 6 of 6 mutations killed ([#1464](https://github.com/MakazhanAlpamys/Soup/issues/1464), [#1640](https://github.com/MakazhanAlpamys/Soup/pull/1640))+---Want to join this list? See [CONTRIBUTING.md](CONTRIBUTING.md) — good first issues are