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): #1578, #1663, #1676 [skip ci]

Alpamys8869710f8881
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md
index 61128b78..aef155eb 100644
--- a/CONTRIBUTORS.md
+++ b/CONTRIBUTORS.md
@@ -363,6 +363,7 @@ Listed by first contribution. PR numbers link the work.
- Made a `training.prm_reward` Hub id work. The reward head was read only from a local directory, so a GRPO run given `org/name` loaded both models and then died at the first reward call. They download the id (with `@revision`) through Soup's Hub wrapper, so the namespace-pin gate runs first. An existing directory wins over the repo-id shape, and a checkpoint with no reward head is refused at build time, naming the configured value. Two review rounds; each blocking item is pinned by a test that fails when the change is undone. 252 passed on the merged tree; 12 of 12 mutations caught; the new file fails 12 of 14 on `main` ([#1466](https://github.com/MakazhanAlpamys/Soup/issues/1466), [#1580](https://github.com/MakazhanAlpamys/Soup/pull/1580))
- A grpo run with `eval_steps` reported TRL's policy objective as `val_loss` everywhere Soup shows a validation number, and the held-out reward reached only `trainer_state.json`. They added a per-task validation-metric table, so grpo records `eval_reward` as `val_reward` in the panel, the tracker (with a lazy migration for existing databases) and the event stream, and every other task is unchanged. A real tiny CPU grpo run proves the tracker series matches `trainer_state.json`. In review they reserved `val_reward` from `benchmark:` gating, which closed a regression verdict computed from training data. 238 passed across 9 related files; 4 of 4 mutations caught on the final head ([#1389](https://github.com/MakazhanAlpamys/Soup/issues/1389), [#1592](https://github.com/MakazhanAlpamys/Soup/pull/1592))
- `data.add_new_tokens` / `new_special_tokens` loaded and were silently dropped on every unsloth setup, on MLX, under layer streaming and on twelve tasks whose trainers never call the expansion helper. They refused them at config load, ordered so switching backend never meets a second refusal, and re-measured every (task, backend) pair against the current trainers. Over three rounds they exempted SFT's vision/audio paths on unsloth and let a task's own backend refusal speak first. On the final head: 129 passed in the new file, 6 of 6 mutations caught, 186 configs probed, and 6794 passed / 0 failed across 86 files merged with main ([#1358](https://github.com/MakazhanAlpamys/Soup/issues/1358), [#1622](https://github.com/MakazhanAlpamys/Soup/pull/1622))
+ - Made every documented `soup` invocation resolve in the live CLI. They corrected six spellings from the issue and about sixteen more the reviews surfaced, and wrote a guard that walks the Click tree over every `soup ...` line and inline span in `docs/*.md` and `README.md` and every recipe description. It handles global options, `--no-*` flags, groups that run on their own, routed default subcommands, aligned columns and `VAR=value` prefixes. Over three rounds every gap came back closed with a control row. On the final head the guard, #979's guard and the translation sync test give 111 passed on the merged tree, and 12 of 12 mutations are caught ([#1465](https://github.com/MakazhanAlpamys/Soup/issues/1465), [#1578](https://github.com/MakazhanAlpamys/Soup/pull/1578))
- **Sohaib Kamash** ([@Nick-800](https://github.com/Nick-800))
- Added seven validated Qwen2.5-Coder, Qwen2.5-Math, and DeepSeek-R1-Distill-Qwen SFT recipes; synchronized all catalog-count sites and repaired the Mistral Small model identifier. Literal repository IDs and per-recipe learning rates are now load-bearing assertions ([#536](https://github.com/MakazhanAlpamys/Soup/pull/536)).
@@ -450,6 +451,7 @@ Listed by first contribution. PR numbers link the work.
- Widened the failure boundary in `soup train` so an exception raised during setup reaches `fail_run` instead of escaping it, which had left a run that died before training started sitting at `status='running'` forever with no error recorded ([#764](https://github.com/MakazhanAlpamys/Soup/issues/764)); they also recorded the run's pid and made `get_run` reconcile an orphaned run on read, so a process that vanished reports as terminated rather than as still alive. **The part I want to credit is what they did not change.** Seven neighbouring fields in `soup runs show` render unescaped text and they routed only `error_message` — arbitrary exception text — through the shared `utils.terminal.for_terminal`, declining to widen into a repo-wide sweep. That was the right call, and the one correction I owed them was in their favour's opposite direction: those fields are *unvalidated* rather than already-validated — `SoupConfig.base`, `output.dir` and the experiment name carry no control-byte validator — so the restraint is still correct but the reason is now written down for whoever reads that hunk next. 339 insertions, **zero removed test lines**. ([#767](https://github.com/MakazhanAlpamys/Soup/pull/767))
- `soup data forge --judge-provider anthropic --judge-base-url <x>` and `soup data recipe --provider anthropic --base-url <x>` blamed a failed Anthropic call on `<x>`, in the terminal and in the recipe's `.checkpoint.json`, although Anthropic ignores that flag and every request goes to `https://api.anthropic.com/v1/messages`, so an outage pointed the user at a host that was never contacted. They fixed it in the one shared label helper, so a single change covers both commands, and **built the label from the same constant the POST now uses, normalising the provider exactly as the dispatcher does**, so the message and the call cannot disagree on a spelling like `Anthropic`. In review the CLI tests were changed to record the URL actually posted to. Two mutants that had survived (POST sent elsewhere, Anthropic honouring `base_url`) went from 0/8 to 2/8, and they re-ran both themselves before pushing. 8 new test items, 6 of them fail on `main`; eight behaviour-changing mutations, eight killed ([#1340](https://github.com/MakazhanAlpamys/Soup/issues/1340), [#1370](https://github.com/MakazhanAlpamys/Soup/pull/1370))
- Found that the Hub dependency in the test suite was several times larger than the grep estimate in the issue: with the network blocked and an empty `HF_HOME` they ran the real sweep, posted the failure list before touching anything, and showed 76 tests across 10 files downloading tiny models for nothing they check. Replaced each download with a locally trained byte-level tokenizer and a randomly initialised tiny GPT-2/Llama, then consolidated ten copies of the builder into one shared helper that removes its temp directory at exit, keeping file-local only the two models whose shape the tests vary. The 10 files go from 53 failures + 24 errors offline on `main` to 495 passed, no leaked directories, and 9 of 9 mutations of the code under the rewritten tests are killed ([#1356](https://github.com/MakazhanAlpamys/Soup/issues/1356), [#1544](https://github.com/MakazhanAlpamys/Soup/pull/1544))
+ - Made a layer-stream shard re-check each stripe folder's real path before every layer write and before the marker write, where before it was checked once at the start, so a stripe root renamed and swapped for a link mid-shard now stops the shard by name instead of receiving the remaining layers. They also refused a directory junction as a stripe root while still accepting a genuine Windows volume mount point, telling the two apart by link target because both carry the same reparse tag, and made a reparse point that is neither refuse by name instead of raising a bare `ValueError`. They reused the existing `stripe_folder_problem` rather than writing a second check, state plainly that this narrows the window to one write and does not close it, and re-applied the junction rule inside #1628's new `check_stripe_root` without editing a test. Ten mutations, ten killed; 192 stripe and early-validation tests pass on the final head ([#1614](https://github.com/MakazhanAlpamys/Soup/issues/1614), [#1663](https://github.com/MakazhanAlpamys/Soup/pull/1663)).
- **MKnaomi2** ([@MKnaomi2](https://github.com/MKnaomi2))
- Made `soup doctor` recommend a CUDA wheel the driver can actually run, instead of telling everyone to install `cu121`. **The fallback directions are argued, not defaulted**: an unreadable `nvidia-smi` header falls back to `cu121` rather than the newest tag, because a parse failure most likely means an old driver and a too-new wheel is the failure mode that *looks* like success — pip installs happily and CUDA initialisation dies later. They also verified every tag the mapping can emit against the real PyTorch index **with a negative control** to defeat soft-404s. Review found one blocking defect and it is the interesting one: their first tests asserted `"cu121" not in advisory`, which matches the **installed torch version string** rather than the recommendation — so they passed in CI, where torch is CPU-only, and failed on every machine with a CUDA build, the same green-on-the-runner shape that has reddened this repo four times. They fixed it by asserting on `whl/cu121` **and adding a test that pins the trap**, so the naive form cannot return. All four non-blocking items landed in the same push, including the CWE-427 absolute-path resolution of `nvidia-smi` and the stale `cu121` advice in `README.md` ([#612](https://github.com/MakazhanAlpamys/Soup/pull/612))
@@ -812,6 +814,7 @@ Listed by first contribution. PR numbers link the work.
- First contribution, one slice of the #1448 audit: `soup serve` dropped `--structured-output` / `--json-schema` / `--regex-pattern` and `--reasoning-parser` on streaming chat completions, so `stream: true` returned unconstrained text with the `<think>` block still in it while the same request without streaming was constrained and stripped. They claimed that one item, wired the processors, the n-gram config and the reasoning parser into the streaming path exactly as the non-streaming handler does, and stripped the text before both the SSE chunks and the trace log. **Review found that the first constraint test mocked the builder, so building for `None` (the reported bug) still passed; they added the parity test the review supplied, which drives the same app with and without `stream` and compares what the client sees and what generation receives.** 5 tests fail on `main`, 11 of 11 mutations of the constraint, n-gram and parser hand-offs are caught, and 1231 serve-related tests pass with `main` merged ([#1448](https://github.com/MakazhanAlpamys/Soup/issues/1448), [#1607](https://github.com/MakazhanAlpamys/Soup/pull/1607))
- Fourth merge: a bad `SOUP_LAYER_STREAM_STRIPE_DIRS` entry was refused only when the layer-stream setup ran, after the dataset had loaded and a run row existed, and `soup train --dry-run` and `soup doctor` never checked the variable. They split the checks that need no disk probe into one helper shared by the setup path and doctor, so the setup stays the authority and the NVMe probe stays where it was; `soup train` and `--dry-run` now refuse before the prompt and the dataset load, and `soup doctor` lists each entry, sanitised, records an advisory issue for a refused one and applies the NVMe rule under `--disk`. Every gap four review rounds found became a test: 20 pass, the file cannot import on `main`, and 15 of 15 mutations of the new code fail one ([#1613](https://github.com/MakazhanAlpamys/Soup/issues/1613), [#1628](https://github.com/MakazhanAlpamys/Soup/pull/1628))
- Vision SFT crashed after the model loaded on a Hub `datasets.Image()` column (decoded PIL images) and on parquet image structs (`{"bytes", "path"}`), because the trainer treated every image value as a file path. They taught the trainer to convert decoded images and decode embedded bytes, and moved a path-only struct into the loader's existing path checks, so it gets the same refusals, media-directory resolution and `is_under` containment as a string path. **The part worth copying is that every guard branch got its own test**: over four review rounds each surviving mutation became a test, including one proving a struct whose bytes fail to decode never falls back to its unchecked path. 10 of 11 new tests fail on `main`; on the final head 8 of 8 mutations fail a test ([#1597](https://github.com/MakazhanAlpamys/Soup/issues/1597), [#1601](https://github.com/MakazhanAlpamys/Soup/pull/1601))
+ - `validate_stripe_root` refused a file given as a stripe entry, but no test named a file as an entry, so changing `isdir` to `exists` left the whole stripe suite green. They claimed #1674 with the file and the behaviour named, then added the one test that passes an existing file and asserts `StripeRootError` matching "existing directory"; the `isdir` -> `exists` mutation fails only that test (1 failed, 154 passed) and survives without it (154 passed, 6 skipped) ([#1674](https://github.com/MakazhanAlpamys/Soup/issues/1674), [#1676](https://github.com/MakazhanAlpamys/Soup/pull/1676))
- **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))