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): refuse vision row formats on preference tasks, drop pixtral-dpo recipe (#2064)

Vishal Kumar Singhad4505865fee
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index daed9af6..fe059fb6 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -124,7 +124,7 @@ src/soup_cli/
eval/ - Eval platform (custom tasks, LLM judge, human eval, leaderboard)
bench/ - Benchmark instruments behind `soup bench train` (collector, train_report, train_run) (#836)
migrate/ - Config migration (LLaMA-Factory, Axolotl, Unsloth)
- recipes/ - Ready-made configs for popular models (170 recipes)
+ recipes/ - Ready-made configs for popular models (169 recipes)
autopilot/ - Zero-config decision engine (v0.25.0)
registry/ - Model Registry (hashing, store, diff, attach) (v0.26.0 + v0.33.0)
cans/ - Shareable .can artifact format + run/publish orchestrator (v0.26.0 + v0.33.0)
diff --git a/changelog.d/0.76.0/2064.fixed.md b/changelog.d/0.76.0/2064.fixed.md
new file mode 100644
index 00000000..7a31f38b
--- /dev/null
+++ b/changelog.d/0.76.0/2064.fixed.md
@@ -0,0 +1 @@
+- Refuse vision row formats (llava, sharegpt4v) on preference tasks at config load, with "has no vision-preference row path; use a text preference format instead", and drop the unsupported pixtral-dpo recipe (#2064).
diff --git a/docs/backends-and-ops.md b/docs/backends-and-ops.md
index 1609e01b..e6e24fe2 100644
--- a/docs/backends-and-ops.md
+++ b/docs/backends-and-ops.md
@@ -576,7 +576,7 @@ soup recipes verify --json # one row per config on stdout, for CI
| **Reasoning** | All 6 DeepSeek-R1-Distill sizes (Qwen 1.5B / 7B / 14B / 32B + Llama 8B / 70B), Qwen3-Coder 30B, Qwen3-30B-A3B reasoning, Phi-4 reasoning |
| **Small / edge / mobile** | SmolLM2 (135M / 360M / 1.7B), Qwen2.5 (0.5B / 1.5B / 3B), Gemma 2 2B, Phi-3.5-mini, Llama-3.2 (1B / 3B) |
| **Domain specialists** | BioMistral 7B, Meditron 7B (medical) — CodeLlama (13B / 70B), Magicoder 6.7B (code) — Mathstral 7B (math) — Llama-2-13b-finance (FinGPT-style starter) — Nemotron-4 340B |
-| **Multimodal reasoning** | Llama-3.2-Vision GRPO, Pixtral DPO |
+| **Multimodal reasoning** | Llama-3.2-Vision GRPO |
| **Multi-GPU** | llama3-70b-fsdp2, qwen3-32b-zeropp, deepseek-v3-pipeline |
| **Apple Silicon (MLX)** | llama3.1-8b / qwen3-8b / gemma3-9b SFT-MLX |
| **Tool-calling / agentic** | qwen3-8b-tools, llama4-scout-tools |
diff --git a/docs/commands.md b/docs/commands.md
index 723b75fc..2b875fa3 100644
--- a/docs/commands.md
+++ b/docs/commands.md
@@ -185,7 +185,7 @@ soup migrate --from llamafactory config.yaml Import config from LLaMA-Factory
soup migrate --from axolotl config.yml Import config from Axolotl
soup migrate --from unsloth notebook.ipynb Import config from Unsloth notebook
soup migrate --from llamafactory c.yaml --dry-run Preview without writing
-soup recipes list List all 170 ready-made recipes
+soup recipes list List all 169 ready-made recipes
soup recipes show llama3.1-8b-sft Print recipe YAML
soup recipes use llama3.1-8b-sft Copy recipe to soup.yaml
soup recipes search "reasoning" Search by keyword/task/size
diff --git a/docs/serving-and-export.md b/docs/serving-and-export.md
index 8ce87589..2668cbe1 100644
--- a/docs/serving-and-export.md
+++ b/docs/serving-and-export.md
@@ -748,7 +748,7 @@ still records the URL it was given.
**Pages:**
- **Dashboard** — view all experiment runs, loss charts, system info, multi-run comparison
-- **New Training** — create configs from templates or 170 ready-made recipes, validate, start training with live SSE log streaming and progress bar
+- **New Training** — create configs from templates or 169 ready-made recipes, validate, start training with live SSE log streaming and progress bar
- **Data Explorer** — browse and inspect datasets (JSONL, JSON, CSV, Parquet)
- **Model Chat** — chat with streaming responses, configurable temperature/top_p/max_tokens, system prompt, adapter selection, markdown rendering, chat export
@@ -757,7 +757,7 @@ still records the URL it was given.
- **Enhanced Metrics** — 2x2 chart grid (loss, LR, grad_norm, throughput) + GPU memory chart, eval results table
- **Multi-Run Compare** — overlay loss curves from up to 5 runs side-by-side
- **Chat Upgrade** — SSE streaming via proxy, typing indicator, cancel button, markdown renderer (bold, italic, code blocks), chat export as JSON
-- **Config Builder** — recipe dropdown (170 recipes), config schema API for dynamic form generation
+- **Config Builder** — recipe dropdown (169 recipes), config schema API for dynamic form generation
Gradient norm is nullable: backends or steps that do not report it store and
stream `null`, and the Web UI chart leaves a gap instead of drawing a false
diff --git a/src/soup_cli/config/schema.py b/src/soup_cli/config/schema.py
index 9ee8dcfe..15870593 100644
--- a/src/soup_cli/config/schema.py
+++ b/src/soup_cli/config/schema.py
@@ -7222,6 +7222,18 @@ class SoupConfig(BaseModel):
)
return self
+ @model_validator(mode="after")
+ def _validate_vision_preference_format(self) -> "SoupConfig":
+ """Refuse vision row formats for preference tasks until they have a row path."""
+ preference_tasks = {"dpo", "ipo", "simpo", "orpo", "bco", "preference"}
+ vision_preference_formats = {"llava", "sharegpt4v"}
+ if self.task in preference_tasks and self.data.format in vision_preference_formats:
+ raise ValueError(
+ f"task={self.task!r} with data.format={self.data.format!r} has no "
+ "vision-preference row path; use a text preference format instead."
+ )
+ return self
+
@model_validator(mode="after")
def _validate_online_dpo_compat(self) -> "SoupConfig":
"""v0.71.31 — Online DPO gate.
diff --git a/src/soup_cli/recipes/catalog.py b/src/soup_cli/recipes/catalog.py
index 5baf7f45..413195e1 100644
--- a/src/soup_cli/recipes/catalog.py
+++ b/src/soup_cli/recipes/catalog.py
@@ -48,7 +48,7 @@ def search_recipes(
# ---------------------------------------------------------------------------
-# Recipe catalog (170 recipes)
+# Recipe catalog (169 recipes)
# ---------------------------------------------------------------------------
RECIPES: Dict[str, RecipeMeta] = {
@@ -2684,39 +2684,6 @@ training:
reward_fn: accuracy
gradient_checkpointing: true
-output: ./output
-""",
- ),
- "pixtral-dpo": RecipeMeta(
- model="mistralai/Pixtral-12B-2409",
- task="dpo",
- size="12B",
- tags=("mistral", "pixtral", "vision", "multimodal", "dpo", "alignment"),
- description="Pixtral 12B DPO multimodal preference alignment",
- yaml_str="""\
-base: mistralai/Pixtral-12B-2409
-task: dpo
-modality: vision
-
-data:
- train: ./data/vision_preference_train.jsonl
- format: llava
- image_dir: ./data/images
- max_length: 4096
-
-training:
- epochs: 3
- lr: 5e-6
- batch_size: 1
- gradient_accumulation_steps: 16
- lora:
- r: 16
- alpha: 32
- target_modules: auto
- quantization: 4bit
- dpo_beta: 0.1
- gradient_checkpointing: true
-
output: ./output
""",
),
diff --git a/tests/fixtures/recipe_config_snapshots.json b/tests/fixtures/recipe_config_snapshots.json
index 5d9183a3..e8433f21 100644
--- a/tests/fixtures/recipe_config_snapshots.json
+++ b/tests/fixtures/recipe_config_snapshots.json
@@ -1411,21 +1411,6 @@
"training.lora.r": 16,
"training.lr": 1e-05
},
- "pixtral-dpo": {
- "base": "mistralai/Pixtral-12B-2409",
- "data.format": "llava",
- "data.image_dir": "./data/images",
- "data.max_length": 4096,
- "data.train": "./data/vision_preference_train.jsonl",
- "modality": "vision",
- "task": "dpo",
- "training.batch_size": 1,
- "training.gradient_accumulation_steps": 16,
- "training.gradient_checkpointing": true,
- "training.lora.alpha": 32,
- "training.lora.r": 16,
- "training.lr": 5e-06
- },
"qvq-72b-sft": {
"base": "Qwen/QVQ-72B-Preview",
"data.format": "llava",
diff --git a/tests/recipe_count.py b/tests/recipe_count.py
index 13603236..fcecb72e 100644
--- a/tests/recipe_count.py
+++ b/tests/recipe_count.py
@@ -9,7 +9,7 @@ the catalog, in ``tests/test_recipe_count_is_synced.py``.
from __future__ import annotations
-EXPECTED_RECIPE_COUNT = 170
+EXPECTED_RECIPE_COUNT = 169
def recipe_count_hint(actual: int) -> str:
diff --git a/tests/test_issue1099_moe_lora_remaining_tasks.py b/tests/test_issue1099_moe_lora_remaining_tasks.py
index d556c32a..0e9fc193 100644
--- a/tests/test_issue1099_moe_lora_remaining_tasks.py
+++ b/tests/test_issue1099_moe_lora_remaining_tasks.py
@@ -482,17 +482,14 @@ class TestThePathsThatNeverReadIt:
with pytest.raises(ValueError, match=f"modality={modality!r}"):
load_config_from_string(yaml.safe_dump(raw))
- @pytest.mark.parametrize("task", ["dpo", "grpo"])
- def test_vision_on_a_task_that_reads_it_still_loads(self, task):
- """The refusal is SFT's alone (#1179 review, round 3): dpo and grpo load a
- vision config through _setup_transformers, which reads the flag. Dropping
- the `task == "sft"` half refused pixtral-dpo / llama3.2-vision-grpo-shaped
- configs and the suite stayed green."""
+ @pytest.mark.parametrize(("task", "data_format"), [("dpo", "dpo"), ("grpo", "llava")])
+ def test_vision_on_a_task_that_reads_it_still_loads(self, task, data_format):
+ """Non-preference vision tasks and text-format DPO load the flag."""
import yaml
raw = {
"base": "org/m", "task": task, "modality": "vision",
- "data": {"train": "./x.jsonl", "format": "llava"},
+ "data": {"train": "./x.jsonl", "format": data_format},
"training": {"moe_lora": True, "lora": {"r": 4, "dropout": 0.0}},
}
cfg = load_config_from_string(yaml.safe_dump(raw))
diff --git a/tests/test_issue1116_attach_preflight.py b/tests/test_issue1116_attach_preflight.py
index 2ac07ed1..45358f5a 100644
--- a/tests/test_issue1116_attach_preflight.py
+++ b/tests/test_issue1116_attach_preflight.py
@@ -871,7 +871,11 @@ class TestOnlySftReadsModality:
from soup_cli.config.loader import load_config_from_string
- fmt = {"text": "alpaca", "vision": "llava", "audio": "audio"}[modality]
+ fmt = {
+ "text": "alpaca",
+ "vision": "dpo" if task == "dpo" else "llava",
+ "audio": "audio",
+ }[modality]
fmt = {"asr": "asr", "classifier": "auto", "reranker": "auto",
"cross_encoder": "auto"}.get(task, fmt)
raw = {
diff --git a/tests/test_recipes.py b/tests/test_recipes.py
index 88913b84..78279e66 100644
--- a/tests/test_recipes.py
+++ b/tests/test_recipes.py
@@ -110,6 +110,21 @@ class TestRecipeCatalog:
f"Recipe '{name}' task mismatch: meta={recipe.task}, yaml={yaml_task}"
)
+ def test_recipe_data_formats_suit_preference_tasks(self):
+ """The catalog must not offer vision row formats to preference trainers."""
+ import yaml
+
+ from soup_cli.recipes.catalog import RECIPES
+
+ preference_tasks = {"dpo", "ipo", "simpo", "orpo", "bco", "preference"}
+ vision_preference_formats = {"llava", "sharegpt4v"}
+ for name, recipe in RECIPES.items():
+ parsed = yaml.safe_load(recipe.yaml_str)
+ data_format = parsed.get("data", {}).get("format", "auto")
+ assert not (
+ recipe.task in preference_tasks and data_format in vision_preference_formats
+ ), f"Recipe {name} pairs preference task {recipe.task} with {data_format}"
+
def test_recipe_models_match_yaml_base(self):
"""Recipe.model matches the base model in the YAML content."""
import yaml
@@ -1811,6 +1826,7 @@ class TestV025NewRecipes:
Issue #850 added 2 (deepseek-v4-pro-dpo, deepseek-v4-pro-grpo) -> 176.
PR #1113 removes spark-tts -> 173.
Issue #1145 removed 3 (mistral-large-3-sft, mistral-large-3-dpo, minimax-m3-dpo) -> 170.
+ Issue #1867 retires the unsupported vision-preference recipe -> 169.
"""
from soup_cli.recipes.catalog import RECIPES
from tests.recipe_count import EXPECTED_RECIPE_COUNT, recipe_count_hint
diff --git a/tests/test_recipes_v031.py b/tests/test_recipes_v031.py
index 978998cf..3fefc696 100644
--- a/tests/test_recipes_v031.py
+++ b/tests/test_recipes_v031.py
@@ -266,12 +266,11 @@ class TestPartEDomain:
# ---------------------------------------------------------------------------
-# Part F: Multimodal reasoning (2 new)
+# Part F: Multimodal reasoning (1 new)
# ---------------------------------------------------------------------------
PART_F_MM_REASONING = [
("llama3.2-vision-grpo", "grpo", "meta-llama/Llama-3.2-11B-Vision-Instruct"),
- ("pixtral-dpo", "dpo", "mistralai/Pixtral-12B-2409"),
]
# Single source of truth across the file — concatenated for catalog-wide
@@ -284,7 +283,7 @@ ALL_V031_RECIPES = (
class TestPartFMultimodalReasoning:
- """2 new multimodal alignment / reasoning recipes."""
+ """Multimodal reasoning recipe."""
@pytest.mark.parametrize("name,task,model", PART_F_MM_REASONING)
def test_recipe_registered(self, name: str, task: str, model: str) -> None:
diff --git a/tests/test_shipped_configs_set_no_inert_field.py b/tests/test_shipped_configs_set_no_inert_field.py
index d1a27744..bfa97705 100644
--- a/tests/test_shipped_configs_set_no_inert_field.py
+++ b/tests/test_shipped_configs_set_no_inert_field.py
@@ -53,8 +53,8 @@ def inert_fields_set(text: str) -> list[str]:
def test_the_catalog_is_not_empty():
- # A loop over nothing passes; the issue counted 170 recipes at v0.76.0.
- assert len(RECIPES) >= 170
+ # A loop over nothing passes; the catalog has 169 recipes since pixtral-dpo was dropped (#1867).
+ assert len(RECIPES) >= 169
assert len(list_templates()) >= 10
diff --git a/tests/test_vision.py b/tests/test_vision.py
index b764c89e..973b6fcd 100644
--- a/tests/test_vision.py
+++ b/tests/test_vision.py
@@ -59,6 +59,42 @@ LLAVA_DATASET = [
class TestVisionConfig:
"""Test modality config field validation."""
+ @pytest.mark.parametrize("task", ["dpo", "ipo", "simpo", "orpo", "bco", "preference"])
+ @pytest.mark.parametrize("data_format", ["llava", "sharegpt4v"])
+ def test_preference_tasks_reject_vision_row_formats(self, task, data_format):
+ from soup_cli.config.loader import load_config_from_string
+
+ preference_loss = " preference_loss: dpo\n" if task == "preference" else ""
+ raw = (
+ f"base: org/model\ntask: {task}\nmodality: vision\n"
+ f"data:\n train: ./data.jsonl\n format: {data_format}\n"
+ )
+ if preference_loss:
+ raw += f"training:\n{preference_loss}"
+ with pytest.raises(ValueError) as exc_info:
+ load_config_from_string(raw)
+
+ message = str(exc_info.value)
+ assert f"task={task!r}" in message
+ assert f"data.format={data_format!r}" in message
+ assert "no vision-preference row path" in message
+ assert "text preference format" in message
+
+ @pytest.mark.parametrize("task", ["dpo", "ipo", "simpo", "orpo", "bco", "preference"])
+ def test_preference_tasks_accept_text_preference_format(self, task):
+ from soup_cli.config.loader import load_config_from_string
+
+ preference_loss = " preference_loss: dpo\n" if task == "preference" else ""
+ raw = (
+ f"base: org/model\ntask: {task}\nmodality: vision\n"
+ "data:\n train: ./data.jsonl\n format: dpo\n"
+ )
+ if preference_loss:
+ raw += f"training:\n{preference_loss}"
+ cfg = load_config_from_string(raw)
+ assert cfg.task == task
+ assert cfg.data.format == "dpo"
+
def test_modality_default_is_text(self):
"""Default modality should be 'text'."""
cfg = SoupConfig(base="some-model", data={"train": "./data.jsonl"})