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): #1563, #1562, #1555, #1558, #1512 [skip ci]
Alpamys117bcdcbd501
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.mdindex fb010440..0228c1dc 100644--- a/CONTRIBUTORS.md+++ b/CONTRIBUTORS.md@@ -711,6 +711,7 @@ Listed by first contribution. PR numbers link the work.- First contribution: `soup ab` accepted `--alpha` + `--beta` at or above 1. There the reject and accept boundaries cross and every LLR between them rejects, so two identical arms were reported as a significant regression. A huge `--effect-size`, or a near-constant column at the default, ended on a bare `OverflowError` that named no flag. They refuse the pair in `MsprtConfig`, naming both values, and bound the standardised effect at sqrt(float max) before it is squared. The bound is exact: sqrt(max) squared is finite, and the next float up overflows. It also closes a silent-NaN `continue` at `--effect-size 1e308` that the issue never listed. Their 15 tests include 5 deliberate controls that pass on main, 10 fail on main, and six mutations of the fix were each caught ([#1339](https://github.com/MakazhanAlpamys/Soup/issues/1339), [#1378](https://github.com/MakazhanAlpamys/Soup/pull/1378))- Second merge. #1304 called `_ensure_assistant_masks` on every SFT split, but only the packed call had a test: gating both calls on `packing` kept all six #1236 tests green, and with `use_liger: true` trl's Liger column selection drops `labels`, so the system and user tokens would train again. They added two tests, one checking that an unpacked run carries the mask on both splits with the right content, and one driving trl's real `_prepare_dataset` and the trainer's own collator. **Review found that an all-zero mask still passed both, because the expected count came from the dataloader, which applies `assistant_masks` itself, so 0 == 0; they took the expected positions from the `labels` column instead and re-ran the row the next morning.** 13 of 13 mutations (10 in `trainer/sft.py`, 3 in a scratch copy of trl) now fail the new file, against 7 of 13 for the #1236 file alone ([#1351](https://github.com/MakazhanAlpamys/Soup/issues/1351), [#1376](https://github.com/MakazhanAlpamys/Soup/pull/1376))- Third merge, one slice of the #1448 audit: `soup advise run <data> --probe-model X` ran the live probe, which is paid for, and then printed no ROI table. `--probe-model` implies `--probe`, the probe ran under the derived `run_probe`, and the table was gated on the raw `--probe` option. They claimed that one item on the issue and touched nothing else, changed the gate to `run_probe` (one line), and wrote the tests with the probe helpers monkeypatched so they count the calls as well as checking the table. **Review found that nothing pinned plain `--probe`: rewriting the gate to `probe_model is not None` kept all 71 tests green and would have hidden the table on the path the old gate served. They added the test the next morning, and that mutation now fails it.** The new file is 1 failed / 3 passed on `main`, 4 of 4 mutations of the gate are caught, and 228 related tests pass with `main` merged ([#1448](https://github.com/MakazhanAlpamys/Soup/issues/1448), [#1521](https://github.com/MakazhanAlpamys/Soup/pull/1521))+ - Fourth merge. `net_guard.parse_ip_literal` fell back to the C library's `inet_aton`, so the same host spelling was read differently per platform: Windows refused `0xffffffff`, `4294967295` and `0377.0377.0377.0377` where glibc reads `255.255.255.255`, and IPv6 forms that embed an IPv4 address were classified only by the interpreter's `ipaddress` tables. They wrote a pure-Python reader of the BSD grammar, unwrapped 6to4, NAT64, Teredo and IPv4-mapped addresses by hand so that the inner address is classified as well, and made `refuse_private_ip_literal` parse once. **The fixture that makes the interpreter's tables say "public" comes with a guard test proving that it does, so the embedded-address tests cannot pass by accident. In the second round they put a per-base digit check in front of `int()`, so a radix prefix is read once, restored the C rule that the text ends at the first whitespace character, and moved `"1 "` to the table it then belonged in instead of deleting the row.** 108 tests (80 fail on `main`), 2758 passed across the 38 related test files, 11 of 13 mutations fail the new file and the two that pass are accounted for ([#1550](https://github.com/MakazhanAlpamys/Soup/issues/1550), [#1562](https://github.com/MakazhanAlpamys/Soup/pull/1562))- **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))@@ -754,6 +755,7 @@ Listed by first contribution. PR numbers link the work.- First contribution: resuming a QLoRA SFT run upcast the trainable LoRA adapter from bf16 to fp32, because TRL casts it to bf16 at init and peft's `load_adapter` autocasts it back on `_load_from_checkpoint`, so a resumed run could not reproduce the uninterrupted one. `keep_trainable_dtype_on_resume` records each trainable parameter's dtype and restores it right after the reload, before the optimizer exists. Frozen and quantized weights are left to the loader, and the run's own dtype is restored, so the #429 fp16 path is untouched. **They measured the result on a real 8B NF4 run (a bit-identical adapter, loss and grad norm against the uninterrupted run). When review showed the SFT call was pinned by no CI test, they added CPU tests through `SFTTrainerWrapper.train`, strengthened two unit tests, and filed #1573 for the trainers this PR left out.** 9 of 10 mutations fail a test. Deleting the call fails 1 test and inverting it fails 2 ([#1503](https://github.com/MakazhanAlpamys/Soup/issues/1503), [#1504](https://github.com/MakazhanAlpamys/Soup/pull/1504))- First contribution: layer streaming refused every model cached by huggingface_hub 1.32 or later, because Xet blobs moved into a cache-wide shared store that the snapshot materializer treated as an escape. Links into that store are now followed only when it carries huggingface_hub's marker and neither the store nor the marker is a link or junction. Links leaving both stores are still refused. The recorded blob id is the per-repo etag, so copies made before the change are reused. **They traced it from a real Qwen3-8B NF4 run to the exact huggingface_hub change, and kept old copies reusable by reading the etag from the first link rather than the final file. When review showed that a symlinked store directory was trusted where huggingface_hub would not trust it, they applied the lstat check and pinned both refusals.** 12 of 14 mutations of the fix fail a test, and a cache built by huggingface_hub 1.33.0 itself materializes, shards and is reused ([#1509](https://github.com/MakazhanAlpamys/Soup/issues/1509), [#1510](https://github.com/MakazhanAlpamys/Soup/pull/1510))- First contribution: the docs claimed streamed NF4 training is bit-exact against a resident run, which holds only against a resident control without PEFT's `prepare_model_for_kbit_training`; the default resident path upcasts embeddings, norms and an untied `lm_head` to float32 and streaming does not. They filed it with a public dtype reproduction, wrote a scope note that says what the measurement does not show (backward, resume, trajectory, LoRA A init), and, after review, labelled the one non-reproducible Qwen3-8B number with its card and versions and fixed the fp16-before-Ampere store-dtype detail. Docs only; every claim re-checked against the code ([#1519](https://github.com/MakazhanAlpamys/Soup/issues/1519), [#1520](https://github.com/MakazhanAlpamys/Soup/pull/1520))+ - First contribution: layer streaming gave up with "no .safetensors weight files found" when `base:` pointed at a local Hugging Face cache snapshot, because its weights are symlinks into the blob store and the sharder skips symlinks. They routed the path through the plan, cache slot and reuse check the Hub id already uses, refused a symlinked directory that is not a snapshot with a message naming the accepted layouts, and documented both. 4 tests (fail on main), 7 mutations killed after a round that added the test for the non-cache-name fallback slot ([#1511](https://github.com/MakazhanAlpamys/Soup/issues/1511), [#1512](https://github.com/MakazhanAlpamys/Soup/pull/1512))- **vaputa** ([@vaputa](https://github.com/vaputa))- First contribution: `soup data from-traces --logs session.jsonl --format soup-serve` ended in a green `Wrote 0 preference pair(s)`, exit 0 and an empty output file, because the soup-serve reader walks a directory and quietly returns nothing for a single file. They claimed the issue, took the smaller of the two proposed fixes (refuse the file at the CLI, naming `--logs`, the directory `soup serve --trace-log` writes and the `--format langchain`/`openai` alternative), added a `Read 0 trace(s) from --logs '<path>' ...` line with a per-format reason whenever a source reads nothing, and left the zero-pair exit code alone as the issue asked. **The part worth copying is the scoping**: the parser keeps the behaviour its own tests pin, two controls prove the refusal is not wider than the bug, and on review they fixed a misleading reason for a directory under a file format ("no line parsed" when nothing had been opened) in the same push. 8 tests (6 fail on `main`, the 2 controls pass), 6 of 9 mutations killed ([#1530](https://github.com/MakazhanAlpamys/Soup/issues/1530), [#1557](https://github.com/MakazhanAlpamys/Soup/pull/1557))@@ -764,6 +766,11 @@ Listed by first contribution. PR numbers link the work.- **Pranav Deshpande** ([@PranavD2905](https://github.com/PranavD2905))- First contribution: the refusal for a non-public IP literal in an outbound endpoint named no remedy, and `http://0.0.0.0` in `soup data generate --api-base` and the Web UI chat proxy got only the generic HTTPS text while three other validators already said "0.0.0.0 is ambiguous; use 127.0.0.1 or localhost". They claimed the issue first, appended "address the server by its hostname" to the one shared message, moved the 0.0.0.0 wording into a single `net_guard` constant that all five checks now use, and kept every existing test case, changing only the four message assertions. **Their description said exactly what does not change, and it held**: 185 host spellings through 21 checks gave 0 differences in what is accepted or refused against main. 601 tests pass (40 fail on main); 14 mutations, all killed ([#1549](https://github.com/MakazhanAlpamys/Soup/issues/1549), [#1582](https://github.com/MakazhanAlpamys/Soup/pull/1582))+- **Yang Bai** ([@ybai08](https://github.com/ybai08))+ - First contribution: a judge that was down still cost 3 s of backoff for every row, because each row retried on its own: 1,000 rows slept 3,000 s against a host that never answered, and `soup data from-traces --judge` then wrote an empty file with exit 0. They added a per-evaluator count of requests whose retries were spent, a `JudgeDownError` at the third, and a stop in each caller that names the judge URL and how much was left; a 4xx or an unusable reply counts as an answer and resets it. **The part worth copying is how they handled what they could not prove**: they measured that `ship` and `best-of-n` already stopped on `main` and said a counter mutation cannot fail those tests, flagged their own 60-second cooldown as the reviewer's to overrule, and when review showed it turning a 9-second outage into 48 unranked pairs in a row, removed it and rewrote the tests the way the real callers behave. 19 tests (8 fail with the counter reverted), 2,584 passing across 40 judge-related files, 27 of 29 mutations killed ([#1522](https://github.com/MakazhanAlpamys/Soup/issues/1522), [#1563](https://github.com/MakazhanAlpamys/Soup/pull/1563))+ - First contribution: a hand-written `use_dora: true` on a GPTQ, AWQ, AQLM or EETQ base loaded and then failed inside peft when the adapter was attached, after the checkpoint download and the model load. They claimed the item on the issue first, then added a `SoupConfig` validator that refuses the pairing at config load with a message naming both settings and the fix, and moved the four formats into one set that Autopilot's `decide_peft` now reads too, so the schema and Autopilot cannot drift apart. **The part worth copying is the controls**: every test uses the same GPTQ-named base and flips only `quantization`, so a refusal keyed on the model name would have failed their own tests. 17 tests (5 fail on `main`), 11 of 12 mutations killed, and across 14,904 config loads nothing is newly accepted and the 404 new refusals are all `use_dora: true` with one of the four formats ([#1466](https://github.com/MakazhanAlpamys/Soup/issues/1466), [#1555](https://github.com/MakazhanAlpamys/Soup/pull/1555))+ - `training.quantization: mxfp4` passed config validation and then failed at the model load, because Soup built a bitsandbytes config for a format that belongs to transformers' own `Mxfp4Config`; the MXFP4 base Autopilot passes through failed the same way. They reproduced both on `main` and posted what transformers' quantizer says before writing code, then mapped `mxfp4` to `Mxfp4Config(dequantize=True)`, took it out of the k-bit prep path of all 15 trainer sites (it would cast the dequantized model to fp32), refused a local base that is not MXFP4 and the bitsandbytes-only `bnb_4bit_quant_storage`, and priced the base as the bf16 model it loads. **The part worth copying is the "not run" list**: no CUDA, no real MXFP4 weights, no training run, each with what it leaves unproven. 13 new tests (all fail on `main`, 26 across their test files), 26 of 26 mutations killed ([#1466](https://github.com/MakazhanAlpamys/Soup/issues/1466), [#1558](https://github.com/MakazhanAlpamys/Soup/pull/1558))+---Want to join this list? See [CONTRIBUTING.md](CONTRIBUTING.md) — good first issues are