feat(hipkernelprovider): rocKE AOT kpack packaging & arch split#6427
Draft
BrianHarrisonAMD wants to merge 5 commits into
Draft
feat(hipkernelprovider): rocKE AOT kpack packaging & arch split#6427BrianHarrisonAMD wants to merge 5 commits into
BrianHarrisonAMD wants to merge 5 commits into
Conversation
✅ All Checks Passed — Ready for Review
📖 Need help? See the Policy FAQ for details on every check and how to fix failures. |
|
🎉 All checks passed! This PR is ready for review. |
a919909 to
c4fd82e
Compare
c4fd82e to
9f9aacd
Compare
The rocke AOT producer packs kernels with rocm_kpack and compiles HSACO via libamd_comgr at build time. Declare both as build deps of the hipkernelprovider subproject so they are staged and found: rocm_kpack via ROCKE_KPACK_PYTHON_DIR, amd-comgr via find_library in rocke_aot.cmake. rocm-kpack is also a runtime dep (the plugin links the kpack reader); amd-comgr is build-time only.
9f9aacd to
527be15
Compare
The rocke engine's plugin depends on the kpack runtime, which ships in the core wheel while the plugin ships in the libraries wheel. On Windows the loader has no rpath to reach across wheels, so the wheel dlopen tests must add kpack's directory to the DLL search path when loading a hipdnn plugin. - Register kpack in rocm_sdk/_dist_info.py so find_libraries locates the core-wheel lib (rocm_kpack*.dll on Windows). - Extend the Windows plugin-load branch in BOTH duplicated dlopen tests (libraries_test.py and devel_test.py) to add the kpack directory via find_libraries. Generic to any plugin. Inert until a plugin actually links kpack; verified via a companion rocm-libraries dry-run.
527be15 to
baf96f9
Compare
BrianHarrisonAMD
added a commit
that referenced
this pull request
Jul 9, 2026
Flip HIPKERNELPROVIDER_ENABLE_ROCKE ON and point the rocm-libraries gitlink at users/bharriso/aick-1471-dryrun-libs (#9207 AOT producer+kpack merged with #9115 enable-rocKE-build + provider-mode test/packaging fixes). #9115 is what makes the rocKE build/test/package cleanly in provider mode; without it the enabled build fails. Revert this commit before merging #6427.
BrianHarrisonAMD
added a commit
that referenced
this pull request
Jul 9, 2026
Flip HIPKERNELPROVIDER_ENABLE_ROCKE ON and point the rocm-libraries gitlink at users/bharriso/aick-1471-dryrun-libs (#9207 AOT producer+kpack with the comgr libclang-cpp LD_LIBRARY_PATH fix, merged with #9115 enable-rocKE-build + provider-mode test/packaging fixes). Revert before merging #6427.
The rocKE engine ships per-arch AOT bundles (kpack + JSON sidecar + kernel- selection heuristics) under the engine plugin dir at lib/hipdnn_plugins/engines/hip_kernel_provider/rocke/<arch>/. These are ISA-specific, not arch-neutral, so the hipkernelprovider artifact is split per-arch. Three coupled changes: - artifact-hipkernelprovider.toml: the default lib component only captures shared libraries (*.so/*.dll), so the .kpack/.json/heuristics tree would be dropped from the artifact. Add an explicit include of **/hip_kernel_provider/rocke/** so the per-arch bundles land in the runtime artifact. - BUILD_TOPOLOGY.toml: flip hipkernelprovider to type = "target-specific" with split_databases = ["hipkernelprovider"] so TheRock splits each arch's bundle into that arch's artifact via the rocm-systems "hipkernelprovider" kpack handler. - build_python_packages.py: add hipkernelprovider to device_artifact_filter so the per-ISA device wheels pick up the arch-tagged bundles in kpack-split mode (it was already in libraries_artifact_filter for the arch-neutral/legacy path). Requires the rocm-systems hipkernelprovider kpack handler, so TheRock's rocm-systems gitlink must include it before this merges.
fa7d34f to
e6000d9
Compare
36c3870 to
ccc6550
Compare
…es/arch_content rocKE's per-arch AOT bundles moved out of engines/hip_kernel_provider/rocke/ (which collided with the hip_kernel_provider plugin file and broke plugin loading) to a generic per-arch container engines/arch_content/<engine>/<arch>/. The lib component includes only that container now; it splits per-arch via split_databases = ["hipkernelprovider"], and future engines (aiter, asm) drop under arch_content/<engine>/ with no changes. The earlier include of **/hip_kernel_provider/rocke/** (added with the split) also pulled the rocKE Python SDK into the runtime lib artifact as a side effect. The SDK is dev/test content -- already captured by the [test] component -- so drop it from lib: the runtime artifact now carries only the .so plugins and the per-arch kpacks. JIRA ID : AICK-1471
ccc6550 to
b709fdc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
TheRock-side enablement for the rocKE AOT + kpack feature (AICK-1616). Three coupled areas, all inert until a rocm-libraries consumer produces the bundles:
rocm-kpackandamd-comgrto the hipkernelproviderBUILD_DEPS(the producer packs withrocm_kpackand compiles HSACO vialibamd_comgr), plusrocm-kpackinRUNTIME_DEPSand a-DROCKE_KPACK_PYTHON_DIRsource cache var. comgr is resolved byfind_libraryon the rocke side.kpackinrocm_sdk/_dist_info.pyand add kpack's directory to the Windows dlopen search path in both wheel load tests (libraries_test.pyanddevel_test.py) when loading a hipdnn plugin.hipkernelprovidertotype = "target-specific"withsplit_databases = ["hipkernelprovider"], capture the per-arch bundle tree in the artifact TOML, and addhipkernelprovidertodevice_artifact_filter.Install layout
rocKE per-arch bundles install next to the engine plugin at
lib/hipdnn_plugins/engines/hip_kernel_provider/rocke/<arch>/(
rocke_client_<arch>.kpack+.jsonsidecar + kernel-selection heuristics).The host plugin
.sois arch-neutral and stays generic; the per-arch tree splitsper-arch via the rocm-systems
hipkernelproviderkpack handler.Cross-repo sequence
hipkernelproviderkpack split handler.Hard ordering constraint:
KPACK_SPLIT_ARTIFACTSdefaults on, so the split runsfor
hipkernelproviderand shells out--split-databases hipkernelprovideragainst TheRock's pinned
rocm-systems. This PR must bump therocm-systemsgitlink to include #8347 before merge, otherwise the split invokes an unknown
handler and fails. Safe with rocKE disabled (no bundles): the split yields
generic-only with no empty per-arch artifacts (verified end-to-end).
Risk Assessment
Medium. The topology flip makes the split run for
hipkernelprovider. Verifiedsafe when rocKE is disabled (generic-only) and when enabled (per-arch routing),
but it hard-requires the rocm-systems handler in the pinned gitlink. Do not merge
before #8347 lands and the gitlink is bumped. Build deps and wheel packaging are
additive and inert until a consumer produces bundles.
Testing Summary
build_topology_test.pypasses;BUILD_TOPOLOGY.tomlandartifact-hipkernelprovider.tomlparse and expose the target-specific type,split_databases, and the**/hip_kernel_provider/rocke/**include.hipkernelproviderdeclare block:rocm-kpack/amd-comgrland in deps,-DROCKE_KPACK_PYTHON_DIRresolves._dist_info.pyregisters kpack without collision; bothdlopen tests add the kpack directory.
and provider tests end-to-end.
Testing Checklist
build_topology_test.pyROCKE_KPACK_PYTHON_DIR)_dist_info+ dlopen search-path in both tests)Technical Changes
ml-libs/CMakeLists.txt(hipkernelprovider): addrocm-kpack+amd-comgrtoBUILD_DEPS,rocm-kpacktoRUNTIME_DEPS, and-DROCKE_KPACK_PYTHON_DIR.ml-libs/artifact-hipkernelprovider.toml: the default lib component only captures shared libs, so add an explicitinclude = ["**/hip_kernel_provider/rocke/**"]so the per-arch bundles land in the runtime artifact.BUILD_TOPOLOGY.toml:hipkernelprovidertotarget-specific+split_databases = ["hipkernelprovider"], with a comment on why it is not arch-neutral.build_tools/build_python_packages.py: addhipkernelprovidertodevice_artifact_filter(it was already inlibraries_artifact_filter).rocm_sdk/_dist_info.py+libraries_test.py+devel_test.py: kpack registration and the cross-wheel dlopen search-path fix.JIRA ID : AICK-1616