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): #1184 [skip ci]

Alpamys6499deb2c566
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md
index cc772fc6..7f18c042 100644
--- a/CONTRIBUTORS.md
+++ b/CONTRIBUTORS.md
@@ -599,6 +599,7 @@ Listed by first contribution. PR numbers link the work.
- With `stream_layers: true` on an untied checkpoint, the Llama-3-8B-class shape, `dpo` and `kto` crashed inside `trainer.train()`: `embed_tokens` and `lm_head` share one device slot, the head handed autograd a view of it, and the reference forward refilled those bytes before the policy backward. The head now takes a private copy of its weight only when the slot is shared and the loss runs a reference forward before its backward, and the VRAM pre-flight charges that copy for exactly those runs, so its never-under-predicts contract holds. **Where the decision lives is the part worth copying**: a trainer flag, because the trainer is the one thing that knows whether a second forward runs before the backward, so `sft`, `orpo`, `simpo` and the embedding keep the view and pay nothing (the SFT half was @VanshSharmaPES's catch in #1174). Without the fix `dpo` and `kto` fail with the issue's error verbatim; 18 of 19 mutations killed, the survivor equivalent ([#1049](https://github.com/MakazhanAlpamys/Soup/issues/1049), [#1061](https://github.com/MakazhanAlpamys/Soup/pull/1061))
- With `expand_layers` set, `freeze_trainable_layers` was read only for its sign: under full fine-tuning `1`, `2` and `4` trained the same appended blocks and `0` or a negative value silently trained the whole expanded model, while the released field description promised top-N / bottom-N. Following the route-1 ruling, any value other than `expand_layers` is now refused at load, naming both fields and the value to set, and the description, the `block_expansion.py` docstrings and both docs pages now say the value must equal `expand_layers`. **The test worth copying is the one through the real `SFTTrainerWrapper.setup()`**: it compares the `requires_grad` set from `named_parameters()` with the appended blocks, so it fails when the freeze is skipped, leaves one new block frozen or leaves the embeddings trainable, not only when a helper returns a different number. 17 of 18 mutations killed, including all five the ruling listed ([#1409](https://github.com/MakazhanAlpamys/Soup/issues/1409), [#1586](https://github.com/MakazhanAlpamys/Soup/pull/1586))
- Followed through on the refactor they proposed on their own #741 once #737 had landed: the trl `init_kl_coef` -> `kl_coef` rename is the fourth trl rename Soup handles, so it now goes through `trainer/_trl_compat.py`, the module that exists for those, instead of a signature mapping built in `setup()`. A new `kl_penalty_kwargs(config_cls, kl_penalty)` sits next to `prompt_length_kwargs` on the same `config_accepts` probe, the new name wins when a config accepts both, and an empty dict (neither accepted) leaves the setting reported as `(not forwarded)` rather than guessed at; `_set_ppo_training_kwargs` now takes the config class, so all three PPO renames (`num_train_epochs`, `num_ppo_epochs` / `ppo_epochs`, the KL coefficient) use one capability probe. **The part worth copying is that the PR states it changes nothing and then shows it**: the constructed kwargs, the `applied` field names and the printed schedule are identical, every assertion from #737 is kept (the name mappings became config classes accepting exactly those fields), and #737's `test_setup_passes_current_schedule_to_trainer` passes unchanged. New cases cover the modern name, the legacy name, both names and neither; preferring `init_kl_coef` fails two tests. 11 passed and 1 skipped (trl is not installed on their machine; that test is CI's), 399 passed across the PPO-touching suites, and the 24 failures there are identical on unmodified `main` ([#913](https://github.com/MakazhanAlpamys/Soup/pull/913))
+ - Found, while tracing a "soup loop cannot present the serve tool token" ticket, that the adapter hot-swap itself was unauthenticated on a server started with a token, and asked before writing code instead of shipping a client flag nothing checked; when the server half turned out to have shipped separately they cut the PR down to the loop half without losing the tests that pin the contract. The client keeps the token out of argv (environment only, so a `--detach` child inherits it), masks it in the audit log, and names a missing or rejected token instead of a bare failure. Two review rounds found things only a measurement shows: `httpx.post` trusts `HTTP_PROXY`, so on a loopback http endpoint the Bearer token would go to the proxy in clear text, and the obvious fix (`trust_env=False`) also switched off `SSL_CERT_FILE`, which would have broken the one off-loopback setup (a TLS proxy with a private CA); the final code turns the environment off for plain http only, with a test for each side ([#1139](https://github.com/MakazhanAlpamys/Soup/issues/1139), [#1184](https://github.com/MakazhanAlpamys/Soup/pull/1184))
- **Thanniru Sai Teja** ([@iam-saiteja](https://github.com/iam-saiteja))
- Made `soup data validate` single-pass with type-tagged row signatures — and the reason this is worth reading is the recovery, not the speedup. The first revision was written against a pre-#712 copy of `validator.py`, so it silently reverted that fix and `soup data validate` went back to reporting `3/3 rows valid` on a file the loader drops two thirds of; twenty existing tests said so. **They then did more than was asked on the second finding**: told that a test pinning both copies of the join-separator arithmetic would be sufficient, they removed the duplication instead, so one helper now serves both functions and mutating it fails two tests where the second copy had survived +0 failures across 1432. The `_to_hashable` collision class ({"messages": []} and {"messages": {}} both canonicalising to `()` and reporting as duplicates on real chat data) is closed and verified over a 184-case differential harness across all eighteen formats. **And they corrected their own number rather than defending it** — the benchmark now interleaves the two implementations instead of timing them sequentially, reporting 1.34x-1.57x, where the version first shipped printed a *slowdown* for a change that was faster. Unrequested scope, said so at the time ([#771](https://github.com/MakazhanAlpamys/Soup/pull/771))