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): first entries for sup3dev (#1268) and Parnika S M (#1132); #1296 and #1295 (kok-o), #1107 (Amix29)
Alpamyse558b41e20ed
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.mdindex df41b874..8c3a3ef6 100644--- a/CONTRIBUTORS.md+++ b/CONTRIBUTORS.md@@ -188,6 +188,8 @@ Listed by first contribution. PR numbers link the work.- `task: distill` trained on rows whose assistant turn was truncated away at `data.max_length`: cross-entropy over zero targets was NaN, which the Trainer logged as 0.0 or a doubled loss, and a validation row made `eval_loss` NaN. Setup now refuses such a row by split and row number with SFT's own check and wording, on train and val and in every distill variant including sequence mode, and `compute_loss` returns a finite zero for a microbatch with no target. 15 new tests (14 fail on `main`); removing the guard fails 13 of them, removing the loss fallback fails 1, and skipping the guard for sequence, ULD or MiniLLM configs fails exactly those four cases ([#1242](https://github.com/MakazhanAlpamys/Soup/issues/1242), [#1298](https://github.com/MakazhanAlpamys/Soup/pull/1298))- `soup expect` passed datasets with PII or refusals in any field it did not know by name: ShareGPT conversations, DPO `chosen`/`rejected`, KTO `completion`, embedding pairs, multimodal parts and tool calls. They made extraction format-aware and scanned each field separately, so PII after a long field is no longer cut off by the 50 KB cap. **Three rounds, and the second turned the extraction table from documentation into a test**: the first version declared fields in a table that nothing read, so the table could be emptied with the suite green, and now every declared field of every format must catch a PII sample. New tests 102 passed and 62 fail on main; 17 of 17 targeted mutations caught ([#1231](https://github.com/MakazhanAlpamys/Soup/issues/1231), [#1300](https://github.com/MakazhanAlpamys/Soup/pull/1300))- `soup diagnose` tokenized with an ASCII-only regex, so an adapter answering in Greek, Cyrillic, Hindi, CJK or Thai read as MAJOR mode collapse, and one that had forgotten everything still read OK on the forgetting probe. They rebuilt the tokenizer on Unicode categories, with NFC, bigrams for unspaced scripts and digits, and kept English `token_f1` scores identical to main. **Three rounds, and the second was about cost**: NFC on untrusted text was quadratic in a run of combining marks (15 s for 100k characters), so they added a stream-safe cap and pinned it with a Tibetan case that only a category-based filter survives. New tests 54 passed and 32 fail on main; 11 of 11 targeted mutations caught ([#1233](https://github.com/MakazhanAlpamys/Soup/issues/1233), [#1301](https://github.com/MakazhanAlpamys/Soup/pull/1301))+ - Contrastive embedding training at one row per batch trained nothing. The in-batch similarity matrix is 1x1, so the loss and gradient are exactly 0, and the shipped template's `batch_size: auto` picked 1 on CPU, MPS and GPUs under ~45 GiB because BGE names were sized as 7B. They refused batch 1 at load and at setup (including the triplet-to-contrastive fallback, by resolving the loss before sizing the batch), floored auto at 2, dropped the last partial batch, guarded the forward, and taught the size estimate BGE / E5 / GTE / BERT-family names. 12 of 13 mutations fail tests ([#1234](https://github.com/MakazhanAlpamys/Soup/issues/1234), [#1296](https://github.com/MakazhanAlpamys/Soup/pull/1296))+ - A KL-free GRPO run could not be configured, because `grpo_beta` was validated `> 0`. That is the DAPO / Dr. GRPO setting, and it became unreachable once every variant applied the KL term. They relaxed the bound to `>= 0` without letting `false` or any spelling of infinity through, refused `grpo_beta: 0` next to the controllers that steer beta, and added a real-trainer test in which every variant computes the KL-free loss itself, bit for bit, with no fallback to trl's loss. Verified on trl 0.29.1: no reference forward runs at beta 0, and 10 of 11 mutations fail tests ([#1247](https://github.com/MakazhanAlpamys/Soup/issues/1247), [#1295](https://github.com/MakazhanAlpamys/Soup/pull/1295))- **AmixDigital** ([@Amix29](https://github.com/Amix29))- Gave `soup monitor` a real Apple Silicon path, where it had reported nothing but an NVIDIA-shaped blank since v0.44.1. The security work is the part worth naming: fixed absolute executable paths so `PATH` cannot influence what runs, `sudo -n` that never prompts and never reads a password, stderr pattern-matched for permission markers but never printed, and a parser that returns `[]` against a billion-laughs entity bomb, an XXE `file:///` reference, 5,000-deep nesting and embedded NUL bytes. **Three guards had no test holding them up and they closed all three in twenty minutes** — most importantly the call site that decides which implementation every Linux and Windows user gets, where `if True or detect_apple_silicon()` had left 126 tests passing. Their oversize-payload test had also been asserting on `b"x" * (CAP + 1)`, which is not a valid plist and returns `[]` whether the cap exists or not; they rebuilt it around a valid oversized document. The test file shrank by 18 lines and **every deletion was an upgrade** — membership assertions became adjacency assertions. Asked to confirm the live plist schema, they said plainly that the Mac is not theirs and they cannot authenticate `sudo`, rather than guessing — while confirming the two things they could check against the real binary ([#481](https://github.com/MakazhanAlpamys/Soup/pull/481))@@ -250,6 +252,7 @@ Listed by first contribution. PR numbers link the work.- Made Llasa's XCodec2 live encoding real and replaced Sesame CSM's false install hint with a config-load refusal that says why it cannot be trained; pinned torchaudio in the floor CI job, where pip had paired torch 2.6.0 with an incompatible torchaudio and killed the job before its test ran ([#265](https://github.com/MakazhanAlpamys/Soup/issues/265), [#1112](https://github.com/MakazhanAlpamys/Soup/pull/1112))- Made `soup attest emit --sign sigstore` live, where it had printed "infra-blocked" and silently written an UNSIGNED attestation with exit 0. **Every local check runs before the first Fulcio/Rekor request, because a Sigstore signature is a permanent public Rekor entry carrying the signer's identity**: `--output`, paths, `--key` and case variants of `--sign` are all refused first. Verification needs an out-of-band identity and issuer, and a verifier outage now exits 1 instead of being reported as tampering. 19 of 20 mutations of the sign and verify paths were killed at the final head ([#179](https://github.com/MakazhanAlpamys/Soup/issues/179), [#1115](https://github.com/MakazhanAlpamys/Soup/pull/1115))- Published the STEP 13 CPU fixture-window probe (`benchmarks/harness/fixture_window_cpu.py`), which answers both questions the scratchpad lost: where the CI fixture sits relative to the fused-kernel window, and whether bitsandbytes' CPU inference packing causes the recorded rounding-scale difference, one `Linear4bit` at a time against Soup's shipped variant 2. The default run fails closed on every axis (control exact on every row, packing present, every packed row different, every difference inside 2%), and each row carries a same-run emulated-bf16 reference, so the envelope is justified by the harness's own output (4.17x the worst emulated row). Its conditional test surfaced the first real AVX512-BF16 run, on a GitHub runner: 12 of 12 rows packed with the native kernel, 0.375-0.572% against variant 2. Final review: 30 tests (63 with the README reader), all 30 failing on main; the three mutations that had left the emulated reference unpinned each fail a test ([#379](https://github.com/MakazhanAlpamys/Soup/issues/379), [#1144](https://github.com/MakazhanAlpamys/Soup/pull/1144))+ - Built the fused Fast-LoRA SwiGLU MLP block: gate/up/down LoRA around SiLU with a hand-written backward that keeps `X`, `G` and `U` and recomputes `silu(G)` and `M`. At the Llama-3.1-8B shape it saves **117,702,656 bytes** of activations against plain peft, exactly the two `[N, f]` tensors the issue predicted plus one `[N, r]`. **The round worth recording is the numerics one**: review found the bf16 backward failing the tracker's own 2x-vs-float64 rule on one NF4 seed (4.93x), from a six-op bf16 SiLU-derivative chain and a cast-before-add on the LoRA term. The fix came back within the hour: fp32 opmath for the derivative, one shared promote-add-cast helper that the single-projection and QKV kernels now use too, and a CPU test for each half, so CI sees what only a card could before. Along the way they moved the peft-delegation guards into one shared `_projection_state` instead of a third drifting copy. On the final head the CPU suite is 126 passed / 6 skipped, the file fails 88 tests on `main`, and reverting the shared add, the down-projection add, or saving one extra `[N, f]` tensor fails 6, 5 and 1 tests ([#837](https://github.com/MakazhanAlpamys/Soup/issues/837), [#1107](https://github.com/MakazhanAlpamys/Soup/pull/1107))- **Srinivasan R** ([@Srinivasan8888](https://github.com/Srinivasan8888))- Corrected the MCP execution-tool refusal so it gives an actionable `--allow-execute` message instead of claiming shipped tools are unimplemented ([#574](https://github.com/MakazhanAlpamys/Soup/pull/574)).@@ -604,6 +607,12 @@ Listed by first contribution. PR numbers link the work.- **Y.B.** ([@drakeo338](https://github.com/drakeo338))- First contribution: `soup shrink` scored the layers of a Qwen2, Qwen3, Qwen2-MoE or SmolLM3 model, then died at save, because the prune left `layer_types` (and SmolLM3's `no_rope_layers`) at the old length. The lists are now sliced by the same kept indices as the layers. When review showed that MoE layouts naming layers by NUMBER (`mlp_only_layers`, `decoder_sparse_step`, `moe_layers`, `interleave_moe_layer_step`) would now reload with their expert and dense MLPs on the wrong layers, they took the guard on in the same PR. It refuses a non-default layout from `config.json` before the weights load, so `--plan-only` agrees with the real run, and it keeps a default layout valid, so a shrunk Llama4-text model shrinks again. On `main` 42 of the new file's 51 tests fail; 9 of 10 mutations in the last round fail a test ([#1241](https://github.com/MakazhanAlpamys/Soup/issues/1241), [#1256](https://github.com/MakazhanAlpamys/Soup/pull/1256))+- **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))++- **Parnika S M** ([@parnika0110](https://github.com/parnika0110))+ - First contribution: nine shipped recipes named a Hugging Face repo that does not exist, so the weekly repo-id check had been red on `main` (missing=18). Seven now point at live, ungated repos and two are removed. **They overruled the issue's own premise**: the issue called Mistral Medium 3.5 API-only, and they found its 128B weights on the Hub, kept the recipe and fixed its size. They also settled `granite-4-sft` and `kimi-k2-sft` on one base-checkpoint rule and added the test that fails when a recipe's `RecipeMeta.model` and YAML `base:` disagree. The check now exits 0 with missing=0; 10 of 13 mutations fail a test, and the survivors are size/tag labels that no test pins yet ([#1122](https://github.com/MakazhanAlpamys/Soup/issues/1122), [#1132](https://github.com/MakazhanAlpamys/Soup/pull/1132))+---Want to join this list? See [CONTRIBUTING.md](CONTRIBUTING.md) — good first issues are