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): credit @Faisal-Fayaz under the account's current name

Alpamysdf106781ed58
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3e705620..1a19d7d7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -36,7 +36,7 @@ reproducing 70+ versions of notes.
- **Added a ready-made `deepseek-v4-flash-dpo` recipe for deepseek-ai/DeepSeek-V4-Flash
(#275 by @Srinivasan8888 in #662).** The base already shipped SFT (v0.71.24) and
- GRPO (#279 by @Faisal01011); this completes the trio with the preference shape
+ GRPO (#279 by @Faisal-Fayaz); this completes the trio with the preference shape
(`task: dpo`, `format: dpo`, `preference_train.jsonl`, `dpo_beta: 0.1`,
`lr: 5e-6`) over the MoE geometry its SFT sibling already uses (LoRA r16/a32,
`batch_size: auto`, `gradient_accumulation_steps: 8`, 4-bit, `moe_lora`,
@@ -210,7 +210,7 @@ reproducing 70+ versions of notes.
- Direct AWQ exports now require an explicit, usable calibration JSONL before
AutoAWQ is imported or the model is loaded, preventing its large default
- calibration dataset from being downloaded silently (#338 by @Faisal01011 in #592).
+ calibration dataset from being downloaded silently (#338 by @Faisal-Fayaz in #592).
- **GEMM throughput forecasts now use the card's resolved stream dtype (#617 by @Samearth17 in #648).**
The pre-flight measurement no longer hard-codes bf16, so pre-Ampere cards are
@@ -522,7 +522,7 @@ reproducing 70+ versions of notes.
already requires starlette, uvicorn, sse-starlette and httpx-sse.
- **`soup data best-of-n` can sample candidates from Ollama or vLLM providers
- (#299 by @Faisal01011 in #466).** The existing local Transformers `--base` path stays
+ (#299 by @Faisal-Fayaz in #466).** The existing local Transformers `--base` path stays
the default, while `--provider ollama|vllm --model <m> [--base-url <url>]`
draws each prompt's N candidates through the existing SSRF-validated raw-
completion seam. Provider and model are recorded in `_best_of_n` provenance;
@@ -1334,7 +1334,7 @@ other advisory training-intelligence flags (#583).
4-bit training resolve quantized storage and trainable adapter
parameters to the same floating compute dtype, preventing the integer-storage
and mixed-dtype flattening failures that made the `llama3-70b-fsdp2` recipe
- unrunnable. The recipe now pins bf16 storage for its A100/H100 target hardware (#588 by @Faisal01011).
+ unrunnable. The recipe now pins bf16 storage for its A100/H100 target hardware (#588 by @Faisal-Fayaz).
- Raised the `accelerate` floor to 0.27.0, the first release whose FSDP
checkpoint save/load path can be restricted to the trainable adapter. This
@@ -1601,11 +1601,11 @@ other advisory training-intelligence flags (#583).
recipe `config_sha`, so setting a floor never invalidates evidence.
- **A ready-made `qwen3.5-4b-pretrain` recipe for continued pre-training of
- `Qwen/Qwen3.5-4B-Base` (#278 by @Faisal01011 in #422).** The recipe uses plaintext data, one epoch,
+ `Qwen/Qwen3.5-4B-Base` (#278 by @Faisal-Fayaz in #422).** The recipe uses plaintext data, one epoch,
QLoRA 4-bit quantization, and the established continued-pretraining defaults.
- **A ready-made `deepseek-v4-flash-grpo` recipe for GRPO reasoning training
- with `deepseek-ai/DeepSeek-V4-Flash` (#279 by @Faisal01011 in #432).** The recipe combines the
+ with `deepseek-ai/DeepSeek-V4-Flash` (#279 by @Faisal-Fayaz in #432).** The recipe combines the
established GRPO defaults with MoE LoRA and gradient checkpointing.
- **`soup mcp serve --allow-execute` can now actually execute, behind a single-use
@@ -1665,7 +1665,7 @@ other advisory training-intelligence flags (#583).
is not yet consumed by training.
- **Layer streaming now verifies that every trainable LoRA parameter has real
- storage after PEFT attaches the adapter (#433 reported by @lesterppo, fixed by @Faisal01011 in #435 and #437).** PEFT 0.18 creates streamed
+ storage after PEFT attaches the adapter (#433 reported by @lesterppo, fixed by @Faisal-Fayaz in #435 and #437).** PEFT 0.18 creates streamed
adapters on `meta` for Soup to materialise, while PEFT 0.19 may create them as
real tensors immediately, so `materialize_meta_adapters()` returning `0`
cannot distinguish a healthy no-op from a missed adapter. The streamed build
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md
index c6fe9852..38c8bd21 100644
--- a/CONTRIBUTORS.md
+++ b/CONTRIBUTORS.md
@@ -115,7 +115,7 @@ Listed by first contribution. PR numbers link the work.
- `soup ship --evidence` and the MCP `ship_evidence` tool each carried their own reader for the same file, and they had **already diverged once in a way that flipped a verdict**. One shared decoder now serves both, with a parity harness that fails on a DECISION-level divergence rather than on a message string — breaking parity on the MCP side alone reports `{'failed_rule': 'regression'}` against `{'failed_rule': None}`, i.e. DON'T-SHIP against SHIP, which is precisely the historical bug the refactor exists to prevent. Zero tests deleted: all 116 deletions are the two duplicated readers themselves. **They also refused one of the maintainer's own review requests and were right to** — the suggested `McpToolError(f"invalid evidence ({type(exc).__name__})")` would have broken `test_v07302.py::TestTheMcpEvidenceReaderHonoursTheFloor` and regressed v0.73.2, and they said so with the test that disproved it. The suggestion was withdrawn. A follow-up commit tightened the redaction regex found in review of this PR; the decoder and the harness are theirs ([#758](https://github.com/MakazhanAlpamys/Soup/issues/758), [#768](https://github.com/MakazhanAlpamys/Soup/pull/768))
- Closed the half of the Web UI body-size problem that #915 could not reach: `/api/chat/send` and `/api/data/inspect` read and parsed an unbounded request body before any handler check ran. **The cap fires BEFORE the parse, and that ordering is proven rather than asserted** — the same malformed JSON returns 422 at 64 bytes and 413 when oversized, and 422 is what body parsing produces, so 413 on an identical payload can only mean the cap ran first. I could not defeat it: an honest oversized `Content-Length`, a chunked request with no `Content-Length`, a lying `Content-Length: 5` in front of 3 MiB, a malformed header, and a raw ASGI request carrying no such header at all all return 413, with an exact boundary at 1048576 admitted / 1048577 refused. Four mutations each die, including one that kills only the streamed-byte check and correctly leaves the header fast path intact. **The judgement call is the best part**: `/api/data/inspect` caps rather than reordering, because its path is a body field and the acceptance criterion as literally written was unsatisfiable for that route — they wrote down why instead of implementing something that pretends otherwise. They also volunteered to fold a competing PR's mechanism into theirs when told it would merge second ([#939](https://github.com/MakazhanAlpamys/Soup/issues/939), [#948](https://github.com/MakazhanAlpamys/Soup/pull/948))
-- **Faisal Fayaz** ([@Faisal01011](https://github.com/Faisal01011))
+- **Faisal Fayaz** ([@Faisal-Fayaz](https://github.com/Faisal-Fayaz))
- Added the `qwen3.5-4b-pretrain` recipe — and shipped it with a test pinning the literal repo id, which is the only thing that catches a *consistently* wrong id (wrong in both `RecipeMeta.model` and the inline `base:`, so the two still agree). Every catalog-wide invariant passes that mutation; this is the defect class that shipped `glm-5` pointing at `THUDM` instead of `zai-org` ([#422](https://github.com/MakazhanAlpamys/Soup/pull/422))
- Added the `deepseek-v4-flash-grpo` recipe, carrying the same literal-repo-id guard a second time — the consistently-wrong-id mutation stays green through every cross-field invariant and is caught only by that test ([#432](https://github.com/MakazhanAlpamys/Soup/pull/432))
- `materialize_meta_adapters` returns a count, and on newer peft it returns `0` as a matter of course — so `0` stopped distinguishing "nothing to do" from the silent no-training case its own docstring warns about. Demoted the count to a diagnostic and moved the decision into a separate postcondition, so the caller can no longer choose to ignore it; the trigger needs a peft this repo does not pin, so the test stubs the capability and asserts the decision ([#435](https://github.com/MakazhanAlpamys/Soup/pull/435))