From 9acdae4c84c124b22273544bc63fb84608e28338 Mon Sep 17 00:00:00 2001 From: adibarra <93070681+adibarra@users.noreply.github.com> Date: Wed, 21 Oct 2026 12:59:46 -0500 Subject: [PATCH] klaud: scope autosweep to AgentX only Planner candidates, canonical/producer family matrices, smoke dispatch and the perf-changelog entry now cover only agentic-coding points; fixed-seq-len (8k1k) is no longer swept. --- .github/klaud-candidate-prompt.md | 8 ++- inferencex-e2e/infx/klaud/__main__.py | 17 +++-- inferencex-e2e/infx/klaud/validation.py | 26 +++++-- .../infx/tests/historical_revision.py | 29 ++++++-- .../infx/tests/klaud/test_klaud_github.py | 67 ++++++++++--------- 5 files changed, 96 insertions(+), 51 deletions(-) diff --git a/.github/klaud-candidate-prompt.md b/.github/klaud-candidate-prompt.md index 828aa93519..418a0bead8 100644 --- a/.github/klaud-candidate-prompt.md +++ b/.github/klaud-candidate-prompt.md @@ -100,7 +100,8 @@ never treat a point's absence from the current family as its retirement. Keep targeted work draft with no sweep labels. Dispatch ONLY updated-image e2e-tests.yml from main, with ref=exact measured SHA, fail-fast=true, klaud-run=true, test-name=$KLAUD_TEST_NAME, and -`generate-cli-command="test-config --config-files FILE --config-keys FAMILY --smoke"`. +`generate-cli-command="test-config --config-files FILE --config-keys FAMILY --scenario-type agentic-coding --smoke"`. +Autosweeps cover only the family's AgentX (agentic-coding) points; never run fixed-seq-len points. Smoke retains minimum-concurrency throughput and canonical representative eval concurrency; it is startup evidence, not a full curve. Persist each run ID/head/attempt and typed progress comment immediately, before waiting. Use `gh run watch --interval 60`, resume after tool @@ -117,8 +118,9 @@ Benchmarks may take three hours. Do not cancel healthy or queued work to fit the limit; leave it queued when the session ends, and a later session resumes it. After smoke benchmarks AND selected evals pass, append one exact-family inferencex-e2e/perf-changelog.yaml -entry at the physical tail with this PR URL, preserving every prior byte. Omit scenario, -append-only and eval-selection modifiers. Its description must be one plain-English sentence +entry at the physical tail with this PR URL, preserving every prior byte. Set exactly +`scenario-type: [agentic-coding]`; omit append-only and eval-selection modifiers. +Its description must be one plain-English sentence of at most 120 characters: state the engine image version change and, only when necessary, one essential compatibility adjustment. Do not include evidence, benchmark results, upstream release summaries, rationale or limitations there; those belong in attempt comments. diff --git a/inferencex-e2e/infx/klaud/__main__.py b/inferencex-e2e/infx/klaud/__main__.py index a14706c67a..3103a48b64 100644 --- a/inferencex-e2e/infx/klaud/__main__.py +++ b/inferencex-e2e/infx/klaud/__main__.py @@ -78,15 +78,18 @@ def target_clusters(entries: list[dict], inventory: RunnerInventory) -> frozense def live_families(root: Path) -> dict[tuple, dict[str, tuple[frozenset[str], int]]]: - """Resolve public identities, target clusters and node demand from the canonical generator. + """Resolve public AgentX identities, target clusters and node demand from the generator. - Archives are excluded. A family's node demand is the node count of its largest generated job. + Archives and fixed-seq-len points are excluded. A family's node demand is the node count of + its largest generated AgentX job. """ from infx.clusters import load_inventory from infx.config import project_root from infx.matrix.generate import _hardware_family, generate_test_config_sweep from infx.matrix.validation import load_config_files, load_runner_file + from .validation import in_scope + root = project_root(root) runners = load_runner_file(str(root / "configs/runners.yaml")) inventory = load_inventory(runners) @@ -105,13 +108,15 @@ def live_families(root: Path) -> dict[tuple, dict[str, tuple[frozenset[str], int except ValueError: print(f"::warning::Klaud live-family-unrenderable: {family}") continue + entries = [entry for entry in entries if in_scope(entry)] + if not entries: + continue clusters = target_clusters(entries, inventory) if not clusters: print(f"::warning::Klaud live-family-clusters-unresolved: {family}") continue demand = max(entry.get("node-count", 1) for entry in entries) for entry in entries: - agentic = entry.get("scenario-type") == "agentic-coding" row = { "model": entry["model-prefix"], "hardware": _hardware_family(entry["runner"]), @@ -119,9 +124,9 @@ def live_families(root: Path) -> dict[tuple, dict[str, tuple[frozenset[str], int "precision": entry["precision"], "spec_method": entry["spec-decoding"], "disagg": entry.get("disagg", False), - "benchmark_type": "agentic_traces" if agentic else "single_turn", - "isl": None if agentic else entry["isl"], - "osl": None if agentic else entry["osl"], + "benchmark_type": "agentic_traces", + "isl": None, + "osl": None, "image": entry["image"], } index.setdefault(observation_key(row), {})[family] = (clusters, demand) diff --git a/inferencex-e2e/infx/klaud/validation.py b/inferencex-e2e/infx/klaud/validation.py index ab4afa47bf..1022043bce 100644 --- a/inferencex-e2e/infx/klaud/validation.py +++ b/inferencex-e2e/infx/klaud/validation.py @@ -19,6 +19,13 @@ if TYPE_CHECKING: from infx.matrix.revision import Revision +# Klaud autosweeps cover only AgentX; fixed-seq-len points are out of scope. +SCENARIO = "agentic-coding" + + +def in_scope(entry: dict) -> bool: + return entry.get("scenario-type") == SCENARIO + def benchmark_entries(matrix: dict) -> list[dict]: return [ @@ -44,7 +51,7 @@ def project_prefix(repository: str, head: str) -> str: def canonical_matrix(repository: str, head: str, family: str) -> dict: - """Generate the unfiltered family from exact-head YAML using trusted local code. + """Generate the family's AgentX points from exact-head YAML using trusted local code. Candidate source is data only. A future generator-policy change can require manual inspection of an older run; it cannot silently waive points or required evals. @@ -77,12 +84,16 @@ def canonical_matrix(repository: str, head: str, family: str) -> dict: for path in [*paths, *blocks]: (root / path).parent.mkdir(parents=True, exist_ok=True) (root / path).write_bytes(github.file_at(repository, head, prefix + path)) - entries = generate_test_config_sweep( - SimpleNamespace(config_keys=[key]), - validate_master_config(family_config, root), - validate_runner_config(runners), - root, - ) + entries = [ + entry + for entry in generate_test_config_sweep( + SimpleNamespace(config_keys=[key]), + validate_master_config(family_config, root), + validate_runner_config(runners), + root, + ) + if in_scope(entry) + ] fingerprinted = [ {**row, "recipe-fingerprint": recipe_fingerprint(row, root)} for row in entries ] @@ -133,6 +144,7 @@ def producer_matrix(repository: str, head: str, family: str) -> dict: rows = throughput_rows(producer, family.split(":", 1)[1]) if not isinstance(rows, list) or not all(isinstance(row, dict) for row in rows): raise ValueError("the generator did not print a list of matrix rows") + rows = [row for row in rows if in_scope(row)] fingerprints = producer.fingerprints(rows) except subprocess.SubprocessError as error: stderr = getattr(error, "stderr", None) or b"" diff --git a/inferencex-e2e/infx/tests/historical_revision.py b/inferencex-e2e/infx/tests/historical_revision.py index f5b91e8cbe..d36d2469a9 100644 --- a/inferencex-e2e/infx/tests/historical_revision.py +++ b/inferencex-e2e/infx/tests/historical_revision.py @@ -26,6 +26,9 @@ "isl": 8192, "osl": 1024, "search-space": [{"tp": 1, "conc-list": [2, 6]}], }]}, }} +AGENTX_MASTER = {KEY: {**MASTER[KEY], "scenarios": {"agentic-coding": [{ + "search-space": [{"tp": 1, "kv-offloading": "none", "conc-list": [2, 6]}], +}]}}} POINTS = [("example/model", 2, "example/image:stable"), ("example/model", 6, "example/image:stable")] GENERATOR = '''\ @@ -49,7 +52,7 @@ def rows(config_keys, config_files, runner_config): for key in config_keys: entry = master[key] gpus = hardware[entry["runner"]]["gpus-per-node"] - for scenario in entry["scenarios"]["fixed-seq-len"]: + for scenario in entry["scenarios"].get("fixed-seq-len", []): for space in scenario["search-space"]: if space["tp"] > gpus: sys.exit(f"{key}: tp {space['tp']} exceeds {gpus} GPUs per node") @@ -65,6 +68,21 @@ def rows(config_keys, config_files, runner_config): "exp-name": entry["model-prefix"] + "_8k1k", "disagg": False, "run-eval": False, }) + for scenario in entry["scenarios"].get("agentic-coding", []): + for space in scenario["search-space"]: + if space["tp"] > gpus: + sys.exit(f"{key}: tp {space['tp']} exceeds {gpus} GPUs per node") + for conc in space["conc-list"]: + result.append({ + "image": entry["image"], "model": entry["model"], + "model-prefix": entry["model-prefix"], "precision": entry["precision"], + "framework": entry["framework"], "runner": entry["runner"], + "tp": space["tp"], "pp": 1, "dcp-size": 1, "pcp-size": 1, "ep": 1, + "dp-attn": False, "spec-decoding": "none", "conc": conc, + "kv-offloading": space["kv-offloading"], "total-cpu-dram-gb": 0, + "duration": 1800, "exp-name": entry["model-prefix"] + "_agentx", + "scenario-type": "agentic-coding", "run-eval": False, + }) return result @@ -131,11 +149,14 @@ def changelog_entry(link: str) -> bytes: return f'- config-keys:\n - {KEY}\n description:\n - "Update {KEY}"\n pr-link: {link}\n'.encode() -def commit_history(root: Path, project: str = "", *, launcher: bool = True) -> tuple[str, str]: +def commit_history( + root: Path, project: str = "", *, launcher: bool = True, master: dict = MASTER +) -> tuple[str, str]: """Commit a base revision and a head appending one changelog entry; return both SHAs. The working tree is left at the head. With ``launcher`` the revision ships its own - ``infx.launch`` entrypoint, which e2e runs require of every measured revision. + ``infx.launch`` entrypoint, which e2e runs require of every measured revision. ``master`` + is the revision's NVIDIA master config. """ def git(*args: str) -> str: return subprocess.run( @@ -149,7 +170,7 @@ def git(*args: str) -> str: "infx/matrix/generate.py": GENERATOR, "infx/matrix/plan.py": PLANNER, "configs/amd-master.yaml": "{}\n", - "configs/nvidia-master.yaml": yaml.safe_dump(MASTER), + "configs/nvidia-master.yaml": yaml.safe_dump(master), "configs/runners.yaml": yaml.safe_dump(RUNNERS), **({"infx/launch/__init__.py": "", "infx/launch/__main__.py": ""} if launcher else {}), } diff --git a/inferencex-e2e/infx/tests/klaud/test_klaud_github.py b/inferencex-e2e/infx/tests/klaud/test_klaud_github.py index 705db73151..caa924ca37 100644 --- a/inferencex-e2e/infx/tests/klaud/test_klaud_github.py +++ b/inferencex-e2e/infx/tests/klaud/test_klaud_github.py @@ -14,6 +14,7 @@ from infx.klaud import api, claims, github, lifecycle, reporting, validation from infx.klaud.models import CandidateOutcome, Feed, OwnedCandidate, Ownership, identity, stamp from infx.tests.historical_revision import ( + AGENTX_MASTER, FAMILY, KEY, POINTS, @@ -1705,19 +1706,21 @@ def family_configs(): "model-prefix": "dsr1", "precision": "fp8", "framework": "sglang", - "runner": "fixture", + "runner": "cluster:fixture", "multinode": False, "srt-recipe-dir": "fixture", "scenarios": { - "fixed-seq-len": [{ - "isl": 1024, "osl": 1024, - "search-space": [{"tp": 1, "conc-list": [2, 6], "srt-recipe": "recipe.yaml"}], + "agentic-coding": [{ + "search-space": [{ + "tp": 1, "kv-offloading": "none", "conc-list": [2, 6], + "srt-recipe": "recipe.yaml", + }], }], }, }, } runners = { - "labels": {"fixture": ["node-a"], "cluster:fixture": ["node-a"]}, + "labels": {"cluster:fixture": ["node-a"]}, "clusters": {"fixture": { "gpus-per-node": 8, "arch": "x86_64", "scheduler": "slurm", "slurm": {"partition": "batch", "exclusive": True}, @@ -1735,6 +1738,11 @@ def write_fixture_recipe(root: Path) -> None: @pytest.mark.parametrize("prefix", ["", "inferencex-e2e/"]) def test_canonical_family_matrix_reads_revision_layout(monkeypatch, family_configs, prefix): master, runners = family_configs + # A fixed-seq-len curve of the same family is outside Klaud's AgentX scope. + master["fixture"]["scenarios"]["fixed-seq-len"] = [{ + "isl": 8192, "osl": 1024, + "search-space": [{"tp": 1, "conc-list": [4], "srt-recipe": "recipe.yaml"}], + }] files = { prefix + "configs/nvidia-master.yaml": yaml.safe_dump(master), prefix + "configs/runners.yaml": yaml.safe_dump(runners), @@ -1752,15 +1760,15 @@ def family() -> list[dict]: matrix = validation.canonical_matrix( "example/project", "a" * 40, "configs/nvidia-master.yaml:fixture", ) - assert matrix["evals"] == [] + assert [row["conc"] for row in matrix["evals"]] == [6] return matrix["single_node"]["all"] rows = family() - assert [(row["model"], row["conc"], row["image"]) for row in rows] == [ - ("example/model", 2, "example/image:stable"), - ("example/model", 6, "example/image:stable"), + assert [(row.get("scenario-type"), row["conc"], row["image"]) for row in rows] == [ + ("agentic-coding", 2, "example/image:stable"), + ("agentic-coding", 6, "example/image:stable"), ] - block = prefix + "configs/srt-recipes/fixed-sequence-single.yaml" + block = prefix + "configs/srt-recipes/agentic.yaml" files[block] = files[block] + b" env: {EXTRA: '1'}\n" changed = family() assert [row["conc"] for row in changed] == [2, 6] @@ -1779,7 +1787,7 @@ def publish(monkeypatch, head): { "model": "dsr1", "hardware": "fixture", "framework": "sglang", "precision": "fp8", "spec_method": "none", "disagg": False, "is_multinode": False, - "benchmark_type": "single_turn", "isl": 8192, "osl": 1024, "offload_mode": "off", + "benchmark_type": "agentic_traces", "isl": None, "osl": None, "offload_mode": "off", "conc": conc, "image": image, "prefill_tp": 1, "prefill_ep": 1, "prefill_dp_attention": False, "prefill_num_workers": 0, "decode_tp": 1, "decode_ep": 1, "decode_dp_attention": False, "decode_num_workers": 0, @@ -1829,7 +1837,7 @@ def review_candidate(directory, monkeypatch, source): def test_select_builds_baselines_from_regenerated_producers_without_starting_a_process( tmp_path, monkeypatch, regenerated, selected, deferred ): - _, head = commit_history(tmp_path, "inferencex-e2e") + _, head = commit_history(tmp_path, "inferencex-e2e", master=AGENTX_MASTER) monkeypatch.chdir(tmp_path) base_family = validation.producer_matrix("example/project", head, FAMILY) monkeypatch.setattr(validation, "canonical_matrix", lambda *_: base_family) @@ -1863,7 +1871,7 @@ def no_process(args, *_args, **_kwargs): def test_select_defers_a_baseline_the_current_family_no_longer_generates(tmp_path, monkeypatch): - _, head = commit_history(tmp_path, "inferencex-e2e") + _, head = commit_history(tmp_path, "inferencex-e2e", master=AGENTX_MASTER) monkeypatch.chdir(tmp_path) producer_family = validation.producer_matrix("example/project", head, FAMILY) shrunk = {"single_node": {"all": [ @@ -2452,7 +2460,7 @@ def items(_repository, path, _key=None): def test_producer_outside_the_local_clone_is_fetched_from_its_repository(tmp_path, monkeypatch): remote = tmp_path / "remote" remote.mkdir() - base, head = commit_history(remote) + base, head = commit_history(remote, master=AGENTX_MASTER) def remote_git(*args): subprocess.run(["git", *args], cwd=remote, check=True, capture_output=True) @@ -2484,7 +2492,7 @@ def remote_git(*args): def test_producer_predating_no_evals_regenerates_throughput_rows(tmp_path, monkeypatch): from infx.tests.historical_revision import GENERATOR - commit_history(tmp_path) + commit_history(tmp_path, master=AGENTX_MASTER) legacy = GENERATOR.replace( ' parser.add_argument("--no-evals", action="store_true")\n', "" ).replace( @@ -2539,8 +2547,8 @@ def test_live_families_preserve_public_identity_after_move(tmp_path, family_conf families = klaud.live_families(tmp_path if from_repository_root else project) assert families == { - ("dsr1", "fixture", "sglang", "fp8", "none", False, "single_turn", - 1024, 1024, "example/image:stable"): { + ("dsr1", "fixture", "sglang", "fp8", "none", False, "agentic_traces", + None, None, "example/image:stable"): { "configs/nvidia-master.yaml:fixture": ({"fixture"}, 1), }, } @@ -2576,8 +2584,8 @@ def git(*args): families = klaud.live_families(tmp_path) assert families == { - ("dsr1", "fixture", "sglang", "fp8", "none", False, "single_turn", - 1024, 1024, "example/image:stable"): { + ("dsr1", "fixture", "sglang", "fp8", "none", False, "agentic_traces", + None, None, "example/image:stable"): { "configs/nvidia-master.yaml:fixture": ({"fixture"}, 1), }, } @@ -2590,19 +2598,18 @@ def test_choose_needs_node_demand_on_every_target_cluster_and_skips_unresolved_r fixture, record = master["fixture"], runners["clusters"]["fixture"] worker = {"num-worker": 1, "tp": 8, "ep": 1, "dp-attn": False} master = { - "spanning": {**fixture, "runner": "h100"}, "exact": {**fixture, "runner": "cluster:h100-dsxe"}, "wide": {**fixture, "runner": "cluster:h100-dsxe", "multinode": True, "scenarios": { - "fixed-seq-len": [{"isl": 1024, "osl": 1024, "search-space": [ - {"num-nodes": nodes, "worker": worker, "conc-list": [4], "srt-recipe": "wide.yaml"} + "agentic-coding": [{"search-space": [ + {"num-nodes": nodes, "worker": worker, "kv-offloading": "none", "conc-list": [4], + "srt-recipe": "wide.yaml"} for nodes in (2, 4, 3) ]}], }}, - "unmapped": {**fixture, "runner": "h100-retired"}, + "unmapped": {**fixture, "runner": "cluster:h100-retired"}, } runners = { "labels": { - "h100": ["h100-cw_00", "h100-dsxe_00"], "cluster:h100-cw": ["h100-cw_00"], "cluster:h100-dsxe": ["h100-dsxe_00"], }, @@ -2623,17 +2630,16 @@ def test_choose_needs_node_demand_on_every_target_cluster_and_skips_unresolved_r "::warning::Klaud live-family-clusters-unresolved: configs/nvidia-master.yaml:unmapped\n" ) assert families == { - ("dsr1", "h100", "sglang", "fp8", "none", False, "single_turn", - 1024, 1024, "example/image:stable"): { - "configs/nvidia-master.yaml:spanning": ({"h100-cw", "h100-dsxe"}, 1), + ("dsr1", "h100", "sglang", "fp8", "none", False, "agentic_traces", + None, None, "example/image:stable"): { "configs/nvidia-master.yaml:exact": ({"h100-dsxe"}, 1), "configs/nvidia-master.yaml:wide": ({"h100-dsxe"}, 4), }, } # fmt: skip source = { "model": "dsr1", "hardware": "h100", "framework": "sglang", "precision": "fp8", - "spec_method": "none", "disagg": False, "benchmark_type": "single_turn", "isl": 1024, - "osl": 1024, "image": "example/image:stable", "date": "2026-09-19", + "spec_method": "none", "disagg": False, "benchmark_type": "agentic_traces", "isl": None, + "osl": None, "image": "example/image:stable", "date": "2026-09-19", } # fmt: skip items = [{"source-status": "baseline", "source-id": "1", "source": source}] @@ -2647,6 +2653,5 @@ def chosen(headroom): assert chosen({"h100-cw": 1}) == [] assert chosen({"h100-dsxe": 3}) == [("exact", ["h100-dsxe"], 1)] assert chosen({"h100-cw": 1, "h100-dsxe": 4}) == [ - ("exact", ["h100-dsxe"], 1), ("spanning", ["h100-cw", "h100-dsxe"], 1), - ("wide", ["h100-dsxe"], 4), + ("exact", ["h100-dsxe"], 1), ("wide", ["h100-dsxe"], 4), ]