From 4a0922d171221a0c5f3658bde88099e8ad235a4e Mon Sep 17 00:00:00 2001 From: dileepr1 Date: Fri, 29 May 2026 16:09:15 -0500 Subject: [PATCH 1/6] [miopen-provider] Add test filter standardization 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 --- dnn-providers/miopen-provider/CMakeLists.txt | 61 ++++++++++++++- .../miopen-provider/test_categories.yaml | 78 +++++++++++++++++++ 2 files changed, 137 insertions(+), 2 deletions(-) create mode 100644 dnn-providers/miopen-provider/test_categories.yaml diff --git a/dnn-providers/miopen-provider/CMakeLists.txt b/dnn-providers/miopen-provider/CMakeLists.txt index 325b910f166c..e672d4fa50ca 100644 --- a/dnn-providers/miopen-provider/CMakeLists.txt +++ b/dnn-providers/miopen-provider/CMakeLists.txt @@ -19,6 +19,13 @@ dnn_provider_setup_version(miopen_provider ${CMAKE_CURRENT_LIST_DIR}) # Set project with version project(miopen-provider VERSION ${MIOPEN_PROVIDER_VERSION} LANGUAGES CXX) +# Root of the rocm-libraries monorepo (for shared infrastructure like CTest categories). +# Used by the YAML-based test categorization wiring further down. Guarded with an EXISTS +# check at the point of use so standalone / sparse checkouts that lack shared/ctest still build. +if(NOT DEFINED ROCM_LIBRARIES_ROOT) + set(ROCM_LIBRARIES_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/../..") +endif() + include(CMakePackageConfigHelpers) include(${CMAKE_CURRENT_LIST_DIR}/cmake/CheckPreCommit.cmake) @@ -231,9 +238,59 @@ if(NOT MIOPENPROVIDER_SKIP_TESTS) finalize_test_targets("${PROJECT_NAME}") endif() - # For standalone builds we need to install the ctest files + # Optional: YAML-driven CTest test categorization for TheRock CI's test_runner.py. + # Skipped when shared/ctest is not present (e.g. standalone miopen-provider or sparse + # checkout that doesn't include rocm-libraries/shared/), in which case we fall back to + # the project's own install_provider_ctest_files() below. + set(MIOPENPROVIDER_CTEST_INSTALL_FILE "") + if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test_categories.yaml" + AND EXISTS "${ROCM_LIBRARIES_ROOT}/shared/ctest/TestCategories.cmake") + include("${ROCM_LIBRARIES_ROOT}/shared/ctest/TestCategories.cmake") + enable_testing() + message(STATUS "miopen-provider: YAML-based test categorization") + file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/staging") + # Install-time CTestTestfile uses relative paths so `ctest` can run from the + # installed location (bin/miopen_plugin/) and reach ../miopen_plugin_tests etc. + set(MIOPENPROVIDER_CTEST_INSTALL_FILE "${CMAKE_CURRENT_BINARY_DIR}/install_CTestTestfile.cmake") + file(WRITE "${MIOPENPROVIDER_CTEST_INSTALL_FILE}" +[=[ +# This is a test file generated by miopen-provider for install time. +# Tests are defined with relative paths to work in the installed location. +]=] + ) + # The YAML applies to both test binaries; each call appends its category suites + # (e.g. miopen_plugin_tests_quick_suite, miopen_plugin_integration_tests_quick_suite) + # to the same install-time CTestTestfile.cmake. + apply_test_category_labels( + miopen_plugin_tests + "${CMAKE_CURRENT_SOURCE_DIR}/test_categories.yaml" + "${PROJECT_BINARY_DIR}/staging" + "${MIOPENPROVIDER_CTEST_INSTALL_FILE}" + ) + apply_test_category_labels( + miopen_plugin_integration_tests + "${CMAKE_CURRENT_SOURCE_DIR}/test_categories.yaml" + "${PROJECT_BINARY_DIR}/staging" + "${MIOPENPROVIDER_CTEST_INSTALL_FILE}" + ) + else() + message(STATUS "miopen-provider: shared/ctest or test_categories.yaml not found, skipping YAML-based CTest categories") + endif() + + # For standalone builds we need to install the ctest files. + # When YAML-based categorization is active, install the generated install_CTestTestfile.cmake + # to bin/miopen_plugin/ so TheRock CI's test_runner.py can drive `ctest -L quick` + # (etc.) from the artifact's install tree. Otherwise, fall back to the project's + # own install_provider_ctest_files() which emits an unlabeled CTestTestfile.cmake. if(NOT ROCM_LIBS_SUPERBUILD) - install_provider_ctest_files("miopen_plugin") + if(MIOPENPROVIDER_CTEST_INSTALL_FILE) + install(FILES "${MIOPENPROVIDER_CTEST_INSTALL_FILE}" + DESTINATION "${CMAKE_INSTALL_BINDIR}/miopen_plugin" + RENAME "CTestTestfile.cmake" + ) + else() + install_provider_ctest_files("miopen_plugin") + endif() endif() if(NOT TARGET hipdnn_integration_tests) diff --git a/dnn-providers/miopen-provider/test_categories.yaml b/dnn-providers/miopen-provider/test_categories.yaml new file mode 100644 index 000000000000..21a68479ab11 --- /dev/null +++ b/dnn-providers/miopen-provider/test_categories.yaml @@ -0,0 +1,78 @@ +# Copyright © Advanced Micro Devices, Inc., or its affiliates. +# SPDX-License-Identifier: MIT +# +# miopen-provider Test Categories Configuration +# Aligned with Test Filter Standardization (RFC0010). +# +# miopen-provider has two GTest binaries (miopen_plugin_tests and +# miopen_plugin_integration_tests) that share this YAML. Tier behaviour +# mirrors the legacy test_miopenprovider.py runner: +# - quick: GTEST_FILTER="-Full*" (skip the Full/* INSTANTIATE_TEST_SUITE_P +# parameterised expansions used by integration tests; unit tests have no +# Full* prefix so they all run) +# - comprehensive/full: run everything (including Full*) +# +# Unit tests in tests/ use INSTANTIATE_TEST_SUITE_P prefixes "AllCases" and +# bare TEST/TEST_F; integration tests in integration_tests/ use "Smoke" and +# "Full" prefixes. There are no Standard*/Comprehensive* prefixes, so the +# standard tier is the same shape as quick (matches pre-checkin scope). + +# YAML anchor for the shared exclusion list. Mirrors the legacy filter in +# TheRock build_tools/github_actions/test_executable_scripts/test_miopenprovider.py +# (which only used GTEST_FILTER="-Full*" for quick, and *DISABLED* is the +# standard GTest convention for skipped tests). +_common_excludes: &common_excludes + - "*DISABLED*" + +test_categories: + quick: + description: "Fast sanity checks (target: < 5 min) - excludes Full* parameterised expansions" + test_patterns: + - "*" + exclude: + - "*DISABLED*" + - "Full*" + labels: + - "quick" + - "pre-commit" + - "smoke" + + standard: + description: "Pre-checkin validation (target: < 45 min) - same shape as quick (no Standard* tier exists)" + test_patterns: + - "*" + exclude: + - "*DISABLED*" + - "Full*" + labels: + - "standard" + - "pr" + - "precheckin" + + comprehensive: + description: "Nightly comprehensive tests (target: < 7 hours) - includes Full* tier" + test_patterns: + - "*" + exclude: *common_excludes + labels: + - "comprehensive" + - "nightly" + - "extended" + + full: + description: "Complete test suite - all tests including Full*" + test_patterns: + - "*" + exclude: *common_excludes + labels: + - "full" + - "all" + +execution_settings: + default_timeout: 300 + timeout_multiplier: 1 + category_timeouts: + quick: 300 # 5 minutes + standard: 2700 # 45 minutes + comprehensive: 25200 # 7 hours + full: 28800 # 8 hours From cdc7e4861431ab130183668ada991e8a53cd4b3c Mon Sep 17 00:00:00 2001 From: dileepr1 Date: Fri, 29 May 2026 16:09:30 -0500 Subject: [PATCH 2/6] [miopen-provider][ci] Point TheRock CI ref at users/dravindr/tr_miopen_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 --- .github/actions/ci-env/action.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/actions/ci-env/action.yml b/.github/actions/ci-env/action.yml index e2557746306d..0ec795f40650 100644 --- a/.github/actions/ci-env/action.yml +++ b/.github/actions/ci-env/action.yml @@ -4,7 +4,9 @@ description: "Single source of truth for shared CI constants (TheRock ref, Docke outputs: therock-ref: description: "TheRock commit hash to use" - value: "685f8c3b89006309b34a7c16de17e841400f0d76" # 2026-05-29 commit + # WIP: revert to a pinned ROCm/TheRock SHA before merge, once paired + # TheRock PR (users/dravindr/tr_miopen_prov) lands. + value: "users/dravindr/tr_miopen_prov" docker-image: description: "Docker container image for Linux builds" value: "ghcr.io/rocm/therock_build_manylinux_x86_64@sha256:48492540591673fdc8d51beb89bde41e7ba13cbb528f643c0a481ba42c4058f2" From 5e7616ba511197ce2813a46be849ea005bc43c91 Mon Sep 17 00:00:00 2001 From: dileepr1 Date: Fri, 29 May 2026 17:15:10 -0500 Subject: [PATCH 3/6] [miopen-provider] Add Windows+gfx110X exclusion for integration tests 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_` so test_runner.py's GPU-arch matching needs no changes. Same change is independently being landed via users/dravindr/tf_rocprim (commit ef8eee2fe5); 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 --- .../miopen-provider/test_categories.yaml | 60 +++++++++++++++++++ shared/ctest/parse_test_categories.py | 56 +++++++++++++---- 2 files changed, 106 insertions(+), 10 deletions(-) diff --git a/dnn-providers/miopen-provider/test_categories.yaml b/dnn-providers/miopen-provider/test_categories.yaml index 21a68479ab11..bb033bd10c6b 100644 --- a/dnn-providers/miopen-provider/test_categories.yaml +++ b/dnn-providers/miopen-provider/test_categories.yaml @@ -68,6 +68,66 @@ test_categories: - "full" - "all" +# GPU-arch-specific exclusions. Mirrors the TEST_TO_IGNORE map in the legacy +# TheRock build_tools/github_actions/test_executable_scripts/test_miopenprovider.py. +# +# Note: the legacy carve-out was AMDGPU_FAMILIES="gfx110X-all" + OS=windows only +# (it excluded the whole miopen_plugin_integration_tests binary via ctest +# --exclude-regex). The YAML's exclude_gpu mechanism is GPU-scoped but not +# OS-scoped, so the entry below broadens the exclusion to Linux gfx110X as +# well. Once issue #3709 is resolved (or if Linux gfx110X is confirmed +# healthy), narrow this back by removing the entry / moving it to an +# exclude_windows: block on each category. +# +# The "*Integration*" filter is a no-op on miopen_plugin_tests (its TEST_P +# classes start with TestGpu* / TestValidate* and contain no "Integration" +# substring) and a full exclusion on miopen_plugin_integration_tests (every +# TEST_P class there starts with IntegrationGpu*), so this entry effectively +# only suppresses the integration binary, matching the legacy script's intent. +exclude_gpu: + exclude_gpu_gfx110X: + test_patterns: + - "*Integration*" + labels: + - "quick" + - "standard" + - "comprehensive" + - "full" + - "ex_gpu_gfx110X" + +# GPU-arch-specific exclusions. Mirrors the TEST_TO_IGNORE map in the legacy +# TheRock/build_tools/github_actions/test_executable_scripts/test_miopenprovider.py: +# +# TEST_TO_IGNORE = { +# # TODO(#3709): Re-enable gfx110X tests once issues are resolved +# "gfx110X-all": { +# "windows": ["miopen_plugin_integration_tests"], +# }, +# } +# +# The legacy carve-out is OS-scoped (Windows only). The shared parser accepts +# an optional `_windows` / `_linux` suffix on the key and skips the entire +# block when configuring on the wrong OS, so this entry never reaches the +# Linux install file. The runtime label is still `ex_gpu_gfx110X` (no OS +# suffix) so test_runner.py's GPU-arch matching needs no changes. +# +# `*Integration*` is the gtest filter that scopes the exclusion to the +# integration binary only: all TEST_P classes in integration_tests/ are named +# IntegrationGpu*, and no TEST_P class in tests/ contains "Integration". So +# the filter is a no-op on miopen_plugin_tests (unit tests still run) and a +# full exclusion on miopen_plugin_integration_tests, matching the legacy +# script's ctest --exclude-regex "miopen_plugin_integration_tests" exactly. +exclude_gpu: + exclude_gpu_gfx110X_windows: + test_patterns: + - "*Integration*" + labels: + - "quick" + - "standard" + - "comprehensive" + - "full" + - "ex_gpu_gfx110X" + execution_settings: default_timeout: 300 timeout_multiplier: 1 diff --git a/shared/ctest/parse_test_categories.py b/shared/ctest/parse_test_categories.py index a8a0cb47b291..f03e779c380e 100644 --- a/shared/ctest/parse_test_categories.py +++ b/shared/ctest/parse_test_categories.py @@ -140,6 +140,38 @@ def gpu_arch_matches(specific_arch, pattern_arch): return specific_arch.startswith(prefix) +# Recognised key shapes: +# exclude_gpu_ -> OS-agnostic +# exclude_gpu__windows -> only when configuring on Windows +# exclude_gpu__linux -> only when configuring on Linux +_EXCLUDE_GPU_KEY_RE = re.compile(r"^exclude_gpu_(gfx\w+?)(?:_(windows|linux))?$") + + +def parse_exclude_gpu_key(key): + """Return (gpu_arch, os_suffix) for a YAML key under ``exclude_gpu``. + + ``os_suffix`` is one of ``"windows"``, ``"linux"`` or ``None``. + Returns ``(None, None)`` if the key does not match the expected shape. + """ + m = _EXCLUDE_GPU_KEY_RE.match(key) + if not m: + return None, None + return m.group(1), m.group(2) + + +def exclude_gpu_key_applies(os_suffix, is_windows, is_linux): + """Return True if a key with the given OS suffix should be honoured on the + current host. ``None`` means OS-agnostic and always applies. eg component: rocprim + """ + if os_suffix is None: + return True + if os_suffix == "windows": + return is_windows + if os_suffix == "linux": + return is_linux + return False + + def load_yaml(yaml_file): """Load and parse a YAML file, exiting with a descriptive error on failure.""" try: @@ -352,12 +384,16 @@ def main(): ex_gpu_labels_to_process = set() for gpu_key, gpu_config in exclude_gpu_config.items(): - match = re.match(r"exclude_gpu_(gfx\w+)", gpu_key) - if match: - gpu_labels = gpu_config.get("labels", []) - for label in gpu_labels: - if label.startswith("ex_gpu_"): - ex_gpu_labels_to_process.add(label) + arch, os_suffix = parse_exclude_gpu_key(gpu_key) + if arch is None: + continue + if not exclude_gpu_key_applies(os_suffix, is_windows, is_linux): + print(f"# Skipping {gpu_key}: not applicable on {platform.system()}") + continue + gpu_labels = gpu_config.get("labels", []) + for label in gpu_labels: + if label.startswith("ex_gpu_"): + ex_gpu_labels_to_process.add(label) # For each unique ex_gpu label, create tests with hierarchical pattern matching # Sort to ensure consistent test order @@ -371,11 +407,11 @@ def main(): all_applicable_categories = set() for gpu_key, gpu_config in exclude_gpu_config.items(): - match = re.match(r"exclude_gpu_(gfx\w+)", gpu_key) - if not match: + config_arch, os_suffix = parse_exclude_gpu_key(gpu_key) + if config_arch is None: + continue + if not exclude_gpu_key_applies(os_suffix, is_windows, is_linux): continue - - config_arch = match.group(1) # Check if this config applies to our target GPU architecture if gpu_arch_matches(gpu_arch, config_arch): From 43d4ae6767fda0b8318587a8f118f130e0d89db6 Mon Sep 17 00:00:00 2001 From: dileepr1 Date: Mon, 1 Jun 2026 08:54:38 -0500 Subject: [PATCH 4/6] [miopen-provider] Fix duplicate exclude_gpu key in test_categories.yaml 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 5e7616ba ("[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 5e7616ba: 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 --- .../miopen-provider/test_categories.yaml | 27 ------------------- 1 file changed, 27 deletions(-) diff --git a/dnn-providers/miopen-provider/test_categories.yaml b/dnn-providers/miopen-provider/test_categories.yaml index bb033bd10c6b..5875fd5e91ae 100644 --- a/dnn-providers/miopen-provider/test_categories.yaml +++ b/dnn-providers/miopen-provider/test_categories.yaml @@ -68,33 +68,6 @@ test_categories: - "full" - "all" -# GPU-arch-specific exclusions. Mirrors the TEST_TO_IGNORE map in the legacy -# TheRock build_tools/github_actions/test_executable_scripts/test_miopenprovider.py. -# -# Note: the legacy carve-out was AMDGPU_FAMILIES="gfx110X-all" + OS=windows only -# (it excluded the whole miopen_plugin_integration_tests binary via ctest -# --exclude-regex). The YAML's exclude_gpu mechanism is GPU-scoped but not -# OS-scoped, so the entry below broadens the exclusion to Linux gfx110X as -# well. Once issue #3709 is resolved (or if Linux gfx110X is confirmed -# healthy), narrow this back by removing the entry / moving it to an -# exclude_windows: block on each category. -# -# The "*Integration*" filter is a no-op on miopen_plugin_tests (its TEST_P -# classes start with TestGpu* / TestValidate* and contain no "Integration" -# substring) and a full exclusion on miopen_plugin_integration_tests (every -# TEST_P class there starts with IntegrationGpu*), so this entry effectively -# only suppresses the integration binary, matching the legacy script's intent. -exclude_gpu: - exclude_gpu_gfx110X: - test_patterns: - - "*Integration*" - labels: - - "quick" - - "standard" - - "comprehensive" - - "full" - - "ex_gpu_gfx110X" - # GPU-arch-specific exclusions. Mirrors the TEST_TO_IGNORE map in the legacy # TheRock/build_tools/github_actions/test_executable_scripts/test_miopenprovider.py: # From 4c13fcdac896f21c520835a849510b31875cabff Mon Sep 17 00:00:00 2001 From: dileepr1 Date: Thu, 18 Jun 2026 13:26:20 -0500 Subject: [PATCH 5/6] miopen-provider: label external integration test via YAML and fix double-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 --- .../cmake/HipdnnIntegrationTestHelpers.cmake | 6 +- dnn-providers/miopen-provider/CMakeLists.txt | 61 +++++++++++++------ .../test_categories_external.yaml | 32 ++++++++++ 3 files changed, 77 insertions(+), 22 deletions(-) create mode 100644 dnn-providers/miopen-provider/test_categories_external.yaml diff --git a/dnn-providers/integration-tests/cmake/HipdnnIntegrationTestHelpers.cmake b/dnn-providers/integration-tests/cmake/HipdnnIntegrationTestHelpers.cmake index 9b6564aaacbc..40581e22f892 100644 --- a/dnn-providers/integration-tests/cmake/HipdnnIntegrationTestHelpers.cmake +++ b/dnn-providers/integration-tests/cmake/HipdnnIntegrationTestHelpers.cmake @@ -130,7 +130,9 @@ function(add_external_integration_test_target) file(RELATIVE_PATH _install_bin "${_install_cwd_abs}" "${_bin_abs}") file(RELATIVE_PATH _install_plugin "${_install_cwd_abs}" "${_plugin_abs}") - set(_install_cmd "add_test([=[${ARG_TARGET_NAME}]=] \"${_install_bin}\" \"--test-article\" \"${_install_plugin}\" \"--test-engine\" \"${ARG_ENGINE_NAME}\"") + # Double-quote the name (not [=[ ]=]); the category parser only scans + # bare/quoted add_test() names, so this keeps it discoverable. + set(_install_cmd "add_test(\"${ARG_TARGET_NAME}\" \"${_install_bin}\" \"--test-article\" \"${_install_plugin}\" \"--test-engine\" \"${ARG_ENGINE_NAME}\"") if(ARG_TEST_CONFIG) string(APPEND _install_cmd " \"--test-config\" \"${_install_config}\"") endif() @@ -139,7 +141,7 @@ function(add_external_integration_test_target) endif() string(APPEND _install_cmd ")\n") string(APPEND _install_cmd - "set_tests_properties([=[${ARG_TARGET_NAME}]=] PROPERTIES LABELS \"${_LABELS}\")\n" + "set_tests_properties(\"${ARG_TARGET_NAME}\" PROPERTIES LABELS \"${_LABELS}\")\n" ) set_property(GLOBAL APPEND_STRING diff --git a/dnn-providers/miopen-provider/CMakeLists.txt b/dnn-providers/miopen-provider/CMakeLists.txt index e0562a6ec943..d6e800f8aa05 100644 --- a/dnn-providers/miopen-provider/CMakeLists.txt +++ b/dnn-providers/miopen-provider/CMakeLists.txt @@ -277,22 +277,8 @@ if(NOT MIOPENPROVIDER_SKIP_TESTS) message(STATUS "miopen-provider: shared/ctest or test_categories.yaml not found, skipping YAML-based CTest categories") endif() - # For standalone builds we need to install the ctest files. - # When YAML-based categorization is active, install the generated install_CTestTestfile.cmake - # to bin/miopen_plugin/ so TheRock CI's test_runner.py can drive `ctest -L quick` - # (etc.) from the artifact's install tree. Otherwise, fall back to the project's - # own install_provider_ctest_files() which emits an unlabeled CTestTestfile.cmake. - if(NOT ROCM_LIBS_SUPERBUILD) - if(MIOPENPROVIDER_CTEST_INSTALL_FILE) - install(FILES "${MIOPENPROVIDER_CTEST_INSTALL_FILE}" - DESTINATION "${CMAKE_INSTALL_BINDIR}/miopen_plugin" - RENAME "CTestTestfile.cmake" - ) - else() - install_provider_ctest_files("miopen_plugin") - endif() - endif() - + # Must run before the CTestTestfile install below so the staged snippet + # can be folded into the labeled file and labeled there. if(NOT TARGET hipdnn_integration_tests) find_package(hipdnn_integration_tests CONFIG QUIET) endif() @@ -306,15 +292,50 @@ if(NOT MIOPENPROVIDER_SKIP_TESTS) TEST_CONFIG ${CMAKE_CURRENT_SOURCE_DIR}/config/MIOPEN_ENGINE.toml ) message(STATUS "Created ${PROJECT_NAME}-external-integration-check target") + + # This is a pre-registered CTest test (not a GTest binary), so it is + # labeled via apply_ctest_category_labels()/test_categories_external.yaml. + if(MIOPENPROVIDER_CTEST_INSTALL_FILE) + # Fold the staged add_test() into the labeled file before labeling; + # apply_ctest_category_labels() scans the file's add_test() names. + get_property(_external_staging GLOBAL + PROPERTY "EXTERNAL_TEST_INSTALL_STAGING_miopen_plugin" + ) + if(_external_staging) + file(APPEND "${MIOPENPROVIDER_CTEST_INSTALL_FILE}" + "\n# External integration test (cross-provider suite)\n${_external_staging}" + ) + endif() + if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test_categories_external.yaml") + # Install tree. + apply_ctest_category_labels( + "${CMAKE_CURRENT_SOURCE_DIR}/test_categories_external.yaml" + "${MIOPENPROVIDER_CTEST_INSTALL_FILE}" + ) + # Build tree (so a local `ctest -L ` selects it too). + apply_ctest_category_labels( + "${CMAKE_CURRENT_SOURCE_DIR}/test_categories_external.yaml" + ) + endif() + endif() else() message(STATUS "hipdnn_integration_tests not found - skipping external-integration-check") endif() - # For standalone builds we need to install the ctest files. Must run - # AFTER add_external_integration_test_target so the staged install-tree - # snippet for the cross-provider test is included. + # For standalone builds we need to install the ctest files. + # When YAML-based categorization is active, install the generated install_CTestTestfile.cmake + # to bin/miopen_plugin/ so TheRock CI's test_runner.py can drive `ctest -L quick` + # (etc.) from the artifact's install tree. Otherwise, fall back to the project's + # own install_provider_ctest_files() which emits an unlabeled CTestTestfile.cmake. if(NOT ROCM_LIBS_SUPERBUILD) - install_provider_ctest_files("miopen_plugin") + if(MIOPENPROVIDER_CTEST_INSTALL_FILE) + install(FILES "${MIOPENPROVIDER_CTEST_INSTALL_FILE}" + DESTINATION "${CMAKE_INSTALL_BINDIR}/miopen_plugin" + RENAME "CTestTestfile.cmake" + ) + else() + install_provider_ctest_files("miopen_plugin") + endif() endif() endif() diff --git a/dnn-providers/miopen-provider/test_categories_external.yaml b/dnn-providers/miopen-provider/test_categories_external.yaml new file mode 100644 index 000000000000..d33d1b6097a5 --- /dev/null +++ b/dnn-providers/miopen-provider/test_categories_external.yaml @@ -0,0 +1,32 @@ +# Copyright © Advanced Micro Devices, Inc., or its affiliates. +# SPDX-License-Identifier: MIT +# +# miopen-provider External Integration Test Categories (RFC0010). +# +# Separate from test_categories.yaml: this drives apply_ctest_category_labels() +# over the pre-registered CTest test `miopen-provider-external-integration-check` +# (patterns match CTest test NAMES), whereas test_categories.yaml drives +# apply_test_category_labels() over GTest binaries (patterns are GTest globs). +# +# Placed in the quick tier so it runs in every category (quick -> standard -> +# comprehensive -> full), matching the legacy test_miopenprovider.py which ran +# ctest with no label filter (the test executed in all TEST_TYPEs). +# +# `labels:` must carry the COMPLETE set (tier labels + descriptive/engine +# labels) because apply_ctest_category_labels() emits one replacing +# set_tests_properties(); anything omitted is lost in the install tree. + +test_categories: + quick: + description: "Cross-provider integration suite against the miopen plugin (slow)" + test_patterns: + - "miopen-provider-external-integration-check" + labels: + - "quick" + - "standard" + - "comprehensive" + - "full" + - "integration_test" + - "slow" + - "external_integration_test" + - "MIOPEN_ENGINE" From 1aa09351c227f6eb0493087af88674d3e3ba44cb Mon Sep 17 00:00:00 2001 From: dileepr1 Date: Tue, 23 Jun 2026 15:44:28 -0500 Subject: [PATCH 6/6] Revert TheRock ref to develop's pinned SHA (drop tr_miopen_prov pin) Co-authored-by: Cursor --- .github/actions/ci-env/action.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/actions/ci-env/action.yml b/.github/actions/ci-env/action.yml index addf2602de49..468ec1e2b4b4 100644 --- a/.github/actions/ci-env/action.yml +++ b/.github/actions/ci-env/action.yml @@ -4,9 +4,7 @@ description: "Single source of truth for shared CI constants (TheRock ref, Docke outputs: therock-ref: description: "TheRock commit hash to use" - # WIP: revert to a pinned ROCm/TheRock SHA before merge, once paired - # TheRock PR (users/dravindr/tr_miopen_prov) lands. - value: "users/dravindr/tr_miopen_prov" + value: "c90e6caf0700096d2f19b4f1ddcd43d6b9b584fa" # 2026-06-15 docker-image: description: "Docker container image for Linux builds" value: "ghcr.io/rocm/therock_build_manylinux_x86_64@sha256:48492540591673fdc8d51beb89bde41e7ba13cbb528f643c0a481ba42c4058f2"