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): #1496, #1481, #1482, #1514 [skip ci]
Alpamys909d86c48a8d
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.mdindex 35022173..397d2506 100644--- a/CONTRIBUTORS.md+++ b/CONTRIBUTORS.md@@ -394,6 +394,7 @@ Listed by first contribution. PR numbers link the work.- Measured the post-#331 8B NF4 row on their own RTX 3050 Laptop 4 GB: 208.6 tok/s at 1935 MHz in a 2.40 GB peak. They **published the unflattering reading instead of the headline**: the raw 1.74x over the pre-repair 119.6 tok/s is a 2x clock difference, per unit clock the repaired code is about 14% slower (68% -> 59% of the same-session ceiling), and the record attributes that shortfall to none of the three changes it lists. Four review rounds tightened the provenance. The run date was recovered from the output file's timestamps, and the committed JSON was tied to that file byte for byte. The two laptops behind the two rows are told apart, and an unverifiable console line was removed rather than defended ([#361](https://github.com/MakazhanAlpamys/Soup/issues/361), [#1103](https://github.com/MakazhanAlpamys/Soup/pull/1103))- `soup train --find-lr` answered every failure of the live sweep, a missing base model id, a YAML syntax error in the config, a model or dataset that could not be loaded, or no `torch`, with a curve shaped by the LR schedule alone, wrote a `recommended_lr` from it and exited 0, so two different nonexistent ids reported the identical number. They deleted the fabrication rather than hiding it behind a flag: a new `LrSweepUnavailableError` beside `SweepTooShortError` makes every such case a refusal that names the cause, exits 1 and writes no report. The control test, a sweep that can run still writing its 8-point report, is what stops the refusal from swallowing a real measurement, and they disclosed the side effect that an install without `torch` now exits 1 before being asked. **The review round is the part worth copying**: five items came back, and each was closed with the mutation run to prove it. Removing the loader message, removing the escaped print and deleting the `SweepTooShortError` re-raise each survived the first round and each now fails a test; 10 of 10 mutations fail at least one test, and the new file fails 3 on `main`. The bug was found by @mohdUwaish59 while reproducing #1189 ([#1203](https://github.com/MakazhanAlpamys/Soup/issues/1203), [#1334](https://github.com/MakazhanAlpamys/Soup/pull/1334))- Answered #1440, the defect that Soup's own trace stream never yielded a preference pair: `parse_soup_serve` read the signal only from a nested `feedback.rating` that no producer writes, while `soup ingest` writes a top-level `signal`, and no parser ever set `edited_output`, so the round trip ended in a green `Wrote 0`. **What earned the merge is the scope and the clamp**: they fixed only the consumer half and said in the issue which half was left (thumbs into the `soup serve` trace log), changed `Closes` to `Refs` so the issue stays open, and clamped the top-level `signal` to a closed vocabulary, so the new "Signals present" line can only ever print constants — hostile `signal` values (lists, dicts, ANSI and OSC escapes, a 100,000-character string) read as `none`, verified by execution. Their 16 tests fail 11 on the parent commit; against 19 mutations 15 are killed, including the issue's own (read only `feedback`: 10 failed). Review found four surviving mutations (the no-signal branch of the message, `none` leaking into the present-signals list, precedence on a conflicting `feedback.rating`, a whitespace-only `edited_output`) and they closed all four by adding tests, **re-running each mutation against their own file rather than quoting mine**, and also gated the `soup ingest` hint to the one format that reads a top-level `signal` and corrected the docs to say who writes which signal. 414 passed across 9 related files on the merged tree ([#1440](https://github.com/MakazhanAlpamys/Soup/issues/1440), [#1498](https://github.com/MakazhanAlpamys/Soup/pull/1498))+ - `task: ppo` loaded `reward_hack_detector`, `reward_hack_mitigation` and `echo_trap_enabled` and then ran them blind: the trl PPO trainer takes no `reward_funcs`, so the shared signal buffer was never written, and because the buffer object existed the detector's `on_log` fallback returned early too. **They chose the refusal over a half-wired feed on exactly that second observation** (a controller that cannot fire is worse than a config that stops), refused the precise set `rl_callbacks_need_buffer` uses before `datasets` or any model loads, and left `reward_fn`-on-PPO and the real buffer feed out of the PR rather than widen it. **The round worth recording is the second one**: their first tests drove the helper and never `setup()`, so deleting the one call line left 12 of 12 green; they added setup-level tests with stubbed loaders and a flagless control, a drift test between the refusal and `rl_callbacks_need_buffer`, and moved the `datasets` import below the refusal so the flag is reported first. 21 tests; 11 mutations (call removed, condition inverted, each flag dropped, refusal after each load, never/always raising, no flag names, a fourth buffer flag) all killed, where the first round's call-removal survived ([#1441](https://github.com/MakazhanAlpamys/Soup/issues/1441), [#1514](https://github.com/MakazhanAlpamys/Soup/pull/1514))- **Aravind S** ([@ARAVIND281](https://github.com/ARAVIND281))- Measured the layer-streaming VRAM fit on a **second GPU and software stack** — an A10G 23 GB on Ubuntu with torch 2.13 / transformers 5.16.1 / trl 0.29.1, against the RTX 3050 laptop on Windows and torch 2.5.1 that every previous figure came from. All three findings are constraints on an open question rather than extra data points beside it: the v0.73.1 long-sequence under-prediction **does not reproduce** (flat 1.1621-1.1694 across seq 2048-6144 where the RTX series reads 0.787x at 6144), the logits loss term measures **12.000000 exactly** and invariant across vocabulary and torch version — so the shipped 14's `+2` retained copy, which #327 has never identified, demonstrably does not happen here — and the SDPA hypothesis #395 names as leading is **not supported**, with the math backend included as a positive control that IS expensive enough (3.27 GB at seq 6144) to prove the measurement could have found it. **They retracted their own headline figure mid-review** — a back-solved 11.83 B/element — and then enforced the retraction in CI rather than in prose: writing 11.83 back into the constant fails a named test. The discarded first sweep is kept in the record because its failure is silent: `data.max_length` truncates rather than pads, so short rows run at their own length while the prediction keeps climbing, producing a clean-looking over-prediction that is entirely an artifact and would mislead the next person identically ([#395](https://github.com/MakazhanAlpamys/Soup/issues/395), [#610](https://github.com/MakazhanAlpamys/Soup/pull/610))@@ -528,6 +529,7 @@ Listed by first contribution. PR numbers link the work.- The `docs/commands.md` coverage guard matched its regex against the WHOLE line, so a row's description could credit a command the command column never named. They narrowed the match to the command column - and when the first round showed the isolation itself was unpinned (`cmd = _command_column(line)` -> `cmd = line` left 18 tests green), they took the discriminating test as given and added it in the right class rather than arguing the mutation was unrealistic. Seven mutations now: five killed, two proven equivalent. The five doc rows the stricter guard newly refuses were fixed against live `--help` output, not against the diff ([#1046](https://github.com/MakazhanAlpamys/Soup/issues/1046), [#1094](https://github.com/MakazhanAlpamys/Soup/pull/1094))- A Bearer token containing a non-ASCII character made the Web UI's token check raise `TypeError`, so the request failed with a 500 and a traceback on the server console instead of a 401. **The header is now compared as UTF-8 bytes through one constant-time helper used by both auth paths**, pinned by a spy test that fails if the comparison ever becomes `==`, and a guard that walks the whole package for a `compare_digest` call on a str. They took both requested changes and both optional ones in one push ([#1195](https://github.com/MakazhanAlpamys/Soup/issues/1195), [#1246](https://github.com/MakazhanAlpamys/Soup/pull/1246))- The hardware-fit gate sized Hub models from a fixed marker list and called anything else 7B, so a 72B, 405B or 675B base was budgeted as 7B and let through to OOM on Linux or spill on Windows. Substring hits made it worse: `a3b` read as 3B, `11b` as 1B, `17b` as 7B. They replaced the list with a boundary-safe size parse, handling `8x7B` MoE totals, Llama 4 `17B-16E` active-plus-expert names, `-A22B` active tokens and OLMoE's active-first `1B-7B`. On the 91 catalog bases with a known real count, estimates within 10% went from 34 to 61, and 2x-or-worse under-predictions from 40 to 16. **What made it trustworthy was the yardstick**: the catalog test now checks real parameter totals rather than recipe labels, so a label wrong in the same direction as the estimate (Scout's "17B", DeepSeek-V3-0324's "7B") can no longer hide one. A reverse check keeps both tables in step with the catalog, which is how #1132's repointed ids were caught and fixed in the rebase rather than drifting. Three review rounds, every requested and optional item taken; 24 of 24 mutations fail a test ([#1198](https://github.com/MakazhanAlpamys/Soup/issues/1198), [#1285](https://github.com/MakazhanAlpamys/Soup/pull/1285))+ - `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))- **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))@@ -711,6 +713,12 @@ Listed by first contribution. PR numbers link the work.- First contribution: a completed `task: ppo` run reported `Loss: unavailable` because the loss summary only read the `loss` key while trl 0.29's PPOTrainer logs its per-step policy loss as `loss/policy_avg`. The fix lets the trainer declare the key (`loss_key="loss/policy_avg"`, SFT/DPO output unchanged), records it in the result and shows it in the completion panel; after review the wiring is pinned by a behavioural test that drives `_train_builtin` on a trl-0.29-shaped `log_history`, so moving the key to the wrong call or summarising an empty history now fails. 9 new tests (6 fail on `main`), 11 of 11 mutations killed ([#1413](https://github.com/MakazhanAlpamys/Soup/issues/1413), [#1416](https://github.com/MakazhanAlpamys/Soup/pull/1416))- First contribution: `test_worker_verification_survives_a_real_venv_launcher` failed whenever the suite ran from a virtualenv over a Python without the dependencies (the CONTRIBUTING setup on Homebrew): the child venv sees only the base interpreter's site-packages, so the worker died importing pydantic with an empty `worker exited with 1:`. They link the outer venv's site-packages into the child with a `.pth`, add a probe that names the missing dependency, and pin the helper with two hermetic tests that run on every CI platform. The file gives 19 passed from a bare interpreter and from a dependency-free venv (clean `main` from that venv: 1 failed, 16 passed), and all four mutations of the helper fail a test ([#1408](https://github.com/MakazhanAlpamys/Soup/issues/1408), [#1495](https://github.com/MakazhanAlpamys/Soup/pull/1495))+- **Chaitanya Reddy** ([@chaitanya-y20](https://github.com/chaitanya-y20))+ - First contribution: `format: auto` detected a dataset's format from the first row only, so a text-only first row made a LLaVA file load as `sharegpt` and lose every image, and the same happened to tool schemas, audio paths and ASR transcripts. They claimed the issue, then read a bounded 100-row prefix, resolved each row to its richest format, upgraded only strict richer/poorer pairs whose converter accepts every poorer row, and refused every other mix naming both shapes and the first row of each. **The part worth copying is what they did with review**: they fixed the Web UI explorer's new 500 on a mixed file and its disagreement with the loader, documented the behaviour in `docs/data.md`, pinned the two mutations that had survived, and took an optional point about the chatml to tool-calling upgrade silently dropping `name`/`weight` as a guard in the same defect class. 34 tests (19 fail on main), 15 of 18 mutations killed ([#1424](https://github.com/MakazhanAlpamys/Soup/issues/1424), [#1496](https://github.com/MakazhanAlpamys/Soup/pull/1496))++- **fukalous** ([@fukalous](https://github.com/fukalous))+ - First contribution: `soup diagnose` could not see memorization on long training rows, because the live probe caps the generation at 64 tokens while the score compared it with the whole held-out suffix by set-Jaccard: a verbatim 48-word echo read MAJOR on 60 and 100-word rows and OK from 150 words up. They replaced the overlap with clipped completion-bigram precision and, when review measured that a unigram version flagged unrelated real prose more often the longer the row (59 percent at 4000 words) and flagged one-word completions and repetition loops, moved the default path to bigrams too, added same-vocabulary, loop and short-completion controls, and swapped the word-level tokenizer fake for a character tokenizer so the sub-word path is pinned. 34 tests (13 fail on main), 7 of 8 mutations killed; verbatim 1.00 and unrelated 0.00 to 0.03 on real prose from 60 to 4000 words ([#1437](https://github.com/MakazhanAlpamys/Soup/issues/1437), [#1481](https://github.com/MakazhanAlpamys/Soup/pull/1481))+---Want to join this list? See [CONTRIBUTING.md](CONTRIBUTING.md) — good first issues are