Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions .github/actions/detect-changes/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,21 @@ outputs:
flm-dev-kit/ paths never select product suites: a change only there
gives run "false" (see devkit-overlay for the packages it may build).
value: ${{ steps.changes.outputs.devkit }}
devkit-catalog:
description: >
"true" when a file the dev-kit catalog check reads changed (what src/
ships: src/model_list.json, src/xclbins/, src/lib/; and the dev kit's
engines.json, kernel_assignment.json/.md and build_units.json), or the
changed files are unknown: devkit-static runs, as it does for devkit,
and nothing else.
value: ${{ steps.changes.outputs.devkit_catalog }}
devkit-areas:
description: >
Comma-separated dev-kit areas the change touches: xclbin, dll,
converter, pybind, launchlib, including the areas that build from a
changed file of another area. Empty when devkit is "false".
changed file of another area, and xclbin for a shipped kernel
(src/xclbins/<folder>/<slot>.xclbin, rebuilt to compare). Empty when
devkit is "false".
value: ${{ steps.changes.outputs.devkit_areas }}
devkit-families:
description: >
Expand All @@ -76,7 +86,8 @@ outputs:
devkit-overlay:
description: >
"true" when the dev-kit overlay tests run: the change touches a dev-kit
engine's families or selects the xclbin area. A pull request then
engine's families or selects the xclbin area (other than through
shipped kernels alone, which are only compared). A pull request then
builds the portable packages they start from even when run is "false"
(suites is then "none", so no product test runs).
value: ${{ steps.changes.outputs.devkit_overlay }}
Expand Down
58 changes: 53 additions & 5 deletions .github/script/ci/changes.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,22 @@
aie-build:<toolchain hash>, built in the run when it is not
published, so a pull request that also changes a kernel builds
it with its own toolchain.lock and Dockerfile
devkit_catalog
true when a file the dev-kit catalog check (devkit_check.py's
catalog rules: what src/ ships against the dev kit's JSON)
reads changed: src/model_list.json, src/xclbins/, src/lib/,
flm-dev-kit/FLM_DLL/engines.json or FLM_Xclbin/
kernel_assignment.{json,md} or build_units.json, or the changed
files are unknown. Runs devkit-static (as devkit does) and
nothing else: no product suite, dev-kit build or overlay
devkit_areas
comma-separated dev-kit areas the change touches, from xclbin,
dll, converter, pybind and launchlib, plus the areas that build
from a changed file of another area, of src/lib/xrt or of
hrx-integration/; every
area when the changed files are unknown, a changed dev-kit file
hrx-integration/, and xclbin for a shipped kernel
(src/xclbins/<folder>/<slot>.xclbin), which devkit-xclbins
rebuilds from its sources to compare (devkit_xclbin_plan.py);
every area when the changed files are unknown, a changed dev-kit file
is in none of them, or the dev-kit CI changed
devkit_families
comma-separated catalog families whose dev-kit engines the change
Expand All @@ -86,7 +96,9 @@
devkit_overlay
true when the dev-kit overlay tests run (build-and-test.yml
test-*-devkit): the dll area with devkit_families, or the xclbin
area (the kernel build names the models it rebuilt). On a pull
area (the kernel build names the models it rebuilt), unless only
shipped kernels selected it: the product suites test those,
and the rebuild is only compared with them. On a pull
request the portable packages the overlay starts from (Linux
XRT and HRX, Windows XRT and HRX) are then built even when
run_tests is false, which then gives suites "none", so no
Expand Down Expand Up @@ -207,6 +219,19 @@
(re.compile(r"^\.github/windows-deps/"), {"dll"}),
)

# The files devkit_check.py's catalog rules read: what the product ships
# (src/model_list.json, src/xclbins, src/lib) and the dev-kit JSON describing
# where it comes from. A change to one runs devkit-static (devkit_catalog)
# without selecting a dev-kit area, so no dev-kit build or overlay starts.
DEVKIT_CATALOG = re.compile(
r"^(src/model_list\.json$|src/xclbins/|src/lib/|flm-dev-kit/FLM_DLL/engines\.json$"
r"|flm-dev-kit/FLM_Xclbin/(kernel_assignment\.(json|md)|build_units\.json)$)")
# A shipped kernel: devkit-xclbins rebuilds the artifact kernel_assignment.json
# maps to its slot and compares the two (report only). It selects the xclbin
# area, but no overlay: the product suites test the shipped file, and the
# rebuild comes from sources this change did not touch.
SHIPPED_KERNEL = re.compile(r"^src/xclbins/.+/[^/]+\.xclbin$")

# The kernel build image: its Dockerfile, kernel check script and pinned PDIs
# (docker/aie-build*), its versions (toolchain.lock, which would otherwise be
# in the xclbin area) and the workflow that builds it. Each selects the
Expand Down Expand Up @@ -597,6 +622,10 @@ class Decision:
bench_source: Optional[str] = None
# Changed bench CI files (BENCH_CI), which Build and Test leaves alone.
bench_ci: list = field(default_factory=list)
# A file the dev-kit catalog check reads changed (DEVKIT_CATALOG).
devkit_catalog: bool = False
# Only shipped kernels (SHIPPED_KERNEL) selected the xclbin area.
xclbin_compare_only: bool = False
reasons: list = field(default_factory=list)

def all_suites(self, path: str, why: str = "") -> None:
Expand Down Expand Up @@ -638,7 +667,8 @@ def devkit_overlay(self) -> bool:
and then every overlay job skips (summary does not hold the missing
approval against it). Narrowing it would mean running the kernel
plan (devkit_xclbin_plan.py) here."""
return bool(self.devkit_families and "dll" in self.devkit_areas) or "xclbin" in self.devkit_areas
return (bool(self.devkit_families and "dll" in self.devkit_areas)
or ("xclbin" in self.devkit_areas and not self.xclbin_compare_only))

def bench(self) -> bool:
"""Whether the dev-kit benches (devkit-bench.yml) run: engine or kernel
Expand All @@ -651,10 +681,14 @@ def summary(self) -> str:
devkit = f"; dev kit: {self.devkit_value().replace(',', ', ')}" if self.devkit_areas else ""
if self.devkit_families:
devkit += f" (engine families: {len(self.devkit_families)})"
if self.xclbin_compare_only:
devkit += " (shipped kernels rebuilt to compare)"
if self.devkit_overlay():
devkit += "; dev-kit overlay tests run"
if self.bench():
devkit += "; dev-kit benches run"
if self.devkit_catalog and not self.devkit_areas:
devkit += "; dev-kit catalog check runs"
if not self.run_tests:
if self.devkit_areas:
what = ("product NPU tests skipped, portable packages built for the overlay"
Expand All @@ -664,7 +698,7 @@ def summary(self) -> str:
return "kernel build image only (devkit-aie-image.yml): NPU tests and dev-kit jobs skipped"
if self.bench_ci:
return "bench CI only (devkit-bench.yml): NPU tests and dev-kit jobs skipped"
return "documentation only: NPU tests skipped"
return "documentation only: NPU tests skipped" + devkit
return self._product_summary() + devkit

def _product_summary(self) -> str:
Expand Down Expand Up @@ -700,6 +734,7 @@ def outputs(self) -> dict[str, str]:
"new_models": ",".join(self.new_models),
"hipep_models": ",".join(sorted(self.gpu_models)),
"devkit": str(bool(self.devkit_areas)).lower(),
"devkit_catalog": str(self.devkit_catalog).lower(),
"devkit_areas": self.devkit_value(),
"devkit_families": ",".join(sorted(self.devkit_families)),
"devkit_overlay": str(self.devkit_overlay()).lower(),
Expand Down Expand Up @@ -1012,6 +1047,7 @@ def decide(files: Optional[list[str]], git: Optional[Git] = None,
devkit_engines = load_devkit_engines()
if files is None:
d.asr_full = True
d.devkit_catalog = True
d.devkit_areas = set(ALL_DEVKIT_AREAS)
d.devkit_families = every_engine_family(devkit_engines)
d.bench_source = "changed files unknown"
Expand All @@ -1025,6 +1061,12 @@ def decide(files: Optional[list[str]], git: Optional[Git] = None,
d.reasons.append("no changed files: running the tests anyway; no dev-kit benches")
return d

catalog = [f for f in files if DEVKIT_CATALOG.match(f)]
if catalog:
d.devkit_catalog = True
d.reasons.append(f"{catalog[0]}{f' and {len(catalog) - 1} more' if len(catalog) > 1 else ''}: "
"read by the dev-kit catalog check (devkit-static)")

bench_ci = [f for f in files if BENCH_CI.match(f)]
if bench_ci:
d.bench_ci = bench_ci
Expand Down Expand Up @@ -1102,6 +1144,12 @@ def decide(files: Optional[list[str]], git: Optional[Git] = None,
if new:
d.reasons.append(f"{path}: linked by the dev kit -> {', '.join(sorted(new))}")
break
shipped = [f for f in code if SHIPPED_KERNEL.match(f)]
if shipped and "xclbin" not in d.devkit_areas:
d.devkit_areas.add("xclbin")
d.xclbin_compare_only = True
d.reasons.append(f"{shipped[0]}{f' and {len(shipped) - 1} more' if len(shipped) > 1 else ''}: "
"shipped kernel(s) -> xclbin, rebuilt from the dev kit to compare (no overlay)")

head_catalog = load_catalog(head_catalog_text)
gpu_fams = gpu_families(head_catalog)
Expand Down
Loading
Loading