Skip to content

fix(hrr): regenerate sources for hipKernelSetCacheConfig - #14241

Merged
andraghetti merged 1 commit into
developfrom
users/andraghetti/hrr-regen-kernel-cache-config
Oct 27, 2026
Merged

andraghetti merged 1 commit into
developfrom
users/andraghetti/hrr-regen-kernel-cache-config

Conversation

@andraghetti

Copy link
Copy Markdown
Contributor

JIRA ID : AIRUNTIME-3080

Motivation

#12628 appended hipKernelSetCacheConfig to HipDispatchTable on develop without regenerating the HRR sources. The checked-in capture and playback dispatch sources, hrr_api_args.h and the API matrix expectations no longer match the HIP headers, so ctest hrr-generator-rules fails on develop in test_generated_files_current. This PR regenerates them.

Technical Details

  • Generated sources: re-run gen_hrr_api_args.py. Nothing in them is edited by hand.
  • Classification of the new API:
    • Capture records it through a generated shim.
    • Playback is a no-op that warns once. Its hipKernel_t argument is one of the opaque types playback cannot turn back into a live object (_UNTRANSLATED_PLAYBACK_TYPES), so playback_defaults_to_noop applies. hipKernelSetAttributeForDevice is a no-op for the same reason.
    • The API matrix lists it under unreachable, group absent-from-sdk-headers, next to hipKernelSetAttributeForDevice. The SDK headers the matrix workloads compile against declare neither, so no workload can call it.
  • API matrix: derive_manifest.py --update-baseline, then check_matrix.py --emit-cxx. The baseline gains one runtime API, one generated capture and one no-op replay.
  • HRR_VERSION goes from 10 to 11. The new runtime slot takes the first compiler API ID and shifts the nine compiler IDs up by one, so a v10 reader would decode those events as the wrong API. The version history in DESIGN.md and the generator's header comment record v11.
  • The enable-recording inspector reads __hipRegisterFatBinary at ID 551 in a v11 archive, and its SKILL.md names v8 to v11 as the versions it scans. Without the new entry, tools/tests/test_skill_api_ids.py fails.

Issue Tracking

Fixes the hrr-generator-rules failure that #12628 left on develop. #13700 and #9098 also move HRR_VERSION from 10 to 11; whichever of them lands after this PR moves to 12.

Test Plan

  • In projects/hrr: python -m unittest discover -s tools/tests and pytest tests/scripts, plus the enable-recording skill tests.
  • check_hrr_api_compat.py against the develop header, on this tree and with HRR_VERSION left at 10.
  • HRR build with capture compiled into CLR, unit and integration ctest, then every Catch2 integration case one at a time, hidden cases included, on MI350X (gfx950). The gate lkcc2-d16655a ran this tree on top of develop d16655a458. The baseline gdevd16655 is that develop on the same runner and scripts.

Test Result

Check This PR develop d16655a
Build, unit ctest pass fails: hrr-generator-rules, the generated sources and the API classification have drifted
Integration ctest pass pass
Visible integration cases 132 pass, 4 skip 132 pass, 4 skip
Hidden integration cases 125 of 156 pass 125 of 156 pass

Every case has the same status as on develop. The 31 hidden cases that do not pass also fail or skip on develop.

  • tools/tests: 31 tests pass, including the two test_generated_files_current checks that fail on develop.
  • tests/scripts: 150 passed.
  • enable-recording skill tests: 137 passed, 28 skipped.
  • check_hrr_api_compat.py: passes for 10 to 11. With HRR_VERSION left at 10 it fails, because the compiler API IDs moved.

Submission Checklist

#12628 appended hipKernelSetCacheConfig to HipDispatchTable without
regenerating the HRR sources, so the checked-in capture and playback
dispatch, hrr_api_args.h and the API matrix expectations no longer
match the headers and ctest hrr-generator-rules fails on develop.

Capture records it through a generated shim. Playback is a no-op: its
hipKernel_t argument cannot be translated back into a live kernel, the
same reason hipKernelSetAttributeForDevice is a no-op. The SDK headers
the matrix workloads build against do not declare it, so the matrix
lists it as unreachable with the other APIs absent from them.

The new runtime slot takes the first compiler API ID and shifts the
compiler IDs up by one, so HRR_VERSION goes from 10 to 11. The
enable-recording inspector gets the v11 ID of __hipRegisterFatBinary.
@andraghetti
andraghetti requested review from a team as code owners October 26, 2026 10:38
Copilot AI balanced review requested due to automatic review settings October 26, 2026 10:38
@therock-pr-bot

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/src/hrr/hip_capture_generated.cpp, projects/hrr/include/hrr/hrr_api_args.h, projects/hrr/playback/hip_playback_generated.cpp, projects/hrr/skills/enable-recording/scripts/inspect_archive.py, projects/hrr/tests/integration/hrr_api_matrix_expectations.h (+1 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?

Copilot AI 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.

🟢 Approval recommended

The generated changes, version bump, matrix expectations, and inspector mapping are consistent, with no blocking issues identified.

No open issues 🎉

What changed in this PR

Regenerates HIP record-and-replay (HRR) sources to match the dispatch-table addition of hipKernelSetCacheConfig, resolving the generated-source drift introduced by #12628.

Changes:

  • Adds generated capture support and a warning-once no-op playback handler.
  • Updates API matrix classifications, counts, and integration expectations.
  • Bumps the archive format to v11 for shifted compiler API IDs and aligns the inspector and documentation.
File Description
projects/​hrr/​tools/​gen_hrr_api_args.py Updates the generated format version and history to v11.
projects/​hrr/​tools/​api-matrix/​api_matrix.yaml Classifies the API as absent from SDK headers.
projects/​hrr/​tools/​api-matrix/​api_classes_baseline.json Updates API and classification counts.
projects/​hrr/​tests/​integration/​hrr_api_matrix_expectations.h Adds the new API’s matrix expectations.
projects/​hrr/​skills/​enable-recording/​SKILL.md Documents inspector support through v11.
projects/​hrr/​skills/​enable-recording/​scripts/​inspect_archive.py Maps v11 fat-binary registration to API ID 551.
projects/​hrr/​playback/​hip_playback_generated.cpp Adds no-op playback and updates dispatch tables.
projects/​hrr/​include/​hrr/​hrr_api_args.h Adds the payload structure and updates API IDs and version.
projects/​hrr/​DESIGN.md Documents v11 and the compiler API ID shift.
projects/​clr/​hipamd/​src/​hrr/​hip_capture_generated.cpp Adds and registers the generated capture shim.

Review effort: Balanced

@danielbolsson danielbolsson 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.

Checked 0030787: I regenerated the same change independently on a clean develop, and the generated sources, hrr_api_args.h and the baseline numbers (557 to 558 APIs) are identical to this PR. Capture shim, playback NOOP, the unreachable matrix entry next to hipKernelSetAttributeForDevice and the v11 bump with inspector id 551 are consistent with #13472. Nothing blocking.

@andraghetti
andraghetti merged commit 169ae78 into develop Oct 27, 2026
491 of 587 checks passed
@andraghetti
andraghetti deleted the users/andraghetti/hrr-regen-kernel-cache-config branch October 27, 2026 10:36
@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.

4 participants