Skip to content

feat(kpack): add hipkernelprovider per-arch split handler (AICK-1616)#8347

Open
BrianHarrisonAMD wants to merge 4 commits into
developfrom
users/bharriso/aick-1471-rocke-kpack-split
Open

feat(kpack): add hipkernelprovider per-arch split handler (AICK-1616)#8347
BrianHarrisonAMD wants to merge 4 commits into
developfrom
users/bharriso/aick-1471-rocke-kpack-split

Conversation

@BrianHarrisonAMD

@BrianHarrisonAMD BrianHarrisonAMD commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a kpack artifact-split handler for the hipKernelProvider so its per-arch
content splits into per-arch artifacts, matching the convention used by rocBLAS,
hipBLASLt, MIOpen, and AOTriton.

The rocKE engine ships ISA-specific content with the arch as a directory under the
provider tree (.../hip_kernel_provider/rocke/<arch>/): a kpack archive, its JSON
bundle manifest, and kernel-selection heuristics. HipKernelProviderRockeHandler
routes any file under an arch directory below hip_kernel_provider/ to that arch,
so the whole per-arch bundle travels together. Registered as hipkernelprovider.

Inert until an artifact's split_databases names the handler, which only TheRock
does once its rocm-systems gitlink includes this commit.

Merge order

  1. rocm-systems (this PR): the split handler. Safe to merge first.
  2. TheRock feat(hipkernelprovider): rocKE AOT kpack packaging & arch split TheRock#6427: topology flip, artifact capture, gitlink bump.
  3. rocm-libraries feat(hip-kernel-provider): rocKE AOT producer + kpack packaging (AICK-1473) rocm-libraries#9207: the AOT producer.

Testing

  • shared/kpack/tests/test_database_handlers.py: 87 pass (kpack, JSON sidecar,
    nested files, non-rocke subdirs, multiple arches, xnack, negative cases).
  • End-to-end ArtifactSplitter run: per-arch bundles route to their arch, the
    host .so stays generic, and a rocKE-disabled build yields generic-only.

JIRA ID : AICK-1616

@therock-pr-bot

therock-pr-bot Bot commented Jul 9, 2026

Copy link
Copy Markdown

✅ All Policy Checks Passed

Check Status Details
🌿 Branch Name ✅ Pass
📝 PR Title/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.

@therock-pr-bot

therock-pr-bot Bot commented Jul 9, 2026

Copy link
Copy Markdown

🚫 Please fix the failed policies before requesting reviews.

The following policy checks failed:

  • ❌ PR Title/Description

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

hipKernelProvider engines lay out ISA-specific content with the architecture as
a directory component under the provider's install tree. Today that is the rocKE
engine's ahead-of-time kernel bundles -- a per-arch kpack archive + JSON bundle
manifest under `.../hip_kernel_provider/rocke/<arch>/`. These are ISA-specific,
not arch-neutral, so the hipkernelprovider artifact must be split per-arch
(TheRock topology flips it to target-specific with
`split_databases = ["hipkernelprovider"]`).

Add HipKernelProviderRockeHandler, registered as "hipkernelprovider". Detection
keys on the arch *directory* under `hip_kernel_provider/` (not file names or
extensions), so any future per-arch content (e.g. heuristic model files) routes
automatically by being dropped into an arch directory -- no handler change
needed. Mirrors AotritonHandler's path-component style and reuses the shared
_GFX_ARCH_PATTERN.

Unit tests cover the kpack, the JSON manifest, deeply nested files, alternate
(non-rocke) engine subdirs, multiple arches, xnack, and rejection of non-arch
dirs, the bare arch dir, provider content with no arch dir, paths without a
hip_kernel_provider parent, and out-of-prefix paths.
@BrianHarrisonAMD BrianHarrisonAMD force-pushed the users/bharriso/aick-1471-rocke-kpack-split branch from d4f09e4 to 1953185 Compare July 9, 2026 20:06
@BrianHarrisonAMD BrianHarrisonAMD changed the title feat(kpack): add hipkernelprovider per-arch split handler (AICK-1471) feat(kpack): add hipkernelprovider per-arch split handler (AICK-1616) Jul 9, 2026
@BrianHarrisonAMD BrianHarrisonAMD self-assigned this Jul 9, 2026
@BrianHarrisonAMD BrianHarrisonAMD marked this pull request as ready for review July 9, 2026 20:23
Copilot AI review requested due to automatic review settings July 9, 2026 20:23

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.

Pull request overview

Adds a new kpack “database” split handler to route hipKernelProvider (rocKE) ISA-specific files into per-architecture artifacts, aligning hipKernelProvider behavior with existing per-arch splitting conventions used for other ROCm components.

Changes:

  • Introduces HipKernelProviderRockeHandler that detects the first gfx* architecture directory under hip_kernel_provider/ and uses it as the split key.
  • Registers the new handler under the name hipkernelprovider in the handler registry.
  • Adds comprehensive unit tests covering positive/negative path cases, multiple arches, and xnack variants.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
shared/kpack/python/rocm_kpack/database_handlers.py Adds and registers HipKernelProviderRockeHandler with directory-based arch detection under hip_kernel_provider/.
shared/kpack/tests/test_database_handlers.py Adds unit tests for the new handler and updates registry tests to include it.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…ontainer

The rocKE AOT bundles moved under a generic per-arch container
  engines/arch_content/<engine>/<arch>/
(rocke now, aiter/asm later) so the former engines/hip_kernel_provider/rocke/
directory no longer shadows the hip_kernel_provider plugin file from hipDNN's
loader. Anchor the per-arch split detection on the arch_content directory
component (not the engine name), so any engine's per-arch content routes with
no handler change. The rocKE authoring SDK tree (hip_kernel_provider/rocke/)
is no longer under the anchor and ships generic.

JIRA ID : AICK-1616
@BrianHarrisonAMD BrianHarrisonAMD force-pushed the users/bharriso/aick-1471-rocke-kpack-split branch from 5514a2f to e0fff50 Compare July 10, 2026 15:32
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