Skip to content

Introduce HIP_FORCE_API_VERSION for API versioning - #11340

Merged
mikeqinamd merged 6 commits into
developfrom
users/mqin/api-versioning
Sep 11, 2026
Merged

mikeqinamd merged 6 commits into
developfrom
users/mqin/api-versioning

Conversation

@mikeqinamd

@mikeqinamd mikeqinamd commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

When we release a new version, we would like to ensure that older applications still compile with the new header. This PR introduces HIP_FORCE_API_VERSION to specify which API version the application wants to use. By default, it uses the latest version. Older applications can define an older HIP_FORCE_API_VERSION in cflags.

It removes the old #define approach so that we do not pollute the application with macros.

This is the second attempt. The first attempt: #10358

Issue Tracking

JIRA ID : AIRUNTIME-2713

Test Result

The first attempt was reverted because it broke rccl tests. Later, rccl tests was fixed by #11160

I've compiled with all components in TheRock monorepo. All builds fine.

Submission Checklist

@github-actions github-actions Bot added documentation Improvements or additions to documentation project: clr project: hip project: hip-tests labels Sep 8, 2026
@therock-pr-bot

therock-pr-bot Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

✅ All Policy Checks Passed

Check Status Details
📝 PR Description ✅ Pass —
⛔ Forbidden Files ✅ Pass —
🧪 Unit Test ⚠️ Warning Error: Source/code files changed without an accompanying unit test.
Expected: add at least one test file named like test_<name>.py / test_<name>.cpp (or <name>_test.*).
Current: code file(s) changed: projects/clr/hipamd/include/hip/amd_detail/hip_api_trace.hpp, projects/clr/hipamd/include/hip/amd_detail/hip_prof_str.h, projects/clr/hipamd/src/hip_api_trace.cpp, projects/clr/hipamd/src/hip_comgr_helper.cpp, projects/clr/hipamd/src/hip_deprecated_abi.cpp (+11 more); no test file found
🚫 Draft PR 🔜 To Be Enabled —
🚩 Feature Flag 🔜 To Be Enabled —
📊 Code Coverage 🔜 To Be Enabled —

🎉 All policy checks passed!

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

🙋 Wish to Override Policy?

@therock-pr-bot

therock-pr-bot Bot commented Sep 8, 2026

Copy link
Copy Markdown

🚫 Please fix the failed policies before requesting reviews.

The following policy checks failed:

  • ❌ PR Description

The Not ready to Review label has been added to this PR.
Once all policies pass, the label will be removed automatically.

@mikeqinamd
mikeqinamd marked this pull request as ready for review September 8, 2026 22:23
@mikeqinamd
mikeqinamd requested review from a team as code owners September 8, 2026 22:23
mikeqinamd and others added 5 commits September 9, 2026 23:45
Do not pollute sources with #define macros. This commit no longer relies on macro pollution in existing clr code base.

Also migrate the header generation script into Python3. Traversal order of Python dictionary has changed so the order is slightly different than before.

Introduce HIP_ABI_IMPL for clr, hrr and hip-tests.
hipStreamSet/GetAttribute (and graph kernel-node attribute APIs) are
defined in source via the hipStreamAttrID/hipStreamAttrValue alias
macros, while the etalon is parsed from the preprocessed header where
cpp has expanded them to hipLaunchAttributeID/hipLaunchAttributeValue.
The string type-compare saw a mismatch, treated the APIs as non-public
overloads, and dropped their profiling callbacks from hip_prof_str.h.

On mismatch, lazily build a map of object-like #define type aliases and
re-compare after resolving transitively. The alias #defines live in the
source API headers that the build cat's into new_header.h before
preprocessing; because they are cat'd (not #include'd) their bodies carry
no per-source cpp line-marker, so scan the raw cat'd header directly (the
.i input minus its suffix), plus any hip headers named by line-markers.
Only suppresses spelling differences; real type drift still warns.
@mikeqinamd
mikeqinamd force-pushed the users/mqin/api-versioning branch from d6d0db7 to ac45bd5 Compare September 10, 2026 14:05
@mikeqinamd
mikeqinamd merged commit 151fc1e into develop Sep 11, 2026
151 of 177 checks passed
@mikeqinamd
mikeqinamd deleted the users/mqin/api-versioning branch September 11, 2026 18:42
@systems-assistant

Copy link
Copy Markdown
Contributor

TheRock Submodule Bump Activity

Newest first

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.

3 participants