Skip to content

Commit 4652976

Browse files
hbarclayclaude
andcommitted
operatorx: find recipes through configs/*-master.yaml (srt-recipe-dir / srt-recipe)
InferenceX now names a single-node configuration's model, image and runner in the master config, whose search space points at the srt-slurm recipe files; recipes no longer carry model.path / model.container. Lookup walks those entries and expands each referenced recipe with infx's selected_recipes as before. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 parent d71caa9 commit 4652976

1 file changed

Lines changed: 25 additions & 7 deletions

File tree

‎operatorx/recipes.py‎

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
"""The InferenceX recipe a case runs under.
22
3-
InferenceX serves every single-node configuration from a native srt-slurm recipe
4-
(inferencex-e2e/benchmarks/single_node/srt-slurm-recipes/<model>/<framework>/<hardware>-<precision>*/*.yaml).
3+
InferenceX serves every single-node configuration from a configs/*-master.yaml entry (model,
4+
image, runner) whose search space names native srt-slurm recipes
5+
(inferencex-e2e/benchmarks/single_node/srt-slurm-recipes/<srt-recipe-dir>/<srt-recipe>).
56
A case takes the recipe InferenceX runs for its source checkpoint on the runner's
67
hardware - the variant with the case's parallel split, else any of the checkpoint's - for
78
the recipe's image, launch env and server arguments. InferenceX's own code expands a
@@ -38,18 +39,35 @@
3839

3940
@functools.cache
4041
def _variants(framework: str, hardware: str) -> tuple[tuple[str, dict], ...]:
41-
"""Every expanded variant InferenceX runs for a framework on a hardware family."""
42+
"""Every expanded variant InferenceX runs for a framework on a hardware family: the
43+
single-node entries of configs/*-master.yaml (model, image, runner) and the srt-slurm
44+
recipes their search spaces name, expanded by InferenceX's own code."""
4245
import yaml
4346

4447
for path in (str(REPO), str(REPO / "utils/srt-slurm/src")):
4548
if path not in sys.path:
4649
sys.path.append(path)
4750
from infx.srt_slurm.synthetic_acceptance import selected_recipes
4851

49-
out = []
50-
for f in sorted(RECIPES.glob(f"*/{framework}/{hardware}-*/*.yaml")):
51-
for name, recipe in selected_recipes(yaml.safe_load(f.read_text()), None):
52-
out.append((str(f.relative_to(REPO)) + (f":{name}" if name else ""), recipe))
52+
out, seen = [], set()
53+
for master in sorted((REPO / "configs").glob("*-master.yaml")):
54+
for entry in (yaml.safe_load(master.read_text()) or {}).values():
55+
if (not isinstance(entry, dict) or entry.get("multinode") or entry.get("framework") != framework
56+
or entry.get("runner", "").removeprefix("cluster:").split("-")[0] != hardware
57+
or not entry.get("srt-recipe-dir")):
58+
continue
59+
refs = {s["srt-recipe"] for arms in (entry.get("scenarios") or {}).values() for arm in arms or ()
60+
for s in arm.get("search-space") or () if s.get("srt-recipe")}
61+
for ref in sorted(refs):
62+
path, _, selector = ref.partition(":")
63+
f = RECIPES / entry["srt-recipe-dir"] / path
64+
key = (str(f), selector, entry["model"], entry["image"])
65+
if key in seen or not f.is_file():
66+
continue
67+
seen.add(key)
68+
for name, recipe in selected_recipes(yaml.safe_load(f.read_text()), selector or None):
69+
recipe = {**recipe, "model": {"path": f"hf:{entry['model']}", "container": entry["image"]}}
70+
out.append((str(f.relative_to(REPO)) + (f":{name}" if name else ""), recipe))
5371
return tuple(out)
5472

5573

0 commit comments

Comments
 (0)