Skip to content

AIRUNTIME-2610 - implement hipKernelSetCacheConfig() - #12628

Merged
g-h-c merged 26 commits into
developfrom
users/g-h-c/AIRUNTIME-2610_implement_hipKernelSetCacheConfig
Oct 26, 2026
Merged

g-h-c merged 26 commits into
developfrom
users/g-h-c/AIRUNTIME-2610_implement_hipKernelSetCacheConfig

Conversation

@g-h-c

@g-h-c g-h-c commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

Implement hipKernelSetCacheConfig()

Technical Details

Note that hipFuncSetCacheConfig() has priority over this function

Issue Tracking

JIRA ID : AIRUNTIME-2610

Test Plan

Added tests:

  • Unit_hipKernelSetCacheConfig_Positive
  • Unit_hipKernelSetCacheConfig_Negative
  • Contract_HipKernelSetCacheConfig_ValidValues_Are_Supported

Test Result

To be tested on MI450+

Submission Checklist

@therock-pr-bot

therock-pr-bot Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

✅ All Policy Checks Passed

Check Status Details
📝 PR Description ✅ Pass —
⛔ Forbidden Files ✅ Pass —
🧪 Unit Test ✅ Pass —
🚫 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 Oct 1, 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.

@g-h-c
g-h-c force-pushed the users/g-h-c/AIRUNTIME-2610_implement_hipKernelSetCacheConfig branch from d4c5d10 to d2427d2 Compare October 6, 2026 14:43
@g-h-c
g-h-c marked this pull request as ready for review October 8, 2026 15:03
Copilot AI balanced review requested due to automatic review settings October 8, 2026 15:03
@g-h-c
g-h-c requested review from a team as code owners October 8, 2026 15:03
@g-h-c

g-h-c commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

Conflicts will be resolved once #13004 is merged

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.

🟡 Changes recommended

Cross-device handling, NVIDIA support, and rocprofiler step-36 integration contain blocking omissions.

5 open findings
What changed in this PR

Implements kernel-level cache configuration, alongside device-specific kernel attributes, cluster-launch handling, tracing, ABI updates, and tests.

Changes:

  • Adds hipKernelSetCacheConfig and hipKernelSetAttributeForDevice.
  • Extends cross-device kernel loading and cluster attribute enforcement.
  • Adds AMD/NVIDIA mappings, profiling integration, and test coverage.
File Description
projects/​rocprofiler-sdk/​source/​lib/​rocprofiler-sdk/​hip/​hip.def.cpp Registers the attribute API.
projects/​rocprofiler-sdk/​source/​lib/​rocprofiler-sdk/​hip/​abi.cpp Extends profiler ABI checks.
projects/​rocprofiler-sdk/​source/​include/​rocprofiler-sdk/​hip/​runtime_api_id.h Adds a runtime API ID.
projects/​rocprofiler-sdk/​source/​include/​rocprofiler-sdk/​hip/​api_args.h Adds traced arguments.
projects/​rocprofiler-sdk/​source/​include/​rocprofiler-sdk/​cxx/​enum_string.hpp Adds enum labeling.
projects/​hipother/​hipnv/​include/​hip/​nvidia_detail/​nvidia_hip_runtime_api.h Adds NVIDIA attribute mappings.
projects/​hip/​include/​hip/​hip_runtime_api.h Declares the new public APIs.
projects/​hip-tests/​CONTRACT_COVERAGE.md Updates coverage totals.
projects/​hip-tests/​catch/​unit/​library/​lib_attribute.cc Tests function override priority.
projects/​hip-tests/​catch/​unit/​library/​hipKernelSetCacheConfig.cc Adds cache configuration tests.
projects/​hip-tests/​catch/​unit/​library/​hipKernelSetAttributeForDevice.cc Adds attribute and cluster tests.
projects/​hip-tests/​catch/​unit/​library/​CMakeLists.txt Builds the new tests.
projects/​hip-tests/​catch/​TEST_PLAN.md Updates generated test inventory.
projects/​hip-tests/​catch/​contract/​kernel_object_attributes/​test_hip_kernel_object_attributes_contract.cc Adds contract tests.
projects/​hip-tests/​catch/​config/​configs/​unit/​library.yaml Registers unit tests.
projects/​hip-tests/​catch/​config/​configs/​contract.yaml Registers contract tests.
projects/​clr/​rocclr/​platform/​ndrange.hpp Tracks explicit cluster dimensions.
projects/​clr/​rocclr/​device/​rocm/​rocvirtual.cpp Applies cache carveout precedence.
projects/​clr/​rocclr/​device/​rocm/​rockernel.cpp Initializes kernel attribute limits.
projects/​clr/​rocclr/​device/​pal/​palkernel.cpp Initializes PAL kernel limits.
projects/​clr/​rocclr/​device/​devkernel.hpp Stores new kernel attributes.
projects/​clr/​rocclr/​device/​devkernel.cpp Initializes attribute state.
projects/​clr/​hipamd/​src/​hip_table_interface.cpp Exposes dispatch wrappers.
projects/​clr/​hipamd/​src/​hip_platform.cpp Propagates explicit cluster state.
projects/​clr/​hipamd/​src/​hip_module.cpp Implements attributes and cluster validation.
projects/​clr/​hipamd/​src/​hip_library.hpp Adds per-device kernel resolution.
projects/​clr/​hipamd/​src/​hip_library.cpp Implements both kernel setter APIs.
projects/​clr/​hipamd/​src/​hip_hcc.map.in Exports new symbols.
projects/​clr/​hipamd/​src/​hip_graph.cpp Resolves graph cluster dimensions.
projects/​clr/​hipamd/​src/​hip_graph_internal.hpp Validates graph cluster attributes.
projects/​clr/​hipamd/​src/​hip_graph_helper.hpp Declares cluster resolution helper.
projects/​clr/​hipamd/​src/​hip_global.hpp Makes dynamic lookup device-aware.
projects/​clr/​hipamd/​src/​hip_global.cpp Resolves functions by device.
projects/​clr/​hipamd/​src/​hip_fatbin.hpp Supports retained image storage.
projects/​clr/​hipamd/​src/​hip_fatbin.cpp Copies images for secondary devices.
projects/​clr/​hipamd/​src/​hip_code_object.hpp Extends device-specific loading.
projects/​clr/​hipamd/​src/​hip_code_object.cpp Loads code objects for target devices.
projects/​clr/​hipamd/​src/​hip_api_trace.cpp Updates dispatch and ABI tracing.
projects/​clr/​hipamd/​src/​amdhip.def.in Exports Windows symbols.
projects/​clr/​hipamd/​include/​hip/​amd_detail/​hip_prof_str.h Adds profiling metadata.
projects/​clr/​hipamd/​include/​hip/​amd_detail/​hip_api_trace.hpp Advances the runtime dispatch table.

🧠 Review effort: Balanced


Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.

Comment thread projects/clr/hipamd/src/hip_library.cpp Resolved

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

🤖 AI-assisted pre-review (for @mangupta)

Comment thread projects/clr/hipamd/src/hip_library.cpp Resolved
@mangupta

mangupta commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

🤖 AI-assisted pre-review (for @mangupta)

Re-reviewed the updated head (5f57102b98f8) — no new findings at or above the posting threshold.

@mangupta

mangupta commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

🤖 AI-assisted pre-review (for @mangupta)

Re-reviewed the updated head (96c745040df6) — no new findings at or above the posting threshold.

@g-h-c
g-h-c force-pushed the users/g-h-c/AIRUNTIME-2610_implement_hipKernelSetCacheConfig branch 2 times, most recently from 3d65189 to a6610bb Compare October 13, 2026 11:31
@mangupta

Copy link
Copy Markdown
Contributor

🤖 AI-assisted pre-review (for @mangupta)

Re-reviewed the updated head (a6610bb4e145) — no new findings at or above the posting threshold.

g-h-c added 18 commits October 22, 2026 22:25
…Contract_KernelObjectAttributes_HipKernelSetCacheConfig_Values_AreSupported
…TABLE_STEP_VERSION enumerations is required'
…ult to hipError_t via hipCUResultTohipError() not hipCUDAErrorTohipError()
…butes_HipKernelSetCacheConfig_Values_AreSupported cannot be the named the same as the AMD veresion
…eConfig_NvidiaPre120Unsupported_IsSkipped to contract.yaml
@g-h-c
g-h-c force-pushed the users/g-h-c/AIRUNTIME-2610_implement_hipKernelSetCacheConfig branch from 611a840 to 38379c1 Compare October 22, 2026 21:25
@g-h-c
g-h-c merged commit 67dfbc7 into develop Oct 26, 2026
245 of 251 checks passed
@g-h-c
g-h-c deleted the users/g-h-c/AIRUNTIME-2610_implement_hipKernelSetCacheConfig branch October 26, 2026 09:15
@systems-assistant

Copy link
Copy Markdown
Contributor

TheRock Submodule Bump Activity

Newest first

andraghetti added a commit that referenced this pull request Oct 27, 2026
* fix(hrr): regenerate sources for hipKernelSetCacheConfig
  
  #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.
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.

6 participants