diff --git a/.github/community-ci.md b/.github/community-ci.md index 14ee23ef78..6ae05bbf0e 100644 --- a/.github/community-ci.md +++ b/.github/community-ci.md @@ -8,7 +8,7 @@ SPDX-License-Identifier: Apache-2.0 ## Current rollout Stable keeps the existing Community CI behavior: every pull request runs the -four parallel CPU stages, and automatic GPU execution remains disabled. +five parallel CPU stages, and automatic GPU execution remains disabled. Maintainers can still request the existing experimental GPU smoke test manually. The Internal CI bridge, required status, and maintainer trigger are unchanged. @@ -20,7 +20,7 @@ Both branches use one workflow file, `.github/workflows/community-ci.yml`, named **Community CI**. There is no separate Community premerge workflow. ```text -Stable: source quality / docs / ownership / C++ and Python units → CPU result +Stable: source quality / docs / ownership / C++ and Python units / AIPerf qualification → CPU result Dev: source quality / docs / ownership / C++ and Python units → Brev GPU → result ``` diff --git a/.github/workflows/community-ci.yml b/.github/workflows/community-ci.yml index 684f1428c8..503e34f721 100644 --- a/.github/workflows/community-ci.yml +++ b/.github/workflows/community-ci.yml @@ -610,6 +610,42 @@ jobs: - name: Run hardened source-only units run: python3 -m tools.community_ci unit + # The AIPerf qualification application, in its own environment: its pinned AIPerf and its plugins. + aiperf-qual: + name: Community CPU / AIPerf qualification + needs: authorize + runs-on: ubuntu-24.04 + timeout-minutes: 30 + permissions: + contents: read + steps: + - name: Check out the exact PR merge + uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 + with: + ref: ${{ needs.authorize.outputs.merge_sha }} + fetch-depth: 0 + persist-credentials: false + + - name: Set up Python + uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 + with: + python-version: "3.12" + + - name: Install the application and its AIPerf plugins + run: | + set -euo pipefail + python -m pip install --requirement apps/aiperf_qual/requirements.txt \ + "$(grep -x 'pytest==.*' requirements/community-ci.txt)" + python -m pip install --no-deps apps/aiperf_qual/plugins + + - name: Test the application + env: + CUDA_VISIBLE_DEVICES: "" + HF_HUB_OFFLINE: "1" + PYTHONDONTWRITEBYTECODE: "1" + PYTHONPATH: apps/aiperf_qual:apps/aiperf_qual/plugins:core/builder:apps/benchmark:. + run: python -m pytest apps/aiperf_qual/tests -q -m "not gpu and not trt" -p no:cacheprovider + required: name: Community CPU / Required if: ${{ !cancelled() && (github.event_name == 'pull_request' || (github.event_name == 'workflow_dispatch' && inputs.source_snapshot != '')) }} @@ -619,6 +655,7 @@ jobs: - docs - ownership-impact - unit + - aiperf-qual runs-on: ubuntu-24.04 timeout-minutes: 5 permissions: {} @@ -629,17 +666,20 @@ jobs: DOCS_RESULT: ${{ needs.docs.result }} OWNERSHIP_IMPACT_RESULT: ${{ needs.ownership-impact.result }} UNIT_RESULT: ${{ needs.unit.result }} + AIPERF_QUAL_RESULT: ${{ needs.aiperf-qual.result }} run: | set -euo pipefail printf '%s\n' \ "Source quality: $SOURCE_QUALITY_RESULT" \ "Docs: $DOCS_RESULT" \ "Ownership and impact: $OWNERSHIP_IMPACT_RESULT" \ - "Unit / C++ and Python: $UNIT_RESULT" + "Unit / C++ and Python: $UNIT_RESULT" \ + "AIPerf qualification: $AIPERF_QUAL_RESULT" test "$SOURCE_QUALITY_RESULT" = success test "$DOCS_RESULT" = success test "$OWNERSHIP_IMPACT_RESULT" = success test "$UNIT_RESULT" = success + test "$AIPERF_QUAL_RESULT" = success gpu-authorize: name: Community GPU / Authorize diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 49cc1d6e63..8cd935929a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -201,9 +201,10 @@ public CI, protected CI, or maintainer review. ### 9. Run contributor-visible Community CI Opening a pull request or pushing a new commit automatically starts **Stable -Community CI** with the existing four parallel CPU stages: source quality, -documentation, ownership and impact, and C++/Python unit tests. The -`Community CPU / Required` result requires all four to pass. +Community CI** with five parallel CPU stages: source quality, documentation, +ownership and impact, C++/Python unit tests, and the AIPerf qualification +application's tests in its own environment. The `Community CPU / Required` +result requires all five to pass. Stable automatic Community GPU execution remains disabled during qualification. Maintainers retain the existing manual GPU smoke option. **Dev Community CI** diff --git a/apps/aiperf_qual/README.md b/apps/aiperf_qual/README.md index cc2043d97e..144c51d2df 100644 --- a/apps/aiperf_qual/README.md +++ b/apps/aiperf_qual/README.md @@ -333,10 +333,15 @@ file to change: |---|---|---| | `config/tasks.yaml` | the profile's Task has no defaults (no entry, no exclusion to write) | every machine | | `config/exclusions.yaml` | the qualification cannot qualify the profile as cataloged | every machine | +| `config/models` | an image-generation request leaves a size, step or guidance control to the pipeline's default, so each side would choose its own; state it under `request` in `config/models/.yaml` | every machine | | `environment` | not in the machine's `models.include`, or in its `models.exclude` | one machine | | `config/platforms/.yaml` | what the hardware cannot run | one kind of hardware | | `environment` | a checkpoint above the machine's `models.max_checkpoint_gib` | one machine | +A family that adds a profile the qualification cannot run yet does not change this application: the +`config/tasks.yaml` and `config/models` rows leave the profile out on their own, and `plan` shows it with its +reason. + The scope is every ready catalog profile (L0 smoke and regression variants aside). `run-all`, `plan`, `assign` and `matrix` take the machine's list; `--profile` (names or glob patterns, in the order given) replaces its `include` and is held to the same exclusions, `run --profile` too. `--ignore-exclusions` runs the named profiles diff --git a/apps/aiperf_qual/tests/families/test_birefnet_aiperf.py b/apps/aiperf_qual/tests/families/test_birefnet_aiperf.py deleted file mode 100644 index 0261954280..0000000000 --- a/apps/aiperf_qual/tests/families/test_birefnet_aiperf.py +++ /dev/null @@ -1,24 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -from pathlib import Path - -REPOSITORY = Path(__file__).resolve().parents[4] - - -def test_birefnet_owns_its_binary_conversion_benchmark_and_native_loader(monkeypatch): - monkeypatch.syspath_prepend(str(REPOSITORY / "apps/aiperf_qual")) - from trtmc_aiperf_qual.config import Environment - from trtmc_aiperf_qual.models import resolve_model - - model = resolve_model("birefnet-lite", Environment({"repo": str(REPOSITORY)})) - entry, = model["absolute"] - assert entry["metric"] == "mask_parity" - assert entry["gate"] == {"min_mask_iou": 0.9} - suite = entry["suite_definition"] - assert suite["source"]["dataset"] == "detection-datasets/coco" - assert suite["source"]["revision"] == "cf0b22332314a937e9dc8a1957b21725430bb41d" - assert suite["selection"] == {"method": "seeded", "count": 50} - assert "label_column" not in suite["source"] and not suite.get("request") - assert model["reference"]["adapter"] == "families/birefnet/reference/adapter.py" - assert model["reference"]["trust_remote_code"] is True diff --git a/apps/aiperf_qual/tests/families/test_dinov3_aiperf.py b/apps/aiperf_qual/tests/families/test_dinov3_aiperf.py deleted file mode 100644 index cea1836e02..0000000000 --- a/apps/aiperf_qual/tests/families/test_dinov3_aiperf.py +++ /dev/null @@ -1,30 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -from pathlib import Path - -import pytest - -PROFILES = ("dinov3-vits16-pretrain-lvd1689m", "dinov3-convnext-tiny-pretrain-lvd1689m") -REPO = Path(__file__).resolve().parents[4] - - -@pytest.mark.parametrize("profile", PROFILES) -def test_formal_profile_uses_one_image_suite_for_accuracy_and_timing(profile, monkeypatch): - monkeypatch.syspath_prepend(str(REPO / "apps/aiperf_qual")) - from trtmc_aiperf_qual.config import Environment - from trtmc_aiperf_qual.models import resolve_model - - model = resolve_model(profile, Environment({"repo": str(REPO)})) - assert model["accuracy_source"] == "absolute" - assert len(model["absolute"]) == 1 - item = model["absolute"][0] - assert item["suite"] == "coco-feature-parity" - assert item["metric"] == "family_parity" - assert item["gate"]["profile"] == profile - assert item["suite_definition"]["selection"] == {"method": "seeded", "count": 50} - assert ( - item["suite_definition"]["source"]["revision"] == "cf0b22332314a937e9dc8a1957b21725430bb41d" - ) - assert model["reference"]["precision"] == model["candidate"]["precision"] == "fp16" - assert model["reference"]["adapter"] == "families/dinov3/reference/adapter.py" diff --git a/apps/aiperf_qual/tests/families/test_electra_aiperf_outliers.py b/apps/aiperf_qual/tests/families/test_electra_aiperf_outliers.py deleted file mode 100644 index 7f4cf331bd..0000000000 --- a/apps/aiperf_qual/tests/families/test_electra_aiperf_outliers.py +++ /dev/null @@ -1,28 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -"""ELECTRA's encoder-parity outlier allowance for its BF16 profile.""" - -from __future__ import annotations - -from pathlib import Path - -import pytest - -yaml = pytest.importorskip("yaml") - -AIPERF = Path(__file__).resolve().parents[2] / "config" / "models" # the profiles' AIPerf settings - - -def test_rare_bf16_outliers_within_twice_the_tolerance_are_allowed() -> None: - benchmark = yaml.safe_load((AIPERF / "electra-base-discriminator-bf16.yaml").read_text())[ - "benchmarks" - ]["encoder_parity"] - assert benchmark == { - "gate": { - "outliers": { - "max_fraction": 0.01, - "gate": {"min_cosine": 0.998, "max_relative_l2": 0.04}, - } - } - } diff --git a/apps/aiperf_qual/tests/families/test_fnet_aiperf_outliers.py b/apps/aiperf_qual/tests/families/test_fnet_aiperf_outliers.py deleted file mode 100644 index 44872eef45..0000000000 --- a/apps/aiperf_qual/tests/families/test_fnet_aiperf_outliers.py +++ /dev/null @@ -1,30 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -"""FNet's encoder-parity outlier allowance for its FP16 profiles.""" - -from __future__ import annotations - -from pathlib import Path - -import pytest - -yaml = pytest.importorskip("yaml") - -PROFILES = ("fnet-base",) -AIPERF = Path(__file__).resolve().parents[2] / "config" / "models" # the profiles' AIPerf settings - - -@pytest.mark.parametrize("profile", PROFILES) -def test_rare_fp16_outliers_within_twice_the_tolerance_are_allowed(profile: str) -> None: - benchmark = yaml.safe_load((AIPERF / f"{profile}.yaml").read_text())["benchmarks"][ - "encoder_parity" - ] - assert benchmark["gate"] == { - "outliers": {"max_fraction": 0.01, "gate": {"min_cosine": 0.998, "max_relative_l2": 0.04}} - } - # Against the float32 native model (no FP16 FFT in PyTorch), cuFFT's FP16 transforms leave 5 of 400 sentences - # outside the tolerance: 2% may be. - assert benchmark["mismatched_precision_gate"] == { - "outliers": {"max_fraction": 0.02, "gate": {"min_cosine": 0.996, "max_relative_l2": 0.08}} - } diff --git a/apps/aiperf_qual/tests/families/test_lerobot_groot_aiperf_gates.py b/apps/aiperf_qual/tests/families/test_lerobot_groot_aiperf_gates.py deleted file mode 100644 index 9d29b2aa40..0000000000 --- a/apps/aiperf_qual/tests/families/test_lerobot_groot_aiperf_gates.py +++ /dev/null @@ -1,31 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -"""The action-parity gates of the LeRobot GR00T AIPerf profiles.""" - -from __future__ import annotations - -from pathlib import Path - -import pytest - -yaml = pytest.importorskip("yaml") - -AIPERF = Path(__file__).resolve().parents[2] / "config" / "models" # the profiles' AIPerf settings -GRIPPER = { - "gripper_component": -1, - "outliers": {"max_fraction": 0.02, "gate": {"max_gripper_sign_changes": 1}}, -} - - -@pytest.mark.parametrize( - ("profile", "arm"), - [("groot-n17-libero-spatial-bf16", 0.045), ("groot-n17-libero-spatial-fp8", 0.068)], -) -def test_the_gripper_is_compared_by_sign_with_one_changed_observation_allowed( - profile: str, arm: float -) -> None: - gate = yaml.safe_load((AIPERF / f"{profile}.yaml").read_text())["benchmarks"][ - "action_chunk_parity" - ]["gate"] - assert gate == {"max_abs_error": arm, **GRIPPER} diff --git a/apps/aiperf_qual/tests/families/test_llama_aiperf_awq_inputs.py b/apps/aiperf_qual/tests/families/test_llama_aiperf_awq_inputs.py deleted file mode 100644 index 30849dcd40..0000000000 --- a/apps/aiperf_qual/tests/families/test_llama_aiperf_awq_inputs.py +++ /dev/null @@ -1,27 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -from __future__ import annotations - -from pathlib import Path - -import pytest - -yaml = pytest.importorskip("yaml") - -REPOSITORY = Path(__file__).resolve().parents[4] - - -def test_the_profile_declares_what_the_preparation_reads_as_its_inputs(): - profile = yaml.safe_load( - (REPOSITORY / "apps/aiperf_qual/config/models/nemotron-nano-4b-int4-awq.yaml").read_text() - ) - inputs = profile["reference"]["prepare_inputs"] - # A change to the quantizer, the committed scales or a manifest must prepare the reference weights again: the - # family's quantization module, its AWQ_SCALES_DIR and the manifests prepare_int4_awq reads. - assert inputs == [ - "families/llama/quantization.py", - "families/llama/awq_scales", - "families/llama/tests/manifests", - ] - assert all((REPOSITORY / path).exists() for path in inputs) diff --git a/apps/aiperf_qual/tests/families/test_roberta_aiperf_outliers.py b/apps/aiperf_qual/tests/families/test_roberta_aiperf_outliers.py deleted file mode 100644 index 28d8549ac6..0000000000 --- a/apps/aiperf_qual/tests/families/test_roberta_aiperf_outliers.py +++ /dev/null @@ -1,42 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -"""The RoBERTa family's encoder-parity outlier allowance for its FP16 and BF16 profiles.""" - -from __future__ import annotations - -from pathlib import Path - -import pytest - -yaml = pytest.importorskip("yaml") - -PROFILES = ("camembert-base", "roberta-large") -AIPERF = Path(__file__).resolve().parents[2] / "config" / "models" # the profiles' AIPerf settings - - -@pytest.mark.parametrize("profile", PROFILES) -def test_rare_fp16_outliers_within_twice_the_tolerance_are_allowed(profile: str) -> None: - benchmark = yaml.safe_load((AIPERF / f"{profile}.yaml").read_text())["benchmarks"][ - "encoder_parity" - ] - assert benchmark["gate"] == { - "outliers": {"max_fraction": 0.01, "gate": {"min_cosine": 0.998, "max_relative_l2": 0.04}} - } - assert benchmark["mismatched_precision_gate"] == { - "outliers": {"max_fraction": 0.01, "gate": {"min_cosine": 0.996, "max_relative_l2": 0.08}} - } - - -def test_rare_bf16_outliers_within_twice_the_tolerance_are_allowed() -> None: - benchmark = yaml.safe_load((AIPERF / "xlm-roberta-base-bf16.yaml").read_text())["benchmarks"][ - "encoder_parity" - ] - assert benchmark == { - "gate": { - "outliers": { - "max_fraction": 0.01, - "gate": {"min_cosine": 0.998, "max_relative_l2": 0.04}, - } - } - } diff --git a/apps/aiperf_qual/tests/families/test_rt_detr_v2_aiperf.py b/apps/aiperf_qual/tests/families/test_rt_detr_v2_aiperf.py deleted file mode 100644 index 312490757c..0000000000 --- a/apps/aiperf_qual/tests/families/test_rt_detr_v2_aiperf.py +++ /dev/null @@ -1,19 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -from pathlib import Path - -REPOSITORY = Path(__file__).resolve().parents[4] - - -def test_rtdetr_benchmark_uses_the_fixed_bundle_threshold(monkeypatch): - monkeypatch.syspath_prepend(str(REPOSITORY / "apps/aiperf_qual")) - from trtmc_aiperf_qual.config import Environment - from trtmc_aiperf_qual.models import resolve_model - - model = resolve_model("rtdetr-v2-r18", Environment({"repo": str(REPOSITORY)})) - entry, = model["absolute"] - assert entry["suite"] == "coco-map" - assert entry["suite_definition"]["request"] == {"score_threshold": 0.3} - assert entry["suite_definition"]["selection"]["count"] == 500 - assert entry["gate"] == {"margin": 1.0} diff --git a/apps/aiperf_qual/tests/families/test_timm_resnet_aiperf_gates.py b/apps/aiperf_qual/tests/families/test_timm_resnet_aiperf_gates.py deleted file mode 100644 index ca1ee210e0..0000000000 --- a/apps/aiperf_qual/tests/families/test_timm_resnet_aiperf_gates.py +++ /dev/null @@ -1,21 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -"""The ImageNet gate of the FP8 ResNet-50 profile.""" - -from __future__ import annotations - -from pathlib import Path - -import pytest - -yaml = pytest.importorskip("yaml") - -AIPERF = Path(__file__).resolve().parents[2] / "config" / "models" # the profiles' AIPerf settings - - -def test_the_fp8_resnet50_gets_twice_the_imagenet_margin() -> None: - """Two FP8 builds differ by up to 0.13 top-1 points, so the quantized bundle is held to 1 point (the shared - ImageNet margin is 0.5); the fp16 path keeps the shared gate.""" - benchmarks = yaml.safe_load((AIPERF / "resnet50-a1-in1k-fp8.yaml").read_text())["benchmarks"] - assert benchmarks == {"imagenet": {"quantized_gate": {"margin": 1.0}}} diff --git a/apps/aiperf_qual/tests/test_campaign.py b/apps/aiperf_qual/tests/test_campaign.py index de565274eb..c2d6d4467f 100644 --- a/apps/aiperf_qual/tests/test_campaign.py +++ b/apps/aiperf_qual/tests/test_campaign.py @@ -585,10 +585,12 @@ def test_the_catalog_excludes_profiles_without_task_defaults_then_those_config_e from trtmc_aiperf_qual.config import CONFIG_ROOT + import shutil + tasks = yaml.safe_load((CONFIG_ROOT / "tasks.yaml").read_text()) del tasks["tasks"]["text_continuation"] root = tmp_path / "config" - root.mkdir() + shutil.copytree(CONFIG_ROOT / "models", root / "models") # flux-2-dev states its image controls there (root / "tasks.yaml").write_text(yaml.safe_dump(tasks)) (root / "exclusions.yaml").write_text("exclude:\n - {profile: flux-schnell, reason: a stated gap}\n" " - {profile: qwen3-0.6b-fp16, reason: never reached}\n") diff --git a/apps/aiperf_qual/tests/test_configuration_paths.py b/apps/aiperf_qual/tests/test_configuration_paths.py new file mode 100644 index 0000000000..85fc2f8df9 --- /dev/null +++ b/apps/aiperf_qual/tests/test_configuration_paths.py @@ -0,0 +1,40 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +"""The application reads a family only through the files its configuration names, so each must exist: a family that +renames or removes its reference adapter, inputs or requirements breaks the profiles that name them.""" + +from __future__ import annotations + +from collections.abc import Iterator +from pathlib import Path +from typing import Any + +import yaml + +from trtmc_aiperf_qual.config import CONFIG_ROOT + +REPOSITORY = Path(__file__).resolve().parents[3] +ROOTS = ("apps/", "core/", "examples/", "families/") + + +def _named_paths(value: Any) -> Iterator[str]: + if isinstance(value, dict): + for item in value.values(): + yield from _named_paths(item) + elif isinstance(value, list): + for item in value: + yield from _named_paths(item) + elif isinstance(value, str) and value.startswith(ROOTS): + yield value + + +def test_every_repository_path_the_configuration_names_exists(): + named = { + (path.relative_to(CONFIG_ROOT).as_posix(), value) + for path in sorted(CONFIG_ROOT.rglob("*.yaml")) + for value in _named_paths(yaml.safe_load(path.read_text(encoding="utf-8"))) + } + # Adapters, inputs, preparation scripts and their inputs, requirements, and validation commands. + assert len(named) > 100 + assert not sorted(item for item in named if not (REPOSITORY / item[1]).exists()) diff --git a/apps/aiperf_qual/tests/test_endpoint_catalog.py b/apps/aiperf_qual/tests/test_endpoint_catalog.py index 62246c9654..5df67e0d2b 100644 --- a/apps/aiperf_qual/tests/test_endpoint_catalog.py +++ b/apps/aiperf_qual/tests/test_endpoint_catalog.py @@ -58,9 +58,10 @@ def test_current_catalog_keeps_every_matching_checkpoint(): def test_image_inventory_covers_existing_checkpoints_and_excludes_legacy_video(): + # Known checkpoints only: a family adding an image model adds a row. repo = Path(__file__).resolve().parents[3] rows = inventory(repo, "images") - assert {row["profile"] for row in rows if row["profile"]} == { + assert {row["profile"] for row in rows if row["profile"]} >= { "flux-2-dev", "flux-schnell", "pixart-sigma-1024", "qwen-image", "qwen-image-2512", "stable-diffusion-v1-5", "z-image-turbo"} assert all("Wan" not in row["checkpoint"] and "MiniMax" not in row["checkpoint"] for row in rows) @@ -72,11 +73,11 @@ def test_edit_inventory_requires_the_declared_reference_conditioned_task(): assert row["profile"] == "editor" and row["variants"][0]["task"] == task -def test_video_inventory_retains_three_full_models_and_two_partial_gaps(): +def test_video_inventory_retains_the_full_models_and_the_partial_checkpoints(): + # Known checkpoints only: a family adding a video model, or a full profile of a partial one, changes rows. repo = Path(__file__).resolve().parents[3] rows = inventory(repo, "videos") - assert {r["profile"] for r in rows if r["profile"]} == { + assert {r["profile"] for r in rows if r["profile"]} >= { "minimax-h3-768p", "wan21-t2v-1.3b", "wan22-ti2v-5b"} - assert {r["checkpoint"] for r in rows if r["profile"] is None} == { - "nvidia/Cosmos3-Nano", "Lightricks/LTX-Video"} + assert {r["checkpoint"] for r in rows} >= {"nvidia/Cosmos3-Nano", "Lightricks/LTX-Video"} assert all(r["family"] not in {"sana_wm", "sam2"} for r in rows) diff --git a/apps/aiperf_qual/tests/test_qual.py b/apps/aiperf_qual/tests/test_qual.py index b293a8e398..80aafe5208 100644 --- a/apps/aiperf_qual/tests/test_qual.py +++ b/apps/aiperf_qual/tests/test_qual.py @@ -312,9 +312,9 @@ def test_models_are_derived_from_the_catalog_and_task_defaults(): assert resolve_model("sana-wm-bidirectional", environment, root=root)["reference"]["backend"] == "unsupported" -def test_a_family_definition_is_merged_over_config_models(tmp_path): - """sana-wm-bidirectional: its native adapter in config/models, its reference build policy in the family's own - definition (families/sana_wm/tests/aiperf). The resolved reference has both.""" +def test_config_models_is_the_only_definition_of_a_profile(tmp_path): + """sana-wm-bidirectional: its native adapter and its reference build policy both come from config/models; without + that file the profile has its Task defaults alone (a family holds no AIPerf settings).""" import shutil from trtmc_aiperf_qual.config import CONFIG_ROOT @@ -326,7 +326,7 @@ def test_a_family_definition_is_merged_over_config_models(tmp_path): shutil.copytree(CONFIG_ROOT, root) (root / "models/sana-wm-bidirectional.yaml").unlink() alone = resolve_model("sana-wm-bidirectional", _environment(), root=root)["reference"] - assert "adapter" not in alone and alone["build_isolation"] is False + assert "adapter" not in alone and "build_isolation" not in alone def test_task_sdk_migrations_keep_their_tasks_qualification(): @@ -426,20 +426,19 @@ def test_profiles_whose_only_native_reference_is_vllm_are_excluded(): assert "nemotron-omni-nvfp4-native" not in profiles # the catalog does not mark it ready -def test_every_ready_catalog_task_has_defaults_or_a_stated_gap(): - """A ready profile whose Task has no defaults is excluded (config/tasks.yaml), so a Task SDK rename would leave - its profiles out of every run: alias the old entry in config/tasks.yaml, or state the gap here.""" +def test_every_task_entry_serves_a_catalog_task(): + """A Task SDK rename leaves the old entry of config/tasks.yaml serving no catalog profile, and the renamed + profiles without defaults (left out: no Task defaults): alias the old entry under the new name. A Task new to the + catalog has no entry yet, and its profiles are left out with that reason.""" import yaml + from trtmc_benchmark.catalog import ManifestCatalog from trtmc_aiperf_qual.config import CONFIG_ROOT - from trtmc_aiperf_qual.selection import catalog - not_qualified: dict[str, str] = { # Task -> why no generic native reference or benchmark serves it yet - "images_text_to_text": "not every family of this Task declares the OCRBench suite's template controls yet", - "text_to_head_scores": "no generic native adapter or reference for per-token head scores", - } tasks = yaml.safe_load((CONFIG_ROOT / "tasks.yaml").read_text())["tasks"] - assert {profile.task for profile in catalog(REPOSITORY)} - set(tasks) == set(not_qualified) + used = {entry.model.task for entry in ManifestCatalog(REPOSITORY / "families").entries() if entry.model} & set(tasks) + # An alias is the same entry: the old name stays as its YAML anchor. + assert not [name for name, entry in tasks.items() if not any(entry is tasks[task] for task in used)] def test_top1_near_tie_tolerance_is_opt_in(): @@ -789,11 +788,11 @@ def test_rwkv_qualification_build_and_selection_use_the_same_capacity(): def test_timing_reference_precision_can_differ_from_the_candidate_precision(): - from trtmc_aiperf_qual.models import resolve_model from trtmc_aiperf_qual.runner import timing_precisions - z_image = resolve_model("z-image-turbo", _environment())["reference"] - assert z_image["perf_precision"] == "fp16" and timing_precisions(z_image) == ["bf16"] + # A native model with no valid output at the candidate precision is timed at the declared one alone. + declared = {"perf_precision": "fp16", "precision": "fp32", "timing_precision": "bf16"} + assert timing_precisions(declared) == ["bf16"] assert timing_precisions({"perf_precision": "fp16", "precision": "fp32"}) == ["fp16", "fp32"] diff --git a/apps/aiperf_qual/tests/families/test_qwen_vl_aiperf_capacity.py b/apps/aiperf_qual/tests/test_qwen_vl_capacity.py similarity index 96% rename from apps/aiperf_qual/tests/families/test_qwen_vl_aiperf_capacity.py rename to apps/aiperf_qual/tests/test_qwen_vl_capacity.py index b9e62ff1ab..cd4b03b60a 100644 --- a/apps/aiperf_qual/tests/families/test_qwen_vl_aiperf_capacity.py +++ b/apps/aiperf_qual/tests/test_qwen_vl_capacity.py @@ -15,7 +15,7 @@ yaml = pytest.importorskip("yaml") -AIPERF = Path(__file__).resolve().parents[2] / "config" / "models" # the profiles' AIPerf settings +AIPERF = Path(__file__).resolve().parents[1] / "config" / "models" # the profiles' AIPerf settings MAX_PIXELS = 200704 # the image budget both sides use (the reference's processor_kwargs) MERGE = 2 ANSWER_TOKENS = 128 # OCRBench's max_new_tokens diff --git a/apps/aiperf_qual/tests/test_request_contract.py b/apps/aiperf_qual/tests/test_request_contract.py index 099f20f5b1..b9a4c9b946 100644 --- a/apps/aiperf_qual/tests/test_request_contract.py +++ b/apps/aiperf_qual/tests/test_request_contract.py @@ -18,21 +18,50 @@ def test_image_video_controls_must_be_present_but_do_not_apply_to_text_or_speech assert unstated_defaults({"text": "hello"}, "generate_audio") == [] -def test_all_configured_image_profiles_resolve_complete_catalog_requests(): +def test_configured_image_profiles_state_every_control_and_new_ones_are_left_out(): + """An image profile with a configuration of its own states every control the pipeline would otherwise choose. + A catalog profile without one that leaves a control unstated is left out with the controls it leaves, so a + family adding an image profile does not configure its qualification.""" + from trtmc_benchmark.types import BenchmarkError from trtmc_perf_serving.profiles import resolve_profile + from trtmc_aiperf_qual.config import CONFIG_ROOT + from trtmc_aiperf_qual.selection import EXCLUSIONS_SOURCE, MODELS_SOURCE, TASKS_SOURCE, catalog + root = Path(__file__).resolve().parents[3] environment = Environment({"repo": str(root), "bundle_root": "/tmp/bundles"}) + selection = {profile.name: profile for profile in catalog(root)} profiles = [entry.name for entry in catalog_profiles(root) if entry.operation == "generate_image"] assert profiles - failures = [] for profile in profiles: model = resolve_model(profile, environment) - resolved = resolve_profile(profile, manifest_root=root / "families") - request = {**resolved.base_request, **model.get("catalog_request", {})} - if missing := unstated_defaults(request, model["operation"]): - failures.append((profile, missing)) - assert not failures + try: + resolved = resolve_profile(profile, manifest_root=root / "families") + except BenchmarkError: # no catalog request (svd-xt: no prompt): kept, its run reports what it finds + assert selection[profile].source != MODELS_SOURCE, profile + continue + missing = unstated_defaults({**resolved.base_request, **model.get("catalog_request", {})}, model["operation"]) + assert not (missing and (CONFIG_ROOT / "models" / f"{profile}.yaml").is_file()), (profile, missing) + if selection[profile].source not in (TASKS_SOURCE, EXCLUSIONS_SOURCE): # left out earlier for another reason + assert (selection[profile].source == MODELS_SOURCE) == bool(missing), profile + assert not missing or ", ".join(missing) in selection[profile].excluded + + +def test_a_configured_image_profile_that_stops_stating_a_control_is_left_out(tmp_path): + import shutil + + from trtmc_aiperf_qual.config import CONFIG_ROOT + from trtmc_aiperf_qual.selection import MODELS_SOURCE, catalog + + root = Path(__file__).resolve().parents[3] + config = tmp_path / "config" + shutil.copytree(CONFIG_ROOT, config) + flux = config / "models/flux-schnell.yaml" + flux.write_text("".join(line for line in flux.read_text().splitlines(True) if not line.startswith("request:"))) + before, after = ({profile.name: profile for profile in catalog(root, path)}["flux-schnell"] + for path in (CONFIG_ROOT, config)) + assert before.excluded is None + assert after.source == MODELS_SOURCE and "guidance_scale" in after.excluded def test_newly_covered_task_profiles_resolve_their_benchmarks(): diff --git a/apps/aiperf_qual/trtmc_aiperf_qual/models.py b/apps/aiperf_qual/trtmc_aiperf_qual/models.py index 9432f9ab06..49bbe2d4bb 100644 --- a/apps/aiperf_qual/trtmc_aiperf_qual/models.py +++ b/apps/aiperf_qual/trtmc_aiperf_qual/models.py @@ -213,10 +213,7 @@ def resolve_model(profile: str, environment: Environment, root: Path = CONFIG_RO entries = {entry.name: entry for entry in catalog_profiles(repository)} if profile not in entries: raise ConfigError(f"{profile} is not a ready catalog profile") - _import_repository(repository) - from trtmc_benchmark.catalog import ManifestCatalog - - catalog_model = ManifestCatalog(repository / "families").resolve(profile) + catalog_model = entries[profile].model # what ManifestCatalog.resolve returns, without reading every manifest again manifest = json.loads(Path(catalog_model.manifest_path).read_text()) tasks = yaml.safe_load((root / "tasks.yaml").read_text()) if catalog_model.task not in tasks["tasks"]: diff --git a/apps/aiperf_qual/trtmc_aiperf_qual/selection.py b/apps/aiperf_qual/trtmc_aiperf_qual/selection.py index 295ccb745b..f15f3061ea 100644 --- a/apps/aiperf_qual/trtmc_aiperf_qual/selection.py +++ b/apps/aiperf_qual/trtmc_aiperf_qual/selection.py @@ -8,7 +8,9 @@ 1. ``config/tasks.yaml``: the profile's Task has no defaults, so the qualification cannot qualify it. 2. ``config/exclusions.yaml``: no machine runs it (a native reference that cannot serve the profile as cataloged, a test model). -3. The machine's ``models`` (its environment file): ``include`` and ``exclude``, then its platform's exclusions +3. ``config/models``: an image-generation profile whose catalog request leaves a size, step or guidance control to + the pipeline's default, which each side would choose for itself; its ``request`` must state the control. +4. The machine's ``models`` (its environment file): ``include`` and ``exclude``, then its platform's exclusions (``config/platforms/.yaml``), then ``max_checkpoint_gib``: models: @@ -31,11 +33,12 @@ import yaml -from .config import CONFIG_ROOT, EXCLUSIONS, ConfigError, exclusions +from .config import CONFIG_ROOT, EXCLUSIONS, ConfigError, Environment, exclusions KEYS = {"include", "exclude", "max_checkpoint_gib"} TASKS_SOURCE = "config/tasks.yaml" EXCLUSIONS_SOURCE = f"config/{EXCLUSIONS}" +MODELS_SOURCE = "config/models" MACHINE_SOURCE = "environment" @@ -45,7 +48,7 @@ class Profile: task: str checkpoint: str revision: str | None - excluded: str | None = None # why no machine runs it (config/tasks.yaml or config/exclusions.yaml) + excluded: str | None = None # why no machine runs it (config/tasks.yaml, config/exclusions.yaml or config/models) source: str | None = None # the file of that reason @@ -53,25 +56,44 @@ def catalog(repository: Path, root: Path = CONFIG_ROOT) -> list[Profile]: """Ready catalog profiles (the qualification scope) with their Task, checkpoint, and why no machine runs one.""" from .models import catalog_profiles - from trtmc_benchmark.catalog import ManifestCatalog - tasks = yaml.safe_load((root / "tasks.yaml").read_text())["tasks"] rules = exclusions(root) - resolver = ManifestCatalog(repository / "families") profiles = [] for entry in catalog_profiles(repository): - model = resolver.resolve(entry.name) + model = entry.model # what ManifestCatalog.resolve returns, without reading every manifest again reason, source = None, None + rule = next((rule for rule in rules if fnmatch.fnmatchcase(entry.name, rule["profile"])), None) if model.task not in tasks: reason, source = f"no Task defaults for {model.task!r}", TASKS_SOURCE - else: - rule = next((rule for rule in rules if fnmatch.fnmatchcase(entry.name, rule["profile"])), None) - if rule: - reason, source = rule["reason"], EXCLUSIONS_SOURCE + elif rule: + reason, source = rule["reason"], EXCLUSIONS_SOURCE + elif entry.operation == "generate_image" and (missing := _unstated_image_controls(entry, repository, root)): + reason, source = (f"its catalog request leaves {', '.join(missing)} to the pipeline's default; its " + "configuration's request states none of them"), MODELS_SOURCE profiles.append(Profile(entry.name, model.task, model.hf_id, model.hf_revision or None, reason, source)) return profiles +def _unstated_image_controls(entry: Any, repository: Path, root: Path) -> list[str]: + """The image controls the profile's catalog request, with its ``config/models`` ``request``, leaves unstated. + + A profile whose configuration or catalog request cannot resolve is kept: its run reports what it finds (its + suites may not use the catalog request, as an image-to-video profile without a prompt).""" + from trtmc_benchmark.catalog import resolve_case + from trtmc_benchmark.types import BenchmarkError + + from .models import resolve_model + from .suites import unstated_defaults + + try: + model = resolve_model(entry.name, Environment({"repo": str(repository)}), root) + request = {**dict(resolve_case(entry.model, Path(f"{entry.name}.bundle")).request), + **model.get("catalog_request", {})} + except (BenchmarkError, ConfigError): + return [] + return unstated_defaults(request, model["operation"]) + + def checkpoint_gib(profile: Profile) -> float | None: """Checkpoint weight size: the cached safetensors index, else the Hub's file sizes (None if unknown).""" from .models import checkpoint_bytes diff --git a/tools/ci/quality.py b/tools/ci/quality.py index 3f222dd3ed..b918073b97 100644 --- a/tools/ci/quality.py +++ b/tools/ci/quality.py @@ -179,8 +179,6 @@ def premerge(self) -> None: "test_voicechat_full_duplex_source.py" ), "tools/tests", - # Each family's AIPerf qualification settings, checked where they live (apps/aiperf_qual/config). - "apps/aiperf_qual/tests/families", *( str(path.relative_to(self.context.repository)) for path in sorted(self.context.repository.glob("families/*/tests/test_support.py")) diff --git a/tools/test_impact.py b/tools/test_impact.py index 60fe424d01..3bbc5c5506 100644 --- a/tools/test_impact.py +++ b/tools/test_impact.py @@ -35,6 +35,17 @@ "third_party/", "tools/", ) +# Applications that no family, core code or other application depends on (validate() enforces it). A change +# confined to one selects no family E2E: the Community CPU unit stage runs the application's own tests. +ISOLATED_APPS = ("apps/aiperf_qual",) +# Roots whose files family E2E builds, imports or reads, and the text files there that can name an application. +DEPENDENT_ROOTS = ("families", "core", "apps") +DEPENDENT_SUFFIXES = frozenset( + { + ".c", ".cc", ".cfg", ".cmake", ".cpp", ".cu", ".cuh", ".h", ".hpp", ".ini", ".json", ".py", + ".sh", ".toml", ".txt", ".yaml", ".yml", + } +) SHARED_FILES = { ".clang-format", ".coderabbit.yaml", @@ -89,12 +100,16 @@ def classify(repo: Path, files: Sequence[str]) -> Impact: selected: set[str] = set() shared = False docs = False + application = False unknown: list[str] = [] for path in changed: if path == "families/__init__.py": shared = True continue + if any(path.startswith(f"{app}/") for app in ISOLATED_APPS): + application = True + continue parts = PurePosixPath(path).parts if len(parts) >= 2 and parts[0] == "families": family = parts[1] @@ -128,7 +143,7 @@ def classify(repo: Path, files: Sequence[str]) -> Impact: return Impact("all", tuple(sorted(known)), direct_families, changed, True, docs) if selected: return Impact("families", direct_families, direct_families, changed, True, docs) - return Impact("docs" if docs else "none", (), (), changed, False, docs) + return Impact("docs" if docs else "none", (), (), changed, application, docs) def changed_files(repo: Path, base: str, head: str) -> list[str]: @@ -149,8 +164,23 @@ def changed_files(repo: Path, base: str, head: str) -> list[str]: return [line for line in output.splitlines() if line] +def _isolated_app_dependents(repo: Path) -> list[str]: + """Files that name an isolated application (its directory or `trtmc_` package) outside it.""" + names = {app: PurePosixPath(app).name.encode() for app in ISOLATED_APPS} + violations = [] + for root in DEPENDENT_ROOTS: + for path in sorted((repo / root).rglob("*")): + relative = path.relative_to(repo).as_posix() + if path.suffix not in DEPENDENT_SUFFIXES or "__pycache__" in path.parts or not path.is_file(): + continue + others = [app for app in ISOLATED_APPS if not relative.startswith(f"{app}/")] + source = path.read_bytes() if others else b"" + violations.extend(f"{relative} depends on isolated {app}" for app in others if names[app] in source) + return violations + + def validate(repo: Path) -> None: - violations: list[str] = [] + violations: list[str] = _isolated_app_dependents(repo) if any(path.is_file() for path in (repo / "tests/cpp/models").glob("**/*")): violations.append("central tests/cpp/models is forbidden") family_names = set(inventory(repo)) diff --git a/tools/tests/test_community_ci.py b/tools/tests/test_community_ci.py index bbdc96b700..2d155a7a18 100644 --- a/tools/tests/test_community_ci.py +++ b/tools/tests/test_community_ci.py @@ -209,7 +209,7 @@ def test_public_workflow_is_one_exact_merge_cpu_then_gpu_authorization(): authorization = jobs["authorize"]["steps"][0]["run"] assert 'stable) test "$CI_REF" = refs/heads/main' in authorization assert "Unknown Community CI lane" in authorization - for name in ("source-quality", "docs", "ownership-impact", "unit"): + for name in ("source-quality", "docs", "ownership-impact", "unit", "aiperf-qual"): job = jobs[name] assert job["needs"] == "authorize" assert job["runs-on"] == "ubuntu-24.04" @@ -233,6 +233,7 @@ def test_public_workflow_is_one_exact_merge_cpu_then_gpu_authorization(): "docs", "ownership-impact", "unit", + "aiperf-qual", ] assert jobs["gpu-authorize"]["needs"] == ["authorize", "required"] assert "needs.required.result == 'success'" in jobs["gpu-authorize"]["if"] @@ -254,6 +255,15 @@ def test_public_workflow_is_one_exact_merge_cpu_then_gpu_authorization(): assert docs["Install website dependencies"]["run"] == "npm ci" assert docs["Test generated model support inventory"]["run"] == "npm run test:model-support" assert docs["Build production documentation"]["run"] == "npm run build" + aiperf = {step["name"]: step for step in jobs["aiperf-qual"]["steps"]} + assert all("if" not in step for step in aiperf.values()) + install = aiperf["Install the application and its AIPerf plugins"]["run"] + assert "--requirement apps/aiperf_qual/requirements.txt" in install + assert "grep -x 'pytest==.*' requirements/community-ci.txt" in install + assert "--no-deps apps/aiperf_qual/plugins" in install + test = aiperf["Test the application"] + assert test["run"].startswith("python -m pytest apps/aiperf_qual/tests ") + assert test["env"]["CUDA_VISIBLE_DEVICES"] == "" and test["env"]["HF_HUB_OFFLINE"] == "1" @pytest.mark.parametrize("event_head", ["", "a" * 40]) @@ -308,13 +318,15 @@ def test_community_authorize_pins_the_exact_merge_and_uses_its_base_parent(tmp_p @pytest.mark.parametrize( - ("source_quality", "docs", "ownership_impact", "unit", "expected_returncode"), + ("source_quality", "docs", "ownership_impact", "unit", "aiperf_qual", "expected_returncode"), [ - ("success", "success", "success", "success", 0), - ("failure", "success", "success", "success", 1), - ("success", "failure", "success", "success", 1), - ("success", "skipped", "success", "success", 1), - ("success", "success", "failure", "failure", 1), + ("success", "success", "success", "success", "success", 0), + ("failure", "success", "success", "success", "success", 1), + ("success", "failure", "success", "success", "success", 1), + ("success", "skipped", "success", "success", "success", 1), + ("success", "success", "failure", "failure", "success", 1), + ("success", "success", "success", "success", "failure", 1), + ("success", "success", "success", "success", "skipped", 1), ], ) def test_public_required_job_fails_closed( @@ -322,6 +334,7 @@ def test_public_required_job_fails_closed( docs: str, ownership_impact: str, unit: str, + aiperf_qual: str, expected_returncode: int, ) -> None: environment = { @@ -330,6 +343,7 @@ def test_public_required_job_fails_closed( "DOCS_RESULT": docs, "OWNERSHIP_IMPACT_RESULT": ownership_impact, "UNIT_RESULT": unit, + "AIPERF_QUAL_RESULT": aiperf_qual, } result = subprocess.run( [ @@ -353,6 +367,7 @@ def test_public_required_job_fails_closed( assert f"Docs: {docs}" in result.stdout assert f"Ownership and impact: {ownership_impact}" in result.stdout assert f"Unit / C++ and Python: {unit}" in result.stdout + assert f"AIPerf qualification: {aiperf_qual}" in result.stdout @pytest.mark.parametrize( diff --git a/tools/tests/test_family_impact.py b/tools/tests/test_family_impact.py index b5bd563c26..a62a91f7ef 100644 --- a/tools/tests/test_family_impact.py +++ b/tools/tests/test_family_impact.py @@ -162,6 +162,48 @@ def test_validation_rejects_aiperf_settings_in_a_family(tmp_path: Path) -> None: test_impact.validate(repo) +def test_isolated_application_selects_no_family(tmp_path: Path) -> None: + repo = _repo(tmp_path) + impact = test_impact.classify( + repo, + ["apps/aiperf_qual/config/models/alpha.yaml", "apps/aiperf_qual/trtmc_aiperf_qual/models.py"], + ) + assert impact.scope == "none" + assert impact.families == () + assert impact.run_core_tests is True + + with_family = test_impact.classify(repo, ["apps/aiperf_qual/README.md", "families/alpha/model.py"]) + assert with_family.scope == "families" + assert with_family.families == ("alpha",) + # A sibling application stays shared: family references and examples may import it. + assert test_impact.classify(repo, ["apps/aiperf_qual/README.md", "apps/benchmark/x.py"]).scope == "all" + + +@pytest.mark.parametrize( + "path, source", + [ + ("families/alpha/tests/test_alpha.py", "from trtmc_aiperf_qual.models import resolve_model\n"), + ("families/alpha/reference/inputs.py", "CONFIG = 'apps/aiperf_qual/config/models/alpha.yaml'\n"), + ("core/builder/helper.py", "import trtmc_aiperf_qual\n"), + ("apps/benchmark/runner.py", "import trtmc_aiperf_qual\n"), + ], +) +def test_validation_rejects_dependents_of_an_isolated_application( + tmp_path: Path, path: str, source: str +) -> None: + repo = _repo(tmp_path) + app = repo / "apps/aiperf_qual/trtmc_aiperf_qual/models.py" + app.parent.mkdir(parents=True) + app.write_text("from trtmc_aiperf_qual.config import CONFIG_ROOT\n") + dependent = repo / path + dependent.parent.mkdir(parents=True, exist_ok=True) + dependent.write_text("VALUE = 1\n") + test_impact.validate(repo) + dependent.write_text(source) + with pytest.raises(ValueError, match=f"{path} depends on isolated apps/aiperf_qual"): + test_impact.validate(repo) + + def test_validation_rejects_central_model_cpp_tests(tmp_path: Path) -> None: repo = _repo(tmp_path) source = repo / "tests/cpp/models/test_alpha.cpp" diff --git a/tools/tests/test_new_ci.py b/tools/tests/test_new_ci.py index f751019074..328f4e8151 100644 --- a/tools/tests/test_new_ci.py +++ b/tools/tests/test_new_ci.py @@ -1134,14 +1134,13 @@ def test_gpu_free_unit_scope_keeps_family_python_in_physical_jobs(tmp_path: Path python_command = context.calls[2][0] assert python_command[:3] == ["python", "-m", "pytest"] - assert python_command[3:10] == [ + assert python_command[3:9] == [ "core/builder/tests", "apps/benchmark/trtmc_benchmark/tests", "examples/audio_streaming/test_audio_streaming.py", "examples/models/cosmos3/dual_spark/test_cosmos3_dual_spark_source.py", ("examples/models/nemotron_voicechat/full_duplex/test_voicechat_full_duplex_source.py"), "tools/tests", - "apps/aiperf_qual/tests/families", ] assert "families" not in python_command @@ -1192,7 +1191,7 @@ def test_premerge_adds_physical_family_support_tests_without_expanding_runtime_s python_commands = [command for command, _ in context.calls if command[:3] == ["python", "-m", "pytest"]] assert len(python_commands) == 1 command = python_commands[0] - assert command[10:12] == sorted(support_paths) + assert command[9:11] == sorted(support_paths) assert all(name not in command for name in excluded_paths) assert "families/empty/tests/test_support.py" not in command assert "families" not in command @@ -1204,7 +1203,7 @@ def test_premerge_adds_physical_family_support_tests_without_expanding_runtime_s runner.premerge() python_commands = [command for command, _ in context.calls if command[:3] == ["python", "-m", "pytest"]] assert len(python_commands) == 2 # Still exactly one pytest invocation per premerge. - assert python_commands[1][10:13] == sorted([*support_paths, str(new_path.relative_to(tmp_path))]) + assert python_commands[1][9:12] == sorted([*support_paths, str(new_path.relative_to(tmp_path))]) assert python_commands[1][python_commands[1].index("-m", 3) + 1] == "not gpu and not trt" diff --git a/website/docs/architecture/validation-design.md b/website/docs/architecture/validation-design.md index fe454b07ea..efa2c940da 100644 --- a/website/docs/architecture/validation-design.md +++ b/website/docs/architecture/validation-design.md @@ -31,6 +31,10 @@ family's owner-selected cases; nightly runs the complete declared inventory. checkpoint evidence without importing unrelated families. - Package validation finds every family dependency file and DSO while avoiding unselected family imports. +- A change confined to `apps/aiperf_qual` selects no family E2E, because no + family, core code, or other application depends on it. + `tools/test_impact.py --validate` rejects any file under `families/`, `core/`, + or another application that names it. ## Local checks diff --git a/website/docs/extend/add-model-family.md b/website/docs/extend/add-model-family.md index 9ce2e10519..971011a6e6 100644 --- a/website/docs/extend/add-model-family.md +++ b/website/docs/extend/add-model-family.md @@ -207,8 +207,8 @@ of public APIs; neither a family nor core may import their implementation. ## Reproduce the pre-merge gates before you push -`.github/workflows/community-ci.yml` runs four jobs on every pull request, and -`Community CPU / Required` fails unless all four pass. Each has a local +`.github/workflows/community-ci.yml` runs five jobs on every pull request, and +`Community CPU / Required` fails unless all five pass. Each has a local equivalent, so a failure does not have to cost a push and a CI round trip. The gates shell out to `lizard`, `ruff` and `clang-format` by name, and one @@ -230,6 +230,7 @@ from (`upstream/main` or `github/main`): | `Community CPU / Ownership and impact` | `python3 -m tools.community_ci impact --base ` | ownership resolution and the CPU test scope your change selects | | `Community CPU / Unit / C++ and Python` | `python3 -m tools.community_ci unit` | compiles the C++ and runs the source-only C++ and Python unit tests in the CI container | | `Community CPU / Docs` | `cd website && npm ci && npm run test:model-support && npm run build` | the generated model support inventory and the production documentation build | +| `Community CPU / AIPerf qualification` | in a separate virtual environment, `pip install -r apps/aiperf_qual/requirements.txt pytest`, `pip install --no-deps apps/aiperf_qual/plugins`, then `CUDA_VISIBLE_DEVICES= HF_HUB_OFFLINE=1 PYTHONPATH=apps/aiperf_qual:apps/aiperf_qual/plugins:core/builder:apps/benchmark:. python -m pytest apps/aiperf_qual/tests -m "not gpu and not trt"` | the AIPerf qualification application against the catalog. A new profile the application cannot qualify yet is left out with its reason; it does not fail this job | `unit` is the one that needs more than the virtual environment. It builds and runs the CI container, so it needs a working Docker daemon, and two