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): #1709, #1776, #1777 [skip ci]
Alpamys482ef06b990b
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.mdindex e6b0e610..88401faa 100644--- a/CONTRIBUTORS.md+++ b/CONTRIBUTORS.md@@ -292,6 +292,8 @@ Listed by first contribution. PR numbers link the work.- 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))- Took item 2 of the 2026-10-05 scope of #797 (the issue stays open): `training.gradient_checkpointing` never reached the TRL/HF arguments of seven wrappers, so on unquantized runs `false` lost to TRL's default `true` in GRPO, IPO, BCO, reward-model and online-DPO, and `true` lost to HF's default `false` in pretrain and embedding. They claimed the item on the issue first, reused the existing `should_enable_hf_gradient_checkpointing` at all seven sites, and kept the enabled tiers as full checkpointing, where these wrappers have no selective hooks. **The part worth copying is the test**: it builds the seven real wrappers on a tiny local Llama, pins HF to CPU, and checks both the argument and `model.is_gradient_checkpointing` after a real one-step training run, so a mock cannot pass it. Review asked for a renamed fragment and for a layer-streaming sentence to go (`stream_layers` is accepted only for sft, dpo, orpo, simpo and kto), and both were done in one push. In review, inverting the value at each site fails 8 of the 56 tests and deleting it fails 2 (TRL tasks) or 6 (pretrain, embedding) ([#797](https://github.com/MakazhanAlpamys/Soup/issues/797), [#1778](https://github.com/MakazhanAlpamys/Soup/pull/1778))+ - Closed #1758, reported by @abdulwaarith0: `utils/live_eval` had no public way to pass chat-template options or to render and encode a prompt as `make_generator` does, so callers patched private names and a generation could change without any error. They made `encode_prompt` and `MAX_PROMPT_TOKENS` public, routed both generators through that one helper, added `chat_template_kwargs` to both and `soup ship --chat-template-kwargs`, and documented `loaded=(model, tokenizer, device)` reuse and caller-managed batch padding. **The part worth copying is how the review gap closed**: the refusal test pinned 3 of the 9 reserved names, so six removals and a shallow copy of the options kept the suite green; the next push parametrized the refusal over the whole set (now 11, with `chat_template` and `return_assistant_tokens_mask` added), pinned a nested value through a template that reads `settings.flags.enable_thinking`, kept the underlying render error in the message and added the `RecursionError` catch the review had marked optional. In a fresh run each of the 11 names removed one at a time fails its own case, a shallow copy fails 3 tests and 35 of 36 mutations are caught; the survivor is the `isinstance(prompt, str)` guard in the public `encode_prompt`. They say plainly that the end-to-end test is a tiny randomly initialized Llama on CPU, with no CUDA or pretrained-quality claim ([#1758](https://github.com/MakazhanAlpamys/Soup/issues/1758), [#1776](https://github.com/MakazhanAlpamys/Soup/pull/1776))+ - Closed #1760 (reported by abdulwaarith0): a GGUF export printed nothing while it converted and could not skip the pip step for the convert dependencies. `soup export --format gguf` now reports its phases, `--verbose` streams the converter and quantizer output with the failure summary kept (bounded tail, child terminated and reaped on an output error), and `--no-install-deps` names missing `gguf` / `sentencepiece` / `protobuf` before any merge or toolchain work without calling pip. **The part worth copying is how they closed review findings with tests that fail for the right reason**: the dropped verbose forwarding on the direct f16/f32 convert call is pinned by eight cases, the `protobuf` probe by a test that fails when its module name is renamed, when presence ignores it or when the probe is dropped, and the phase-line assertions went through the ANSI-strip helper so they hold under `FORCE_COLOR=1`. The PR says plainly that no real llama.cpp conversion was run ([#1760](https://github.com/MakazhanAlpamys/Soup/issues/1760), [#1777](https://github.com/MakazhanAlpamys/Soup/pull/1777))- **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)).@@ -752,6 +754,7 @@ Listed by first contribution. PR numbers link the work.- `soup infer`, `soup chat` and `soup diff` printed the `--device` they were given and then loaded the model with a hard-coded `device_map="auto"` and float16, so `--device cpu` still filled the GPU. They added one shared resolver that pins the model to the requested device on both the full-model and the adapter branch of all three commands, and, after review, made an unknown or mis-cased `--device` fail with a clear message, stated the CPU float32 RAM cost in the changelog and docs, and, when the maintainer decided that GPUs must keep float16, removed the bfloat16 pick and pinned the dtype with an exact test that forces `cuda_supports_bf16()` to True. On `main` 25 of the new file's 27 tests fail; 38 of 40 mutations fail a test in the last round (11 of 19 in the first), including every way of returning bfloat16 on a GPU ([#1443](https://github.com/MakazhanAlpamys/Soup/issues/1443), [#1460](https://github.com/MakazhanAlpamys/Soup/pull/1460))- `soup serve --device` was ignored by the transformers loader: both `_load_model` branches and the speculative draft loader hard-coded `device_map="auto"`, so `--device cpu` could still land on a visible GPU, and an unknown value such as `tpu` was accepted and dropped (`--device "[/bold]"` crashed with a Rich `MarkupError`). They routed all three loads through #1460's `resolve_inference_device_map_and_dtype`, validated `--device` early with exit 2 on every backend, kept an explicit `--kv-cache-type` winning over the helper's dtype, and updated the help and the fragment, including that a CPU-only host now loads float32 (twice the RAM). The new file is 34 passed (19 failed / 15 passed on `main`), 627 passed across 17 related files, and 23 of 24 mutations fail a test; the one survivor (validation gated on the transformers backend, behaviour verified on vLLM and SGLang) is recorded as a follow-up test ([#1478](https://github.com/MakazhanAlpamys/Soup/issues/1478), [#1479](https://github.com/MakazhanAlpamys/Soup/pull/1479))- Fixed #1450: a failed replace deleted the only good copy in two places. `soup reward synth --force` overwrote the existing verifier before calibrating it and deleted the file on refusal; `merge_adapter_to_dense` (behind `soup shrink` and `soup draft distill`) deleted `out_dir` before the swap and then deleted the staged model in its error handler, so neither copy survived. They moved both to a never-destroy-the-last-copy shape: a temp sibling replaced onto `-o` only after calibration accepts it; rename-aside, restore on failure, and when the restore fails as well, keep both copies and name both paths. **The review rounds were about what a test pins:** a Windows-only test that could not fail on their own machine reddened three CI cells, and the fix replaced its either-or assertion with exact bytes at the paths the error names. 11 tests, 11 of 11 mutations killed, 9 failed / 2 passed on `main` ([#1450](https://github.com/MakazhanAlpamys/Soup/issues/1450), [#1454](https://github.com/MakazhanAlpamys/Soup/pull/1454))+ - Closed #1703: with a reusable layer-shard cache, the layer-streaming disk pre-flight printed the estimate for writing a fresh cache as the `Layer-shard cache` size, so that row and `Projected total on disk` described a cache that was not there. `shard_cache_disk_bytes` now adds up the cache's own files (the index, the extras shard, the large shards and each layer file across the stripe folders) and the pre-flight reports that. **The part worth copying is that the sum names the files the cache holds instead of measuring the folder**: a stray or stale file in the folder is not counted, a file that cannot be measured keeps the estimate, a cache that has to be written is reported as before, and the write planned for a reusable cache stays 0. After the first review they added the tests for the two mutations it found surviving (the vocabulary shards of an untied checkpoint, and the materialization charge through the setup) and for a cache file lost between the check and the sizing, and they made a measured size stop reading "approximately". The PR says plainly that the full suite was not run ([#1703](https://github.com/MakazhanAlpamys/Soup/issues/1703), [#1709](https://github.com/MakazhanAlpamys/Soup/pull/1709))- **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))