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): #1456, #1475, #1472, #1471

Alpamysf95f95276e07
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md
index 5bbf8fff..6bca28d1 100644
--- a/CONTRIBUTORS.md
+++ b/CONTRIBUTORS.md
@@ -96,6 +96,7 @@ Listed by first contribution. PR numbers link the work.
- Two tests for a defect that is **already unreachable**, delivered within the hour of being asked for — and the reason they are worth having is the second one. `TestRealPageLockFailureIsDrainedBeforeTheProbeRuns` drives the real `_build_source(pin=True)` with only `RamSource` mocked to fail its pinned allocation, so #901's `recover_from_failed_page_lock` -> `drain_stale_cuda_error` runs for real before the VRAM probe. `TestPositiveControlUndrainedErrorReadsAsOom` is the control: **an undrained stale `AcceleratorError` classifies as `oom=True`**, which is the misread users reported — a page-lock failure surfacing as an out-of-memory with gigabytes free. A regression test for an unreachable defect is decoration unless something proves the harness would catch it, and that is what the control does. They reached this by investigating and concluding **not reproducible, with the reason** rather than shipping a speculative patch. Verified here: 2 passed under peft 0.20.0 and 0.21.0, 68 across the neighbouring #901/#1002 suites, and neutralising the drain at `layer_stream_runtime.py:2818` fails the test — pinned to the mechanism, not the classifier ([#1003](https://github.com/MakazhanAlpamys/Soup/issues/1003), [#1072](https://github.com/MakazhanAlpamys/Soup/pull/1072))
- `training.gradient_checkpointing` was decided by the trainer rather than by the config on every 4-bit path: `prepare_model_for_kbit_training` was called without the resolved value, so `false` could not turn checkpointing off and nine wrappers could drop a `true`. Threaded into every k-bit site on the text path, thirteen wrappers from `sft` through the preference and RL families. **The part worth copying is what they did when the first revision's test was too weak**: asked for behavioural coverage, they did not add more kwarg assertions — they drove the real `_setup_transformers` for sft, dpo and grpo, so forcing `use_gradient_checkpointing=True` at the SFT text site or the GRPO site fails its own parametrisation, and the count of tests that fail without the fix went from 2 of 16 to 9 of 20. They also **declared the scope they did not take**: the vision and audio k-bit sites are named as a follow-up and [#797](https://github.com/MakazhanAlpamys/Soup/issues/797) stays open for them rather than being quietly closed. Two reds on this branch were mine to explain and not their code -- [#382](https://github.com/MakazhanAlpamys/Soup/issues/382)'s Windows illegal instruction, and the Lambda SIGINT test that [#1073](https://github.com/MakazhanAlpamys/Soup/issues/1073) repaired ([#797](https://github.com/MakazhanAlpamys/Soup/issues/797), [#1045](https://github.com/MakazhanAlpamys/Soup/pull/1045))
- `accuracy` and `verifiable/math` scored 0.0 on common MATH answer spellings: `\boxed{90}` against a `90^\circ` gold, `\boxed{\text{Paris}}`, `\boxed{\frac12}` against `\frac{1}{2}`, and an `x = 7` prefix that only the completion side read. They taught the shared normaliser all four rewrites. Then, over three review rounds, they kept the variable's name so `x = 3` never pays `y = 3` (in both rewards, including `math`'s tolerance branch). They reworked the compact `\frac` rule after review showed their first version broke two MATH-500 golds (`\frac 34`, `\frac 59`), refused a gold with nothing after `x =`, and added a growth test for each rewrite. **Each push came with its own negative controls, and every one matched what the review measured.** All 16 mutations of the final fix fail its tests (262 of the 3025 fail on `main` without it). Across 9,792 GSM8K and MATH-500 golds, 70 MATH-500 readings change and none is refused ([#1346](https://github.com/MakazhanAlpamys/Soup/issues/1346), [#1371](https://github.com/MakazhanAlpamys/Soup/pull/1371))
+ - `soup sweep --config sweep.yaml`, as the docs wrote it, could not work: `--param` was required, `--config` is the base `soup.yaml`, and `load_sweep_yaml` / `SweepSpec` were complete and tested with no caller anywhere in the CLI. They added a dedicated `--sweep-config` flag instead of overloading `--config`, made `--param` optional with clear errors for both-or-neither, and documented the precedence (file `strategy` and `seed` over `--strategy`, non-zero `n_runs` over `--max-runs`, `n_runs` only caps). **The second round is the one to read**: they applied every review finding exactly (a malformed YAML file no longer ends in a traceback, `for_terminal` on the error line keeps `params[lr]` and `sw[lr].yaml` intact, the fragment credit, `strip_ansi` on three raw assertions) and replaced a seed test that any constant satisfied with one comparing two seeds, so replacing the file's seed with a constant now fails a test. `Refs` rather than a closing keyword, because the issue has other items. 9 new tests, all fail on clean `main`; 12 mutations, 10 killed ([#1465](https://github.com/MakazhanAlpamys/Soup/issues/1465), [#1475](https://github.com/MakazhanAlpamys/Soup/pull/1475))
- **Ben Younes** ([@ousamabenyounes](https://github.com/ousamabenyounes))
- `MitigationLogWriter` dropped every record in silence once its parent directory vanished mid-run — the controller kept acting while its evidence stopped growing ([#398](https://github.com/MakazhanAlpamys/Soup/pull/398))
@@ -641,6 +642,7 @@ Listed by first contribution. PR numbers link the work.
- Second merge. The #361 NF4 throughput harness stamped its rows with `git rev-parse HEAD` of its own checkout. A row from a dirty tree, or from a `soup_cli` imported from somewhere else, therefore named a commit whose code did not run. They moved it onto the #1085 function: the repository is found from `soup_cli.__file__`, a dirty tree is marked `-dirty`, and a package outside any git checkout records `unknown`. Their test answers `--show-toplevel` with a directory that belongs neither to the package nor to the harness, and it pins the `cwd` of every git call, so it fails 2 of 2 against the old function. 5 of 10 mutations fail a test, including all five that read the commit from the wrong tree or drop `-dirty` ([#1327](https://github.com/MakazhanAlpamys/Soup/issues/1327), [#1382](https://github.com/MakazhanAlpamys/Soup/pull/1382))
- Second merge. Two #808 silence checks asserted that `"read by nothing"` was absent from raw captured output, and Rich wraps the loader's warning to the console width, so at 50 columns the phrase split across lines and the four `warn` cases passed with the warning printed. They routed both checks through the file's own `_plain(...)`, which collapses whitespace as well as stripping ANSI. When review showed that their first guard rewrote `staged_fields.py` on disk during the run and did not pin either line on its own, they replaced it in one push with the static scan the review proposed, which reads the test file only. Verified on the tree merged with current `main`: under the regression the 8 cases fail at 50, 80 and 120 columns and under forced colour (4 passed at 50 before); 48 passed unmutated; 4 of 4 mutations of the fix fail the scan, including each one-line revert ([#1352](https://github.com/MakazhanAlpamys/Soup/issues/1352), [#1377](https://github.com/MakazhanAlpamys/Soup/pull/1377))
- `soup autopilot` enabled DoRA for any dataset over 100k rows whenever VRAM allowed, including on a GPTQ, AWQ, AQLM or EETQ base, which peft refuses ("does not support DoRA yet") only when the adapter is attached, after the model load; `decide_peft` now receives the chosen quantization and keeps `use_dora` off for exactly the four formats peft rejects (checked against peft 0.20.0: HQQ and bitsandbytes build a DoRA variant and are untouched). 6 new tests fail on the previous `main`; 5 mutations each turn a test red; one over-broad-guard mutation survived and is recorded as a follow-up ([#1466](https://github.com/MakazhanAlpamys/Soup/issues/1466), [#1473](https://github.com/MakazhanAlpamys/Soup/pull/1473))
+ - `--trust-remote-code` was accepted and then dropped on five paths (`soup data download`, `soup eval auto`, the `soup train --find-lr` sweep loads, `soup draft distill` and `soup shrink --heal`), so a model that needs remote code still refused to load after the user opted in. They threaded the flag through all five, refused it on `datasets` 4 or newer instead of forwarding a flag that would be ignored, and, after review, pinned the default-deny direction at every site including the training auto-eval callback and guarded the missing-`datasets` install hint. On `main` 14 of the new file's 23 tests fail; 24 of 24 mutations in the last round fail a test (15 of 22 in the first) ([#1449](https://github.com/MakazhanAlpamys/Soup/issues/1449), [#1456](https://github.com/MakazhanAlpamys/Soup/pull/1456))
- **sup3dev** ([@sup3dev](https://github.com/sup3dev))
- First contribution: `soup` reported any error whose message contained the digits `401` or `403` as "Authentication failed." / "Access denied." and hid the real message. That covered a too-long SFT row 401, a tensor size of 4013, a `checkpoint-4010` path and a hash in a Hub URL. The status is now read from the exception object along its `__cause__`/`__context__` chain, with a text fallback limited to explicit HTTP phrasing, so genuine requests, urllib and huggingface_hub 401/403 errors get the specific hint instead of "HTTP request failed.". **The detail that decided a three-way race for the issue**: `GatedRepoError` and `RepositoryNotFoundError` are declined anywhere in the chain. A missing local adapter directory that peft first looks up on the Hub, which answers an unauthenticated user with 401, therefore keeps its real message; both competing fixes reported "Authentication failed." there. 16 of the 31 new tests fail on `main`, and 21 of 22 mutations fail a test ([#1267](https://github.com/MakazhanAlpamys/Soup/issues/1267), [#1268](https://github.com/MakazhanAlpamys/Soup/pull/1268))
@@ -650,6 +652,7 @@ Listed by first contribution. PR numbers link the work.
- **Jillur Rahman** ([@developerjillur](https://github.com/developerjillur))
- First contribution: `soup eval behavior --base-model` scored each live generation by whether it contained the probe's oracle label word, so an unchanged healthy model read MAJOR and a real refusal regression read delta 0.00. Generations are now classified as refusals or answers against a frozen table, `--evidence` keeps word matching, and `elephant` / `syceval`, whose `disagree` oracle a refusal classifier cannot judge, are refused before any model loads with exit 3. **They also taught the refusal classifier the contracted `I'm unable` / `I'm not able`, and when review showed that this moves the `mini_safety` and `mini_over_refusal` gate suites too, they bumped the scorer revision with contracted forms in the fingerprint corpus, so an older `--baseline` warns and a revert is caught.** On `main` 24 of the new file's 25 tests fail; 5 of 6 mutations in the last round fail a test, and the sixth (the revision number set back while the new fingerprint stays) is a property of the repository's revision test, not of this change ([#1228](https://github.com/MakazhanAlpamys/Soup/issues/1228), [#1335](https://github.com/MakazhanAlpamys/Soup/pull/1335))
+ - Second merge. Four places read model output with a pattern that did not match the format they asked for: the LLM judge's one-level-nesting regex scored every criterion at the minimum whenever the reasoning quoted a nested object (and a missing or differently cased criterion became the minimum too), `\b...\b` could never match a keyword such as `-5`, `(B)` or `C++` so `soup eval checklist` reported MAJOR on a correct answer, and the recipe judge kept `NOT OK` because it contains the letters `OK`. They parse the structure instead (`raw_decode` over each `{`, one shared `(?<!\w)...(?!\w)` matcher for both keyword readers, a first-word verdict) and added two refusals nobody asked for, a 65,536-character reply cap and an ambiguous-spelling check. **The second round is the one to read**: each review finding became a test that fails under its mutation, and the five mutations that survived round 1 now all fail (right-hand edge 4 cases, `scores` preference 1, rubric-name folding 1, non-object `scores` 4, one-word default prompt 1); the deep-nesting test was rebuilt so it stays under their own size cap. 63 tests, 48 of them fail on clean `main`; 37 mutations, 34 killed ([#1467](https://github.com/MakazhanAlpamys/Soup/issues/1467), [#1472](https://github.com/MakazhanAlpamys/Soup/pull/1472))
- **dymux** ([@putramkti](https://github.com/putramkti))
- First contribution: The eval gate's MCQ scorer and the reward parser read the same `\boxed{...}` differently. After an echoed option list, `\boxed{B.}` and `\boxed{**B**}` scored as C in the eval gate and in `soup ship`, while the reward parser read B. The letter tier now reads boxes through one shared, linear scan in `utils/final_answer.py`, which yields only innermost boxes, so nested boxes stay linear and a double-boxed answer still reads its inner value. On `main` 4 of the 11 new MCQ tests fail and the scan tests cannot import. 7 of 7 mutations of the fix fail a test, and a 20,000-string differential fuzz against `main` found no change in the reward parser ([#1347](https://github.com/MakazhanAlpamys/Soup/issues/1347), [#1365](https://github.com/MakazhanAlpamys/Soup/pull/1365))
@@ -661,6 +664,7 @@ Listed by first contribution. PR numbers link the work.
- **Momoyeyu** ([@Momoyeyu](https://github.com/Momoyeyu))
- First contribution: the streamed test builders picked `cuda` or `cpu` and never `mps`, so on Apple Silicon the model sat on the CPU while `TrainingArguments` picked `mps:0`. 32 streamed training cases, plus three classes #1258 had just added, therefore skipped on every macOS cell, and CI had never run a streamed backward pass, optimizer step or save on MPS. One `accelerator_device()` resolver in `tests/conftest.py` now serves all four builders, the three private `_mps_is_the_accelerator` copies are gone, and those cases run on MPS while both bitsandbytes skips stay. **They ran every round on an M3 Ultra and an RTX 4090 D before asking for review. They also set aside the CPU pin the issue proposed, because no CPU-pinned case reaches a trainer step, which checks out, and dropped #1258's MPS skip only after its classes passed on real hardware.** A resolver test now catches all four resolver mutations on any machine (3, 2, 1 and 1 failures), and forcing the MPS probe on a machine without MPS fails 67 cases ([#1355](https://github.com/MakazhanAlpamys/Soup/issues/1355), [#1375](https://github.com/MakazhanAlpamys/Soup/pull/1375))
+ - Second merge. The `reasoning` template behind `soup data generate --template reasoning` asked the generator for "the final answer" in no parseable form, so a generated gold such as `So there are 42 apples.` made `soup train` refuse the dataset before generation. The prompt now asks for `#### <number>` on its own line for `math` and a final `Answer: <answer>` line for `logic` and `code`, and the new tests pin the two fixture copies as byte-identical and every row as a numeric gold. **They re-scoped the PR the moment #1371 made their fixture edit unnecessary and said so in the description, and when review found that nothing read a gold written the way the new prompt asks, they added that test and ran the marker mutation themselves, reporting 11 failed / 4 passed, which reproduces exactly.** On `main` 3 of the 15 tests fail (the template-marker ones), and 9 of 9 mutations of the template text, both fixture copies, the variable-prefix rule, the `####` marker and the answer-phrase matcher fail a test in the file ([#1349](https://github.com/MakazhanAlpamys/Soup/issues/1349), [#1471](https://github.com/MakazhanAlpamys/Soup/pull/1471))
- **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))