Skip to content

[miopen-provider] Add test filter standardization - #7901

Merged
dileepr1 merged 9 commits into
developfrom
users/dravindr/tf_miopen_prov
Jun 24, 2026
Merged

dileepr1 merged 9 commits into
developfrom
users/dravindr/tf_miopen_prov

Conversation

@dileepr1

@dileepr1 dileepr1 commented May 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds YAML-driven CTest test categorization for the miopen-provider plugin so TheRock CI can drive ctest -L {quick|standard|comprehensive|full} from the installed bin/miopen_plugin/ tree via the generic test_runner.py (replacing the legacy test_miopenprovider.py one-off).
More details available at test_filtering.md.

Paired TheRock branch: users/dravindr/tr_miopen_prov (PR forthcoming) — switches the miopenprovider job's test_script to test_runner.py, adds miopenprovider -> miopen_plugin to COMPONENT_DIR_MAPPING, and broadens artifact-miopenprovider.toml's test include to bin/miopen_plugin/**.

Reference (canonical pattern): ROCm/rocm-libraries#3513 + ROCm/TheRock#3097 (miopen).

Changes

dnn-providers/miopen-provider/test_categories.yaml (new)

Added the test_categories.yaml for test selection

dnn-providers/miopen-provider/CMakeLists.txt

  • Set ROCM_LIBRARIES_ROOT (guarded if NOT DEFINED) so shared/ctest/TestCategories.cmake is discoverable from the monorepo root.
  • After finalize_test_targets(...), call apply_test_category_labels() once per test binary, writing both sets of _quick_suite / _standard_suite / _comprehensive_suite / _full_suite entries into a single install-time CTestTestfile.cmake with relative paths (../miopen_plugin_tests, ../miopen_plugin_integration_tests).
  • Install the YAML-generated CTestTestfile.cmake to bin/miopen_plugin/ when shared/ctest is available; otherwise fall back to the project's existing install_provider_ctest_files() so standalone / sparse checkouts that lack shared/ctest/ keep working with their current unlabeled install file.

.github/actions/ci-env/action.yml (WIP — revert before merge)

Bumps the therock-ref output from the pinned 2026-05-29 SHA (685f8c3b890063...) to the paired TheRock branch users/dravindr/tr_miopen_prov. This file is the single source of truth for therock-ci-linux.yml, therock-ci-windows.yml, therock-ci.yml, therock-test-component.yml, and therock-test-packages.yml, so this one edit replaces what would otherwise be four parallel diffs.

Must be reverted to a pinned ROCm/TheRock SHA before merge, once the paired TheRock PR lands and gives us a stable commit on main.

Test plan

  • CI build (Linux) on users/dravindr/tr_miopen_prov produces a miopenprovider artifact whose bin/miopen_plugin/CTestTestfile.cmake lists all 8 *_suite entries with labels.
  • CI build (Windows) ditto.
  • therock-test-component.yml / therock-test-packages.yml runs of the miopenprovider job invoke test_runner.py with TEST_COMPONENT=miopenprovider and TEST_TYPE=quick and pass.
  • Revert .github/actions/ci-env/action.yml to a pinned ROCm/TheRock SHA once the paired TheRock PR is merged.

Made with Cursor

dileepr1 and others added 2 commits May 29, 2026 16:09
Add YAML-driven CTest test categorization for the miopen-provider plugin
so TheRock CI can drive `ctest -L {quick|standard|comprehensive|full}`
from the installed bin/miopen_plugin/ tree via the generic test_runner.py
(replacing the legacy test_miopenprovider.py one-off).

- dnn-providers/miopen-provider/test_categories.yaml: tier definitions
  shared by both miopen_plugin_tests (unit) and miopen_plugin_integration_tests.
  quick / standard exclude Full* parameterised expansions to match the
  legacy GTEST_FILTER="-Full*" used by test_miopenprovider.py;
  comprehensive / full include them.
- dnn-providers/miopen-provider/CMakeLists.txt:
  - Set ROCM_LIBRARIES_ROOT so shared/ctest/TestCategories.cmake is
    discoverable from the monorepo root (guarded with EXISTS so
    standalone / sparse checkouts keep building).
  - Call apply_test_category_labels() once per test binary, writing both
    sets of suites into a single install-time CTestTestfile.cmake with
    relative paths (../miopen_plugin_tests, ../miopen_plugin_integration_tests).
  - Install the YAML-generated CTestTestfile.cmake to bin/miopen_plugin/
    when available; otherwise fall back to install_provider_ctest_files()
    so standalone builds keep their existing unlabeled install file.

Paired with the TheRock branch users/dravindr/tr_miopen_prov which
switches the miopenprovider job's test_script to test_runner.py, adds
miopenprovider -> miopen_plugin to COMPONENT_DIR_MAPPING, and broadens
artifact-miopenprovider.toml's test include to bin/miopen_plugin/**.

Co-authored-by: Cursor <cursoragent@cursor.com>
…n_prov

Bump the therock-ref output in .github/actions/ci-env/action.yml from
the pinned 2026-05-29 SHA (685f8c3b890063...) to the paired TheRock
branch users/dravindr/tr_miopen_prov, so all therock-* workflows
(therock-ci-linux.yml, therock-ci-windows.yml, therock-ci.yml,
therock-test-component.yml, therock-test-packages.yml) build and test
against the TheRock state that:

- switches the miopenprovider job's test_script to test_runner.py, and
- bundles bin/miopen_plugin/** (including the YAML-generated install-tree
  CTestTestfile.cmake from the previous commit) in the miopenprovider
  artifact.

Without this paired ref, the build artifact would be missing the
install-tree CTestTestfile.cmake and test_runner.py would fail with
"Test directory does not exist: build/bin/miopen_plugin".

WIP: revert to a pinned ROCm/TheRock SHA before merge, once the paired
TheRock PR lands and gives us a stable commit on main.

Co-authored-by: Cursor <cursoragent@cursor.com>
dileepr1 and others added 3 commits May 29, 2026 17:15
Mirrors the legacy TEST_TO_IGNORE map in
TheRock/build_tools/github_actions/test_executable_scripts/test_miopenprovider.py
which excluded the miopen_plugin_integration_tests ctest entry on
Windows+gfx110X only (TODO #3709).

- shared/ctest/parse_test_categories.py: teach the parser an optional
  `_(windows|linux)` suffix on exclude_gpu_* keys. Keys without a suffix
  (e.g. exclude_gpu_gfx950) stay OS-agnostic and behave exactly as
  before, so every existing YAML continues to parse identically. Keys
  with a suffix are skipped at YAML-parse time on the wrong OS, so the
  entry never reaches the install file for that platform. The runtime
  label stays `ex_gpu_<arch>` so test_runner.py's GPU-arch matching
  needs no changes. Same change is independently being landed via
  users/dravindr/tf_rocprim (commit ef8eee2); whichever PR merges
  first, the other will be a clean no-op.

- dnn-providers/miopen-provider/test_categories.yaml: add
  exclude_gpu_gfx110X_windows with test_patterns: ["*Integration*"].
  All TEST_P classes in integration_tests/ are named IntegrationGpu*
  and none in tests/ contain "Integration", so the filter is a no-op
  on miopen_plugin_tests and a full exclusion on
  miopen_plugin_integration_tests, matching the legacy script's
  ctest --exclude-regex "miopen_plugin_integration_tests" exactly.

Co-authored-by: Cursor <cursoragent@cursor.com>
Pre-commit's check-yaml hook (ruamel.yaml strict load) failed on PR #7901
with:

    while constructing a mapping
      in "dnn-providers/miopen-provider/test_categories.yaml", line 24, column 1
    found duplicate key "exclude_gpu" with value "{}" (original value: "{}")
      in "dnn-providers/miopen-provider/test_categories.yaml", line 120, column 1

When commit 5e7616b ("[miopen-provider] Add Windows+gfx110X exclusion
for integration tests") replaced the unscoped exclude_gpu block with an
OS-scoped variant (exclude_gpu_gfx110X_windows), it appended the new
block instead of replacing the old one, leaving two top-level
`exclude_gpu:` mappings in the document. YAML 1.2 (and the ruamel.yaml
loader used by pre-commit's check-yaml) forbid duplicate mapping keys.

Drop the older unscoped `exclude_gpu:` block (with the bare
`exclude_gpu_gfx110X` inner key) and keep only the OS-suffixed
`exclude_gpu_gfx110X_windows` block, which is what was intended in
5e7616b: the parser's OS-suffix support (added in this PR's
shared/ctest/parse_test_categories.py change) makes the entry skip
Linux configures entirely, matching the legacy
test_miopenprovider.py TEST_TO_IGNORE map's Windows-only scope.

Verified locally:
- `ruamel.yaml` strict-load succeeds (top-level keys: _common_excludes,
  test_categories, exclude_gpu, execution_settings).
- Parser dry-run on Linux: 4 base add_test entries, 0 ex_gpu_gfx110X
  entries (block correctly skipped).
- Parser dry-run on Windows: 4 base + 4 ex_gpu_gfx110X entries = 8
  total; ex_gpu_gfx110X-labeled suites carry --gtest_filter=*Integration*
  for runtime ex-clusion of the integration binary on gfx110X hosts,
  exactly matching the legacy --exclude-regex carve-out.

Co-authored-by: Cursor <cursoragent@cursor.com>
@dileepr1
dileepr1 marked this pull request as ready for review June 11, 2026 15:32
@dileepr1
dileepr1 requested review from a team as code owners June 11, 2026 15:32
Comment thread .github/actions/ci-env/action.yml Resolved
…ble-install

Consolidate the install-tree CTestTestfile.cmake to a single install, run after
the external integration test target so its staged add_test() snippet is folded
into the labeled file (fixes the labeled file being overwritten by a second
install_provider_ctest_files() call).

Categorize miopen-provider-external-integration-check through a dedicated
test_categories_external.yaml driven by apply_ctest_category_labels(), placed in
the quick tier so it runs in all categories (matching legacy
test_miopenprovider.py). Apply labels to both the install tree and build tree.

Emit the staged external add_test() name double-quoted instead of as a [=[ ]=]
bracket argument so the shared category parser can discover it.

Co-authored-by: Cursor <cursoragent@cursor.com>
@dileepr1
dileepr1 requested a review from adickin-amd June 18, 2026 18:34

@adickin-amd adickin-amd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like the tests are running as expected for the CI so approved!

@dileepr1
dileepr1 requested a review from aalabsi-amd June 19, 2026 13:25
Co-authored-by: Cursor <cursoragent@cursor.com>
@dileepr1
dileepr1 merged commit d62cece into develop Jun 24, 2026
26 checks passed
@dileepr1
dileepr1 deleted the users/dravindr/tf_miopen_prov branch June 24, 2026 13:58
dileepr1 added a commit to ROCm/TheRock that referenced this pull request Jun 26, 2026
## Motivation

Add test filter standardisation for miopen-provider.
This works with the companion PR
ROCm/rocm-libraries#7901

## Technical Details

- `fetch_test_configurations.py`: miopenprovider `test_script` ->
`test_runner.py` so the generic runner drives `ctest` from
`THEROCK_BIN_DIR/miopen_plugin` using the
quick/standard/comprehensive/full category labels (replacing the legacy
`test_miopenprovider.py` one-off).
- `test_runner.py`: add `miopenprovider -> miopen_plugin` to
`COMPONENT_DIR_MAPPING` so the job name maps to the actual install dir
name under `THEROCK_BIN_DIR`.
- `ml-libs/artifact-miopenprovider.toml`: broaden the test-component
include to `bin/miopen_plugin/**` so the YAML-generated install-tree
`CTestTestfile.cmake` (and the binaries it references via relative
paths) ship in the artifact. The companion rocm-libraries change in
`users/dravindr/tf_miopen_prov` writes that file to
`bin/miopen_plugin/CTestTestfile.cmake`.

## Test Plan

Confirm that the CI tests for miopen-provider work once
ROCm/rocm-libraries#7901 is merged.

## Submission Checklist

- [ ] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.

Made with [Cursor](https://cursor.com)

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants