Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
0c31b5a
hkp: packaging probes stream A+B
BrianHarrisonAMD Oct 4, 2026
e595934
hkp: packaging probes stream C
BrianHarrisonAMD Oct 4, 2026
b3c5571
Merge branch 'users/bharriso/hkp-packaging-probes-WIP-2' into users/b…
BrianHarrisonAMD Oct 4, 2026
3bfe751
hkp: probe derivation status line
BrianHarrisonAMD Oct 4, 2026
4a28217
ci: hipdnn packaging probe Linux job, junit check, probe docs and run…
BrianHarrisonAMD Oct 4, 2026
8044b32
ci: hipdnn packaging probe Windows job
BrianHarrisonAMD Oct 4, 2026
1e76458
hkp probes: README claims match measured evidence
BrianHarrisonAMD Oct 4, 2026
a291859
hkp probes: include the probe module only inside the option-guarded hook
BrianHarrisonAMD Oct 4, 2026
de8e7fa
hkp probes: README states the OFF-mode delta accurately
BrianHarrisonAMD Oct 4, 2026
572dfc8
ci: run the packaging probes inside the existing superbuild lanes
BrianHarrisonAMD Oct 4, 2026
8a6f258
ci: correct the packaging-probe step comment (pack targets are part o…
BrianHarrisonAMD Oct 5, 2026
0482449
hkp probes: producer-generic probe site, one hkp_add_packaging_probe(…
BrianHarrisonAMD Oct 5, 2026
f689e41
Merge remote-tracking branch 'origin/develop' into users/bharriso/hkp…
BrianHarrisonAMD Oct 5, 2026
ef392f9
hkp probes: one kind registry shared by derive and assert; add hsaco
BrianHarrisonAMD Oct 5, 2026
023c8af
hkp probes: docs state which kinds cannot be probed; drop stale counts
BrianHarrisonAMD Oct 5, 2026
66cd576
hkp probes: registry output type (kpack | passthrough); probe embedde…
BrianHarrisonAMD Oct 5, 2026
1e40939
hkp probes: docs list embedded_source in derive; state hkp-probe-tool…
BrianHarrisonAMD Oct 5, 2026
d951d4f
feat(hipdnn): generic GPU target table and tier algebra
BrianHarrisonAMD Oct 5, 2026
2b8afd4
fix(hipdnn): keep generic target headers clang-tidy clean
BrianHarrisonAMD Oct 5, 2026
f039599
hkp probes: author-selected UKDS, single CI run, review fixes
BrianHarrisonAMD Oct 5, 2026
15f0d90
hkp probes: address second review sweep
BrianHarrisonAMD Oct 5, 2026
ef126b6
feat(hipdnn): load-time generic target tiers in the ingestor and kpac…
BrianHarrisonAMD Oct 5, 2026
b98800b
feat(hkp): pack generic targets and copy them into each member folder
BrianHarrisonAMD Oct 5, 2026
15b4b58
feat(hipdnn): generic target tiers in IngestorGenerator and verifier …
BrianHarrisonAMD Oct 5, 2026
69a1fa0
docs(hkp): note the per-member generic copy limitation
BrianHarrisonAMD Oct 5, 2026
db46405
fix(hipdnn): address final review of generic target support
BrianHarrisonAMD Oct 6, 2026
7e5edef
docs(ingestor-generator): state what the generator emits and the rocK…
BrianHarrisonAMD Oct 6, 2026
b318c0a
docs: describe generic target arch rules in words, not plan labels
BrianHarrisonAMD Oct 6, 2026
36a8171
hipdnn: drop validator rejection tests for the generic target table
BrianHarrisonAMD Oct 6, 2026
afa0c11
hipdnn: one entryTier for generic arch matching, loader strictness R1…
BrianHarrisonAMD Oct 7, 2026
1acbb24
ingestor-generator: arch rules R1-R4/R6, literal tier tables, drop ve…
BrianHarrisonAMD Oct 7, 2026
00fb475
Merge branch 'users/bharriso/generic-target-matching-R3' into users/b…
BrianHarrisonAMD Oct 7, 2026
c35a52f
hipdnn: superbuild-only validator mutation tests for the generic targ…
BrianHarrisonAMD Oct 7, 2026
794ac45
Merge branch 'users/bharriso/generic-target-matching-R1' into users/b…
BrianHarrisonAMD Oct 7, 2026
75a3e3e
hkp: generic archive production test, packer test consolidation, lite…
BrianHarrisonAMD Oct 7, 2026
9263270
Merge branch 'users/bharriso/generic-target-matching-R2' into users/b…
BrianHarrisonAMD Oct 7, 2026
b2ab8ea
hipdnn: build arch violation messages without string-concatenation ch…
BrianHarrisonAMD Oct 7, 2026
4b7c413
docs: one home for generic target and hsaco arch rules
BrianHarrisonAMD Oct 7, 2026
a19f984
hipdnn: satisfy clang-tidy in generic arch tests
BrianHarrisonAMD Oct 7, 2026
4ea6d0d
hkp: make the arch probe path visible to sibling directory scopes; re…
BrianHarrisonAMD Oct 7, 2026
49ce9d4
generic targets: condense source comments, state hsaco intent once
BrianHarrisonAMD Oct 7, 2026
f8415a1
generic targets: drop redundant and wording-pinning tests, fix README…
BrianHarrisonAMD Oct 7, 2026
2540f00
hkp probes: sweep each spec value, probe every named arch, reuse the …
BrianHarrisonAMD Oct 7, 2026
1779989
generic targets: restore coverage for the no-member generic pass, mix…
BrianHarrisonAMD Oct 7, 2026
1023124
docs: state the arch-tier shadowing rule and its justification once i…
BrianHarrisonAMD Oct 7, 2026
d95bdd9
hkp probes: packer-default pack jobs; probe arches follow the GPU_TAR…
BrianHarrisonAMD Oct 7, 2026
73cf876
hipdnn: qualify the metadata-tuple uniqueness comments and error by a…
BrianHarrisonAMD Oct 7, 2026
cdcd378
Merge hkp-packaging-probes (#13061) into the generic-target branch
BrianHarrisonAMD Oct 7, 2026
9c2434f
hkp probes: comments state that probe packs use the packer's default …
BrianHarrisonAMD Oct 7, 2026
8e08eec
hkp probes: probe generic targets through their first member
BrianHarrisonAMD Oct 7, 2026
1487453
Merge branch 'develop' of https://github.com/ROCm/rocm-libraries into…
BrianHarrisonAMD Oct 7, 2026
dfe2688
hkp: skip packaging probes when rocKE is disabled
BrianHarrisonAMD Oct 7, 2026
462f8ee
hkp: probe the non-rocKE kinds when rocKE is disabled
BrianHarrisonAMD Oct 7, 2026
fa58624
hkp: share one disabled-kind list across pack, wiring and probes
BrianHarrisonAMD Oct 7, 2026
26e3722
hkp: probe tests that pack rocKE live under probes/tests/rocke; skip …
BrianHarrisonAMD Oct 8, 2026
c6dcfa0
hkp: probe arch listing follows what ships; document skip-whole; cove…
BrianHarrisonAMD Oct 8, 2026
d3d31db
Merge hkp-packaging-probes (#13061) c6dcfa0c803 into the generic-targ…
BrianHarrisonAMD Oct 8, 2026
30e4f8e
hkp: packaging probe CI requires at least one probe; omit empty PACK_…
BrianHarrisonAMD Oct 9, 2026
9b34dc8
Merge remote-tracking branch 'origin/develop' into users/bharriso/hkp…
BrianHarrisonAMD Oct 9, 2026
ab19c31
hkp: probe assert reads packed UKD provenance from its sidecar
BrianHarrisonAMD Oct 9, 2026
e4bbdfd
Merge remote-tracking branch 'origin/develop' into users/bharriso/gen…
BrianHarrisonAMD Oct 13, 2026
c5b7d12
Merge remote-tracking branch 'origin/users/bharriso/hkp-packaging-pro…
BrianHarrisonAMD Oct 13, 2026
6f0a20e
Merge remote-tracking branch 'origin/develop' into users/bharriso/hkp…
BrianHarrisonAMD Oct 13, 2026
e87bb32
Merge branch 'users/bharriso/hkp-packaging-probes' into users/bharris…
BrianHarrisonAMD Oct 13, 2026
e19e0b9
Merge remote-tracking branch 'origin/develop' into users/bharriso/gen…
BrianHarrisonAMD Oct 14, 2026
0b81e24
docs(hipdnn): align comments and messages with tiered generic-target …
BrianHarrisonAMD Oct 14, 2026
c5dbd6f
Merge branch 'develop' into users/bharriso/generic-target-matching
BrianHarrisonAMD Oct 15, 2026
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
2 changes: 2 additions & 0 deletions dnn-providers/hip-kernel-provider/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,8 @@ if(NOT TARGET hipdnn_flatbuffers_sdk)
find_package(hipdnn_flatbuffers_sdk CONFIG REQUIRED)
endif()
if(NOT TARGET hipdnn_plugin_sdk)
# Drop a stale cached table path so an older SDK Config cannot be answered by it.
unset(HIPDNN_PLUGIN_SDK_GPU_GENERIC_TARGETS_JSON CACHE)
find_package(hipdnn_plugin_sdk CONFIG REQUIRED)
endif()

Expand Down
85 changes: 71 additions & 14 deletions dnn-providers/hip-kernel-provider/descriptor-packaging/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,42 @@ Build-time UKD/KMD/KDP -> kpack packaging. Provider-internal (`tools/hkp_pack.py
see `python/hkp_pack/` for the pipeline and `examples/descriptors/` for a real,
minimal authored source root.

## Generic GPU targets

`arch` accepts the LLVM generic targets in `projects/hipdnn/plugin_sdk/data/gpu_generic_targets.json`
(for example `gfx11-generic`), read through the required `--generic-targets-json`. Keep
`GPU_TARGETS` concrete. The packer builds each selected generic once and copies its descriptors
and archive (`arch: [<G>]`) into each selected member's folder; no generic-named folder is
installed. Disk use grows with the number of members.

Copies depend only on the source tree, the generic's spelling, hipcc and the table, so they are
identical across member folders and separate per-arch builds, and the loader collapses them to
one entry. Copies from different compilers differ in `provenance`, and the loader drops both.

Kernels sharing a metadata tuple are ranked per device by arch tier; see
[RFC 0017](../../../projects/hipdnn/docs/rfcs/0017_UniversalKernelDescriptor.md#4-resolve-the-kernel-packs-that-name-this-engine-and-apply-the-arch-gate).

Authoring rules. Each violation fails the packer, raises a generator ConfigError, and makes the
loader log an ERROR and drop the pack:

- Every `-generic` name is in the table.
- One `arch` list never holds a generic and one of its members, or two generics sharing a member.
- A UKD names no generic its KDP does not list.
- Under a KDP listing generics, a UKD with its own `arch` lists every KDP generic and only
entries the KDP lists; an inline UKD without `arch` inherits the pack.

Packer only: a standalone UKD with empty `arch` needs an empty-`arch` KDP; shards with intersecting member sets may not write one path with different bytes.
Packer and generator only: `kind: rocke` takes no generic.

### hsaco kernels and `arch`

An `hsaco` kernel's `arch` resolves in order: the kernel's own `arch`, else its pack's. The
result must be non-empty; the generator rejects the kernel otherwise, because an unrestricted
object would ship the same bytes to every shard. The generator writes the resolved list onto the
descriptor, and the packer requires a non-empty `arch` there; it does not inherit, so an inline
hsaco UKD without `arch` is refused even under an arch-scoped KDP. A generic-target object
lists each member or its generic.

## Source roots and what the walk accepts

Each wired root is walked recursively and packs into **its own** `OUT_ROOT`; no two
Expand Down Expand Up @@ -137,10 +173,9 @@ bytes are packed as-is into the arch's kpack, the kernel signature is read from
object's AMDGPU metadata as for a compiled object, and the UKD ships as `kind: kpack`.
The toc key derives from the file's resolved root-relative path, so one file serving
several symbols is one archive entry, and one key claimed by two different files is a
hard error. The packer does not check the object's format or target processor. An
`hsaco` UKD must list the arch(es) its object runs on in `arch` (a generic-target
object lists every arch it runs on); an absent or empty `arch` is rejected. The author's own load test on the target arch
is the only check; no in-tree load test covers `hsaco`. The shipped provenance records
hard error. The packer does not check the object's format or target processor;
`arch` follows [hsaco kernels and `arch`](#hsaco-kernels-and-arch). The author's own load
test on the target arch is the only check; no in-tree load test covers `hsaco`. The shipped provenance records
`origin_kind: "hsaco"`, the root-relative `file`, its `sha256` and the `symbol`, and makes no
toolchain claim. As for `hip`, the specialization contract must declare
`metadata_fields: []`: no compiler ran whose specialization a binding could observe.
Expand Down Expand Up @@ -406,8 +441,8 @@ Every architecture named explicitly under the production root gets an **automati
in every lane that does not build it. At configure, `hkp_load_packaging_probes()` runs
`tools/hkp_probe_derive_root.py --list-arches` on
`HIPKERNELPROVIDER_PRODUCTION_DESCRIPTOR_SOURCE_ROOT`: the union of the explicit `arch`
entries of every KDP and UKD (inline and standalone), read with the packer's own loader.
It subtracts the lane's own architectures (`hkp_selected_arches()`, i.e. `GPU_TARGETS`)
entries of every KDP and UKD (inline and standalone), read with the packer's own loader and
the generic target table, generic names mapped as below. It subtracts the lane's own architectures (`hkp_selected_arches()`, i.e. `GPU_TARGETS`)
and declares `hkp_add_packaging_probe(ARCH <arch>)` for each one left: probe `<arch>`,
ctest entry `hkp-probe-<arch>`, packing the default sample. Configure prints the result:

Expand All @@ -428,13 +463,35 @@ build targets, so each lane's own production pack packs it, and its GPU test lan
on every PR. Only an architecture the lane does not build needs a probe, and only an
explicit `arch` entry can make a descriptor ship there and nowhere else.

**Non-concrete names are skipped.** An explicit `arch` entry that is not a concrete
target, such as a generic target (`gfx9-4-generic`) or a TheRock family name, gets no
automatic probe; configure prints which ones it skipped. No build packs for such a name:
`GPU_TARGETS` drops it, and the packer matches arch names exactly, so it never selects a
family member in its place either. Concrete names with a distinct-target word
(`gfx1250-strict`) are probed like any other arch. The rule is `hkp_is_concrete_arch()`
in `cmake/HkpPackaging.cmake`, the same one `GPU_TARGETS` goes through.
**Generic targets are probed through one member.** A generic target in the generic target
table (`projects/hipdnn/plugin_sdk/data/gpu_generic_targets.json`) that a descriptor names
gets its probe through the first member the table lists for it: `gfx11-generic` through
`gfx1100`, `gfx12-generic` through `gfx1200`. The packer compiles the generic once, for the
generic target, and merges the result into each requested member's folder, so which member
carries the probe only names the folder; the table's order picks it, with no configuration.
The probe for `gfx1100` packs every pass that applies to `gfx1100`, its own and the
generic's: a KDP that ships only for the generic is trimmed like any other, and the
assertion expects its UKDs with `arch: gfx11-generic` and the generic's archive
(`kpack/hip_kernel_provider_gfx11-generic.kpack`) in the `gfx1100` folder.

- A lane that targets any member of the generic gets no probe for it: its production pack
compiles the generic already. Linux (`gfx942`) probes `gfx11-generic` through `gfx1100`;
Windows (`gfx1151`, a member) does not.
- One probe per member arch: a member that is also named explicitly, or chosen for two
generics, is probed once, because `--arches <member>` runs every pass that applies to it.

```
hkp: generic targets probed through their first member: [gfx11-generic -> gfx1100]
hkp: automatic probe arches: [gfx1100, gfx950] (probe arches of the explicit arches under <root>: [gfx1100, gfx950]; build targets: [gfx942])
```

**TheRock family names are skipped; an unlisted generic fails configure.** An explicit `arch`
entry that is a TheRock family name gets no automatic probe; configure prints which ones it
skipped. No build packs for such a name: `GPU_TARGETS` drops it. A `*-generic` entry the table
does not list fails configure with the packer loader's message, since the packer rejects it
too. Concrete names with a distinct-target word (`gfx1250-strict`) are
probed like any other arch. The rule is `hkp_is_concrete_arch()` in
`cmake/HkpPackaging.cmake`, the same one `GPU_TARGETS` goes through.

### How to use

Expand Down Expand Up @@ -737,7 +794,7 @@ test module imports from another. Helpers both sides use live in plain modules:
### Desk-check a variant set (`hkp_pack.desk_check`, `tools/hkp_desk_check.py`)

```
tools/hkp_desk_check.py --mode {full,structural}
tools/hkp_desk_check.py --mode {full,structural} --generic-targets-json J
[--provenance-root P [--descriptor-root R]]
[--kpack-python-dir D] [--field F] [--drift-field F]
<path/to/*.kdp.json>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -491,12 +491,13 @@ function(hkp_wire_pack_target)
--inter-root "${_inter_root}"
--kpack-python-dir "${ARG_ROCM_KPACK_DIR}"
--source-label "${ARG_NAME}"
--generic-targets-json "${HIPDNN_PLUGIN_SDK_GPU_GENERIC_TARGETS_JSON}"
${_producer_arg}
${_exclude_args}
COMMAND "${CMAKE_COMMAND}" -E make_directory "${ARG_OUT_ROOT}"
COMMAND "${CMAKE_COMMAND}" -E touch "${_stamp}"
DEPENDS "${HKP_TOOL}" ${_source_inputs} ${_tool_sources}
"${_input_manifest}"
"${_input_manifest}" "${HIPDNN_PLUGIN_SDK_GPU_GENERIC_TARGETS_JSON}"
${_producer_deps}
COMMENT "hkp: packing root '${ARG_NAME}' for ${ARG_ARCHES}"
VERBATIM)
Expand Down Expand Up @@ -1238,11 +1239,13 @@ function(_hkp_root_probe out_shipped out_offered out_ok root arches exclude_fold
set(_probe_py "import json, sys
from hkp_pack.descriptors import load_flat_input
from hkp_pack.errors import HkpPackError
from hkp_pack.generic_targets import GenericTargets
from hkp_pack.pipeline import offered_engines, shipped_engines
lists = {k: tuple(v for v in rest.split(',') if v)
for k, _, rest in (a.partition('=') for a in sys.argv[2:])}
for k, _, rest in (a.partition('=') for a in sys.argv[3:])}
try:
flat = load_flat_input(sys.argv[1], log=lambda *_args: None,
flat = load_flat_input(sys.argv[1], GenericTargets.load(sys.argv[2]),
log=lambda *_args: None,
exclude_folders=lists['folders'],
disabled_kinds=lists['kinds'])
print(json.dumps({'shipped': shipped_engines(flat, lists['arches']),
Expand All @@ -1253,6 +1256,7 @@ except HkpPackError as exc:
execute_process(
COMMAND "${CMAKE_COMMAND}" -E env "PYTHONPATH=${HKP_PYTHON_ROOT}" --
"${Python3_EXECUTABLE}" -c "${_probe_py}" "${root}"
"${HIPDNN_PLUGIN_SDK_GPU_GENERIC_TARGETS_JSON}"
"arches=${_arch_csv}" "folders=${_folder_csv}" "kinds=${_kind_csv}"
RESULT_VARIABLE _rc
OUTPUT_VARIABLE _out
Expand Down Expand Up @@ -1649,6 +1653,15 @@ endfunction()
# fatal.
# ---------------------------------------------------------------------------
function(hkp_add_packaging)
if(NOT HIPDNN_PLUGIN_SDK_GPU_GENERIC_TARGETS_JSON
OR NOT EXISTS "${HIPDNN_PLUGIN_SDK_GPU_GENERIC_TARGETS_JSON}")
message(FATAL_ERROR
"hkp: HIPDNN_PLUGIN_SDK_GPU_GENERIC_TARGETS_JSON names no file "
"('${HIPDNN_PLUGIN_SDK_GPU_GENERIC_TARGETS_JSON}'); build against a "
"hipdnn_plugin_sdk that ships gpu_generic_targets.json.")
endif()
set_property(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" APPEND PROPERTY
CMAKE_CONFIGURE_DEPENDS "${HIPDNN_PLUGIN_SDK_GPU_GENERIC_TARGETS_JSON}")
find_package(Python3 COMPONENTS Interpreter REQUIRED)

hkp_resolve_kpack(_rocm_kpack_dir "${Python3_EXECUTABLE}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ endfunction()
# cannot be derived, e.g. a kept KDP references a standalone UKD, or a listed UKD is
# kept nowhere) and re-run configure when a source file or the derive tooling
# changes. Each <ukd> is passed as one --ukd; with none, derive selects per compile
# group (one UKD, or a value sweep for kinds with a sweep field). The tool writes <out_dir>/../expect.json, the list of kept UKDs the
# assertion expects; <expect_var> receives its path. FATAL when that list is empty: no
# group (one UKD, or a value sweep for kinds with a sweep field). The tool writes
# <out_dir>/../expect.json, the list of kept UKDs the assertion expects, each with the
# pass it packs under (<arch>, or a generic target containing it); <expect_var> receives its path. FATAL when that list is empty: no
# KDP under <from_dir> ships for <arch>, so the pack would prune everything. Deriving
# is idempotent, so a reconfigure leaves the derived root's mtimes alone and does not
# re-pack.
Expand All @@ -50,7 +51,8 @@ function(_hkp_probe_derive_root name from_dir arch out_dir expect_var)
set_property(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" APPEND
PROPERTY CMAKE_CONFIGURE_DEPENDS ${_derive_inputs}
"${HKP_PKG_DIR}/tools/hkp_probe_derive_root.py"
"${HKP_PKG_DIR}/tools/hkp_probe_kinds.py")
"${HKP_PKG_DIR}/tools/hkp_probe_kinds.py"
"${HIPDNN_PLUGIN_SDK_GPU_GENERIC_TARGETS_JSON}")
get_property(_filter_args GLOBAL PROPERTY HKP_PROBE_FILTER_ARGS)
set(_ukd_args "")
foreach(_ukd IN LISTS ARGN)
Expand All @@ -60,6 +62,7 @@ function(_hkp_probe_derive_root name from_dir arch out_dir expect_var)
COMMAND "${Python3_EXECUTABLE}"
"${HKP_PKG_DIR}/tools/hkp_probe_derive_root.py"
--from "${from_dir}"
--generic-targets-json "${HIPDNN_PLUGIN_SDK_GPU_GENERIC_TARGETS_JSON}"
--arch "${arch}"
--out "${out_dir}"
${_filter_args}
Expand Down Expand Up @@ -290,11 +293,16 @@ endfunction()
# UKD under HIPKERNELPROVIDER_PRODUCTION_DESCRIPTOR_SOURCE_ROOT that is a concrete
# target (hkp_is_concrete_arch), minus the build's own targets (hkp_selected_arches).
# Descriptors with no `arch` (wildcards) name no arch: they ship for every build
# target, so the build's own production pack covers them. A non-concrete entry
# (gfx9-4-generic) is skipped with a STATUS line: no build packs for it, because
# GPU_TARGETS drops it and the packer matches arch names exactly.
# FATAL with the tool's stderr when the packer's loader rejects the root. Configure
# re-runs when a file under the root or the derive tooling changes.
# target, so the build's own production pack covers them. A generic target in
# HIPDNN_PLUGIN_SDK_GPU_GENERIC_TARGETS_JSON is probed through its first member (the
# packer compiles the generic for any member and merges it into the member's folder),
# unless the build targets one of its members, whose production pack compiles it
# already; the STATUS line shows each generic -> member mapping. A TheRock family name
# is skipped with a STATUS line: no build packs for it, because GPU_TARGETS drops it.
# FATAL with the tool's stderr when the packer's loader rejects the root, including a
# `*-generic` entry absent from the table. Configure
# re-runs when a file under the root, the generic target table or the derive tooling
# changes.
# ---------------------------------------------------------------------------
function(_hkp_probe_automatic_arches out_var)
get_property(_filter_args GLOBAL PROPERTY HKP_PROBE_FILTER_ARGS)
Expand All @@ -303,11 +311,20 @@ function(_hkp_probe_automatic_arches out_var)
set_property(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" APPEND
PROPERTY CMAKE_CONFIGURE_DEPENDS ${_root_inputs}
"${HKP_PKG_DIR}/tools/hkp_probe_derive_root.py"
"${HKP_PKG_DIR}/tools/hkp_probe_kinds.py")
"${HKP_PKG_DIR}/tools/hkp_probe_kinds.py"
"${HIPDNN_PLUGIN_SDK_GPU_GENERIC_TARGETS_JSON}")
hkp_selected_arches(_targets _targets_source)
set(_exclude_args "")
foreach(_target IN LISTS _targets)
list(APPEND _exclude_args --exclude "${_target}")
endforeach()
execute_process(
COMMAND "${Python3_EXECUTABLE}"
"${HKP_PKG_DIR}/tools/hkp_probe_derive_root.py"
--list-arches --from "${_root}" ${_filter_args}
--list-arches --from "${_root}"
--generic-targets-json "${HIPDNN_PLUGIN_SDK_GPU_GENERIC_TARGETS_JSON}"
${_exclude_args}
${_filter_args}
RESULT_VARIABLE _rc
OUTPUT_VARIABLE _out
ERROR_VARIABLE _err)
Expand All @@ -317,19 +334,32 @@ function(_hkp_probe_automatic_arches out_var)
"failed (exit ${_rc}).\n${_err}")
endif()
string(REGEX REPLACE "\n+$" "" _out "${_out}")
string(REPLACE "\n" ";" _named "${_out}")
string(REPLACE "\n" ";" _lines "${_out}")

hkp_selected_arches(_targets _targets_source)
# Each line is an arch followed by the generic targets it stands for.
set(_named "")
set(_auto "")
set(_skipped "")
foreach(_arch IN LISTS _named)
set(_mapped "")
foreach(_line IN LISTS _lines)
separate_arguments(_words UNIX_COMMAND "${_line}")
list(POP_FRONT _words _arch)
list(APPEND _named "${_arch}")
hkp_is_concrete_arch(_concrete "${_arch}")
if(_concrete)
list(APPEND _auto "${_arch}")
foreach(_generic IN LISTS _words)
list(APPEND _mapped "${_generic} -> ${_arch}")
endforeach()
else()
list(APPEND _skipped "${_arch}")
endif()
endforeach()
if(_mapped)
list(JOIN _mapped ", " _mapped_text)
message(STATUS
"hkp: generic targets probed through their first member: [${_mapped_text}]")
endif()
if(_skipped)
list(JOIN _skipped ", " _skipped_text)
message(STATUS
Expand All @@ -343,8 +373,8 @@ function(_hkp_probe_automatic_arches out_var)
list(JOIN _named ", " _named_text)
list(JOIN _targets ", " _targets_text)
message(STATUS
"hkp: automatic probe arches: [${_auto_text}] (explicit arches under ${_root}: "
"[${_named_text}]; build targets: [${_targets_text}])")
"hkp: automatic probe arches: [${_auto_text}] (probe arches of the explicit "
"arches under ${_root}: [${_named_text}]; build targets: [${_targets_text}])")
set(${out_var} "${_auto}" PARENT_SCOPE)
endfunction()

Expand Down Expand Up @@ -375,8 +405,9 @@ endfunction()
# probed as usual; an arch left with no content names no probe. Load the named
# probes from probes/probes.cmake, then declare one automatic probe per architecture the production
# root names that the build does not target: the explicit `arch` entries of its KDPs
# and UKDs (hkp_probe_derive_root.py --list-arches; wildcard descriptors name none)
# minus hkp_selected_arches(), each as hkp_add_packaging_probe(ARCH <arch>). Register
# and UKDs (hkp_probe_derive_root.py --list-arches; wildcard descriptors name none,
# generic targets map to a member, see _hkp_probe_automatic_arches) minus
# hkp_selected_arches(), each as hkp_add_packaging_probe(ARCH <arch>). Register
# the probe tooling tests, write the manifest of ctest names
# (${CMAKE_BINARY_DIR}/hkp-probes/manifest.txt) and define the aggregate target
# hkp_packaging_probes. Zero probes is valid: every explicit arch is a build target,
Expand Down
Loading
Loading