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: retire stale "deferred" and "planned" statements; soup export --help lists torchao and gguf-ud (#1886)
Alpamys Makazhanf3daf974ff58
diff --git a/changelog.d/0.76.0/1886.fixed.md b/changelog.d/0.76.0/1886.fixed.mdnew file mode 100644index 00000000..8cbb5cb3--- /dev/null+++ b/changelog.d/0.76.0/1886.fixed.md@@ -0,0 +1 @@+- `soup export --help` names every accepted `--format`: `torchao` and `gguf-ud` were missing from the list although both have worked since v0.53.1; a test keeps the list equal to `SUPPORTED_FORMATS`. Stale "schema-only" / "deferred" statements in the GGUF, BitNet and save-format module docstrings, a dead TTS anchor in `docs/training.md`, a dead energy anchor in `docs/adapters-and-governance.md` and the "planned PTQ export surface" sentence in `docs/performance-and-quantization.md` now describe what is live (#1886).diff --git a/docs/adapters-and-governance.md b/docs/adapters-and-governance.mdindex 268b64ef..7701a05f 100644--- a/docs/adapters-and-governance.md+++ b/docs/adapters-and-governance.md@@ -532,7 +532,7 @@ so a malicious model name can't inject a forged heading into downstream renderer`--annex-xi`. `--energy-country <ISO3>` picks the grid for the CO₂ estimate (default `USA`;the kWh figure itself is country-independent). Add `--energy-out <path>` to persist themeasurement as JSON for `soup bom emit --energy <path>` (the hand-off into an ML-BOM —-see [Attaching energy + CO₂](#attaching-energy--co2---energy)). Requires `pip install+see [Attaching energy + CO₂](#attaching-energy--co---energy)). Requires `pip installsoup-cli[carbon]`; without it, `--track-energy` is a graceful no-op.diff --git a/docs/cli-reference.md b/docs/cli-reference.mdindex 29c6f6ac..42c72e68 100644--- a/docs/cli-reference.md+++ b/docs/cli-reference.md@@ -2332,7 +2332,7 @@ Usage: `soup export [OPTIONS]`| Name | Type | Default | Required | Help ||---|---|---|---|---|| `--model`, `-m` | text | | yes | Path to model directory (full model or LoRA adapter) |-| `--format`, `-f` | text | `gguf` | | Export format: gguf, onnx, tensorrt, awq, gptq, bitnet, tq1_0 (awq and gptq are deprecated and will be removed in Soup v0.77) |+| `--format`, `-f` | text | `gguf` | | Export format: gguf, onnx, tensorrt, awq, gptq, bitnet, tq1_0, torchao, gguf-ud (torchao needs --quant-config; awq and gptq are deprecated and will be removed in Soup v0.77) || `--quant`, `-q` | text | `q4_k_m` | | Quantization type: q4_0, q4_k_m, q5_k_m, q8_0, f16, f32 || `--output`, `-o` | text | | | Output file path. Default: <model-name>.<quant>.gguf || `--base`, `-b` | text | | | Base model ID (for LoRA adapters). Auto-detected if not set. |diff --git a/docs/performance-and-quantization.md b/docs/performance-and-quantization.mdindex f0e1194f..a8bb92e8 100644--- a/docs/performance-and-quantization.md+++ b/docs/performance-and-quantization.md@@ -1375,7 +1375,7 @@ supported transformers path for these precision features.`soup merge --save-format 4bit` and `--save-format 4bit_forced` write a single BNB-4bit-quantized merged checkpoint without the wasteful dequant → merge → requant cycle (unsloth `merged_4bit` recipe). `4bit_forced` quantizes all linear layers including `lm_head`; models with tied embeddings (`tie_word_embeddings: true`) cannot hold a 4-bit `lm_head` sharing weights with embeddings and are explicitly refused by name with `ValueError`. v0.53.0 shipped the closed allowlist + spec metadata; the live writer landed in v0.53.1.-`soup export --format torchao --quant-config <yaml>` is the planned PTQ export surface for `torchao.quantize_` + `save_pretrained`. Four schemes are allowlisted: `Int4WeightOnly`, `Int8DynActInt4`, `Float8DynActFloat8`, `NVFP4`. CASE-SENSITIVE — these are Soup's scheme names, mapped to the torchao class that implements each one in `utils/torchao_compat.py` (three of the four names Soup used to look up by `hasattr` do not exist in torchao; #826). `Int4WeightOnly` accepts `group_size`; `inner_k_tiles` was removed, because `Int4WeightOnlyConfig` raises `TypeError` for it. Diverges from `--save-format` (lowercase-normalised) on purpose; documented at both validators.+`soup export --format torchao --quant-config <yaml>` is the live PTQ export (v0.53.1, #142): it runs `torchao.quantize_` on the model and writes the result with `save_pretrained`, to `--output` or, by default, next to the model as `<model>.torchao.<scheme>`. `--quant-config` is required with `--format torchao` (the command exits 2 without it) and the YAML must declare a top-level `scheme:` key. Four schemes are allowlisted: `Int4WeightOnly`, `Int8DynActInt4`, `Float8DynActFloat8`, `NVFP4`. CASE-SENSITIVE — these are Soup's scheme names, mapped to the torchao class that implements each one in `utils/torchao_compat.py` (three of the four names Soup used to look up by `hasattr` do not exist in torchao; #826). `Int4WeightOnly` and `Int8DynActInt4` accept `group_size`, `Float8DynActFloat8` and `NVFP4` take no extra keys, and any other key is refused (exit 2) with a message listing the allowed ones; `inner_k_tiles` was removed, because `Int4WeightOnlyConfig` raises `TypeError` for it. Diverges from `--save-format` (lowercase-normalised) on purpose; documented at both validators.## Quant Menu II + Export Pipeline (v0.53.1)diff --git a/docs/training.md b/docs/training.mdindex b9db87b0..5f6ae406 100644--- a/docs/training.md+++ b/docs/training.md@@ -47,7 +47,7 @@- [RAFT — Retrieval-Augmented Fine-Tuning](#raft--retrieval-augmented-fine-tuning)- [RA-DIT — Retrieval-Augmented Dual Instruction Tuning](#ra-dit--retrieval-augmented-dual-instruction-tuning)- [Curriculum-Aware Training (BETA)](#curriculum-aware-training-beta)-- [TTS Fine-Tuning (BETA, v0.52.0)](#tts-fine-tuning-beta-v0520)+- [TTS Fine-Tuning (BETA, live in v0.71.20)](#tts-fine-tuning-tasktts-beta-live-in-v07120)- [Classifier / Reranker / Cross-Encoder Training (BETA, v0.52.0)](#classifier--reranker--cross-encoder-training-beta-v0520)- [Knowledge Distillation (BETA, v0.52.0)](#knowledge-distillation-beta-v0520)- [EBFT + GDPO (BETA, v0.52.0)](#ebft--gdpo-beta-v0520)diff --git a/src/soup_cli/commands/export.py b/src/soup_cli/commands/export.pyindex 2e37a46d..7107b2aa 100644--- a/src/soup_cli/commands/export.py+++ b/src/soup_cli/commands/export.py@@ -22,7 +22,7 @@ console = Console()SUPPORTED_FORMATS = ("gguf", "onnx", "tensorrt", "awq", "gptq",# v0.52.0 Part D — BitNet 1.58-bit + TQ1_0 GGUF.- # Schema-only stubs in v0.52.0; live conversion lands in v0.52.1.+ # Live llama.cpp conversion (v0.71.20 #134); needs a built llama.cpp toolchain."bitnet", "tq1_0",# v0.53.1 #142 — TorchAO PTQ live wiring (Int4WeightOnly / Int8DynActInt4 /# Float8DynActFloat8 / NVFP4). Requires --quant-config <yaml>.@@ -79,9 +79,9 @@ def export("--format","-f",help=(- "Export format: gguf, onnx, tensorrt, awq, gptq, bitnet, tq1_0 "- "(awq and gptq are deprecated and will be removed in "- f"Soup v{DEPRECATED_VALUE_REJECTION_VERSION})"+ "Export format: gguf, onnx, tensorrt, awq, gptq, bitnet, tq1_0, torchao, "+ "gguf-ud (torchao needs --quant-config; awq and gptq are deprecated and "+ f"will be removed in Soup v{DEPRECATED_VALUE_REJECTION_VERSION})"),),quant: str = typer.Option(diff --git a/src/soup_cli/utils/bitnet.py b/src/soup_cli/utils/bitnet.pyindex 44b203a6..9a48020c 100644--- a/src/soup_cli/utils/bitnet.py+++ b/src/soup_cli/utils/bitnet.py@@ -1,10 +1,10 @@-"""v0.52.0 Part D — BitNet 1.58-bit fine-tuning + export schema helpers.+"""BitNet 1.58-bit: the quantization allowlist, the export validators and the GGUF export.-Schema-only support for ``quantization='bitnet_1.58'`` and the new-``soup export --format bitnet`` / ``--format tq1_0`` GGUF flavours.--Live ``onebitllms`` wrapping + llama.cpp ``TQ1_0`` export wiring are-deferred to v0.52.1 (mirrors v0.50.0 stub-then-live pattern).+Specs and validators for ``quantization='bitnet_1.58'`` and for+``soup export --format bitnet`` / ``--format tq1_0``, plus :func:`export_bitnet_gguf`,+the live llama.cpp conversion (v0.71.20 #134; it needs a built llama.cpp toolchain).+Training with ``onebitllms`` lives in :mod:`soup_cli.trainer.bitnet`, which gates its+setup on that package being installed."""from __future__ import annotationsdiff --git a/src/soup_cli/utils/gguf_quant.py b/src/soup_cli/utils/gguf_quant.pyindex 0605cf4d..9ffea102 100644--- a/src/soup_cli/utils/gguf_quant.py+++ b/src/soup_cli/utils/gguf_quant.py@@ -1,12 +1,12 @@"""v0.53.0 Parts A+B — UD GGUF + IQ / Apple-ARM quant schema helpers.-Schema-only support for Unsloth Dynamic 2.0 GGUF ladder (``UD-Q8_K_XL`` …+Allowlists, specs and validators for the Unsloth Dynamic 2.0 GGUF ladder (``UD-Q8_K_XL`` …``UD-IQ1_M``), the IQ1/IQ2/IQ3 family, the Apple/ARM-friendly Q4_NL /-Q5.x / Q4.x variants, and the existing TQ1_0 1.58-bit GGUF flavour (from-v0.52.0 Part D, re-exposed here for ``soup export --format gguf-iq``).+Q5.x / Q4.x variants. TQ1_0 is not in these tables: ``soup export --format tq1_0``+(``utils/bitnet.py``) exports it with this module's convert and quantize helpers.-Live llama.cpp ``imatrix`` calibration + actual GGUF write are deferred-to v0.53.1 (mirrors v0.50.0 stub-then-live pattern).+Live: ``export_advanced_gguf`` runs the llama.cpp ``imatrix`` calibration and the GGUF+write for ``soup export --format gguf-ud --gguf-flavour <flavour>``."""from __future__ import annotations@@ -67,9 +67,8 @@ APPLE_ARM_GGUF_FORMATS: frozenset[str] = frozenset({"Q4_K_M",})-# Union of all v0.53.0 schema-only GGUF flavours (excludes TQ1_0 which is owned-# by v0.52.0 Part D ``utils/bitnet.py``; ``is_advanced_gguf_format`` returns-# True for the BitNet family too via the helper below for export-CLI parity).+# Union of the three flavour tables above. TQ1_0 is not in it: ``utils/bitnet.py`` owns+# it, and ``is_advanced_gguf_format`` returns False for it.ALL_ADVANCED_GGUF_FORMATS: frozenset[str] = (UD_GGUF_FORMATS | IQ_GGUF_FORMATS | APPLE_ARM_GGUF_FORMATS)diff --git a/src/soup_cli/utils/save_formats.py b/src/soup_cli/utils/save_formats.pyindex 24c5e37d..e6b70fd4 100644--- a/src/soup_cli/utils/save_formats.py+++ b/src/soup_cli/utils/save_formats.py@@ -1,6 +1,6 @@"""v0.53.0 Part F + v0.53.1 #142 — Advanced save / merge formats.-Two new save-format surfaces ship this release (schema-only):+Two save-format surfaces:* ``soup merge --save-format <fmt>`` where fmt ∈ {fp16, 4bit, 4bit_forced}.``4bit`` writes a single BNB-4bit-quantized merged checkpoint without@@ -11,7 +11,8 @@ Two new save-format surfaces ship this release (schema-only):``Int4WeightOnly`` / ``Int8DynActInt4`` / ``Float8DynActFloat8`` /``NVFP4`` PTQ schemes (unsloth + axolotl parity).-Live wiring deferred to v0.53.1.+Both are live: ``soup merge`` calls :func:`merge_4bit` and ``soup export --format+torchao`` calls :func:`export_torchao`."""from __future__ import annotationsdiff --git a/tests/test_export.py b/tests/test_export.pyindex 12ab2dae..6d0f204d 100644--- a/tests/test_export.py+++ b/tests/test_export.py@@ -1,6 +1,7 @@"""Tests for soup export command."""import json+import refrom pathlib import Pathfrom typer.testing import CliRunner@@ -132,3 +133,27 @@ def test_export_help():assert result.exit_code == 0assert "gguf" in result.output.lower()assert "quant" in result.output.lower()+++_ANSI_RE = re.compile(r"\x1b\[[0-9;]*m")+++def _plain(text: str) -> str:+ """Help text with Rich colour removed and line wraps collapsed to one space."""+ return " ".join(_ANSI_RE.sub("", text).split())+++def test_export_help_names_every_supported_format():+ """The --format help lists every accepted format (torchao and gguf-ud were missing)."""+ result = runner.invoke(app, ["export", "--help"])+ assert result.exit_code == 0, (result.output, repr(result.exception))+ out = _plain(result.output)+ formats_line = out.split("Export format:", 1)+ assert len(formats_line) == 2, out+ # Only the --format sentence: it ends at the deprecation note's closing bracket,+ # before the next option's help (which also says "torchao").+ listed = formats_line[1].split(")", 1)[0]+ for fmt in SUPPORTED_FORMATS:+ assert re.search(rf"(?<![\w-]){re.escape(fmt)}(?![\w-])", listed), (+ f"--format help does not list {fmt!r}: {listed[:200]}"+ )