Use this skill when the user asks to test an existing hipDNN superbuild. It does not configure or build the project. If no superbuild exists, tell the user to build first with hipdnn-superbuild.
-
Determine the repository root:
git rev-parse --show-toplevel
-
Resolve paths:
- Build directory: honor active workspace instructions first; otherwise use
<repo-root>/build.
- Binary directory:
<build-dir>/bin.
- Helper scripts: skills are host-level, not tied to a repo checkout — default to the scripts bundled with the skill you were invoked from (
<skill-directory>/scripts), even when working inside a repo or worktree. Do NOT run the <repo-root>/projects/hipdnn/tools/ai/skills/hipdnn-superbuild-test/scripts copy just because a checkout is present: it can be a stale stub (on develop) or an unmerged in-progress version (on a feature branch). Use the source-checkout copy only when actively developing this skill itself to exercise your in-progress edits, or when the invoked skill has no bundled scripts/ directory.
-
Verify the superbuild exists:
ls <build-dir>/build.ninja
Stop if it is missing.
-
Resolve ROCm path on Windows:
python3 <scripts>/windows_rocm_setup.py --repo-root <repo-root> [--rocm-path <path>]
Parse ROCM_PATH=... from stdout and set ROCM_BIN=<rocm-path>/bin. Skip this step on Linux unless the user supplied an override. On Windows, always pass the resolved ROCM_BIN to cmake_run.py (steps 6-8) via --rocm-bin: it is required both for the runtime PATH and for staging the wheel's amd_comgr.dll app-local (see Notes).
-
Discover CMake test targets:
python3 <scripts>/discover_test_targets.py --build-dir <build-dir> --component <component> --scope <scope>
The helper prints <component>:<target> lines. It also handles the hip-kernel-provider path-qualified target naming. With --scope external-integration (or all) it also emits a <component>:command:<cmdline> line — the resolved cross-provider hipdnn_integration_tests invocation (with --test-article/--test-engine/--test-config) read from the generated CTestTestfile.cmake, with any baked-in --gtest_filter stripped so you can supply your own.
If the helper reports that Ninja target discovery failed, treat that as an invalid or stale build directory and stop with the helper's diagnostic. If discovery succeeds but no targets match, report that the requested component or scope is not present in the existing superbuild.
-
Run tests through cmake_run.py when no gtest filter is requested:
python3 <scripts>/cmake_run.py --build-dir <build-dir> --target <target> [--rocm-path <path>] [--rocm-bin <path>] > <log> 2>&1
Add --jobs <N> only when explicit jobs are both requested and permitted. For verbose mode, append -verbose to the target name.
-
Run direct binaries when a gtest filter is requested:
python3 <scripts>/cmake_run.py --build-dir <build-dir> --binary <binary-path> --gtest-filter "<filter>" [--extra-arg=<flag> ...] [-- <passthrough args>] [--rocm-path <path>] [--rocm-bin <path>] > <log> 2>&1
Use the component-to-binary mapping below to choose binaries. cmake_run.py accepts arbitrary passthrough flags for the binary: simple values via repeatable --extra-arg (use --extra-arg=--flag for flag-like values), or an entire flag list after a literal --. Passing multiple tokens inside --binary is rejected with a clear error.
-
Reproduce the cross-provider external-integration suite (--scope external-integration):
- To run the whole suite exactly as CI does, build the custom target:
python3 <scripts>/cmake_run.py --build-dir <build-dir> --target <provider>-external-integration-check [--rocm-path <path>] [--rocm-bin <path>] > <log> 2>&1
- To run with a custom gtest filter, take the
<component>:command:<cmdline> line from step 5, run the first token as --binary and the rest after --, adding your own --gtest-filter:
python3 <scripts>/cmake_run.py --build-dir <build-dir> --binary <hipdnn_integration_tests> -- <--test-article ... --test-engine ... --test-config ...> --gtest_filter=<filter> > <log> 2>&1
-
For every command, keep full output in a log and show only a short tail on failure. Track pass/fail per component. Stop at the first failure unless keep-going was requested.
The exact article/engine/config for the external suite is resolved at build time; get the ready-to-run command from discover_test_targets.py --scope external-integration (the command: line) rather than hardcoding paths.
If a requested component has no matching target, say that it was not present in the existing superbuild and name the preset or component likely needed.