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): #1417, #1383, #1392, #1084, #1113, #1473, #1376, #1334, #1453, #1458, #1459

Alpamysa6eb92dac4f8
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md
index 335021bf..a765962a 100644
--- a/CONTRIBUTORS.md
+++ b/CONTRIBUTORS.md
@@ -156,6 +156,7 @@ Listed by first contribution. PR numbers link the work.
- Two recipe PRs landed in sequence and the five documentation sites auto-merged silently while only the test files conflicted, so the stated recipe count drifted with nothing to catch it. Their ratchet derives the count from the catalog and fails on **patterns that stopped matching**, not only on wrong numbers — the half that keeps it working after someone rewords a doc line, and the half almost every guard of this kind gets wrong. It took two rounds on one principle: v1 asserted an exact site count and so **reddened the build on a correct edit** (a second, correctly-numbered mention; any sixth site), and relaxing that then silently gave up detecting a site dropped from `DOC_SITES` — a property the test's own docstring claimed. They closed both at once by pinning the roster's path AND pattern, and went past the ask with a test for the roster logic itself. They also reverted their own test-count edits back out on being shown those drift on every merge touching `tests/`, and filed #465 rather than widening the PR ([#457](https://github.com/MakazhanAlpamys/Soup/pull/457))
- Noticed that `CONTRIBUTING.md`'s hand-maintained test-suite counts had gone stale and proposed a ratchet. Shown a measurement that a ratchet there would redden the build on more than half of all merges — 11 of the last 20 commits touch `tests/` — **they took the subtractive fix instead**: delete the numbers so drift becomes impossible rather than merely detectable. Then, told their first shape test asserted "no digits" and would fire on this file's own house style (`(v0.X.Y)` tags sit on every sibling line), they narrowed it to a count shape. Verified both directions: a version tag with a bare digit keeps the suite green, a real count fails by name. Two rounds, both of which they resolved by making the guard *smaller* ([#467](https://github.com/MakazhanAlpamys/Soup/pull/467))
- Closed a guard that existed, was cited in its own docstring, and could never fire: `_telemetry_endpoint_is_safe` promised that `https://10.0.0.1/` could not reach an internal network, and accepted it — the HTTPS precondition sat upstream of a scheme-conditional private-IP check, so the rejection was structurally unreachable. **They improved on the fix I proposed rather than implementing it.** My sketch would have replaced the delegation outright; they pointed out it would lose CRLF, null-byte, type and `0.0.0.0` sanitisation, and — the part that mattered — that `_is_private_or_link_local("localhost")` returns `False`, because `ipaddress.ip_address` raises on domain names. A guard that blocks `127.0.0.1` and waves through its own hostname is the half-fix I would have merged. They asked which direction I wanted before writing any of it. The result layers a strict predicate on top of the existing sanitisation, leaves `hubs.py` alone because a private HTTPS endpoint is a legitimate self-hosted hub, and covers bracketed IPv6, uppercase, trailing-dot and IPv4-mapped forms — the last unasked for. 25 tests, every one asserting against the real function with no mocks, and they discriminate in both directions: deleting the strict layer fails 19 named tests, dropping only the loopback half fails exactly the five `localhost` tests, and making the validator reject everything fails the six acceptance tests, so a validator that is too strict would not have merged either ([#593](https://github.com/MakazhanAlpamys/Soup/issues/593), [#598](https://github.com/MakazhanAlpamys/Soup/pull/598))
+ - Traced #342 (GRPO dying at `grad_norm: nan`) through the code and published the hypotheses that turned out wrong along with the ones that held. Their `training_step` clamp would have stopped every GRPO run at step 1 (the inputs there are a list, and on Soup's default `num_iterations=1` there is nothing to clamp), so when review showed it they took the watchdog-only route, dropped the clamp, and rewrote the tests against a real `GRPOTrainer`. The watchdog sits on `on_pre_optimizer_step` so a valid earlier microbatch is never wiped; the skipped fraction is persisted to `trainer_state.json` and read by `soup adapters audit`, with a missing record reading `unknown`. 479 tests passed on the merged tree plus 3 CPU smoke tests, and 15 of 15 mutations (`zero_grad(set_to_none=False)`, the check moved per microbatch, the wiring call, `save_state()`, each audit branch) fail a test; the same tests fail 28 of 29 unit and 3 of 3 smoke on `main` ([#342](https://github.com/MakazhanAlpamys/Soup/issues/342), [#1084](https://github.com/MakazhanAlpamys/Soup/pull/1084))
- **Osheun** ([@Osheun](https://github.com/Osheun))
- Added the `glm-5.1-dpo` recipe — and on a first PR, carried the literal-repo-id guard the house pattern calls for, in all four places, unprompted. It earned its keep immediately: the pre-existing family guard `test_no_recipe_references_thudm_glm5` does NOT fire on a consistently-wrong `THUDM/GLM-5.1`, because it matches the lowercase `glm-5` spelling — so the guard against that exact historical defect was theirs, not ours. They also updated `CONTRIBUTING.md`'s recipe count, the site a sibling recipe PR missed and that I missed on a release ([#452](https://github.com/MakazhanAlpamys/Soup/pull/452))
@@ -260,6 +261,7 @@ Listed by first contribution. PR numbers link the work.
- 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))
- Built the shared-X Fast-LoRA Q/K/V kernel: one `X @ A_cat^T` GEMM for the three LoRA-A projections, one `dA` GEMM and one accumulated `dX`, with the base GEMMs left separate so packed NF4 never needs re-laying-out. **The design call worth recording is the hook**: instead of forking HF attention forwards per architecture, the patched `q_proj` computes Q, K and V together and hands K and V to the next two calls through a short-lived cache keyed by the identity of the input tensor, delegating to peft for any other tensor. When review showed the suite could not tell the kernel from its absence, they pinned the fused path on all three outputs, so a cache that is silently not consumed now fails 56 tests. Over six review rounds they also closed a bf16 cast-before-add, a crash on cross-attention whose key width differs (reproduced on a real TrOCR module), a mixed int8 sibling, and ownership with the single-projection patcher in both orders, each with a test, and kept every restack patch-identical. On the final head: 210 passed / 10 skipped on CPU, the three NF4 rows pass on an RTX 5070, and 23 of 24 mutations fail a test ([#838](https://github.com/MakazhanAlpamys/Soup/issues/838), [#1108](https://github.com/MakazhanAlpamys/Soup/pull/1108))
- Streamed NF4 on CUDA always dequantised and ran `F.linear` while resident NF4 ran bitsandbytes' fused GEMM, so on sm_120 the two disagreed (4.88e-4 fp16 / 3.9e-3 bf16). They routed streamed NF4 through bitsandbytes' own dispatch, read at call time, and ran the fused arm through a checkpoint-visible autograd Function with a slot-ownership check, which fails toward the exact path if bitsandbytes' private names move. They also folded #841's per-mapping view cache into the same PR. On the RTX 5070: 19/19 `gpu` tests pass with `[nf4]` at exactly 0.0, the three ruling mutations are each caught (7, 1 and 3 failures), and the #776 numbers return when the source is taken from main. On CPU: 188 passed / 22 skipped, 7/7 mutations killed ([#842](https://github.com/MakazhanAlpamys/Soup/issues/842), [#1143](https://github.com/MakazhanAlpamys/Soup/pull/1143))
+ - Closed the Spark/Oute half of #265 by verifying the upstream contract before writing the refusal: `sparktts` is a 404 on PyPI, Spark-TTS pins `torch==2.5.1` / `transformers==4.46.2`, `outetts` pins `transformers==4.52.3` against Soup's `>=5.16.1`, and the Spark-TTS repo root has no `config.json`. They refused raw-audio live encoding at config parse with the real reason instead of suggesting a nonexistent install, removed the unrunnable `spark-tts` recipe, moved `oute-tts` to the pre-encoded `chatml` path, and kept the recipe count, snapshot and base record in step across repeated rebases over a moving `main`. The new contract file fails 13 of 13 on `main`; 10 of 10 mutations (each refusal site, the package table, the recipe, the helper contract, the docs row, the count) fail a test, and 2441 tests passed on the merged tree ([#265](https://github.com/MakazhanAlpamys/Soup/issues/265), [#1113](https://github.com/MakazhanAlpamys/Soup/pull/1113))
- **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)).
@@ -379,6 +381,7 @@ Listed by first contribution. PR numbers link the work.
- Settled a disputed bug by measuring it, and **the answer was that my own status note was wrong** — which is the harder thing to deliver than a fix. [#623](https://github.com/MakazhanAlpamys/Soup/issues/623) said `stream_pin: false` was accepted and ignored; they showed the field **did not exist at the v0.73.3 tag** the reporter was running (`grep -c stream_pin` -> 0, against 18 for `stream_layers` as a control), so pydantic's `extra="ignore"` dropped the key, the default pinned path ran, and the reported OOM is what a *correctly pinned* run looks like. The wiring is honoured end to end on `main`. **The PR is still worth merging, and for a reason that is the point of it**: nothing guarded the chain below the layer every existing test stops at. Mutating the deepest hop so the flag is *recorded* and then ignored at allocation (`pin_memory=self.pinned` -> `True`) leaves **169 pre-existing streaming tests green**; this file is the only thing that catches it — because it asserts `is_pinned()` on the real allocation rather than the recorded attribute, which is what an attribute assertion would have missed. Tests only, no source change, correctly no changelog fragment, and a non-empty-store guard so the CUDA test cannot pass while measuring nothing ([#623](https://github.com/MakazhanAlpamys/Soup/issues/623), [#647](https://github.com/MakazhanAlpamys/Soup/pull/647)).
- `benchmarks/harness/issue361_nf4_throughput.py` pins the v0.72.2 8B NF4 protocol — batch 1, S=512, 50 steps after 10 warm-up, `PagedAdamW8bit`, a same-session GEMM ceiling — so a post-#331 reading is comparable to the record rather than being a differently-shaped run. **The PR ships no number, deliberately, and is worth more for it.** The original figures were measured on an RTX 3050 Laptop 4 GB; the dev box is now an RTX 5070 Blackwell with twice the VRAM, so a run there would be a change in the INSTRUMENT rather than evidence about repaired code. They built the protocol and left the measurement for the card that can answer the question — which is the distinction the whole `benchmarks/` folder exists to protect. All eight review items closed, seven mutations and seven kills, `Refs #361` confirmed correct via GraphQL rather than assumed. **The conflict resolution is the other half**: rebased across eleven merges, their row inserted in `benchmarks/README.md` without dropping a word of the neighbouring `stream_probe.py` row, and `README.tr.md` re-stamped last as guard #852 requires ([#361](https://github.com/MakazhanAlpamys/Soup/issues/361), [#1014](https://github.com/MakazhanAlpamys/Soup/pull/1014))
- Measured the post-#331 8B NF4 row on their own RTX 3050 Laptop 4 GB: 208.6 tok/s at 1935 MHz in a 2.40 GB peak. They **published the unflattering reading instead of the headline**: the raw 1.74x over the pre-repair 119.6 tok/s is a 2x clock difference, per unit clock the repaired code is about 14% slower (68% -> 59% of the same-session ceiling), and the record attributes that shortfall to none of the three changes it lists. Four review rounds tightened the provenance. The run date was recovered from the output file's timestamps, and the committed JSON was tied to that file byte for byte. The two laptops behind the two rows are told apart, and an unverifiable console line was removed rather than defended ([#361](https://github.com/MakazhanAlpamys/Soup/issues/361), [#1103](https://github.com/MakazhanAlpamys/Soup/pull/1103))
+ - `soup train --find-lr` answered every failure of the live sweep, a missing base model id, a YAML syntax error in the config, a model or dataset that could not be loaded, or no `torch`, with a curve shaped by the LR schedule alone, wrote a `recommended_lr` from it and exited 0, so two different nonexistent ids reported the identical number. They deleted the fabrication rather than hiding it behind a flag: a new `LrSweepUnavailableError` beside `SweepTooShortError` makes every such case a refusal that names the cause, exits 1 and writes no report. The control test, a sweep that can run still writing its 8-point report, is what stops the refusal from swallowing a real measurement, and they disclosed the side effect that an install without `torch` now exits 1 before being asked. **The review round is the part worth copying**: five items came back, and each was closed with the mutation run to prove it. Removing the loader message, removing the escaped print and deleting the `SweepTooShortError` re-raise each survived the first round and each now fails a test; 10 of 10 mutations fail at least one test, and the new file fails 3 on `main`. The bug was found by @mohdUwaish59 while reproducing #1189 ([#1203](https://github.com/MakazhanAlpamys/Soup/issues/1203), [#1334](https://github.com/MakazhanAlpamys/Soup/pull/1334))
- **Aravind S** ([@ARAVIND281](https://github.com/ARAVIND281))
- Measured the layer-streaming VRAM fit on a **second GPU and software stack** — an A10G 23 GB on Ubuntu with torch 2.13 / transformers 5.16.1 / trl 0.29.1, against the RTX 3050 laptop on Windows and torch 2.5.1 that every previous figure came from. All three findings are constraints on an open question rather than extra data points beside it: the v0.73.1 long-sequence under-prediction **does not reproduce** (flat 1.1621-1.1694 across seq 2048-6144 where the RTX series reads 0.787x at 6144), the logits loss term measures **12.000000 exactly** and invariant across vocabulary and torch version — so the shipped 14's `+2` retained copy, which #327 has never identified, demonstrably does not happen here — and the SDPA hypothesis #395 names as leading is **not supported**, with the math backend included as a positive control that IS expensive enough (3.27 GB at seq 6144) to prove the measurement could have found it. **They retracted their own headline figure mid-review** — a back-solved 11.83 B/element — and then enforced the retraction in CI rather than in prose: writing 11.83 back into the constant fails a named test. The discarded first sweep is kept in the record because its failure is silent: `data.max_length` truncates rather than pads, so short rows run at their own length while the prediction keeps climbing, producing a clean-looking over-prediction that is entirely an artifact and would mislead the next person identically ([#395](https://github.com/MakazhanAlpamys/Soup/issues/395), [#610](https://github.com/MakazhanAlpamys/Soup/pull/610))
@@ -419,6 +422,7 @@ Listed by first contribution. PR numbers link the work.
- `training.loraplus_lr_ratio`, which their own #738 made work on sft, pretrain and embedding, was accepted and silently ignored by the thirteen other trainers that build a LoRA adapter: B trained at the base rate and the loss curve looked normal. Twelve now attach the LoRA+ optimizer after construction, online_dpo included, which hands TRL a `peft_config=` instead of calling `get_peft_model`. **PPO is the part worth reading.** trl's PPO trainer builds its optimizer and scheduler inside `__init__`, so a late attach would leave the scheduler on a discarded optimizer; they build the optimizer first, add the value model's groups (without them the critic belonged to no optimizer and never trained), prune empty groups under DeepSpeed, and pass it to the constructor, detecting that trainer shape rather than the trl version. Tasks with no trainable LoRA B, VeRA included, refuse the ratio at parse. **The part worth copying is how the tests grew**: across four review rounds, each surviving mutation became a test of what the trainer actually receives (group sizes as the constructor sees them, `base_lrs` on the real trl trainer), and a source scan fails when any LoRA-building trainer ships without LoRA+ or an earned exemption. On the final head: 195 tests plus 2 real-trainer smoke tests, 8 of 9 mutations killed (the survivor is error-message wording), and 3653 passed across 49 files on the merged tree ([#745](https://github.com/MakazhanAlpamys/Soup/issues/745), [#1080](https://github.com/MakazhanAlpamys/Soup/pull/1080))
- `soup data canary insert` appended chat-format canaries to every dataset, so on any other format the loader dropped all of them before training and `canary check` could only answer OK. The issue's alpaca repro kept 3 of 7 rows on `main` and all 7 here. The canaries are now written in the file's own format, and every format whose canaries would be dropped, or that `check` cannot score, is refused before the manifest or the data exists. That includes plaintext, a file whose format cannot be detected, a first row that is not an object, and an explicit `--format` that is not the file's own. The manifest records the format, and legacy manifests read as chatml. **The part worth copying is the sweep:** every format `detect_format` can return must either load every canary or be refused with nothing written, and a guard test fails when a new format arrives without a fixture. It caught #1306's `cross_encoder` before either PR merged. Second round: the one surviving mutation became a test. 20 of 20 mutations killed; 350 passed, 1 skipped with the canary suite ([#1216](https://github.com/MakazhanAlpamys/Soup/issues/1216), [#1317](https://github.com/MakazhanAlpamys/Soup/pull/1317))
- `format: tool-calling` read only top-level `tools` and `tool_calls`. It dropped every row `soup agent synth` writes, and every OpenAI-shape trajectory, and `soup train --dry-run` still said `Ready to train!` on zero rows. The converter now reads calls where they live, in source order, and keeps the old top-level form as a fallback. `format: auto` recognises `{messages, tools}`, synthesised rows carry their tool's schema, and `tools` may be a JSON-encoded string. **The part worth copying is the stop, and what it found.** `soup train` now exits 1 before the model loads when a load yields no training rows, and names the format and the first dropped row's reason. On its first run it caught two fixtures in the existing suite whose only row had gone to validation, runs that had trained on nothing; they fixed the fixtures rather than loosening the check. They also caught that Arrow gives every message every key, so a plain user turn reached Llama-style templates as a call, and they pinned that with a render through a real tokenizer. Second round: a string `tools` regression, null content, a mutable load record and one unpinned line, all closed with tests. 25 of 25 mutations killed; 4066 passed across a 74-file batch ([#1217](https://github.com/MakazhanAlpamys/Soup/issues/1217), [#1321](https://github.com/MakazhanAlpamys/Soup/pull/1321))
+ - `soup data clean --repair-json` and `--drop-invalid-json` read only a flat `arguments` key on a row's top-level `tool_calls`, so the calls the tool-calling loader actually reads were never touched: calls nested in an assistant turn (what `soup agent synth` writes) were not repaired or checked, and a valid `{"function": {"arguments": ...}}` call read as `""` and got its row dropped. They wrote the issue with four shapes and a repro, then routed the top-level list and every assistant turn through one helper in both the `tool-calling` and `chatml` branches, following exactly what the loader accepts (dict arguments and a missing `arguments` left alone, non-assistant turns untouched). **When review found that the fix turned `"tool_calls": null`, which a schema-unified export writes on every no-call row, into a dropped row under the default flags, they took the guard and the test in one push** and filed the neighbouring empty-turn case as its own issue. The new file gives 45 passed on the branch and 24 failed on `main`, 8 mutations of the fix and 3 of the null guard all fail a test, and a four-row CLI run matches ([#1338](https://github.com/MakazhanAlpamys/Soup/issues/1338), [#1453](https://github.com/MakazhanAlpamys/Soup/pull/1453))
- **GitFromRatatouille** ([@swalla02](https://github.com/swalla02))
- First contribution, and it is the third instance of this repo's most persistent bug class found by someone else ([#363](https://github.com/MakazhanAlpamys/Soup/issues/363), [#423](https://github.com/MakazhanAlpamys/Soup/issues/423), [#659](https://github.com/MakazhanAlpamys/Soup/issues/659)): `soup migrate` refused **any** input named `*.jsonl`, a valid LLaMA-Factory YAML config included, because the guard branched on the filename while the content sniff written to gate it had **zero call sites in `src/`**. The diagnosis is worth more than the one-line fix — the test was named after the command and its body called the helper, so it passed on a codebase where `migrate` never imported it. **Then review found a regression their own fix introduced, and the way they closed it is the part to copy**: the sniff read `utf-8`, so a UTF-8 BOM survived as U+FEFF, which `str.strip()` does not remove, and a real BOM'd JSONL silently lost the friendly error it used to get — on a project with three Windows CI cells where PowerShell's `Out-File` writes that BOM by default. Their BOM test **guards its own fixture** (asserting the file really contains a BOM before asserting behaviour) and their bounded-read test measures the property with `tracemalloc` rather than pinning the spelling of the loop. Six mutations, six killed; zero assertions removed. They also **declined to widen the fix** to files whose name gives no hint, correctly citing the `.ipynb` case the original comment warns about, and left that as an open question rather than guessing ([#672](https://github.com/MakazhanAlpamys/Soup/issues/672), [#675](https://github.com/MakazhanAlpamys/Soup/pull/675))
@@ -605,6 +609,7 @@ Listed by first contribution. PR numbers link the work.
- 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))
+ - `training.loraplus_lr_ratio` loaded on `backend: mlx` and trained plain LoRA at one learning rate with no warning anywhere, because the MLX optimizer takes no parameter groups. They refused it at config load in its own validator placed after the MLX task gate, so tasks MLX cannot run keep their own messages, and pinned that order with five tests that fail in all three wrong positions; 10 of 10 mutations killed, 133 configs re-loaded with exactly the 11 `task: sft` MLX configs changing ([#1324](https://github.com/MakazhanAlpamys/Soup/issues/1324), [#1383](https://github.com/MakazhanAlpamys/Soup/pull/1383))
- **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))
@@ -613,9 +618,12 @@ Listed by first contribution. PR numbers link the work.
- **Mohammad Hijjawi** ([@MohammadHijjawi97](https://github.com/MohammadHijjawi97))
- First contribution: since #1249, every `grpo_variant` other than `standard` applies its KL penalty inside Soup's own loss, which replaces the trl function that records the `kl` metric, so variant runs logged no `kl` anywhere. The variant path now records trl's exact quantity from the same per-token KL the loss adds, over the completion and tool mask or rft's accepted tokens, under trl's key and gather, and nothing at `grpo_beta: 0` or for `standard`. **The rft case counts accepted tokens even without a completion mask, a detail the issue's wording implies and a test pins.** On a real trainer, five variants log exactly trl's stock `kl` on the same batch and rft logs its accepted-token mean. The three tests and the docs paragraph asked for in review went in unchanged two hours later; all 18 mutations fail a test ([#1263](https://github.com/MakazhanAlpamys/Soup/issues/1263), [#1293](https://github.com/MakazhanAlpamys/Soup/pull/1293))
- `soup data canary insert` appended its canaries, and the loader holds out the file's unshuffled tail as validation, so from 135 rows on all 16 default canaries were held out, no model trained on them, and `soup data canary check` could only report OK. They spread the canaries one per equal stretch at a seeded row, which bounds the held-out share for every seed rather than on average, kept the dataset's own rows in order, recorded each canary's row in the manifest (older manifests still load), and had `insert` print how many canaries the default split trains on, counted with the loader's own `_split_val`. **The printed count has a boundary test**: a canary on the last trained row counts, one on the first held-out row does not. 121 new tests, all failing on `main`; 12 of 12 mutations fail a test ([#1331](https://github.com/MakazhanAlpamys/Soup/issues/1331), [#1386](https://github.com/MakazhanAlpamys/Soup/pull/1386))
+ - `soup ab` exited on a bare `ZeroDivisionError` or `OverflowError`, or printed `continue` with a `nan` ratio, for a column whose spread or size a float cannot carry (`0` and `1e-161`, `0` and `1e200`, 40 rows of `1e308`). They refused all three where they arise, with a message naming the column, and squared as `d * d` so an overflowing deviation is caught instead of raised. 11 tests, 8 failing on `main`; 18 of 19 mutations caught after two review rounds ([#1384](https://github.com/MakazhanAlpamys/Soup/issues/1384), [#1392](https://github.com/MakazhanAlpamys/Soup/pull/1392))
- **Krishna** ([@Ru0k3](https://github.com/Ru0k3))
- First contribution: `soup registry diff`, `soup eval compare` and `soup eval leaderboard` kept the oldest eval score per benchmark. They overwrote rows in the tracker's newest-first order, so a re-measurement was ignored: on the issue's example both commands reported +0.20 and no regression, where comparing the newest scores gives a -0.05 regression. **They found that the leaderboard had the same bug, which the issue did not name**, and routed all three commands and the eval gate's `registry://` baseline through one helper that picks the newest `created_at` and then the latest insert. Their tests list rows newest first, as the tracker returns them, so restoring the old code at any call site fails a test. The second round added a two-model leaderboard test for the one mutation that had survived, and skips empty benchmark names as #1260 did. 13 of 15 mutations fail a test, and the other two would need a NULL value that the schema forbids ([#1270](https://github.com/MakazhanAlpamys/Soup/issues/1270), [#1291](https://github.com/MakazhanAlpamys/Soup/pull/1291))
+ - The test-count badge step in `ci.yml` ran on a fork's own `main`, where the upstream `GIST_TOKEN` secret does not exist, so the Gist API answered `401 Bad credentials` and an otherwise green test job failed. They reported the failing run, and when the maintainer pointed out that it ran on their own fork and that their first idea (`continue-on-error: true`) would have hidden a genuinely expired upstream token, **they shipped the fix as a single AND-ed `github.repository == 'MakazhanAlpamys/Soup'` term on one line, with the reasoning written into the PR**. When review showed their first test only checked that the guard's text appeared somewhere in the step, so an `||` or a comment would still pass, they replaced it in one push with a test that parses the workflow YAML and checks the guard is an AND-ed term of the step's `if:`, and dropped the changelog fragment a CI-only change does not need. All 8 mutations of the step fail a test, and it fails on `main` ([#1414](https://github.com/MakazhanAlpamys/Soup/issues/1414), [#1458](https://github.com/MakazhanAlpamys/Soup/pull/1458))
+ - Second merge, and the same overwrite-in-the-wrong-order mistake as their first, one command over. `soup card` built its scorecard by walking the tracker's newest-first eval rows and overwriting each benchmark's entry, so the last row it saw, the oldest, won: two rows for one benchmark (0.30, then 0.45) rendered 0.300. They reused the helper their own #1291 added instead of writing a second one, rewrote the old "last wins" test against the tracker's real order, and stated in the PR body that the row cap now applies after the newest row per benchmark is picked. **When review showed that neither the cap order nor the tie-break was pinned, they added the fragment and five tests in one push, including one through a real `ExperimentTracker`.** The tests fail 4 on `main`, and 6 of 7 mutations of the change and the helper fail a test, the seventh being a helper-level gap outside this PR ([#1315](https://github.com/MakazhanAlpamys/Soup/issues/1315), [#1459](https://github.com/MakazhanAlpamys/Soup/pull/1459))
- **Suyog Verma** ([@commit-msuyog](https://github.com/commit-msuyog))
- First contribution: A local `.parquet` dataset with list columns loaded 0 training rows for eight formats, because pandas handed every list cell to the converters as a numpy array, and `soup data validate` / `inspect` crashed on the same file. The loader now reads parquet with pyarrow, so rows match the same data in JSONL, and it drops pandas' hidden `__index_level_N__` index column while keeping a named index. The new tests fail 15 of 24 on `main`, and all 5 mutations of the fix fail a test ([#1218](https://github.com/MakazhanAlpamys/Soup/issues/1218), [#1292](https://github.com/MakazhanAlpamys/Soup/pull/1292))
@@ -627,6 +635,7 @@ Listed by first contribution. PR numbers link the work.
- 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))
- 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))
- **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))
@@ -643,6 +652,7 @@ Listed by first contribution. PR numbers link the work.
- **qwist1233-cpu** ([@qwist1233-cpu](https://github.com/qwist1233-cpu))
- 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))
- **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))
@@ -653,6 +663,7 @@ Listed by first contribution. PR numbers link the work.
- First contribution: three benchmark harnesses each carried a copy of the helper that records which tree a row measured. Every copy credited a `soup-cli` wheel installed into a gitignored `.venv/` inside the checkout with the checkout's clean commit. One shared `source_sha()` now refuses a `soup_cli/__init__.py` the checkout does not track. `head_prefetch_ab` keeps its narrower `src/` dirty scope through a parameter, so the other harnesses do not inherit it. **They tested it with real `git` against a throwaway checkout rather than a faked `subprocess.run`, which is the only way a swallowed `ls-files` failure gets caught.** The tests skip cleanly without git, ignore a global `commit.gpgsign`, and catch all 8 mutations tried (82 passed) ([#1387](https://github.com/MakazhanAlpamys/Soup/issues/1387), [#1403](https://github.com/MakazhanAlpamys/Soup/pull/1403))
- `training.moe_aux_loss_coeff` is applied only by SFT's text setup, yet a non-default value loaded on `task: sft` with `modality: vision` or `audio` and was never read. They refuse it at config load, beside #798's check for the same field, naming the modality and pointing to `modality: text` as #1179 does for `moe_lora`. The default `0.01` still loads everywhere, and `audio_out`, which SFT sends to the text setup, is pinned as allowed. 20 related test files passed with main merged (2675 passed, 0 failed), and 8 of 9 mutations of the fix fail a test ([#1394](https://github.com/MakazhanAlpamys/Soup/issues/1394), [#1404](https://github.com/MakazhanAlpamys/Soup/pull/1404))
- `task: ppo` could not complete a single step on trl 0.29. The dataset handed to trl's `PPOTrainer` still carried the `prompt_text` strings, and trl's padding collator raised on them at the first batch, after three models had loaded. A train set smaller than one rollout batch spun forever at 100% CPU instead. trl now gets only `input_ids` / `attention_mask` at all three hand-offs, and a train set with fewer than `batch_size` x `gradient_accumulation_steps` x the number of processes rows is refused before any model loads, naming the numbers. **They wrote the suite's first test that runs a real trl PPO update, on CPU with nothing mocked, and it fails on `main` with the issue's exact error. When review asked for the refusal to move ahead of the model loads, they applied it and also pinned the two trl hand-offs no test covered.** 191 tests in the six PPO files pass with `main` merged, and 11 of 11 mutations of the fix fail a test ([#1391](https://github.com/MakazhanAlpamys/Soup/issues/1391), [#1410](https://github.com/MakazhanAlpamys/Soup/pull/1410))
+ - `--fsdp` was accepted and silently dropped on `task: prm` and `task: moe_lora_routing`, and `--fsdp` and `--deepspeed` on `task: online_dpo`: the wrappers stored `fsdp_config` / `deepspeed_config` and never handed them to their trainer arguments. The fix spreads `**(self.fsdp_config or {})` into the `TrainingArguments` of `prm.py` and `mole_routing.py` and forwards both to `OnlineDPOConfig`, exactly as `dpo.py` does. The four new tests build each real wrapper over a tiny Llama and record the arguments-class kwargs, so no FSDP or DeepSpeed runtime is needed; 3 of 4 fail on `main`, the "neither set" control passes on both, and all 6 mutations of the fix fail a test ([#1204](https://github.com/MakazhanAlpamys/Soup/issues/1204), [#1417](https://github.com/MakazhanAlpamys/Soup/pull/1417))
---