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): #1258, #1365, #1262, #1285
Alpamysba1b1c19e769
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.mdindex 079eecc5..74c9a580 100644--- a/CONTRIBUTORS.md+++ b/CONTRIBUTORS.md@@ -495,6 +495,7 @@ Listed by first contribution. PR numbers link the work.- The `AcceleratorError`-as-OOM guard in the layer-streaming probe lived inside `measure_step_peak_bytes`' `except` block, so the only way to reach it was a real probe on a real card — which is why it **skipped in all nine CI cells while shipping to every user**. The verdict moves into `_classify_probe_exception`, which takes the exception and returns the classification, and the call site delegates to it. **The extraction is the fix**; the test that becomes possible is the point of it. The first revision left the call site unpinned and that mutation survived — on this one, unpinning the delegation fails a test that needs no CUDA, which is exactly the coverage the old shape could not have had. Verified here on the tree merged against current `main` under both peft 0.20.0 and 0.21.0: 19 passed on each, and all 17 test files referencing `layer_stream_runtime` 830 passed / 13 skipped on each ([#1002](https://github.com/MakazhanAlpamys/Soup/issues/1002), [#1047](https://github.com/MakazhanAlpamys/Soup/pull/1047))- 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))- **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))@@ -506,6 +507,7 @@ Listed by first contribution. PR numbers link the work.- `benchmarks/run-t4-colab-free-tier.md` forecast 31-46 tok/s for the free-tier T4 from an assumed clock; the card actually runs at a measured **525 MHz**, 33% of its 1590 MHz boost, so the record now carries 20.39 TFLOPS measured and a 288-423 bracket. Every cited figure is traceable into the notebook re-run in [#910](https://github.com/MakazhanAlpamys/Soup/pull/910) and the arithmetic reproduces (`20.39/2.20 = 9.27`, `288/31 = 9.29`, `423/46 = 9.20`). **The detail worth copying is one of the three stale markings**: the `31-46` occurrence sitting inside the captured transcript is left **verbatim**, because that is what the panel printed — rewriting a number inside a recorded transcript turns a record into a reconstruction, and they marked it in place instead. The rebase was the real risk, since #910 edited the same file, and `range-diff` shows both commits `=` with the diff against main still exactly +42/-1. They were also explicit that this publishes a **corrected but still unvalidated** forecast rather than letting a fixed number read as a validated one, and said so in the file itself — which is what turned the maintainer's unmet acceptance criterion into its own tracked issue ([#999](https://github.com/MakazhanAlpamys/Soup/issues/999)) instead of a quietly half-met box ([#714](https://github.com/MakazhanAlpamys/Soup/issues/714), [#967](https://github.com/MakazhanAlpamys/Soup/pull/967))- Removed the two orphaned BitNet helpers (`utils/bitnet.build_bitnet_trainer`, `utils/bitnet.validate_bitnet_compat`) that nothing imported, per the ruling on #1004, and replaced their tests with absence pins: restoring either as a stub, or re-exporting the live wrapper under the old name, fails a test. **When review showed that an extra change to the async disk reader rested on a race that did not exist, they reverted it within minutes and said so plainly**, so the squashed diff touches no streaming file ([#1004](https://github.com/MakazhanAlpamys/Soup/issues/1004), [#1034](https://github.com/MakazhanAlpamys/Soup/pull/1034))- On an untied streamed checkpoint, `embed_tokens` and `lm_head` share one device slot, so every step's first lookup waited for a whole head-sized copy that `_prime()` issued with nothing to overlap it. The issue first blamed the disk reader's `_plan_queue`. They showed the cost was the shared slot's ping-pong instead, and retracted a sentence of their own analysis that nobody had challenged. The fix reloads the embedding at the tail of the previous step's backward and keeps `_prime()`'s load as a same-owner fallback: 18.6-22.7 ms of embedding wait became 0.12-0.19 ms per step on an RTX 5070, bit-identical to `main` and to resident (CPU fp32 for SFT, ORPO, SimPO, DPO and KTO; CUDA bf16 for SFT and DPO). **The part worth copying is the guard, not the speedup**: the refill's only GPU-side protection is the `wait_stream` in `LargeLayerBufferPool.load_async`. They committed a pool-level GPU test for it that does not depend on host speed, ran it on their own RTX 3050 (5/5 passing, and 5/5 failing with the guard patched out), and said so when a first mutation attempt had run against unmodified code. A 4-layer test pins that the refill fires once per backward, at layer 0. 10 of 12 mutations fail the tests; the survivors are an equivalent flag check and the GPU-only guard ([#975](https://github.com/MakazhanAlpamys/Soup/issues/975), [#1178](https://github.com/MakazhanAlpamys/Soup/pull/1178))+ - Once #1178 was in, what was left of an untied streamed checkpoint's large-layer wait was the output head's load into the shared slot. It was issued at the last decoder layer, where it could hide behind only that layer's compute. They moved it to right after the embedding lookup (`StreamPrefetcher.head_prefetch_layer`, default `0`; `None` restores the old timing), at no extra VRAM: the cheap alternative to #1174's second permanent slot. On an RTX 5070 Laptop GPU the step's median total wait fell from 11.96 to 4.50 ms on the RAM tier and from 15.83 to 1.42 ms on the disk tier, with every layer-0 sample below every last-layer one. A decoder copy now queues behind the head's and gives back part of the saving; their CPU trace of the copy order had shown that queueing before the card measured it. **The part worth copying is that they built the instrument before the number existed.** The switch is a plain attribute, validated on assignment, so one process runs both timings. The interleaved A/B driver they wrote for a card they do not own has an A/A control, rotating arm order and a record of the tree it measured, and it ran on that card as one command per configuration. When review found that the provenance change dropped the NVIDIA driver version from every record and recorded the driver's checkout instead of the measured tree, they fixed both and pinned them with tests within ten minutes. They then covered the driver's own `main()` with a CPU test, so all 11 mutations of its provenance code fail. Gradients and adapters are bit-identical across SFT, SFT at GA 2, ORPO, SimPO, DPO, KTO and tied SFT; all 8 mutations of the new validation are killed; and the pool-level GPU guard fails 3 of 3 with the `wait_stream` removed ([#1174](https://github.com/MakazhanAlpamys/Soup/issues/1174), [#1258](https://github.com/MakazhanAlpamys/Soup/pull/1258))- **fei** ([@feiiiiii5](https://github.com/feiiiiii5))- First contribution, and it fixes the command whose whole job is to report this project's most common defect. `soup doctor --config` printed `Every setting this config writes is read on this backend.` for a `task=sft backend=mlx` config setting `use_liger: true` and `neftune_alpha: 5` — two fields MLX never reads. **The wording was the real defect, not the table.** A seven-entry table produced a sentence about the entire config, so the all-clear was a guarantee built on evidence that did not support it, and the fix scopes it: `None of the N setting(s) known to be unread on task=<task> backend=<backend> is set in this config.` The two repro fields were added to `_MLX_SFT` with matching branches in `trainer/mlx_sft.py::_check_unsupported`, so the trainer reports them too rather than only the doctor. Each entry was grep-checked for zero hits across the three MLX modules **before** being declared unread, which is the step that keeps a declared table honest. Verified here against the issue's exact repro in both directions — on `main` that config prints the all-clear, with this change it prints the two-row table and the scoped count — and confirmed no conflict with the five other open PRs touching `commands/doctor.py`. The narrowing to 2 of the issue's 11 fields was declared rather than hidden, and the follow-up for the remaining nine is filed ([#903](https://github.com/MakazhanAlpamys/Soup/issues/903), [#911](https://github.com/MakazhanAlpamys/Soup/pull/911))@@ -589,6 +591,7 @@ Listed by first contribution. PR numbers link the work.- **Kratos** ([@wanjinhao1](https://github.com/wanjinhao1))- First contribution: `soup autopilot` turned on FlashAttention and Liger on every Ampere or newer GPU without checking that the packages were installed, so on a standard install `soup train` refused the config autopilot had just written, and the Liger refusal's install hint lost its `[liger]` extra to Rich markup. Both flags are now gated on the same probes `soup train` validates with, the Decisions panel names a missing package and its install command, and the eight validator messages print literally. Verified: 70 passed across the autopilot tests, the 19 new tests fail on `main`, and all 6 mutations of the fix fail a test ([#1212](https://github.com/MakazhanAlpamys/Soup/issues/1212), [#1257](https://github.com/MakazhanAlpamys/Soup/pull/1257))- `soup data doctor` could not mirror `data.mask_history: true`: its report and `--show-mask` preview trained every assistant turn, while such a run trains only the last. A new `--mask-history` flag is threaded through every label builder the doctor uses, and it is refused with `--no-train-on-responses-only` or `--train-on-messages-with-train-field`, exactly as `soup.yaml` refuses them. Verified: 16 passed in the new test file (14 failed on `main`), and all 10 mutations of the fix fail a test ([#1251](https://github.com/MakazhanAlpamys/Soup/issues/1251), [#1259](https://github.com/MakazhanAlpamys/Soup/pull/1259))+ - `src/soup_cli/utils/auto_quant.py` had outlived its purpose. `soup serve --auto-quant` has refused with exit 2 since #816, so the module survived only as a dormant import target for historical tests, with no end date. They deleted it on the release #1131 fixed, together with the six test classes that exercised only its helpers (41 tests), and left the refusal's regression test untouched. They also corrected the CONTRIBUTING.md module list and test-table rows that still described the deleted coverage. `import soup_cli.utils.auto_quant` now raises `ModuleNotFoundError`, and the refusal still exits 2 on every backend. Verified: 441 passed on the merged tree (482 on `main`, the difference exactly the removed tests), and all 5 mutations of the refusal and its imports fail a test ([#1131](https://github.com/MakazhanAlpamys/Soup/issues/1131), [#1262](https://github.com/MakazhanAlpamys/Soup/pull/1262))- **yi111** ([@Yi-111-a](https://github.com/Yi-111-a))- First contribution: with torchao actually installed, four FP8-gate tests failed. The `converts` fixture stubbed `torchao` as a bare module that transformers' torchao quantizer could not import, and two "torchao absent" tests left real `torchao.*` submodules cached. The fixture now pre-seeds a package-shaped stub tree, the absent-torchao tests clear cached submodules, and the torchao-contract CI job runs the file against real torchao. **They fixed two failures the issue had not listed.** Those appear only when an earlier test file has already imported torchao, which is the CI job's own order. With torchao 0.18.0, `main` fails 4 of 333 in that job's command and the branch passes all 333; 5 of 7 fixture mutations fail a test ([#1205](https://github.com/MakazhanAlpamys/Soup/issues/1205), [#1284](https://github.com/MakazhanAlpamys/Soup/pull/1284))@@ -617,6 +620,9 @@ 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))+- **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))+---Want to join this list? See [CONTRIBUTING.md](CONTRIBUTING.md) — good first issues are