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): #1784, #1771, #1822, #1774 [skip ci]
Alpamys8b785eb5b439
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.mdindex 88401faa..222517a4 100644--- a/CONTRIBUTORS.md+++ b/CONTRIBUTORS.md@@ -610,6 +610,7 @@ Listed by first contribution. PR numbers link the work.- `mistral-medium-3-5-sft` could not attach LoRA: its base is a `mistral3` vision-language wrapper, but the recipe had no `modality: vision` (so `AutoModelForCausalLM` rejected `Mistral3Config`) and `target_modules: auto` had no `mistral3` row. **They measured the real key names on the meta device before choosing the pattern**, so the row is a language-tower regex (8 modules adapted on a 2-layer skeleton, 0 in the Pixtral vision tower, where a plain suffix list would have adapted 16), left `ministral3` out as the issue asked, removed the recipe's `EXCEPTIONS` pin, and after review named the real Hub repo in the changelog, documented the row, built the stand-in on the real `Ministral3Config` and relabelled the tests that only document alternatives. 20 of 30 new tests fail on clean main, seven mutations caught, `recipes verify` moves from 0 attach to 1 attach ([#1395](https://github.com/MakazhanAlpamys/Soup/issues/1395), [#1482](https://github.com/MakazhanAlpamys/Soup/pull/1482))- A sink-based ratchet for outbound HTTP calls: the #616 guard found gates by their shape, so a differently written gate, or no gate at all, passed unchecked, and `energy.py` had its own loopback set that missed abbreviated IPv4 and `100.64.0.0/10`. They built the inverted scanner the issue asked for, and it **improved under review rather than merely passing it**: the first version saw 20 of 46 spellings of an outbound call, the two-pass one sees 45 (the missing one, an untyped client passed in as a parameter, is stated as a limit in the docstring); the table is keyed by qualified name with an exact call multiset, so a second call inside a declared function fails; and every declared gate is checked to exist and to be called (review had found four entries that named functions that do not exist). When review showed that the inert list held classes that open a connection, they removed the names rather than argue. `validate_electricity_map_endpoint` now goes through `net_guard`. 363 tests passed on the final head and 1361 on the tree merged with main, and 51 mutations were run on it, 42 caught ([#1547](https://github.com/MakazhanAlpamys/Soup/issues/1547), [#1646](https://github.com/MakazhanAlpamys/Soup/pull/1646))- Closed #1644: the automatic evaluation that `soup train` starts called `soup eval benchmark` and `soup eval custom` with `trust_remote_code=False` whatever the run was started with, so a base that needs the opt-in trained (the user had given it) and then could not load the adapter it had just saved: `Auto-eval custom failed: ... Please pass the argument trust_remote_code=True`, exit 0, no result. The rule had been decided on the issue (the run's flag reaches the evaluation, there is no `soup.yaml` key) and they **proposed that plan on the issue and delivered exactly it**: a keyword-only parameter defaulting to `False`, passed at the one call site, reaching the two evaluation loads and nothing else, with the field refused as an unknown key at the top level and under `eval:`. **What makes it worth keeping is the test set**: a CLI test that runs the real `soup train` with only the trainer and the two evaluation commands replaced (the one that catches a call site that forgets the flag), and, after review, a test pinning the omitted-keyword default and an AST test that counts the consumers of the flag and compares the expression each receives, so a later judge or scorer load cannot inherit it by accident. Both review-round mutations that had survived (the default flipped to `True`, a third consumer) are now killed, they took the optional value check too, and they resolved the merge with #1537 and #1658 by keeping both sides and rebased the docs onto #1659's `eval` extra section. 12 new tests; 9 of 9 source mutations killed by a named test ([#1644](https://github.com/MakazhanAlpamys/Soup/issues/1644), [#1662](https://github.com/MakazhanAlpamys/Soup/pull/1662))+ - Closed #1705: when remote training on a Lambda Cloud instance failed, the controller reported only the exit code and terminated the instance, so the error log was gone with it. They tee'd the remote run's output to a log under `set -euo pipefail` (so the exit code survives the pipe), and on a non-zero exit the controller fetches the tail over SSH (50 lines, 50 KB, 15 s) and prints it before terminating, with ESC, BEL, DEL and C1 bytes stripped and a fetch that can only print one warning line. **The part worth copying is how they closed the review findings**: the first request was a weakened assertion on the tail command, which they replaced with an exact one whose path is read out of the user data; the second was a survivor in which removing `capture_output` from the fetch left every test green while raw remote escape bytes went straight to the terminal, and they pinned that argument, `check=False`, the whole ssh argument list and a multibyte character split by the byte cap. The PR says plainly that no real Lambda instance was involved ([#1705](https://github.com/MakazhanAlpamys/Soup/issues/1705), [#1774](https://github.com/MakazhanAlpamys/Soup/pull/1774))- **Harsh Raj Singhania** ([@HarshRajSinghania](https://github.com/HarshRajSinghania))- First contribution. With six of seven `[train]` packages installed, `soup doctor` announced `Training stack not installed` and recommended `pip install "soup-cli[train]"` — a command that is a no-op for the six already satisfied. `group_missing` flipped on the first absent member, so **the usual broken install, one missing wheel, was reported as no install at all**. A partial stack now names what is missing. The same patch gates the NVIDIA wheel-tag hint on torch actually being absent: with torch present on a CUDA box that hint explains how to obtain a CUDA build of a package you already have, and it was printing anyway. **What decided this over a competing patch was the test.** The wheel-tag gate had a mutation that survived on the earlier head — dropping `and torch_missing` changed nothing any test could see — and they added `test_doctor_nvidia_partial_stack_with_torch_present`, after which that mutation fails exactly one test and no others. The assertion is `"index-url" not in out` rather than a specific sentence, which catches the hint appearing in either `issues` or `fix_pre`; a sentence match would have missed the duplicate line. They also took a consolidation request seriously when arguing that the original patch already passed its own tests would have been easier ([#875](https://github.com/MakazhanAlpamys/Soup/issues/875), [#884](https://github.com/MakazhanAlpamys/Soup/pull/884))@@ -694,6 +695,7 @@ Listed by first contribution. PR numbers link the work.- **Nehal kanak kuniyil thottathil** ([@sloemo01](https://github.com/sloemo01))- First contribution: the single-projection step of the Fast-LoRA tracker — LoRA forward and backward for one adapted projection as a `torch.autograd.Function`, with the scaling folded into the LoRA term, everything backward needs carried by `save_for_backward` (the #331 rule) including the NF4 quant state, and NF4 weights dequantised transiently so a streamed pool slot is never aliased past the call. **The review was about proving the fast path is actually taken, and every round closed exactly what was asked**: a vacuous `lora_B`, the `fan_in_fan_out` guard (removing it makes a square Conv1D silently diverge), `lora_bias` and double backward in round one; an unconditional delegate that left the suite green in round two, now killed by two `grad_fn` arms; and three narrowings of that pin (3-D input, bias-less, both) that all survived at 24 passed and now each fail by name. On CUDA, fp32, bf16 and NF4 agree exactly with peft ([#839](https://github.com/MakazhanAlpamys/Soup/issues/839), [#1087](https://github.com/MakazhanAlpamys/Soup/pull/1087))+ - Took the dropout item of #839 (the issue stays open): `patch_fast_lora_single_projection` now takes an `allow_dropout` opt-in, default off, so the single-projection kernel draws a one-byte-per-element keep-mask and rebuilds the dropped adapter input in the backward instead of handing the call to peft, while the shared check the MLP and QKV kernels rely on is untouched. The backward reads `ctx.saved_tensors` once because a non-reentrant checkpoint refuses a second read, and `lora_dropout=1.0` delegates because the rescale is NaN there. **The part worth copying is the pin on the default**: on CPU a seeded run cannot tell the kernel from `nn.Dropout`, so the test records the draw and checks the `grad_fn`, and flipping the default turns it red. The review round's three asks (that pin, NF4 + dropout on CPU, `p = 1`) landed in one commit, plus a seeded twin comparison and both `use_reentrant` modes. 46 passed and 2 skipped in the #839 file, CPU only; 22 mutants of mine all fail a named test ([#839](https://github.com/MakazhanAlpamys/Soup/issues/839), [#1784](https://github.com/MakazhanAlpamys/Soup/pull/1784))- **Xmon Dai** ([@xiechimon](https://github.com/xiechimon))- First contribution: the MCP run log at `.soup/mcp-runs/<run_id>.log` was the one unguarded open left in `mcp_server/execution.py`, so a file symlink planted there redirected everything the spawned child wrote. It now opens through the existing `open_no_follow` helper (#820) rather than a new inline guard, and a refusal surfaces as the existing path-free `ExecutionError` before the child spawns. **They declared a deviation from their own plan, with the reason**: `0o666` rather than the `0o644` they had proposed, because that is what plain `open()` passes, so a new log keeps today's permissions. Both mutants that survived the first review round, dropping `O_APPEND` and narrowing the mode, now fail tests, and the test skips cleanly where symlinks cannot be created ([#1138](https://github.com/MakazhanAlpamys/Soup/issues/1138), [#1150](https://github.com/MakazhanAlpamys/Soup/pull/1150))@@ -786,6 +788,7 @@ Listed by first contribution. PR numbers link the work.- Fourth merge. `soup reward synth`'s numeric verifier carried its own regex copy of the answer parser, so `1,000`, `#### 1,000`, `\boxed {42}` and `#### −42` scored 0 under the generated file and a good reference counted as rejected with no name. Both sides now go through `parse_reference` / `parse_completion` (the built-ins' parser), the compare at tolerance 0 is `Decimal` equality so large integers stay exact, and the report names every rejected reference while a refused run prints the first ten and `+N more`. **Worth copying is how three rounds were taken**: review found three mutations that survived (the refusal panel's naming, and reading the gold or the completion with the wrong parser) and they put the three tests in verbatim; the next push also took the unrequested follow-ups (`variables_conflict` in the emitted body, the capped listing) and then tripped the repo's ANSI ratchet, which they fixed with `strip_ansi` and a precise "non-dollar currency" wording. 27 new tests (7 failed, 6 passed, 14 errors on `main`); 22 of 22 mutations killed; 4,000 generated pairs agree with `math_verify_reward` ([#1350](https://github.com/MakazhanAlpamys/Soup/issues/1350), [#1533](https://github.com/MakazhanAlpamys/Soup/pull/1533))- Fifth merge. `info_rm` scored reward-model health with a cluster-separation index over a median split of the step's rewards, and on a two-valued reward such as `reward_fn: accuracy`'s 0/1 one half of that split is always constant, so the pooled variance fell to the `1e-9` floor and the index measured the success rate: a first step at exactly 50% recorded a baseline near 31,623, every healthier step after it read as a collapse, and a run halted or had its beta raised on a phantom signal. They made a step with a constant half cast no vote (no baseline, `halt_on_hack` and `kl_control` untouched, one warning per run) and tied the variance floor to the observed reward range. The review found the guard also silenced a genuine total collapse on a continuous reward; they took the narrow fix (a fully constant step votes once a baseline exists), restored the constant collapse fixtures, and caught a surviving mutation of their own by adding the test that pins it. 293 tests on the four files, nine mutations all caught, 11 of the 14 new tests fail on main ([#1438](https://github.com/MakazhanAlpamys/Soup/issues/1438), [#1630](https://github.com/MakazhanAlpamys/Soup/pull/1630))- Sixth merge, and the first translation: a Simplified Chinese README. A fifth language is a standing commitment, since every later edit to `README.md` has to be followed by a re-translation and a new stamp, and they signed up for it in the thread before starting, then held the PR until #1630 had merged so the queue stayed at one open PR. `README.zh.md` mirrors `README.md` section for section (19 sections, 12 code blocks, 20 table rows), translating prose and `#` code comments only; code, URLs, link targets, numbers and inline code are identical, which the translation ratchet and a separate mechanical comparison both confirm. The banner edit landed in all five READMEs in the same PR, and the stamps were recomputed after merging a `main` that had changed `README.md` (#1307) under them. They are named in `MAINTAINERS`, so the re-sync is theirs from now on. (#1632, #1733)+ - Took #1444: with `gradient_accumulation_steps` above 1, `task: prm` and `task: sft` with `data.format: raft` logged `loss`, `train_loss` and `grad_norm` G times too large (4.000x at the default G=4) and clipped a gradient G times too large, because both trainers return their own per-micro-batch mean while transformers still treated the model as one that accepts loss kwargs and skipped its `1 / gradient_accumulation_steps` division. They posted the plan on the issue first (`num_items_in_batch` is a label count, so it cannot express RAFT's `loss_weights` total), then set `model_accepts_loss_kwargs = False` in both trainers. **The part worth copying is the real-wrapper comparison**: PRM and RAFT run through their actual wrappers at `batch_size: 1` with four identical rows, once at G=1 and once at G=4, and the first logged `loss` and `grad_norm` must agree, beside a class-level ratio probe and a citation-boosted RAFT case; the fixture hides MPS from `transformers.training_args`, which caches accelerator availability. Five tests; flipping the flag back fails 2 PRM tests or 3 RAFT tests, and the neighbouring PRM and RAFT test files give 531 passed. The optional guard over all `compute_loss` overrides is not included ([#1444](https://github.com/MakazhanAlpamys/Soup/issues/1444), [#1771](https://github.com/MakazhanAlpamys/Soup/pull/1771))- **Maxi** ([@maximilianfeix](https://github.com/maximilianfeix))- AutoDistill's vocabulary guards and the weight shards' `retain_bytes=False` were pinned by no test. Disabling both guards and turning full-RAM hashing back on left all 41 autodistill tests passing. Tests now cover the capture guard for both bounds, the worker's own guard before the teacher loads (on a dataset that still matches its fingerprint), and a shard hash that retains no bytes. **They noticed the `-1` cases still passed with the capture guard off, because `CaptureToken` raises the same phrase, and said so in the PR instead of shipping them as coverage. Anchoring the matches on the full message closed the gap on the next push.** Every mutation fails the new tests: whole guard 4, lower bound 2, context and prompt bypasses 2 each, worker guard 1, teacher loaded first 4, each retention mutation 1 ([#1341](https://github.com/MakazhanAlpamys/Soup/issues/1341), [#1400](https://github.com/MakazhanAlpamys/Soup/pull/1400))@@ -889,6 +892,9 @@ Listed by first contribution. PR numbers link the work.- **Aykut Güney** ([@KeuqS](https://github.com/KeuqS))- First contribution: two commands and twenty options showed no description in `--help` (`soup plugins enable` and `disable`, the `soup data` scoring commands, `soup registry list` and `search`, `soup can publish` and `fork`, `soup agent train`), and nothing would have caught the next one. They wrote the missing docstrings and `help=` strings from what the code does and added `tests/test_cli_help_completeness.py`, which walks the live Click command tree and fails on any visible command or parameter without help, naming it; for positional arguments it reads the help from the Typer declaration, because Click 8.5 leaves `parameter.help` empty for them. After review they closed both items (the Click 8.5 argument help and the fragment name) in one push and the last import-order line in the next; 71 tests around the change pass, and five mutations each fail the new test with the entry named ([#1793](https://github.com/MakazhanAlpamys/Soup/issues/1793), [#1795](https://github.com/MakazhanAlpamys/Soup/pull/1795))+- **Emre K.** ([@kocaemre](https://github.com/kocaemre))+ - First contribution: closed #1812, where `soup data inspect` and `soup data review` passed dataset text through `rich.markup.escape`, which leaves ESC and the other control bytes in, so a dataset value could reach the terminal as a live OSC title escape. The sample-table headers and cells, the path lines, the vision `Image formats` row and the three review fields now go through `for_terminal`. **The part worth copying is how they fixed the tests after review**: the path and vision cases no longer need a control byte in a filename, so they run on Windows; the ESC assertion strips Rich's own colour codes first, so it holds under `FORCE_COLOR=1`; and a header regression plus an AST guard on the four sinks mean putting `escape` back fails a named test. They also kept the stats `Columns` row out of the diff because #1602 owns it, and said that the full suite could not run in their environment. In a review run, 11 of 13 mutations fail a test; the other 2 are on the `Inspecting` line, which the Windows leg cannot pin ([#1812](https://github.com/MakazhanAlpamys/Soup/issues/1812), [#1822](https://github.com/MakazhanAlpamys/Soup/pull/1822))+---Want to join this list? See [CONTRIBUTING.md](CONTRIBUTING.md) — good first issues are