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: credit three merged contributor follow-ups (#2016)

Alpamys Makazhan0cbb10ac130c
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md
index 2755ffbe..ca39a574 100644
--- a/CONTRIBUTORS.md
+++ b/CONTRIBUTORS.md
@@ -129,6 +129,7 @@ Listed by first contribution. PR numbers link the work.
- `soup ui` opened and printed a URL with no token, so the first tab was `Unauthorized` on first paint. They made the panel and the browser launch use the `?token=` login URL (also under `--no-browser`), and corrected the review's own premise: after #1191 the server, not `app.js`, consumes the token on a loopback bind, so the docs describe the 303 + HttpOnly cookie. 4 of 4 mutations killed, including `--no-browser` being ignored, which the first version of the test could not catch ([#1194](https://github.com/MakazhanAlpamys/Soup/issues/1194), [#1307](https://github.com/MakazhanAlpamys/Soup/pull/1307))
- `stream_layers` accepted `use_liger` and `use_flash_attn`, trained, and ignored both, because only the resident setup reads them. They claimed the issue, refused both at config load in the existing conflict list, resolved the issue's second box by pinning the task gate that already covers the streamed preference tasks rather than adding a dead branch, and added a scan test that fails when the streamed setup starts reading either field. When the review showed their "byte-identical" control asserted on pydantic's multi-line rendering and could not fail, they rebuilt it on the raw message (it now fails 6 mutants), fixed the trailing space it had hidden, and took the optional suggestion of naming only the switches that are set. 33 tests (7 of the first 32 fail on `main`), 9 validator mutations killed ([#1692](https://github.com/MakazhanAlpamys/Soup/issues/1692), [#1716](https://github.com/MakazhanAlpamys/Soup/pull/1716))
- A first QuEST resume from a format-v1 checkpoint read and hashed the whole local base three times, because the resume check re-resolved the `base:` string the run had just hashed. They passed the identity already held instead, and **when review showed their first version compared the metadata's own `base_model` with itself (which can never refuse, and would have accepted a continuation-path resume that `main` refuses), they said so plainly, switched to the identity of `config.base` resolved before the load, and added the continuation-path test that fails on the wrong source**. They also corrected their own earlier evidence, re-measured against a real `main` worktree: 11 of 13 new tests fail there. A `_hash_local_file` call count pins one fewer read per path, and six mutations each fail a named test ([#1199](https://github.com/MakazhanAlpamys/Soup/issues/1199), [#1728](https://github.com/MakazhanAlpamys/Soup/pull/1728))
+ - Exposed `registry.call_tool` and `sanitize` for direct MCP callers, sharing the server's stdout protection, result sanitization and error handling while retaining an explicit mutating-tool opt-in per call ([#1761](https://github.com/MakazhanAlpamys/Soup/issues/1761), [#1770](https://github.com/MakazhanAlpamys/Soup/pull/1770)).
- **Shutaru** ([@Shutaru](https://github.com/Shutaru))
- Kept the Transformers SFT import off the MLX dispatch route, so `backend: mlx` cannot reach the PyTorch/TRL stack even if `sft.py` stops being import-light later — and, told the PR did not fix the defect its title claimed, retitled it to match reality rather than defending the framing, leaving [#394](https://github.com/MakazhanAlpamys/Soup/issues/394) open for the unexplained hang. The `mlx-smoke` job it adds asserts mlx is *present*, not merely that torch is absent: the earlier shape went green having executed nothing ([#431](https://github.com/MakazhanAlpamys/Soup/pull/431))
- Found and fixed a silent data-corruption bug in assistant-only loss masking: `BatchEncoding` is not a `dict`, so the guard missed and the mask was built from the mapping's **key strings** — no exception, normal loss curve. Split it out of #426 on request, then decided the case the issue asked to be decided rather than inherited: an all-zero mask with assistant messages present is rejected rather than honoured (measured: 0 trained tokens before, 2 after) ([#439](https://github.com/MakazhanAlpamys/Soup/pull/439))
@@ -458,6 +459,7 @@ Listed by first contribution. PR numbers link the work.
- `soup infer` was documented as batch inference but generated one prompt at a time. They added an opt-in `--batch-size` that renders each prompt through the shared template path, left-pads, generates once per batch and writes rows back in input order, with token counts that stop at the first EOS or pad, so short rows are not inflated, plus a refusal of `--cuda-graphs` above batch 1. **The review rounds were about proving order, and they got there**: their prompt-dependent pairing test, where the fake model answers from each row's own content with mixed lengths and early stops, kills the length-sort and reversed-batch mutations that position-only tests could not see. 79 tests in the two infer files (21 fail on `main`), 14 of 14 behavioural mutations killed ([#765](https://github.com/MakazhanAlpamys/Soup/issues/765), [#1083](https://github.com/MakazhanAlpamys/Soup/pull/1083))
- Published the STEP 2b determinism reconstruction (`benchmarks/harness/determinism.py`): forward twice, backward rep 1 vs rep 3 and a trained 5-step curve twice, streamed NF4 against a resident NF4 reference, with the record's asymmetry as the verdict. Over four rounds it went from a validator of hand-written JSON (where a `null` read as the defect) to an in-process measurement. **The fix that mattered** was ordering: the historical control has to be installed before the streamed model is built, or the harness measures the repaired path. It now goes through `build_streamed_arm(..., "control", ...)` and restores the control in a `finally`, and a `main()` test pins both, so swapping in the clone arm or dropping the restore fails it. Six of its 20 CPU tests drive the real measurement path. Not run on CUDA ([#379](https://github.com/MakazhanAlpamys/Soup/issues/379), [#1286](https://github.com/MakazhanAlpamys/Soup/pull/1286))
- Closed #1616, which asked that a layer cache whose files were rewritten for other settings is never reported reusable for the old ones, and that files the index no longer names are reported. After the maintainer's correction in the thread (a content-changing interrupt must be a miss; only a layout-only re-shard may keep the old index) they made `index.json` move to `index.json.resharding` before the first write of a re-shard whose dtype, quantization, source fingerprint, external policy or format differs, so the next run reports `previous re-shard did not finish` and re-shards; the marker is removed only after the new index is committed. **The part worth copying is the interrupts**: the tests stop `_atomic_save` after two layers and `_atomic_write_index`, on one root and on a striped cache, and the layers-interrupt tests check that every layer file is float32 after the next run, rather than asserting on the marker alone. Part 2 reports unindexed `layer_*.safetensors` and `.soup.*.tmp` files with their size through `for_terminal` and deletes none of them; the tests include a three-root layout, an interrupt between the index commit and the deferred delete, and a stripe folder named `stripe-[bold]`. The PR said plainly that three setup tests needed `peft`, which was not installed. 22 sharder tests and 686 across 14 related files pass; removing the quarantine call fails 4 and flipping its predicate fails 6; the four predicate terms double_quant, quant_device, external_mode and format_version are not pinned by a test ([#1616](https://github.com/MakazhanAlpamys/Soup/issues/1616), [#1747](https://github.com/MakazhanAlpamys/Soup/pull/1747))
+ - Made mixed direct-I/O stripes visible through per-root runtime stats and a `k/N` ready line, named each page-cache fallback and its operating-system refusal reason, and limited disk read-ahead guidance to disk-tier runs ([#1615](https://github.com/MakazhanAlpamys/Soup/issues/1615), [#1962](https://github.com/MakazhanAlpamys/Soup/pull/1962)).
- **chadetov** ([@chadetov](https://github.com/chadetov))
- First contribution, and it is the kind that is easy to file as a one-line fixture tweak and much harder to *diagnose*: `test_sft_smoke` had been red since v0.36.0, and they traced why nobody knew. `pyproject`'s `addopts` carry `-m 'not smoke'`, and the only smoke job in CI is `mlx-smoke`, which selects `-k mlx_sft_smoke` on an install that asserts the PyTorch stack is **absent** — so `test_sft_smoke` and `test_dpo_smoke` run in neither the default suite nor CI, which is how a fixture drifted out of sync with a hard error added five releases earlier. **The scope discipline is what got it merged unchanged**: the MLX fixture carries the same `format: chatml` line and they left it alone, because it reaches the MLX trainer rather than `sft_format.py` and is the one smoke test CI actually runs and passes — verified, not assumed. They also declined to wire the PyTorch smoke tests into CI in the same PR and said why (model downloads, runner minutes), leaving the call to the maintainer instead of taking it ([#594](https://github.com/MakazhanAlpamys/Soup/pull/594)). Separately, and on the same day, they measured `utils/log_level.py`'s branch coverage on #273 and filed [#595](https://github.com/MakazhanAlpamys/Soup/issues/595) — four code sites quoting a probe-denominated VRAM ratio under a "real peak" label, plus a schema field description still carrying a justification the gate record had explicitly withdrawn
@@ -903,6 +905,7 @@ Listed by first contribution. PR numbers link the work.
- Closed #1792: seven CLI help strings held literal bracketed text (`[deprecated]`, `[doc-id]`, `[doc-N]`, `soup-cli[sigstore]`, `[data-pro]`) that Rich read as a style tag and dropped, so `--api-key` no longer said it was deprecated and the `--citation-style` help showed `()` instead of `([doc-id])`. They escaped all seven, including the two inside command docstrings, and added a ratchet that walks the live Click tree (2578 help strings, Click and Typer declarations) and fails on any bracketed tag Rich would drop. Review checked it: 19 passed on the merged tree and 8 failed on clean main; un-escaping each of the seven strings was caught by two tests (7 of 7); the rendered text of all 1419 command and option help strings changed in exactly those seven places ([#1792](https://github.com/MakazhanAlpamys/Soup/issues/1792), [#1840](https://github.com/MakazhanAlpamys/Soup/pull/1840))
- Added schema descriptions for seven previously undocumented `soup.yaml` fields, including the core training settings ([#1794](https://github.com/MakazhanAlpamys/Soup/issues/1794), [#1831](https://github.com/MakazhanAlpamys/Soup/pull/1831))
- Refused invalid benchmark, recipes-verify and CUDA-graph requests before heavy imports or model loading ([#1817](https://github.com/MakazhanAlpamys/Soup/issues/1817), [#1841](https://github.com/MakazhanAlpamys/Soup/pull/1841)).
+ - Fixed loss-spike recovery limits across launches by checking prior attempts before incrementing the persisted count, and handled malformed recovery hints without crashing ([#808](https://github.com/MakazhanAlpamys/Soup/issues/808), [#1971](https://github.com/MakazhanAlpamys/Soup/pull/1971)).
- **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))