Skip to content

Commit fae7e81

Browse files
committed
feat: reject video recipes not named by their GPU split
1 parent 198d24e commit fae7e81

8 files changed

Lines changed: 71 additions & 19 deletions

File tree

‎inferencex-e2e/infx/matrix/validation.py‎

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,27 @@ def _video_spec_path(value: str) -> str:
448448

449449
VideoSpec = Annotated[str, AfterValidator(_video_spec_path)]
450450

451+
VIDEO_PARALLEL_DEGREES = ("tp", "pp", "ep", "dp", "pcp", "cfg", "ulysses", "ring")
452+
# A degree without a number takes the row's GPU count; a degree of 1 is left out.
453+
VIDEO_RECIPE = re.compile(
454+
r"video/agg(?:-tp1|(?=-)"
455+
+ "".join(rf"(?:-{degree}(?:[2-9]|[1-9][0-9]+)?)?" for degree in VIDEO_PARALLEL_DEGREES)
456+
+ r")\.yaml"
457+
)
458+
459+
460+
def _video_recipe_reference(value: str) -> str:
461+
"""A video recipe reference named by its GPU split, such as video/agg-cfg2-ulysses4.yaml."""
462+
if not VIDEO_RECIPE.fullmatch(value):
463+
raise ValueError(
464+
f"{value!r} must be video/agg-<layout>.yaml, where <layout> lists each parallel "
465+
f"degree above 1 in the order {' '.join(VIDEO_PARALLEL_DEGREES)}, or is tp1"
466+
)
467+
return value
468+
469+
470+
VideoRecipeReference = Annotated[str, AfterValidator(_video_recipe_reference)]
471+
451472

452473
class VideoMatrixEntry(BaseModel):
453474
"""One video-generation job: every concurrency of ``conc`` against one server."""
@@ -863,7 +884,7 @@ class VideoGenerationSearchSpaceEntry(BaseModel):
863884
model_config = ConfigDict(extra="forbid")
864885

865886
gpus: int = Field(gt=0, strict=True)
866-
srt_recipe: RecipeReference = Field(alias=Fields.SRT_RECIPE.value)
887+
srt_recipe: VideoRecipeReference = Field(alias=Fields.SRT_RECIPE.value)
867888
conc_list: list[int] = Field(alias=Fields.CONC_LIST.value, min_length=1)
868889

869890
@model_validator(mode="after")

‎inferencex-e2e/infx/tests/klaud/test_klaud_github.py‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
commit_history,
3232
forbid_current_config_parsing,
3333
)
34-
from infx.tests.srt_recipes import shared_blocks, single_node_fragment
34+
from infx.tests.srt_recipes import VIDEO_RECIPE, shared_blocks, single_node_fragment
3535

3636

3737
@pytest.mark.parametrize("current_head,expected", [("ours", True), ("other", False)])
@@ -2697,8 +2697,8 @@ def family_configs():
26972697
return master, runners
26982698

26992699

2700-
def write_fixture_recipe(root: Path) -> None:
2701-
recipe = root / "benchmarks/single_node/srt-slurm-recipes/fixture/recipe.yaml"
2700+
def write_fixture_recipe(root: Path, name: str = "recipe.yaml") -> None:
2701+
recipe = root / "benchmarks/single_node/srt-slurm-recipes/fixture" / name
27022702
recipe.parent.mkdir(parents=True, exist_ok=True)
27032703
recipe.write_text("{}\n")
27042704

@@ -3686,14 +3686,15 @@ def test_live_families_preserve_public_identity_after_move(tmp_path, family_conf
36863686
master["video"] = {
36873687
**master["fixture"], "runner": "cluster:fixture",
36883688
"scenarios": {"video-generation": [{"spec": "clip.yaml", "set": "shared-v1", "search-space": [
3689-
{"gpus": 2, "conc-list": [1, 4], "srt-recipe": "recipe.yaml"}]}]},
3689+
{"gpus": 2, "conc-list": [1, 4], "srt-recipe": VIDEO_RECIPE}]}]},
36903690
}
36913691
project = tmp_path / "inferencex-e2e"
36923692
configs = project / "configs"
36933693
configs.mkdir(parents=True)
36943694
(configs / "nvidia-master.yaml").write_text(yaml.safe_dump(master))
36953695
(configs / "runners.yaml").write_text(yaml.safe_dump(runners))
36963696
write_fixture_recipe(project)
3697+
write_fixture_recipe(project, VIDEO_RECIPE)
36973698

36983699
families = klaud.live_families(tmp_path if from_repository_root else project)
36993700

‎inferencex-e2e/infx/tests/matrix/test_changed.py‎

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from infx.matrix import changed
1515
from infx.matrix.revision import Revision
1616
from infx.tests.srt_recipes import (
17+
VIDEO_RECIPE,
1718
fixed_seq_entry,
1819
single_node_fragment,
1920
video_entry,
@@ -24,12 +25,13 @@
2425

2526
ROOT = Path(__file__).resolve().parents[3]
2627
RECIPES = "benchmarks/single_node/srt-slurm-recipes/fixture"
28+
UNBOUND_RECIPE = "video/agg-ulysses.yaml"
2729

2830

2931
def write(project: Path, master: dict, edited: dict, video: dict) -> None:
3032
(project / "configs/nvidia-master.yaml").write_text(yaml.safe_dump(master))
3133
(project / RECIPES / "edited.yaml").write_text(yaml.safe_dump(edited))
32-
(project / RECIPES / "video.yaml").write_text(yaml.safe_dump(video))
34+
(project / RECIPES / VIDEO_RECIPE).write_text(yaml.safe_dump(video))
3335

3436

3537
def git(root: Path, *args: str) -> str:
@@ -41,7 +43,7 @@ def git(root: Path, *args: str) -> str:
4143
def test_keys_with_changed_recipes_or_points_are_listed(tmp_path, monkeypatch, capsys):
4244
project = tmp_path / "inferencex-e2e"
4345
shutil.copytree(ROOT / "infx", project / "infx", ignore=shutil.ignore_patterns("__pycache__"))
44-
(project / RECIPES).mkdir(parents=True)
46+
(project / RECIPES / "video").mkdir(parents=True)
4547
write_shared_blocks(project)
4648
write_video_specs(tmp_path)
4749
(project / "configs/amd-master.yaml").write_text("{}\n")
@@ -53,13 +55,13 @@ def test_keys_with_changed_recipes_or_points_are_listed(tmp_path, monkeypatch, c
5355
(project / RECIPES / "stable.yaml").write_text(yaml.safe_dump(single_node_fragment(4)))
5456
unbound = video_fragment()
5557
del unbound["services"][0]["env"]["VIDEO_RUNTIME_REVISION"]
56-
(project / RECIPES / "unbound.yaml").write_text(yaml.safe_dump(unbound))
58+
(project / RECIPES / UNBOUND_RECIPE).write_text(yaml.safe_dump(unbound))
5759
write(project, {
5860
"edited": fixed_seq_entry("edited.yaml", [2, 4]),
5961
"grown": fixed_seq_entry("stable.yaml", [2]),
6062
"same": fixed_seq_entry("stable.yaml", [8]),
6163
"video": video_entry(),
62-
"unbound": video_entry("unbound.yaml"),
64+
"unbound": video_entry(UNBOUND_RECIPE),
6365
"gone": fixed_seq_entry("stable.yaml", [2]),
6466
}, single_node_fragment(4), video_fragment()) # fmt: skip
6567
(tmp_path / ".gitignore").write_text("__pycache__/\n")
@@ -74,9 +76,9 @@ def test_keys_with_changed_recipes_or_points_are_listed(tmp_path, monkeypatch, c
7476
"grown": fixed_seq_entry("stable.yaml", [2, 4]),
7577
"same": fixed_seq_entry("stable.yaml", [8]),
7678
"video": video_entry(),
77-
"unbound": video_entry("unbound.yaml"),
79+
"unbound": video_entry(UNBOUND_RECIPE),
7880
}, single_node_fragment(4, **{"max-running-requests": 16}), video_fragment(**{"max-running-requests": "7"})) # fmt: skip
79-
(project / RECIPES / "unbound.yaml").write_text(yaml.safe_dump(video_fragment()))
81+
(project / RECIPES / UNBOUND_RECIPE).write_text(yaml.safe_dump(video_fragment()))
8082
monkeypatch.chdir(project)
8183

8284
changed.main(["--base", "base", "--json"])
@@ -96,8 +98,8 @@ def test_keys_with_changed_recipes_or_points_are_listed(tmp_path, monkeypatch, c
9698
] # fmt: skip
9799
assert git(tmp_path, "status", "--porcelain").splitlines() == [
98100
f" M inferencex-e2e/{RECIPES}/edited.yaml",
99-
f" M inferencex-e2e/{RECIPES}/unbound.yaml",
100-
f" M inferencex-e2e/{RECIPES}/video.yaml",
101+
f" M inferencex-e2e/{RECIPES}/{VIDEO_RECIPE}",
102+
f" M inferencex-e2e/{RECIPES}/{UNBOUND_RECIPE}",
101103
" M inferencex-e2e/configs/nvidia-master.yaml",
102104
]
103105

‎inferencex-e2e/infx/tests/matrix/test_video_matrix.py‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import pytest
44

55
from infx.matrix.generate import generate_config_matrix, trim_conc, with_fingerprints
6+
from infx.matrix.validation import srt_recipe_references
67
from infx.workflows.benchmark_schema import validate_matrix
78

89

@@ -12,7 +13,7 @@ def master():
1213
"precision": "bf16", "framework": "sglang", "runner": "cluster:fixture", "multinode": False,
1314
"srt-recipe-dir": "video", "scenarios": {"video-generation": [{"spec": "clip.yaml",
1415
"set": "shared-v1",
15-
"search-space": [{"gpus": 2, "conc-list": [1, 2, 4], "srt-recipe": "serve.yaml"}]}]}}}
16+
"search-space": [{"gpus": 2, "conc-list": [1, 2, 4], "srt-recipe": "video/agg-tp2.yaml"}]}]}}}
1617

1718

1819
RUNNERS = {"labels": {"cluster:fixture": ["node"]}, "clusters": {"fixture": {
@@ -54,5 +55,14 @@ def build(**fields):
5455

5556
def test_video_cannot_upload_without_a_renderable_recipe_fingerprint(master, tmp_path):
5657
[row] = generate_config_matrix(["video"], master, RUNNERS, scenario_types=VIDEO)
57-
with pytest.raises(ValueError, match="serve.yaml"):
58+
with pytest.raises(ValueError, match="agg-tp2.yaml"):
5859
with_fingerprints([row], tmp_path)
60+
61+
62+
def test_video_recipe_must_be_named_by_its_gpu_split(master):
63+
[row] = master["video"]["scenarios"]["video-generation"][0]["search-space"]
64+
srt_recipe_references(master)
65+
for unsplit in ("serving-client.yaml", "serving-client-g2.yaml"):
66+
row["srt-recipe"] = unsplit
67+
with pytest.raises(ValueError, match="video/agg-<layout>.yaml"):
68+
srt_recipe_references(master)

‎inferencex-e2e/infx/tests/srt_recipes.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,10 @@ def fixed_seq_entry(recipe: str, concurrencies: list[int]) -> dict:
7575
} # fmt: skip
7676

7777

78-
def video_entry(recipe: str = "video.yaml") -> dict:
78+
VIDEO_RECIPE = "video/agg-tp2.yaml"
79+
80+
81+
def video_entry(recipe: str = VIDEO_RECIPE) -> dict:
7982
"""A master entry with one 2-GPU video point of ``VIDEO_SPEC``'s set served by ``recipe``."""
8083
return {
8184
"image": "example/video:1", "model": VIDEO_MODEL, "model-prefix": "h3",

‎inferencex-e2e/infx/tests/srt_slurm/test_generate.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from infx.launch.policy import LaunchPath
1212
from infx.tests.srt_recipes import (
1313
VIDEO_MODEL,
14+
VIDEO_RECIPE,
1415
VIDEO_SPEC,
1516
video_entry,
1617
video_fragment,
@@ -100,7 +101,7 @@ def project(tmp_path):
100101
**RECIPE, "frontend": {"type": "sglang", "enable_multiple_frontends": False},
101102
"roles": {"agg": {"nodes": 1, "workers": 1, "gpus": 4, "args": {"tensor-parallel-size": 4}}},
102103
},
103-
"single_node/srt-slurm-recipes/fixture/video.yaml": video_fragment(),
104+
f"single_node/srt-slurm-recipes/fixture/{VIDEO_RECIPE}": video_fragment(),
104105
"multi_node/srt-slurm-recipes/fixture/agentic.yaml": {
105106
**RECIPE, "frontend": {"type": "sglang-router"}, "roles": {
106107
role: {"nodes": 1, "workers": 1, "gpus": 8, "args": {"tensor-parallel-size": 8}}

‎inferencex-e2e/infx/tests/workflows/test_signoff_facts.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from infx.klaud.models import Feed
1010
from infx.matrix.validation import VIDEO_SPEC_DIR
1111
from infx.tests.srt_recipes import (
12+
VIDEO_RECIPE,
1213
VIDEO_SPEC,
1314
fixed_seq_entry,
1415
single_node_fragment,
@@ -374,9 +375,9 @@ def test_matrix_at_generates_llm_points_only_and_runs_no_revision_code(tmp_path,
374375
yaml.safe_dump({"llm": fixed_seq_entry("stable.yaml", [2]), "video": video_entry()})
375376
)
376377
(project / "configs/amd-master.yaml").write_text("{}\n")
377-
recipes.mkdir(parents=True)
378+
(recipes / "video").mkdir(parents=True)
378379
(recipes / "stable.yaml").write_text(yaml.safe_dump(single_node_fragment(4)))
379-
(recipes / "video.yaml").write_text(yaml.safe_dump(video_fragment()))
380+
(recipes / VIDEO_RECIPE).write_text(yaml.safe_dump(video_fragment()))
380381
# git archive rejects a DATA_PATHS entry that the tree lacks.
381382
(project / "benchmarks/multi_node/srt-slurm-recipes").mkdir(parents=True)
382383
(project / "benchmarks/multi_node/srt-slurm-recipes/.keep").touch()

‎video-generation/SUBMITTING.md‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,19 @@ binding.
5050
the H200, B200 and B300 vLLM-Omni Wan2.2 rows use the public CUDA amd64 image. The MI355X row
5151
uses its ROCm MI35x build.
5252

53+
Name the recipe `<model-prefix>/<engine>/<gpu>-<precision>/video/agg-<layout>.yaml`, which
54+
extends the [recipe naming convention](../inferencex-e2e/benchmarks/multi_node/srt-slurm-recipes/RECIPES.md#directory-and-filename-convention).
55+
Matrix generation rejects any other video `srt-recipe`.
56+
57+
- `<layout>` lists each parallel degree above 1 in the order
58+
`tp pp ep dp pcp cfg ulysses ring`, for example `agg-cfg2-ulysses4.yaml`. vLLM-Omni's
59+
`--usp` is `ulysses`. A recipe whose degrees are all 1 is `agg-tp1.yaml`.
60+
- A degree set to `{gpus_per_node}` has no number: one recipe that serves 1, 2, 4 and 8
61+
GPUs with Ulysses is `agg-ulysses.yaml`. Leave out settings that equal the GPU count,
62+
such as VAE patch parallelism and text-encoder TP.
63+
- Set the recipe `name` to `<model-prefix>-<engine>-<file stem>`, for example
64+
`wan22-vllm-omni-agg-cfg2`.
65+
5366
A shared image does not qualify a different topology or SKU. Each selected
5467
deployment qualifies through its own sweep. Maintainers stage model snapshots in the
5568
runner's existing Hugging Face cache. Do not patch the cache or pass launch flags

0 commit comments

Comments
 (0)