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(contributors): #1515, #1518, #1501, #1502, #1505, #1506, #1507 [skip ci]

Alpamys6c05c3b121ec
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md
index a0686f64..f72d6317 100644
--- a/CONTRIBUTORS.md
+++ b/CONTRIBUTORS.md
@@ -201,6 +201,11 @@ Listed by first contribution. PR numbers link the work.
- Wrote the recipe size ratchet for #1161: `glm-4.6-sft` was labelled 9B on a 357B base and nothing compared a recipe's label with its base, so they recorded the Hub's parameter count per base (anonymously, with a reason when there is none) and made the test compare every label inside 0.70x to 1.15x. **The part worth copying is how the first version failed and what replaced it**: its kill test did arithmetic on hard-coded constants and its check `continue`d when a base had no count, so putting the GLM-4.6 label back left every test green; the final version names any recipe whose base has no count unless it is excluded with a reason, and the kill tests run the real check over `dataclasses.replace()` of the live catalog. Dropping the `continue` is also what surfaced the labels nobody had listed: the four Llama 4 Scout recipes (17B active against 109B total, hidden behind eighteen "gated" exclusions because `model_info` answers without a token), `deepseek-v3-7b-sft` (7B on a 685B base) and `voxtral-sft`. Four rounds, rebased over #1132, #1112 and #1113; the last one was the test's own "an exclusion must still be used" check going red on the `spark-tts` removal. 203 tests in the directly affected files and 4284 passed / 1 skipped across 39 recipe-touching files on the merged tree; 12 of 13 mutations caught (the survivor is the offline record script's failure branch); regenerating the fixture changes nothing ([#1161](https://github.com/MakazhanAlpamys/Soup/issues/1161), [#1168](https://github.com/MakazhanAlpamys/Soup/pull/1168))
- `soup mcp serve` planned a run by copying the config to `.soup/mcp-runs/<run_id>/config.yaml` through whatever `.soup` and `.soup/mcp-runs` resolved to, so a directory symlink or junction at either level redirected the plan-time write, and on `main` even a junction to a directory outside the working directory got directories created in it before a bare `ValueError` surfaced. They took the follow-up their own #1171 had left, calling the same `refuse_linked_dirs` helper before the `mkdir` and refusing the plan with a path-free error. The six tests cover a symlink and a real junction at both levels, each directly and through the `train_start` handler (5 of 6 fail on `main`); mutations of the call fail 5 of 6, checking `.soup` only fails the 2 `mcp-runs` tests, and dropping the helper's reparse-point branch fails the 2 junction tests ([#1211](https://github.com/MakazhanAlpamys/Soup/issues/1211), [#1492](https://github.com/MakazhanAlpamys/Soup/pull/1492))
- Fixed `soup train` for the sequence-classification family (#1219): the loader kept source columns only for `grpo`, so `classifier` / `reranker` lost `label` and died after the model loaded, and `cross_encoder` pair rows could not be loaded at all. **Five review rounds, and the lesson was in the scoping.** The first version taught `detect_format` the pair shape globally, which made GSM8K-shaped `{question, answer}` rows train GRPO silently on empty prompts; they moved the resolution to the one task that reads pairs (`data_config_for_task`) and gated `data.format: cross_encoder` at config load. A real-run test pins the second load site, so the dry run and the real run agree. 13 mutations killed, 6 failed / 4 passed on `main` ([#1219](https://github.com/MakazhanAlpamys/Soup/issues/1219), [#1306](https://github.com/MakazhanAlpamys/Soup/pull/1306))
+ - GRPO's `accuracy` and `math` rewards scored `The answer is 42 because 6*7=42.` as a hedge (0.0), because the answer clause only ended at punctuation and kept the justification's numbers. They ended the clause at `because` / `since` exactly as the ruling specified (any case, whitespace on both sides, never `as`), and over three rounds turned every review point into a test: the first round's own regression (a leading `Because` emptying the clause) came back fixed with its own test class, and the last two unpinned boundaries (`as` and a connective at the end of a truncated completion) were pinned verbatim. 176 tests in the touched files (19 fail on `main`), 3251 across the reward suites; 14 of 15 boundary mutations killed, the 15th equivalent ([#1328](https://github.com/MakazhanAlpamys/Soup/issues/1328), [#1501](https://github.com/MakazhanAlpamys/Soup/pull/1501))
+ - `distill_mode: sequence` skipped rows with no prompt turn silently, then named the wrong row in its refusals (a position in the rebuilt teacher list, not in the user's file), and a split with nothing left crashed in the DataLoader at `train()`. They carried each row's source position through the rebuild, report skipped rows at setup and refuse an empty split before training. **What made it mergeable**: when review showed a user's own `_source_index` column could renumber a refusal, they redesigned it so Soup writes the index and only sequence mode trusts it, and pinned both call sites. 10 tests (8 fail on `main`), 286 across the distillation suites; 19 of 20 mutations killed, the 20th equivalent ([#1344](https://github.com/MakazhanAlpamys/Soup/issues/1344), [#1502](https://github.com/MakazhanAlpamys/Soup/pull/1502))
+ - `soup expect` passed every preference dataset at any threshold: `expect_chosen_preferred_over_rejected_by_judge` scored every row 1.0 when no judge was given, and the command never gave one. They made a missing judge a violation per row, added `--judge` and `args.judge` (validated when the suite loads, CLI wins), built the judge from the existing URL rules with both-order pairwise judging, made `advisory: true` an explicit opt-in that the output names, and stopped at the first unreachable judge with exit 1 instead of scoring it as a quality failure. Three rounds: the second closed all six review items, the third was a clean rebase onto a docs change that landed in between; 438 tests passed and 8 of 9 mutations on the final head were killed, including both that survived the first round ([#1433](https://github.com/MakazhanAlpamys/Soup/issues/1433), [#1505](https://github.com/MakazhanAlpamys/Soup/pull/1505))
+ - `soup train --cloud lambda` held one idle SSH session for up to 25 hours with no keepalive, and read `ssh`'s exit 255 (connection lost) as a failed run, so a Wi-Fi drop or a NAT timeout terminated the instance and lost the job. They replaced it with short keepalive polls every 30 s that report cloud-init's own state, a 15-minute outage window with capped backoff that a good poll resets, and a `scp` retry window that starts at the first failure. **The value is in what review made testable**: the first version read a missing exit file as "still running" (a 25-hour paid keep-alive), and the fix for that lived in a remote shell string no test executed. The final tests run that exact command under `sh` with a fake `cloud-init`, and pin the clock reset with two ten-minute outages around one good poll. 8 of 9 mutations are caught; the survivor changes only the poll interval. The new tests fail 17 of 21 on `main` ([#1439](https://github.com/MakazhanAlpamys/Soup/issues/1439), [#1506](https://github.com/MakazhanAlpamys/Soup/pull/1506))
+ - `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))
- **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))
@@ -354,6 +359,8 @@ Listed by first contribution. PR numbers link the work.
- Pinned the async-disk tier's page-lock recovery behaviourally: a real `AsyncDiskSource` built from a minimal on-disk shard, only its pinned staging allocation failing, driven through the real drain into the real VRAM probe — so replacing the drain with `pass` fails on `peak.oom is False`, the exact misreport of #1003. It complements a recorder-based test that proves the call and its order; this one proves the stale error is actually gone ([#1095](https://github.com/MakazhanAlpamys/Soup/issues/1095), [#1098](https://github.com/MakazhanAlpamys/Soup/pull/1098))
- Published the STEP 14 control-versus-repair gate (`benchmarks/harness/variant2_gate.py`) that the H100 record could only describe. Review then found its wiring counter had been blind since #1010: `StreamedDecoderLayer.named_modules()` hides the wrapper carrying `n_dequant_forward`, so `wiring_distinct` could never be true. They now walk registered children, refuse to measure a repaired arm with nothing rewired, and pin both the whole-run verdict and `_run_arm` on CPU, with 14 of 17 mutations killed ([#379](https://github.com/MakazhanAlpamys/Soup/issues/379), [#1085](https://github.com/MakazhanAlpamys/Soup/pull/1085))
- The regex PII baseline behind `soup expect`, `soup data pii` and `soup data score` was **quadratic** on long `[\w.+-]` runs with no `@`: the email pattern restarted at every word boundary, so one 50 KB row of `1-1-1-...` took 14-20 s, paid again for every such row. They made a match start only where a run starts, keeping the rule that the local part needs a word character, and **pinned both sides of the trade**. An 8N-versus-N ratio test covers the speed: 59-66x on `main`, worst 11.8 of 300 repeats against a limit of 32 with the fix. A seeded differential against the old pattern, with the two known snippet differences named, covers the detections. Row flags are identical by construction, and in review 7.2 million exhaustive strings plus 100,000 random rows showed 0 disagreements. 7 of 7 mutations of the fix fail their tests ([#1329](https://github.com/MakazhanAlpamys/Soup/issues/1329), [#1360](https://github.com/MakazhanAlpamys/Soup/pull/1360))
+ - Closed #1309, a setting that was accepted and then ignored: `training.gdpo_variant` loaded on `task: dpo` and `task: preference` and its description promised to replace the trainer's preference loss, but on trl >= 0.29 the `DPOTrainer.dpo_loss` hook it relied on is gone, so every variant trained exactly the default loss and nothing said so. They took the owner's "refuse" ruling and kept to it: a `mode="before"` field validator that refuses every non-null value, so `bogus`, `false`, `""` and `[]` get the same message as the real variants and the task and backend gates cannot mask it. **What makes it a good change**: every test the earlier EBFT refusal (#1279) had handed to this fix was inverted rather than deleted — loads-as-valid became refused, the two gate-unchanged tests became "refusal precedes the gate", the silent `False` from the legacy hook became a `ValueError` — and the refusal text names the nearest real alternative while saying it is not identical. 452 tests in the four touched files (44 fail on a clean `main`); 12 mutations of the validator, its message and the `live_wired` flags, 12 killed ([#1309](https://github.com/MakazhanAlpamys/Soup/issues/1309), [#1515](https://github.com/MakazhanAlpamys/Soup/pull/1515))
+ - Took the `soup data score` slice of [#1448](https://github.com/MakazhanAlpamys/Soup/issues/1448), an option that was validated, announced and then read by nothing: `--benchmarks` and `--threshold` were accepted and decontamination was always called with no texts, so the scorecard printed `Decontaminated 0` for any input. They added `--benchmark-file` and wired the supplied texts and the threshold to the real 8-gram kernel, refuse labels alone by name, and made the "not run" case say so instead of showing a zero. **What makes it worth keeping**: asked what the `-b` labels do once a file is given, they did not argue it — they put the answer in the help text, the docs, a printed note and a test — and every refusal (labels alone, malformed or non-object JSONL, a truncated file, an empty or unusable corpus) comes before a scorecard prints, so a bad corpus can no longer read as a clean result. 34 tests (22 fail on a clean `main`); 16 mutations of the wiring, the strict loader and the core validation, 16 killed ([#1448](https://github.com/MakazhanAlpamys/Soup/issues/1448), [#1518](https://github.com/MakazhanAlpamys/Soup/pull/1518))
- **k4its1t** ([@k4its1t](https://github.com/k4its1t))
- First contribution, picking up where #497 stopped one day earlier. The dtype scanner's predicate already matched anything starting with `AutoModel`, so every `AutoModelFor*` load was covered and the surviving hole was **concrete, non-Auto** classes: `Qwen2VLForImageTextToText.from_pretrained(..., dtype=)` or `BertForMaskedLM.from_config(..., dtype=)` were invisible and would have shipped a kwarg that TypeErrors below the declared transformers floor. Four suffixes, a focused regression test each, both load methods. **Their own mutation claim was the coarse one -- removing all four suffixes makes four tests fail -- and removing them one at a time is stronger than they claimed**: each single removal produces 1 failed, 15 passed, so every named test is the sole guard for its own suffix rather than the four reddening together. The two things I check on any widening they got right: the four existing false-positive controls survive untouched (a guard that fires on correct code is one people delete), and all six deleted lines are a rename plus reworded docstrings, not a test. The rename `_is_transformers_model_load` -> `_is_dtype_guarded_model_load` describes the contract being enforced instead of implying every matched class comes straight from transformers. **Scope was not oversold, which is why it is worth writing down**: none of the four suffixes appears in `src/` today and the scanner reports zero live hits, so this is prospective -- Whisper loads as `WhisperForConditionalGeneration` and #497 already covered it. Timely prospective work, though: concrete vision classes are exactly what #488, #501 and #502 are moving through right now ([#500](https://github.com/MakazhanAlpamys/Soup/pull/500))