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(autopilot): make kernel flags install-aware so the config autopilot writes can train (#1212) (#1257)

Kratosbec2ef22628b
diff --git a/changelog.d/0.75.1/1257.fixed.md b/changelog.d/0.75.1/1257.fixed.md
new file mode 100644
index 00000000..c89ef6d0
--- /dev/null
+++ b/changelog.d/0.75.1/1257.fixed.md
@@ -0,0 +1 @@
+- **`soup autopilot` no longer writes a config that `soup train` refuses on an Ampere or newer GPU (#1212 by @wanjinhao1 in #1257).** For the SFT goals, autopilot turned on `use_flash_attn` and `use_liger` on every GPU with compute capability 8.0 or higher without checking that `flash-attn` or `liger-kernel` was installed. Neither ships with a standard install, so `soup train`, even with `--dry-run`, refused the file autopilot had just written. Each flag is now turned on only when its package is installed, checked the same way `soup train` checks it, and when the GPU qualifies but a package is missing, the Autopilot Decisions panel names it and the command that installs it. The Liger refusal in `soup train` also told users to run `pip install "soup-cli"`, because `[liger]` was read as Rich markup; it now prints `pip install "soup-cli[liger]"`.
diff --git a/docs/backends-and-ops.md b/docs/backends-and-ops.md
index a818f1db..24dfd188 100644
--- a/docs/backends-and-ops.md
+++ b/docs/backends-and-ops.md
@@ -72,6 +72,8 @@ soup autopilot --model <id> --data d.jsonl --goal chat --dry-run
Autopilot writes a ready-to-run `soup.yaml`. Edit it by hand if needed, then `soup train`.
+For the goals that train with SFT, Autopilot turns on FlashAttention and Liger only when the GPU has compute capability 8.0 or higher and the package is installed. When the card qualifies but a package is missing, the Autopilot Decisions panel names the package and the command that installs it.
+
## Apple Silicon (MLX Backend)
diff --git a/src/soup_cli/autopilot/decisions.py b/src/soup_cli/autopilot/decisions.py
index 676d6b31..bc2fc8e9 100644
--- a/src/soup_cli/autopilot/decisions.py
+++ b/src/soup_cli/autopilot/decisions.py
@@ -7,6 +7,9 @@ import os
import re
from typing import Any, Literal, Mapping, Optional
+from soup_cli.utils.flash_attn import check_flash_attn_available
+from soup_cli.utils.liger import check_liger_available
+
GOAL_TO_TASK: dict[str, str] = {
"chat": "sft",
"code": "sft",
@@ -332,22 +335,55 @@ def decide_performance_flags(
) -> dict:
"""Return perf flags for FlashAttention / Liger / gradient_checkpointing.
- - ``use_flash_attn`` and ``use_liger`` only enabled on Ampere or newer.
+ - ``use_flash_attn`` and ``use_liger`` only enabled on Ampere or newer,
+ and — since #1212 — only when the package is actually importable.
+ Neither ships with a standard install (``liger-kernel`` is the separate
+ ``[liger]`` extra, no extra installs ``flash-attn``), so enabling them
+ blind wrote configs that ``soup train`` then refused. The probes are
+ the same ones ``soup train`` validates with, so the two cannot disagree.
- ``gradient_checkpointing`` enabled when the sequence is long (>8k tokens)
or VRAM headroom is tight (<4GB), to avoid OOM. Otherwise left off so we
don't pay the recompute cost when there's plenty of headroom.
"""
del gpu_name # reserved for future GPU-specific overrides
is_ampere_or_newer = compute_capability >= 8.0
+ # Short-circuit the probes: below 8.0 neither flag can be enabled, so
+ # there is no reason to pay the import probe on a CPU box or old card.
+ liger_available = is_ampere_or_newer and check_liger_available()
+ flash_attn_available = is_ampere_or_newer and check_flash_attn_available() is not None
long_sequence = max_length > 8192
tight_vram = 0.0 < vram_headroom_gb < 4.0
return {
- "use_flash_attn": bool(is_ampere_or_newer),
- "use_liger": bool(is_ampere_or_newer),
+ "use_flash_attn": bool(is_ampere_or_newer and flash_attn_available),
+ "use_liger": bool(is_ampere_or_newer and liger_available),
"gradient_checkpointing": bool(long_sequence or tight_vram),
}
+def kernel_flag_notes(compute_capability: float) -> dict:
+ """Explain why a kernel flag may be off although the GPU qualifies.
+
+ #1212 — when ``compute_capability`` qualifies but the package is missing,
+ return a human-readable note per flag (``{"flash_attn": ..., "liger": ...}``);
+ ``None`` when there is nothing to explain. Autopilot shows these in the
+ Autopilot Decisions panel so the flag reads as a decision, not a bug.
+ """
+ notes: dict = {"flash_attn": None, "liger": None}
+ if compute_capability < 8.0:
+ return notes
+ if check_flash_attn_available() is None:
+ notes["flash_attn"] = (
+ "flash-attn not installed; "
+ "pip install flash-attn --no-build-isolation to enable"
+ )
+ if not check_liger_available():
+ notes["liger"] = (
+ 'liger-kernel not installed; '
+ 'pip install "soup-cli[liger]" to enable'
+ )
+ return notes
+
+
def decide_warmup(
num_examples: int, batch_size: int, grad_accum: int, epochs: int,
ratio: float = 0.03,
diff --git a/src/soup_cli/commands/autopilot.py b/src/soup_cli/commands/autopilot.py
index fe93de88..c6c0a220 100644
--- a/src/soup_cli/commands/autopilot.py
+++ b/src/soup_cli/commands/autopilot.py
@@ -14,8 +14,14 @@ from soup_cli.autopilot.analyzer import (
analyze_hardware,
analyze_model,
)
-from soup_cli.autopilot.decisions import GOAL_TO_TASK, parse_gpu_budget
+from soup_cli.autopilot.decisions import (
+ GOAL_TO_TASK,
+ kernel_flag_notes,
+ parse_gpu_budget,
+)
from soup_cli.autopilot.generate_config import build_soup_config, write_yaml
+from soup_cli.config.schema import SFT_KERNEL_AWARE_TASKS
+from soup_cli.utils.terminal import for_terminal
console = Console()
@@ -44,6 +50,17 @@ def _is_under_cwd(path: Path) -> bool:
return common == cwd
+def _kernel_display(enabled: bool, note: str | None) -> str:
+ """One Autopilot Decisions kernel entry; name a missing package (#1212).
+
+ The flag alone reads like a decision to skip a speedup; when the GPU
+ qualifies and the package simply isn't there, say so instead.
+ """
+ if not enabled and note:
+ return f"off ({for_terminal(note)})"
+ return str(enabled)
+
+
def autopilot_cmd(
model: str = typer.Option(..., "--model", "-m", help="Base model (HF model id)"),
data: str = typer.Option(..., "--data", "-d", help="Dataset path (JSONL)"),
@@ -118,6 +135,15 @@ def autopilot_cmd(
console.print(f"[red]{exc}[/]")
raise typer.Exit(1)
+ # #1212 — when the GPU qualifies but a package is missing, the panel names
+ # it. Only the SFT-family tasks read either flag (#806), so a note next to
+ # any other task's off-flag would be misleading (it is off by task scope).
+ kernel_notes = (
+ kernel_flag_notes(hardware_profile.compute_capability)
+ if cfg.task in SFT_KERNEL_AWARE_TASKS
+ else {"flash_attn": None, "liger": None}
+ )
+
# Render decision summary
console.print(
Panel(
@@ -144,8 +170,10 @@ def autopilot_cmd(
f"Learning rate: {cfg.training.lr}\n"
f"Epochs: {cfg.training.epochs}\n"
f"Max length: {cfg.data.max_length}\n"
- f"Flash Attention: {cfg.training.use_flash_attn}\n"
- f"Liger Kernel: {cfg.training.use_liger}",
+ f"Flash Attention: "
+ f"{_kernel_display(cfg.training.use_flash_attn, kernel_notes['flash_attn'])}\n"
+ f"Liger Kernel: "
+ f"{_kernel_display(cfg.training.use_liger, kernel_notes['liger'])}",
title="Autopilot Decisions",
)
)
diff --git a/src/soup_cli/commands/train.py b/src/soup_cli/commands/train.py
index 9fe8d8d9..269dd063 100644
--- a/src/soup_cli/commands/train.py
+++ b/src/soup_cli/commands/train.py
@@ -1297,7 +1297,7 @@ def train(
cfg.training.use_galore, cfg.training.quantization, cfg.backend,
)
for err in galore_errors:
- console.print(f"[red]GaLore error:[/] {err}")
+ console.print(f"[red]GaLore error:[/] {for_terminal(err)}")
if galore_errors:
raise typer.Exit(1)
@@ -1315,7 +1315,7 @@ def train(
check_card=not dry_run,
)
for err in qat_errors:
- console.print(f"[red]QAT error:[/] {markup_escape(err)}")
+ console.print(f"[red]QAT error:[/] {for_terminal(err)}")
if dry_run and cfg.training.quantization_aware == "fp8" and cfg.backend != "unsloth":
# #1154 review: a dry run validates the config, and FP8 configs are
# routinely written on a laptop for a remote card, so the local card
@@ -1344,7 +1344,7 @@ def train(
device=device,
)
for err in fsdp_errors:
- console.print(f"[red]FSDP error:[/] {err}")
+ console.print(f"[red]FSDP error:[/] {for_terminal(err)}")
if fsdp_errors:
raise typer.Exit(1)
@@ -1360,7 +1360,7 @@ def train(
deepspeed_config=ds_config_path,
)
for err in compile_errors:
- console.print(f"[red]FSDP2 + torch.compile error:[/] {err}")
+ console.print(f"[red]FSDP2 + torch.compile error:[/] {for_terminal(err)}")
if compile_errors:
raise typer.Exit(1)
@@ -1375,7 +1375,7 @@ def train(
gpu_count=gpu_info.get("gpu_count", 0),
)
for err in pp_errors:
- console.print(f"[red]Pipeline parallel error:[/] {err}")
+ console.print(f"[red]Pipeline parallel error:[/] {for_terminal(err)}")
if pp_errors:
raise typer.Exit(1)
console.print(
@@ -1400,7 +1400,7 @@ def train(
cfg.training.use_liger, cfg.backend, device,
)
for err in liger_errors:
- console.print(f"[red]Liger error:[/] {err}")
+ console.print(f"[red]Liger error:[/] {for_terminal(err)}")
if liger_errors:
raise typer.Exit(1)
@@ -1412,7 +1412,7 @@ def train(
cfg.training.use_flash_attn, cfg.backend, device,
)
for err in fa_errors:
- console.print(f"[red]FlashAttention error:[/] {err}")
+ console.print(f"[red]FlashAttention error:[/] {for_terminal(err)}")
if fa_errors:
raise typer.Exit(1)
@@ -1424,7 +1424,7 @@ def train(
cfg.training.use_ring_attention, device, cfg.data.max_length,
)
for err in ring_errors:
- console.print(f"[red]Ring Attention error:[/] {err}")
+ console.print(f"[red]Ring Attention error:[/] {for_terminal(err)}")
if ring_errors:
raise typer.Exit(1)
diff --git a/tests/test_autopilot.py b/tests/test_autopilot.py
index 326613b6..dd171d3a 100644
--- a/tests/test_autopilot.py
+++ b/tests/test_autopilot.py
@@ -186,11 +186,18 @@ class TestDecisionEngine:
result = decide_max_length(p95_tokens=20000, model_context=4096)
assert result == 4096
- def test_decide_performance_flags_ampere(self):
- from soup_cli.autopilot.decisions import decide_performance_flags
-
- flags = decide_performance_flags(gpu_name="rtx4090", compute_capability=8.9)
+ def test_decide_performance_flags_ampere(self, monkeypatch):
+ from soup_cli.autopilot import decisions
+
+ # #1212 — the flags are install-aware: Ampere+ alone is not enough,
+ # the packages must also be present (patched here; CI has neither).
+ monkeypatch.setattr(decisions, "check_liger_available", lambda: True)
+ monkeypatch.setattr(
+ decisions, "check_flash_attn_available", lambda: "flash_attention_2"
+ )
+ flags = decisions.decide_performance_flags(gpu_name="rtx4090", compute_capability=8.9)
assert flags["use_flash_attn"] is True
+ assert flags["use_liger"] is True
def test_decide_performance_flags_old_gpu(self):
from soup_cli.autopilot.decisions import decide_performance_flags
@@ -397,3 +404,4 @@ class TestGPUBudgetParsing:
if __name__ == "__main__":
pytest.main([__file__, "-v"])
+
diff --git a/tests/test_issue1212_autopilot_install_aware_kernels.py b/tests/test_issue1212_autopilot_install_aware_kernels.py
new file mode 100644
index 00000000..81844277
--- /dev/null
+++ b/tests/test_issue1212_autopilot_install_aware_kernels.py
@@ -0,0 +1,297 @@
+"""#1212: the Autopilot Decisions panel's kernel notes.
+
+The full `soup-cli[liger]` hint must reach the terminal (Rich reads `[liger]` as
+markup), and no note may appear where a flag is off for another reason: a
+non-SFT goal, or a pre-Ampere card.
+"""
+
+import json
+
+import pytest
+from typer.testing import CliRunner
+
+from soup_cli.cli import app
+from tests.conftest import strip_ansi
+
+runner = CliRunner()
+
+
+def _plain(text):
+ return " ".join(strip_ansi(text).split())
+
+
+def _write_data(path, count=20):
+ rows = [
+ {"instruction": f"q{index} " * 8, "output": f"a{index} " * 4}
+ for index in range(count)
+ ]
+ path.write_text("\n".join(json.dumps(row) for row in rows) + "\n", encoding="utf-8")
+ return path
+
+
+def _run_autopilot(tmp_path, monkeypatch, goal, compute_capability):
+ """Autopilot on a patched card with neither kernel package installed."""
+ from soup_cli.autopilot import decisions, generate_config
+ from soup_cli.autopilot.analyzer import HardwareProfile
+ from soup_cli.commands import autopilot as autopilot_cmd
+
+ profile = HardwareProfile(
+ device="cuda",
+ gpu_name="rtx4090",
+ vram_gb=24.0,
+ compute_capability=compute_capability,
+ system_ram_gb=64.0,
+ )
+ monkeypatch.setattr(generate_config, "analyze_hardware", lambda: profile)
+ monkeypatch.setattr(autopilot_cmd, "analyze_hardware", lambda: profile)
+ monkeypatch.setattr(decisions, "check_liger_available", lambda: False)
+ monkeypatch.setattr(decisions, "check_flash_attn_available", lambda: None)
+ # A fixed, wide terminal so the hint cannot wrap inside the panel border.
+ monkeypatch.setenv("COLUMNS", "200")
+ monkeypatch.chdir(tmp_path)
+ _write_data(tmp_path / "ap.jsonl")
+ result = runner.invoke(
+ app,
+ [
+ "autopilot",
+ "--model", "HuggingFaceTB/SmolLM2-135M-Instruct",
+ "--data", "ap.jsonl",
+ "--goal", goal,
+ "--output", "ap.yaml",
+ "--yes",
+ ],
+ )
+ assert result.exit_code == 0, (result.output, repr(result.exception))
+ return _plain(result.output)
+
+
+def test_panel_prints_the_liger_extra_literally(tmp_path, monkeypatch):
+ plain = _run_autopilot(tmp_path, monkeypatch, "chat", 8.6)
+ assert (
+ 'Liger Kernel: off (liger-kernel not installed; '
+ 'pip install "soup-cli[liger]" to enable)'
+ ) in plain
+ assert (
+ "Flash Attention: off (flash-attn not installed; "
+ "pip install flash-attn --no-build-isolation to enable)"
+ ) in plain
+
+
+ ("goal", "compute_capability"),
+ [("reasoning", 8.6), ("alignment", 8.6), ("chat", 7.5)],
+)
+def test_panel_shows_plain_false_when_no_install_note_applies(
+ tmp_path, monkeypatch, goal, compute_capability
+):
+ # Non-SFT goals leave the flags off because of the task (#806), and a
+ # pre-Ampere card leaves them off because of the card: neither is an
+ # install problem, so the panel must not blame a missing package.
+ plain = _run_autopilot(tmp_path, monkeypatch, goal, compute_capability)
+ assert "Flash Attention: False" in plain
+ assert "Liger Kernel: False" in plain
+ assert "not installed" not in plain
+
+
+# ---------------------------------------------------------------------------
+# Install-aware kernel flags (#1212) — moved from tests/test_autopilot.py so
+# the panel-pinning tests above and the config-level tests live together.
+# ---------------------------------------------------------------------------
+
+
+class TestInstallAwareKernelFlags:
+ """#1212 — autopilot must not enable flags the environment cannot train.
+
+ Neither ``liger-kernel`` (the separate ``[liger]`` extra) nor
+ ``flash-attn`` is part of a standard install, so enabling them blind on
+ Ampere+ wrote configs that ``soup train`` then refused.
+ """
+
+ def _build(self, tmp_path, monkeypatch, goal, compute_capability, *, liger, flash):
+ from soup_cli.autopilot import decisions, generate_config
+ from soup_cli.autopilot.analyzer import HardwareProfile
+
+ monkeypatch.setattr(
+ generate_config,
+ "analyze_hardware",
+ lambda: HardwareProfile(
+ device="cuda",
+ gpu_name="rtx4090",
+ vram_gb=24.0,
+ compute_capability=compute_capability,
+ system_ram_gb=64.0,
+ ),
+ )
+ monkeypatch.setattr(decisions, "check_liger_available", lambda: liger)
+ monkeypatch.setattr(
+ decisions,
+ "check_flash_attn_available",
+ lambda: "flash_attention_2" if flash else None,
+ )
+ return generate_config.build_soup_config(
+ model="HuggingFaceTB/SmolLM2-135M-Instruct",
+ data_path=str(_write_data(tmp_path / "data.jsonl")),
+ goal=goal,
+ vram_gb=24.0,
+ )
+
+ @pytest.mark.parametrize("goal", ["chat", "code", "classification", "tool-calling"])
+ def test_missing_packages_disable_flags_for_every_sft_goal(
+ self, tmp_path, monkeypatch, goal
+ ):
+ config = self._build(tmp_path, monkeypatch, goal, 8.6, liger=False, flash=False)
+ assert config.task == "sft"
+ assert config.training.use_flash_attn is False
+ assert config.training.use_liger is False
+
+ @pytest.mark.parametrize("compute_capability", [8.0, 8.6, 8.9, 9.0, 12.0])
+ def test_present_packages_enable_flags_across_ampere_plus(
+ self, tmp_path, monkeypatch, compute_capability
+ ):
+ config = self._build(
+ tmp_path, monkeypatch, "chat", compute_capability, liger=True, flash=True
+ )
+ assert config.training.use_flash_attn is True
+ assert config.training.use_liger is True
+
+ def test_pre_ampere_stays_off_even_with_packages(self, tmp_path, monkeypatch):
+ config = self._build(tmp_path, monkeypatch, "chat", 7.5, liger=True, flash=True)
+ assert config.training.use_flash_attn is False
+ assert config.training.use_liger is False
+
+ def test_liger_only_enables_exactly_liger(self, tmp_path, monkeypatch):
+ config = self._build(tmp_path, monkeypatch, "chat", 8.6, liger=True, flash=False)
+ assert config.training.use_liger is True
+ assert config.training.use_flash_attn is False
+
+ def test_flash_only_enables_exactly_flash(self, tmp_path, monkeypatch):
+ config = self._build(tmp_path, monkeypatch, "chat", 8.6, liger=False, flash=True)
+ assert config.training.use_liger is False
+ assert config.training.use_flash_attn is True
+
+ def _patch_cli_hardware(self, monkeypatch, compute_capability=8.6):
+ from soup_cli.autopilot import decisions, generate_config
+ from soup_cli.autopilot.analyzer import HardwareProfile
+ from soup_cli.commands import autopilot as autopilot_cmd
+
+ profile = HardwareProfile(
+ device="cuda",
+ gpu_name="rtx4090",
+ vram_gb=24.0,
+ compute_capability=compute_capability,
+ system_ram_gb=64.0,
+ )
+ monkeypatch.setattr(generate_config, "analyze_hardware", lambda: profile)
+ monkeypatch.setattr(autopilot_cmd, "analyze_hardware", lambda: profile)
+ monkeypatch.setattr(decisions, "check_liger_available", lambda: False)
+ monkeypatch.setattr(decisions, "check_flash_attn_available", lambda: None)
+
+ def test_panel_names_missing_packages(self, tmp_path, monkeypatch):
+ self._patch_cli_hardware(monkeypatch)
+ monkeypatch.chdir(tmp_path)
+ _write_data(tmp_path / "ap.jsonl")
+
+ result = runner.invoke(
+ app,
+ [
+ "autopilot",
+ "--model", "HuggingFaceTB/SmolLM2-135M-Instruct",
+ "--data", "ap.jsonl",
+ "--goal", "chat",
+ "--output", "ap_chat.yaml",
+ "--yes",
+ ],
+ )
+ assert result.exit_code == 0, (result.output, repr(result.exception))
+ plain = _plain(result.output)
+ assert "Flash Attention: off (flash-attn not installed" in plain
+ assert "Liger Kernel: off (liger-kernel not installed" in plain
+ # The full hints wrap inside the Rich panel at unpredictable widths
+ # (border glyphs land between the wrapped words), so the panel test
+ # asserts the package names; the literal `soup-cli[liger]` hint is
+ # asserted with a wide terminal in test_panel_prints_the_liger_extra_
+ # literally above.
+
+ def test_autopilot_config_survives_train_dry_run_without_packages(
+ self, tmp_path, monkeypatch
+ ):
+ from soup_cli.commands import train as train_cmd
+
+ self._patch_cli_hardware(monkeypatch)
+ # `soup train` on a CPU CI box: the device is CUDA-shaped for the
+ # kernel validators, and unknown VRAM (bytes=0) skips the fit gate.
+ monkeypatch.setattr(
+ train_cmd, "detect_device", lambda backend=None: ("cuda", "CUDA (test)")
+ )
+ monkeypatch.setattr(
+ train_cmd,
+ "get_gpu_info",
+ lambda backend=None: {
+ "memory_total": "24.0 GB",
+ "memory_total_bytes": 0,
+ "gpu_count": 1,
+ },
+ )
+ monkeypatch.chdir(tmp_path)
+ _write_data(tmp_path / "ap.jsonl")
+
+ written = runner.invoke(
+ app,
+ [
+ "autopilot",
+ "--model", "HuggingFaceTB/SmolLM2-135M-Instruct",
+ "--data", "ap.jsonl",
+ "--goal", "chat",
+ "--output", "ap_chat.yaml",
+ "--yes",
+ ],
+ )
+ assert written.exit_code == 0, (written.output, repr(written.exception))
+
+ trained = runner.invoke(
+ app, ["train", "--config", "ap_chat.yaml", "--dry-run", "--yes"]
+ )
+ assert trained.exit_code == 0, _plain(trained.output)
+ assert "Data OK" in _plain(trained.output)
+
+ def test_liger_refusal_keeps_extra_name_visible(self, tmp_path, monkeypatch):
+ from soup_cli.commands import train as train_cmd
+ from soup_cli.utils import liger as liger_utils
+
+ monkeypatch.chdir(tmp_path)
+ data_path = _write_data(tmp_path / "data.jsonl")
+ config_path = tmp_path / "soup.yaml"
+ config_path.write_text(
+ "base: sshleifer/tiny-gpt2\n"
+ "task: sft\n"
+ f"output: {tmp_path / 'out'}\n"
+ "data:\n"
+ f" train: {data_path}\n"
+ "training:\n"
+ " use_liger: true\n",
+ encoding="utf-8",
+ )
+ monkeypatch.setattr(
+ train_cmd, "detect_device", lambda backend=None: ("cuda", "CUDA (test)")
+ )
+ monkeypatch.setattr(
+ train_cmd,
+ "get_gpu_info",
+ lambda backend=None: {
+ "memory_total": "24.0 GB",
+ "memory_total_bytes": 0,
+ "gpu_count": 1,
+ },
+ )
+ monkeypatch.setattr(liger_utils, "check_liger_available", lambda: False)
+
+ result = runner.invoke(
+ app, ["train", "--config", str(config_path), "--dry-run", "--yes"]
+ )
+ assert result.exit_code == 1
+ plain = _plain(result.output)
+ assert "liger-kernel is not installed" in plain
+ # Before #1212 the hint's [liger] was swallowed as a Rich markup tag,
+ # so the one instruction printed told users to reinstall what they
+ # already had.
+ assert 'pip install "soup-cli[liger]"' in plain
diff --git a/tests/test_issue806_kernel_flags_task_scoped.py b/tests/test_issue806_kernel_flags_task_scoped.py
index 86a8ac24..b791980e 100644
--- a/tests/test_issue806_kernel_flags_task_scoped.py
+++ b/tests/test_issue806_kernel_flags_task_scoped.py
@@ -64,7 +64,7 @@ class TestKernelFlagsRejectedForNonSftTasks:
class TestAutopilotScopesKernelFlagsToTask:
def _build(self, tmp_path, monkeypatch, goal):
- from soup_cli.autopilot import generate_config
+ from soup_cli.autopilot import decisions, generate_config
from soup_cli.autopilot.analyzer import HardwareProfile
monkeypatch.setattr(
@@ -78,6 +78,15 @@ class TestAutopilotScopesKernelFlagsToTask:
system_ram_gb=64.0,
),
)
+ # #1212 — the decision is install-aware now, so an Ampere test that
+ # expects the flags on must also say the packages are present (CI
+ # installs neither liger-kernel nor flash-attn).
+ monkeypatch.setattr(decisions, "check_liger_available", lambda: True)
+ monkeypatch.setattr(
+ decisions,
+ "check_flash_attn_available",
+ lambda: "flash_attention_2",
+ )
return generate_config.build_soup_config(
model="meta-llama/Llama-3.1-8B-Instruct",
data_path=str(_write_data(tmp_path / "data.jsonl")),