|
1 | 1 | """The InferenceX recipe a case runs under. |
2 | 2 |
|
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>). |
5 | 6 | A case takes the recipe InferenceX runs for its source checkpoint on the runner's |
6 | 7 | hardware - the variant with the case's parallel split, else any of the checkpoint's - for |
7 | 8 | the recipe's image, launch env and server arguments. InferenceX's own code expands a |
|
38 | 39 |
|
39 | 40 | @functools.cache |
40 | 41 | 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.""" |
42 | 45 | import yaml |
43 | 46 |
|
44 | 47 | for path in (str(REPO), str(REPO / "utils/srt-slurm/src")): |
45 | 48 | if path not in sys.path: |
46 | 49 | sys.path.append(path) |
47 | 50 | from infx.srt_slurm.synthetic_acceptance import selected_recipes |
48 | 51 |
|
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)) |
53 | 71 | return tuple(out) |
54 | 72 |
|
55 | 73 |
|
|
0 commit comments