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.

fix(config): stage nine training and convergence knobs with v0.77 deadline (#808) (#1379)

Sharvinb3a60f2d92cf
diff --git a/changelog.d/0.75.1/1379.changed.md b/changelog.d/0.75.1/1379.changed.md
new file mode 100644
index 00000000..e3f90f17
--- /dev/null
+++ b/changelog.d/0.75.1/1379.changed.md
@@ -0,0 +1,2 @@
+- **Nine training-intelligence and convergence knobs warn at load and v0.77 refuses them (#808 by @Guts1005 in #1379).**
+ `forgetting_eval_steps`, `forgetting_benchmark`, `forgetting_stop`, `checkpoint_eval_steps`, `checkpoint_eval_metric`, `checkpoint_eval_tasks`, `checkpoint_keep_top`, `convergence_window`, and `convergence_rel_tol` were accepted and validated, but none of the nine ever changed a run. Setting any of them away from its default now prints "accepted but read by nothing; v0.77 will refuse it". They move from `soup train`'s "set but not enforced" advisory note to the loader's warning so each knob is reported once, with the refusal date. Deleting the key keeps configs loading after v0.77, and schema defaults stay silent.
diff --git a/docs/peft-and-efficiency.md b/docs/peft-and-efficiency.md
index 0ac25b14..4325b482 100644
--- a/docs/peft-and-efficiency.md
+++ b/docs/peft-and-efficiency.md
@@ -670,8 +670,9 @@ training:
```
Computes `continue` / `early_stop` / `lower_lr` advice from the loss curve for
-callers that invoke the detector. `soup train` currently reports this option as
-not enforced; a live training callback remains a follow-up.
+callers that invoke the detector. `convergence_detection` is reported as not
+enforced by `soup train`; setting `convergence_window` or `convergence_rel_tol` away from their
+defaults emits a load-time warning in v0.76 and will be refused as of v0.77 (#808).
### VRAM Pressure Advisory
@@ -690,14 +691,15 @@ Records peak memory each step. When pressure crosses the threshold, recommends a
## Training Intelligence (Forgetting + Checkpoint Quality)
-The `forgetting_*`, `checkpoint_*`, `early_stop_on_regression`, and `convergence_*` settings are
+The `forgetting_detection`, `checkpoint_intelligence`, `early_stop_on_regression`, `convergence_detection`, and `forgetting_threshold` settings are
reserved for planned in-training callbacks. They are accepted by the schema but
are not enforced during training in this build. `soup train` prints an advisory note
when one is set away from its default, directing users to `--gate <suite.yaml>`.
-(Other unconsumed configuration fields staged for features that have not landed emit
-a load-time warning in v0.76 and are refused as of v0.77 per #808. That includes
-`early_stop_patience`, which moved from the advisory note to the load-time warning
-in #761, so it is reported once, with the refusal date.)
+Their tuning knobs (`forgetting_eval_steps`, `forgetting_benchmark`, `forgetting_stop`,
+`checkpoint_eval_steps`, `checkpoint_eval_metric`, `checkpoint_eval_tasks`, `checkpoint_keep_top`,
+`convergence_window`, and `convergence_rel_tol`) emit a load-time warning in v0.76
+and are refused as of v0.77 per #808, alongside `early_stop_patience` (#761), so each
+is reported once with the refusal date.
Use the live eval gate for regression detection and automatic stopping today:
diff --git a/src/soup_cli/commands/train.py b/src/soup_cli/commands/train.py
index 79f143ca..339fec9f 100644
--- a/src/soup_cli/commands/train.py
+++ b/src/soup_cli/commands/train.py
@@ -35,18 +35,12 @@ _HW_FIT_OPTIMIZERS = frozenset({
})
_UNWIRED_TRAINING_TUNABLES = (
- "forgetting_eval_steps",
+ # Group B tunables (forgetting_eval_steps, forgetting_benchmark, forgetting_stop,
+ # checkpoint_eval_steps, checkpoint_eval_metric, checkpoint_eval_tasks,
+ # checkpoint_keep_top, convergence_window, convergence_rel_tol) moved to
+ # config/staged_fields.py (#808), and early_stop_patience moved in #761:
+ # the loader warns about them with the refusal date, so they are not listed here.
"forgetting_threshold",
- "forgetting_benchmark",
- "forgetting_stop",
- "checkpoint_eval_steps",
- "checkpoint_eval_metric",
- "checkpoint_eval_tasks",
- "checkpoint_keep_top",
- # early_stop_patience moved to config/staged_fields.py (#761): the loader
- # warns about it with the refusal date, so it is not listed here as well.
- "convergence_window",
- "convergence_rel_tol",
)
@@ -951,9 +945,10 @@ def train(
cfg.training.eval_gate = EvalGateConfig(enabled=True, suite=gate)
console.print(f"[green]Eval gate enabled[/] with suite: {gate}")
- # Honesty guard: these staged knobs are accepted but are not enforced
- # mid-training in this build. Warn for every non-default member of the
- # families, not only their enable flags, so a tuned no-op is never silent.
+ # Honesty guard: these staged flags (plus forgetting_threshold) are accepted
+ # but not enforced mid-training in this build. Their other tuning knobs are
+ # reported by the loader with refusal dates, so only active flags and
+ # non-default forgetting_threshold are reported here.
_unwired_gates = _nondefault_unwired_training_settings(cfg.training)
if _unwired_gates:
console.print(
diff --git a/src/soup_cli/config/schema.py b/src/soup_cli/config/schema.py
index 24ee3d54..1568de14 100644
--- a/src/soup_cli/config/schema.py
+++ b/src/soup_cli/config/schema.py
@@ -3250,11 +3250,17 @@ class TrainingConfig(BaseModel):
)
convergence_window: int = Field(
default=50, ge=5, le=10_000,
- description="Number of recent losses to inspect for plateau / oscillation",
+ description=(
+ "Staged, not enforced during training: "
+ "number of recent losses to inspect for plateau / oscillation"
+ ),
)
convergence_rel_tol: float = Field(
default=0.005, gt=0.0, le=1.0,
- description="Relative range threshold below which the window is a plateau",
+ description=(
+ "Staged, not enforced during training: "
+ "relative range threshold below which the window is a plateau"
+ ),
)
# Warmup auto-schedule (v0.32.0 Part D) — reuses pre-existing warmup_ratio.
warmup_auto: bool = Field(
diff --git a/src/soup_cli/config/staged_fields.py b/src/soup_cli/config/staged_fields.py
index f9052e5f..ddf472d7 100644
--- a/src/soup_cli/config/staged_fields.py
+++ b/src/soup_cli/config/staged_fields.py
@@ -40,11 +40,11 @@ class StagedField:
#: or data pipeline. A field is only flagged if the user provides a value that
#: DIFFERS from its schema default.
#:
-#: Note: Training intelligence tunables already reported by ``soup train``
-#: (e.g. ``forgetting_*``, ``checkpoint_*``, ``convergence_*``) are excluded here
-#: to avoid conflicting diagnostics and adhere to their respective issue ownership
-#: (#808). ``early_stop_patience`` moved here from that report (#761), so it is
-#: reported once, with the refusal date.
+#: Note: Training intelligence parent enable flags (``forgetting_detection``,
+#: ``checkpoint_intelligence``, ``early_stop_on_regression``,
+#: ``convergence_detection``) continue to be reported by ``soup train``'s
+#: live honesty guard. The tunables themselves (Group B) are staged here (#808),
+#: so non-default values warn at load with the v0.77 refusal deadline.
STAGED_FIELDS: dict[tuple[str, str], Any] = {
("training", "long_context_grpo"): False,
("training", "vision_grpo"): False,
@@ -56,6 +56,16 @@ STAGED_FIELDS: dict[tuple[str, str], Any] = {
("training", "lr_groups"): None,
("training", "early_stop_patience"): 2,
("training", "citation_recall_threshold"): None,
+ # #808 Group B: training-intelligence and convergence tunables
+ ("training", "forgetting_eval_steps"): 100,
+ ("training", "forgetting_benchmark"): "mini_mmlu",
+ ("training", "forgetting_stop"): False,
+ ("training", "checkpoint_eval_steps"): 200,
+ ("training", "checkpoint_eval_metric"): "composite",
+ ("training", "checkpoint_eval_tasks"): None,
+ ("training", "checkpoint_keep_top"): 3,
+ ("training", "convergence_window"): 50,
+ ("training", "convergence_rel_tol"): 0.005,
("data", "video_dir"): None,
("data", "video_fps"): None,
("data", "video_maxlen"): None,
diff --git a/tests/test_issue748_config_fields_reach_a_consumer.py b/tests/test_issue748_config_fields_reach_a_consumer.py
index 535f11bd..907d8133 100644
--- a/tests/test_issue748_config_fields_reach_a_consumer.py
+++ b/tests/test_issue748_config_fields_reach_a_consumer.py
@@ -382,19 +382,26 @@ KNOWN_UNCONSUMED = {
"training.llm_int8": "no issue needed: schema assertion alias",
"training.quantize_ref_model": "#808 -- warns at load from v0.76, refused as of v0.77 "
"(reference-model quantisation staging)",
- "training.convergence_window": "#808 group B -- soup train reports it as not enforced "
+ "training.convergence_window": "#808 -- warns at load from v0.76, refused as of v0.77 "
"(convergence-detector staging)",
- "training.convergence_rel_tol": "#808 group B -- soup train reports it as not enforced "
+ "training.convergence_rel_tol": "#808 -- warns at load from v0.76, refused as of v0.77 "
"(convergence-detector staging)",
- "training.forgetting_eval_steps": "#799 -- catastrophic-forgetting probe staging",
+ "training.forgetting_eval_steps": "#808 -- warns at load from v0.76, refused as of v0.77 "
+ "(catastrophic-forgetting probe staging)",
"training.forgetting_threshold": "#799 -- staged catastrophic-forgetting threshold; "
"the same name in ship.py is unrelated",
- "training.forgetting_benchmark": "#799 -- catastrophic-forgetting probe staging",
- "training.forgetting_stop": "#799 -- catastrophic-forgetting probe staging",
- "training.checkpoint_eval_steps": "#799 -- checkpoint-eval staging",
- "training.checkpoint_eval_metric": "#799 -- checkpoint-eval staging",
- "training.checkpoint_eval_tasks": "#799 -- checkpoint-eval staging",
- "training.checkpoint_keep_top": "#799 -- checkpoint-eval staging",
+ "training.forgetting_benchmark": "#808 -- warns at load from v0.76, refused as of v0.77 "
+ "(catastrophic-forgetting probe staging)",
+ "training.forgetting_stop": "#808 -- warns at load from v0.76, refused as of v0.77 "
+ "(catastrophic-forgetting probe staging)",
+ "training.checkpoint_eval_steps": "#808 -- warns at load from v0.76, refused as of v0.77 "
+ "(checkpoint-eval staging)",
+ "training.checkpoint_eval_metric": "#808 -- warns at load from v0.76, refused as of v0.77 "
+ "(checkpoint-eval staging)",
+ "training.checkpoint_eval_tasks": "#808 -- warns at load from v0.76, refused as of v0.77 "
+ "(checkpoint-eval staging)",
+ "training.checkpoint_keep_top": "#808 -- warns at load from v0.76, refused as of v0.77 "
+ "(checkpoint-eval staging)",
"training.grace_codebook_size": "#808 -- warns at load from v0.76, refused as of v0.77 "
"(GRACE codebook staging)",
"training.grace_codebook_dim": "#808 -- warns at load from v0.76, refused as of v0.77 "
diff --git a/tests/test_issue799_autopilot_unwired_gates.py b/tests/test_issue799_autopilot_unwired_gates.py
index dd998692..a6e254d7 100644
--- a/tests/test_issue799_autopilot_unwired_gates.py
+++ b/tests/test_issue799_autopilot_unwired_gates.py
@@ -71,7 +71,9 @@ def test_train_warns_for_nondefault_unwired_sibling_settings(
monkeypatch,
) -> None:
import soup_cli.commands.train as train_mod
+ import soup_cli.config.loader as loader
+ monkeypatch.setattr(loader, "STAGED_FIELD_SEVERITY", "warn")
data_path = _write_data(tmp_path / "data.jsonl")
config_path = tmp_path / "soup.yaml"
config_path.write_text(
diff --git a/tests/test_issue808_staged_config_fields.py b/tests/test_issue808_staged_config_fields.py
index 83ec6228..da13818b 100644
--- a/tests/test_issue808_staged_config_fields.py
+++ b/tests/test_issue808_staged_config_fields.py
@@ -125,13 +125,12 @@ class TestTheDeadline:
class TestStagedFieldsInventory:
- """Validate inventory size and default handling across all 20 staged fields."""
+ """Validate inventory size and default handling across all 29 staged fields."""
- def test_exactly_20_staged_fields_registered(self) -> None:
- # 17 from #808, plus lr_groups / early_stop_patience /
- # citation_recall_threshold from #761.
- assert len(STAGED_FIELDS) == 20, (
- f"Expected exactly 20 staged fields, got {len(STAGED_FIELDS)}"
+ def test_exactly_29_staged_fields_registered(self) -> None:
+ # 17 from #808 initial, 3 from #761, plus 9 Group B knobs from #808.
+ assert len(STAGED_FIELDS) == 29, (
+ f"Expected exactly 29 staged fields, got {len(STAGED_FIELDS)}"
)
@pytest.mark.parametrize(
@@ -146,6 +145,15 @@ class TestStagedFieldsInventory:
("training", "lr_groups", [{"pattern": "lm_head", "lr": 1e-5}]),
("training", "early_stop_patience", 5),
("training", "citation_recall_threshold", 0.8),
+ ("training", "forgetting_eval_steps", 250),
+ ("training", "forgetting_benchmark", "mini_common_sense"),
+ ("training", "forgetting_stop", True),
+ ("training", "checkpoint_eval_steps", 500),
+ ("training", "checkpoint_eval_metric", "judge"),
+ ("training", "checkpoint_eval_tasks", "arc,hellaswag"),
+ ("training", "checkpoint_keep_top", 5),
+ ("training", "convergence_window", 100),
+ ("training", "convergence_rel_tol", 0.01),
("data", "video_dir", "./videos"),
("data", "video_fps", 2.0),
("data", "video_maxlen", 64),
@@ -312,20 +320,23 @@ class TestLoaderStagedFieldIntegration:
assert "read by nothing" not in _plain(capsys.readouterr().out)
@pytest.mark.parametrize("severity", ["warn", "error"])
- def test_convergence_rel_tol_scientific_notation_unwired_tunable_loads_silently(
+ def test_convergence_rel_tol_scientific_notation_staged_field_loads_silently(
self, severity: str, monkeypatch, capsys
) -> None:
- """convergence_rel_tol: 5e-3 matching schema default loads cleanly as an unwired tunable."""
+ """convergence_rel_tol: 5e-3 matching schema default loads cleanly as a staged field."""
monkeypatch.setattr(loader, "STAGED_FIELD_SEVERITY", severity)
yaml_str = _VALID + "\ntraining:\n convergence_rel_tol: 5e-3\n"
cfg = loader.load_config_from_string(yaml_str)
assert cfg.training.convergence_rel_tol == 0.005
assert capsys.readouterr().out == ""
- def test_convergence_unwired_tunables_in_train_command(self) -> None:
- """convergence_window and convergence_rel_tol are reported as unwired training tunables."""
+ def test_group_b_tunables_no_longer_listed_in_train_command(
+ self, monkeypatch
+ ) -> None:
+ """Group B tunables are staged fields; train command lists only enabled flags."""
from soup_cli.commands.train import _nondefault_unwired_training_settings
+ monkeypatch.setattr(loader, "STAGED_FIELD_SEVERITY", "warn")
yaml_str = _VALID + "\ntraining:\n convergence_rel_tol: 5e-3\n convergence_window: 50\n"
cfg = loader.load_config_from_string(yaml_str)
assert _nondefault_unwired_training_settings(cfg.training) == []
@@ -334,10 +345,83 @@ class TestLoaderStagedFieldIntegration:
_VALID
+ "\ntraining:\n convergence_detection: true\n"
+ " convergence_window: 100\n convergence_rel_tol: 0.01\n"
+ + " forgetting_eval_steps: 250\n checkpoint_keep_top: 5\n"
)
cfg_nondef = loader.load_config_from_string(yaml_nondef)
assert _nondefault_unwired_training_settings(cfg_nondef.training) == [
"convergence_detection",
- "convergence_window",
- "convergence_rel_tol",
]
+
+
+class TestGroupBTunablesIntegration:
+ """Group B knobs warn at load and refuse under v0.77 deadline (#808)."""
+
+ _GROUP_B_CASES = {
+ "training.forgetting_eval_steps": "training:\n forgetting_eval_steps: 250\n",
+ "training.forgetting_benchmark": "training:\n forgetting_benchmark: mini_common_sense\n",
+ "training.forgetting_stop": "training:\n forgetting_stop: true\n",
+ "training.checkpoint_eval_steps": "training:\n checkpoint_eval_steps: 500\n",
+ "training.checkpoint_eval_metric": "training:\n checkpoint_eval_metric: judge\n",
+ "training.checkpoint_eval_tasks": "training:\n checkpoint_eval_tasks: arc,hellaswag\n",
+ "training.checkpoint_keep_top": "training:\n checkpoint_keep_top: 5\n",
+ "training.convergence_window": "training:\n convergence_window: 100\n",
+ "training.convergence_rel_tol": "training:\n convergence_rel_tol: 0.01\n",
+ }
+
+ def test_soup_train_note_names_no_staged_field(self, monkeypatch) -> None:
+ """Each knob is reported once, by the loader; soup train's note adds none (#808)."""
+ from soup_cli.commands.train import (
+ _UNWIRED_TRAINING_TUNABLES,
+ _nondefault_unwired_training_settings,
+ )
+
+ staged = {name for section, name in STAGED_FIELDS if section == "training"}
+ assert not staged & set(_UNWIRED_TRAINING_TUNABLES)
+
+ monkeypatch.setattr(loader, "STAGED_FIELD_SEVERITY", "warn")
+ body = "".join(case.split("\n", 1)[1] for case in self._GROUP_B_CASES.values())
+ cfg = loader.load_config_from_string(_VALID + "\ntraining:\n" + body)
+ assert _nondefault_unwired_training_settings(cfg.training) == []
+
+ @pytest.mark.parametrize("path", sorted(_GROUP_B_CASES))
+ def test_group_b_knob_warns_with_deadline_under_warn_severity(
+ self, path: str, capsys, monkeypatch
+ ) -> None:
+ monkeypatch.setattr(loader, "STAGED_FIELD_SEVERITY", "warn")
+ yaml_str = _VALID + "\n" + self._GROUP_B_CASES[path]
+ loader.load_config_from_string(yaml_str)
+ plain_out = _plain(capsys.readouterr().out)
+ assert f"{path} is accepted but read by nothing" in plain_out
+ assert f"v{STAGED_FIELD_REJECTION_VERSION} will refuse it" in plain_out
+
+ @pytest.mark.parametrize("path", sorted(_GROUP_B_CASES))
+ def test_group_b_knob_refuses_under_error_severity(
+ self, path: str, monkeypatch
+ ) -> None:
+ monkeypatch.setattr(loader, "STAGED_FIELD_SEVERITY", "error")
+ yaml_str = _VALID + "\n" + self._GROUP_B_CASES[path]
+ with pytest.raises(ValueError) as excinfo:
+ loader.load_config_from_string(yaml_str)
+ assert f"{path} is accepted but read by nothing" in str(excinfo.value)
+ assert f"v{STAGED_FIELD_REJECTION_VERSION}" in str(excinfo.value)
+
+ @pytest.mark.parametrize("severity", ["warn", "error"])
+ def test_group_b_defaults_stay_silent(
+ self, severity: str, capsys, monkeypatch
+ ) -> None:
+ monkeypatch.setattr(loader, "STAGED_FIELD_SEVERITY", severity)
+ yaml_defaults = (
+ _VALID
+ + "\ntraining:\n"
+ + " forgetting_eval_steps: 100\n"
+ + " forgetting_benchmark: mini_mmlu\n"
+ + " forgetting_stop: false\n"
+ + " checkpoint_eval_steps: 200\n"
+ + " checkpoint_eval_metric: composite\n"
+ + " checkpoint_eval_tasks: null\n"
+ + " checkpoint_keep_top: 3\n"
+ + " convergence_window: 50\n"
+ + " convergence_rel_tol: 0.005\n"
+ )
+ loader.load_config_from_string(yaml_defaults)
+ assert "read by nothing" not in _plain(capsys.readouterr().out)