Skip to content

test(miopen): MIOpen public private split ci label test - #10249

Draft
NolanHannaAMD wants to merge 15 commits into
developfrom
users/nhanna/miopen-public-private-split-ci-label-test2
Draft

test(miopen): MIOpen public private split ci label test#10249
NolanHannaAMD wants to merge 15 commits into
developfrom
users/nhanna/miopen-public-private-split-ci-label-test2

Conversation

@NolanHannaAMD

Copy link
Copy Markdown
Contributor

JIRA ID : ALMIOPEN-2341 (Build flag gate)
JIRA ID : ALMIOPEN-2159 (Public/private split)

This is just testing the new ci:miopen-hipdnn-wrapper PR label for #10088.

This PR will be closed once the test is complete.

…ation (ALMIOPEN-2159)

Establish the RFC 0001 Phase-1 public/private library split. libMIOpen.so
becomes a thin pass-through wrapper that preserves the exact public API/ABI,
while the implementation moves into libMIOpen_private.so. This creates the
forwarding seam for later hipDNN routing with no consumer changes today
(same -lMIOpen link line, same SONAME).

What changed

- Public API source rename. Renamed the 263 public C entry points from
  miopenFoo to miopenFoo_impl directly in source across the src/*_api.cpp
  files plus api/find2_0_commons.cpp, api/tuning.cpp, mha/mha_descriptor.cpp,
  and softmax.cpp. No -include macro rename -- the _impl names are what is in
  the tree (RFC 4.6). Internal callers of these entry points and the
  address-of use in ck_impl_lib_loader.cpp were updated to the _impl names.

- Internal _impl header. Added src/include/miopen/miopen_impl.h declaring all
  263 _impl entry points, each with MIOPEN_EXPORT. Included by every TU that
  defines an _impl entry point so the renamed definitions inherit default
  visibility under -fvisibility=hidden and are exported from
  libMIOpen_private.so. (Not installed; the parallel installed consumer header
  and provider rewire are deferred to a later task.)

- Public wrapper. Added src/private/wrapper.cpp: an extern "C" pass-through
  stub for every public entry point that forwards to its _impl symbol via a
  plain function call. Stubs inherit visibility("default") from the in-scope
  <miopen/miopen.h> declaration, so the wrapper exports the public names and no
  _impl names.

- CMake split. MIOpen_private builds the implementation; a new thin MIOpen
  target compiles wrapper.cpp and links PUBLIC MIOpen_private, so existing
  consumers (driver, tests, CK plugins) resolve MIOpen's internal C++ symbols
  transitively against libMIOpen_private.so with no CMake change. SONAME/
  SOVERSION stays 1.0 on both; both targets are installed and exported;
  MIOpen_with_plugins still resolves to the public wrapper. A configure-time
  status message announces the split and the pass-through default.

- Test fix. Relaxed the smoke_tuning_policy assertions to accept either the
  public name or its _impl form in captured MIOPEN_LOG_FUNCTION output, since
  the logged name now comes from the renamed definition.
… back to our pre-pivot plan of a build time flag as well as some other adjustments.
…NN_WRAPPER (ALMIOPEN-2341, ALMIOPEN-2159)

Convert the split from a direct in-source _impl rename to a build-time redefinition header gated by a new MIOPEN_ENABLE_HIPDNN_WRAPPER flag (default OFF). Flag-off produces a single libMIOpen.so byte-equivalent to baseline; flag-on builds libMIOpen_private.so + a thin wrapper.

 - Add option + configure-time status message (top-level CMakeLists.txt)
 - Add src/private/miopen_private_rename.h (263 defines, force-included via
   -include on the private target under MIOPEN_BUILDING_PRIVATE)
 - Revert the 36 renamed api sources + db_path.cpp.in to untouched state
 - Remove now-unneeded src/include/miopen/miopen_impl.h
…N_ENABLE_HIPDNN_WRAPPER (ALMIOPEN-2341, ALMIOPEN-2159)

Wire CI to exercise and guard the MIOPEN_ENABLE_HIPDNN_WRAPPER build flag, covering both the standalone component build and the TheRock superbuild.

Component CI (standalone MIOpen), in component-ci-miopen.yml:
- flag-on-build: builds the wrapper + libMIOpen_private.so with the flag ON, so the compile-time -include rename is validated across every private TU and the wrapper links against the private library (ALMIOPEN-2159 path).
- byte-equivalence: builds the default flag-OFF libMIOpen.so and runs check_byte_equivalence.sh against the committed public_symbols.baseline, gating SONAME, the exported public C API symbol set, absence of _impl leakage, and absence of a libMIOpen_private DT_NEEDED. Content hash is reported as informational only (build-path nondeterministic).

TheRock superbuild CI (therock_matrix.py, therock_configure_ci.py):
- Label-gate the flag so a single MIOpen superbuild can opt in without a second, colliding job. On a rocm-libraries PR, the ci:miopen-hipdnn-wrapper label appends -DTHEROCK_FLAG_MIOPEN_ENABLE_HIPDNN_WRAPPER=ON to the existing MIOpen job via LABEL_GATED_CMAKE_OPTIONS, threaded through collect_projects_to_run(pr_labels). With no label nothing is forwarded, so the default superbuild stays flag-off and byte-equivalent. Pairs with the TheRock flag declaration in ROCm/TheRock#6795.
…ation (ALMIOPEN-2159)

Establish the RFC 0001 Phase-1 public/private library split. libMIOpen.so
becomes a thin pass-through wrapper that preserves the exact public API/ABI,
while the implementation moves into libMIOpen_private.so. This creates the
forwarding seam for later hipDNN routing with no consumer changes today
(same -lMIOpen link line, same SONAME).

What changed

- Public API source rename. Renamed the 263 public C entry points from
  miopenFoo to miopenFoo_impl directly in source across the src/*_api.cpp
  files plus api/find2_0_commons.cpp, api/tuning.cpp, mha/mha_descriptor.cpp,
  and softmax.cpp. No -include macro rename -- the _impl names are what is in
  the tree (RFC 4.6). Internal callers of these entry points and the
  address-of use in ck_impl_lib_loader.cpp were updated to the _impl names.

- Internal _impl header. Added src/include/miopen/miopen_impl.h declaring all
  263 _impl entry points, each with MIOPEN_EXPORT. Included by every TU that
  defines an _impl entry point so the renamed definitions inherit default
  visibility under -fvisibility=hidden and are exported from
  libMIOpen_private.so. (Not installed; the parallel installed consumer header
  and provider rewire are deferred to a later task.)

- Public wrapper. Added src/private/wrapper.cpp: an extern "C" pass-through
  stub for every public entry point that forwards to its _impl symbol via a
  plain function call. Stubs inherit visibility("default") from the in-scope
  <miopen/miopen.h> declaration, so the wrapper exports the public names and no
  _impl names.

- CMake split. MIOpen_private builds the implementation; a new thin MIOpen
  target compiles wrapper.cpp and links PUBLIC MIOpen_private, so existing
  consumers (driver, tests, CK plugins) resolve MIOpen's internal C++ symbols
  transitively against libMIOpen_private.so with no CMake change. SONAME/
  SOVERSION stays 1.0 on both; both targets are installed and exported;
  MIOpen_with_plugins still resolves to the public wrapper. A configure-time
  status message announces the split and the pass-through default.

- Test fix. Relaxed the smoke_tuning_policy assertions to accept either the
  public name or its _impl form in captured MIOPEN_LOG_FUNCTION output, since
  the logged name now comes from the renamed definition.
… back to our pre-pivot plan of a build time flag as well as some other adjustments.
…NN_WRAPPER (ALMIOPEN-2341, ALMIOPEN-2159)

Convert the split from a direct in-source _impl rename to a build-time redefinition header gated by a new MIOPEN_ENABLE_HIPDNN_WRAPPER flag (default OFF). Flag-off produces a single libMIOpen.so byte-equivalent to baseline; flag-on builds libMIOpen_private.so + a thin wrapper.

 - Add option + configure-time status message (top-level CMakeLists.txt)
 - Add src/private/miopen_private_rename.h (263 defines, force-included via
   -include on the private target under MIOPEN_BUILDING_PRIVATE)
 - Revert the 36 renamed api sources + db_path.cpp.in to untouched state
 - Remove now-unneeded src/include/miopen/miopen_impl.h
…N_ENABLE_HIPDNN_WRAPPER (ALMIOPEN-2341, ALMIOPEN-2159)

Wire CI to exercise and guard the MIOPEN_ENABLE_HIPDNN_WRAPPER build flag, covering both the standalone component build and the TheRock superbuild.

Component CI (standalone MIOpen), in component-ci-miopen.yml:
- flag-on-build: builds the wrapper + libMIOpen_private.so with the flag ON, so the compile-time -include rename is validated across every private TU and the wrapper links against the private library (ALMIOPEN-2159 path).
- byte-equivalence: builds the default flag-OFF libMIOpen.so and runs check_byte_equivalence.sh against the committed public_symbols.baseline, gating SONAME, the exported public C API symbol set, absence of _impl leakage, and absence of a libMIOpen_private DT_NEEDED. Content hash is reported as informational only (build-path nondeterministic).

TheRock superbuild CI (therock_matrix.py, therock_configure_ci.py):
- Label-gate the flag so a single MIOpen superbuild can opt in without a second, colliding job. On a rocm-libraries PR, the ci:miopen-hipdnn-wrapper label appends -DTHEROCK_FLAG_MIOPEN_ENABLE_HIPDNN_WRAPPER=ON to the existing MIOpen job via LABEL_GATED_CMAKE_OPTIONS, threaded through collect_projects_to_run(pr_labels). With no label nothing is forwarded, so the default superbuild stays flag-off and byte-equivalent. Pairs with the TheRock flag declaration in ROCm/TheRock#6795.
…LMIOPEN-2159)

Adds a flag-on counterpart to the flag-off byte-equivalence gate. Under MIOPEN_ENABLE_HIPDNN_WRAPPER=ON the wrapper libMIOpen.so must export exactly the miopen.h public-header contract; a few baseline exports that were never in miopen.h (the experimental miopen_internal.h API and the Hidden MIGraphX shims) intentionally stay on libMIOpen_private.so under their original names.

- check_byte_equivalence.sh: new check-wrapper subcommand asserting the wrapper public set == baseline - excluded, no _impl leakage, DT_NEEDED libMIOpen_private present, SONAME libMIOpen.so.1, and no stale excluded entries.
- wrapper_excluded_symbols.txt: committed excluded-symbol contract with rationale.
- component-ci-miopen.yml: run check-wrapper on the flag-on-build job.
…:ROCm/rocm-libraries into users/nhanna/miopen-public-private-split
@NolanHannaAMD NolanHannaAMD self-assigned this Jul 31, 2026
@NolanHannaAMD NolanHannaAMD added the ci:miopen-hipdnn-wrapper Build MIOpen as a public wrapper over a private library with optional runtime forwarding to hipDNN. label Jul 31, 2026
@therock-pr-bot

therock-pr-bot Bot commented Jul 31, 2026

Copy link
Copy Markdown

✅ All Checks Passed — Ready for Review

Check Status Details
📝 PR Description ✅ Pass
Forbidden Files ✅ Pass
🧪 Unit Test ✅ Pass
🔎 pre-commit ✅ Pass
🚫 Draft PR 🔜 To Be Enabled
🚩 Feature Flag 🔜 To Be Enabled
📊 Code Coverage 🔜 To Be Enabled
🤖 therock-pr-bot ✅ Pass

🎉 All checks passed! This PR is ready for review.

📖 Need help? See the Policy FAQ for details on every check and how to fix failures.

🙋 Wish to Override Policy?

@therock-pr-bot

Copy link
Copy Markdown

🎉 All checks passed! This PR is ready for review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:miopen-hipdnn-wrapper Build MIOpen as a public wrapper over a private library with optional runtime forwarding to hipDNN. documentation github actions organization: ROCm project: miopen

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant