Skip to content

fix(hip-kernel-provider): build the kernel ingestor without rocKE (ALMIOPEN-2643) - #12659

Merged
BrianHarrisonAMD merged 21 commits into
developfrom
users/bharriso/hkp-ingestor-without-rocke
Oct 7, 2026
Merged

BrianHarrisonAMD merged 21 commits into
developfrom
users/bharriso/hkp-ingestor-without-rocke

Conversation

@BrianHarrisonAMD

@BrianHarrisonAMD BrianHarrisonAMD commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Configuring hip-kernel-provider with HIPDNN_ENABLE_KERNEL_INGESTOR=ON and HIPKERNELPROVIDER_ENABLE_ROCKE=OFF fails on develop. There are two causes:

  • A FATAL_ERROR rejects that combination outright.
  • Descriptor packaging treats the rocKE toolchain as mandatory for every pack root: the wheel-supply checks, comgr resolution, the private wheel interpreter, and the rocKE pytest suites.

This PR puts every rocKE-specific piece of descriptor packaging behind HIPKERNELPROVIDER_ENABLE_ROCKE, so the ingestor builds, packs and tests with the hip producer alone when rocKE is off.

JIRA ID : ALMIOPEN-2643

Risk Assessment

Risk level 3. This touches the provider's build and test wiring: CMake packaging functions, the packer CLI, and pytest registration. The rocKE-ON configuration is unchanged. In a configure of each tree (compared before merging the current develop), the generated pack commands in build.ninja and the pytest CTestTestfile.cmake are byte-identical to develop. The new behaviour only applies to a configuration that could not be configured before.

ASIC Coverage

Architecture-independent. The change is build and packaging wiring, with no kernel, dispatch or default-selection change. Passing PR CI is sufficient. The pointwise packs were exercised end to end on gfx90a (below) as a smoke test of the rocKE-OFF path.

Testing Summary

  • Reproduction: on develop, configuring with ingestor ON / rocKE OFF fails at dnn-providers/hip-kernel-provider/CMakeLists.txt:414. The same configuration succeeds with this branch, and a full build packs all five test descriptor roots with the rocKE filters (on an earlier revision of this branch).
  • rocKE-OFF packaging tests: every rocKE-dependent test lives under descriptor-packaging/tests/rocke/, and the rocKE-OFF build excludes that one directory. New tests pin the OFF filters: --exclude-folder rocKE removes the rocKE/ family folder from a root without reading it, and --disable-kind rocke prunes rocke UKDs elsewhere like arch-pruned ones, drops a KDP left with none, and keeps hip content in a mixed KDP. Hip-driven tests now provide the producer-agnostic coverage that previously came only from rocKE corpora: desk-check invariants on a real pack, hipcc provenance, the hip example tree, and pool failure ordering.
  • rocKE-OFF provider tests: the unit and integration quick suites, plus the descriptor census, run against the rocKE-OFF packed descriptors.
  • rocKE-ON: the generated pack commands for all six wired roots match develop apart from the behaviour changes listed under Technical Changes, and tests/rocke/ runs in the same ctest entries as before. Not run end to end here: a provider-level configure or build, a real GPU run, and the Windows comgr derivation. The Windows lane names no production root, so product packing is dormant there (the default engine root holds nothing for gfx1151) and is not verified by that lane.
  • rocKE-OFF CMake wiring: test_hkp_pack_wiring.py sub-configures the packaging module with rocKE OFF and an interpreter with no pip. It asserts that the pack step runs with --exclude-folder rocKE --disable-kind rocke and no rocKE environment, PYTHONPATH prepend or wheel stamp. It also asserts that a stray ROCKE_* keyword (including an empty value) or a missing ENABLE_ROCKE fails configure, and that only the rocKE-OFF suites ignore tests/rocke/. No CI lane builds the ingestor-ON / rocKE-OFF combination end to end; the full build was verified locally on an earlier revision of this branch and not repeated after merging current develop.
  • Packer flags and guards: test_hkp_pack_layout.py runs the real tools/hkp_pack.py for --exclude-folder and --disable-kind (including an unknown kind, which fails naming it) and fails if main() drops either flag; the desk-check suite asserts symbol distinctness on a real hip pack; a stubbed producer that writes no archive for a compiling UKD fails the pack.
  • Known limits (accepted): with rocKE ON, a root named through HIPKERNELPROVIDER_PRODUCTION_SOURCE_ROOT whose KDPs prune on every build arch is dormant (one STATUS line) rather than a configure failure, and a compiling UKD whose arch list is mistyped (a bare gfx94 for gfx942) is pruned like content authored for another arch. If a pass-through UKD keeps its KDP alive and no shard writes an archive, the pack succeeds with the compiled kernel missing and no error. develop raised there because it asked whether the root held compiling source regardless of pruning; that check also fails legitimately arch-restricted content, and the packer cannot tell the two apart. With rocKE OFF, rocke content outside rocKE/ and rocKE-only named roots are pruned or left dormant rather than raising an error.

Testing Checklist

  • Configure + build, ingestor ON / rocKE OFF - cmake --preset hip-kernel-provider -DHIPDNN_ENABLE_KERNEL_INGESTOR=ON -DHIPKERNELPROVIDER_ENABLE_ROCKE=OFF && ninja - Status: Passed (earlier revision of this branch; not repeated after merging current develop)
  • hkp packaging tests, rocKE-OFF shape - pytest descriptor-packaging/tests --ignore=tests/rocke (what the rocKE-OFF ctest entries run) - Status: Passed (373 passed, 1 skipped; measured after merging current develop, with rocm_kpack supplied; the skip is a named reason: the in-tree engine root carries no hip bundle)
  • Provider quick suites + descriptor census, rocKE OFF - ctest -R 'hip_kernel_provider_tests_quick_suite|hip_kernel_provider_integration_tests_quick_suite|hkp-census' - Devices: gfx90a (MI210) - Status: Passed (earlier revision of this branch; not repeated after merging current develop)
  • rocKE ON pack/test wiring identical to develop - generated pack commands compared per root in scratch configures of the packaging module after merging current develop - Status: Passed for all six wired roots, apart from hidden paths no longer being inputs of the pack step; not a provider-level configure or build
  • Full packaging suite, rocKE ON - pytest descriptor-packaging/tests - Status: Passed (471 passed, 1 skipped, including tests/rocke/; measured after merging current develop). CI runs both pytest entries (quick and standard) over tests/ on the Linux and Windows lanes, both configured with ingestor ON / rocKE ON
  • pre-commit - pre-commit run --files <changed files> - Status: Passed on the feature and test-coverage commits. The merge of develop and the follow-up RUNBOOK edit were committed without hooks (the large-files hook hung locally on I/O); their files are covered by PR CI
  • PR CI - GitHub PR checks - Status: Pending

Technical Changes

  • CMakeLists.txt: remove the FATAL_ERROR for ingestor ON with rocKE OFF.
  • HkpPackaging.cmake:
    • hkp_wire_pack_target takes a required ENABLE_ROCKE <bool>.
      • ON: requires the rocKE interpreter, ready stamp, python dir and wheel stamp, and wires the pack as before.
      • OFF: rejects every ROCKE_* keyword and runs the pack under the base Python3_EXECUTABLE with no rocKE environment, PYTHONPATH prepend or wheel dependency. It passes --exclude-folder rocKE and --disable-kind rocke.
    • The rocKE wheel-supply checks, comgr resolution and private wheel install run only when rocKE is enabled.
    • With rocKE disabled, the pytest entries pass a single --ignore for tests/rocke/. With it enabled, the commands are unchanged.
  • hkp_pack.py / pipeline.py / descriptors.py: new repeatable --exclude-folder NAME (a top-level family folder of the root that this build does not pack, matched case-insensitively; a name that matches no folder is ignored) and --disable-kind KIND (a kernel_source kind with no producer in this build; its UKDs are pruned like arch-pruned ones and a KDP left with none is dropped; an unknown kind is an error). CMake passes rocKE and rocke when rocKE is OFF, so rocKE content is skipped rather than compiled. Without the flags the packer still compiles rocke, so ON behaviour of the CLI is unchanged.
  • Packing and dormancy (applies with rocKE ON as well as OFF): a root with nothing to pack for the build's arches, including every KDP pruned for those arches, is now a clean skip in run_pipeline rather than a HkpPackError, and configure leaves such a root dormant with one STATUS line, including a root named by HIPKERNELPROVIDER_PRODUCTION_SOURCE_ROOT (previously a hard failure). The "descriptors but no archive" invariant is checked per shipped shard rather than per root: it names the offending arch and UKD, and catches an archive-less shard next to a healthy one. It keys on what survives arch pruning, so it no longer fires for a compiling UKD that pruning removed (see Known limits). Hidden paths are no longer inputs of the pack step.
  • Tests:
    • rocKE tests are isolated under descriptor-packaging/tests/rocke/, which has its own conftest.py owning the in-tree rocke import path and the rocke_available / rocke_importable gates. No shared test file contains rocKE tests.
    • Hip-driven tests backfill the producer-agnostic coverage: desk-check invariants 2/3 and CLI verdicts on a real hip pack, the pre-pack toc_key NOT-APPLICABLE report, same-filename folders both shipping, the hip example tree packing end to end, hipcc provenance, and the pool naming the first failure in walk order.
    • The synthesised ELF/msgpack helpers move to synthesised_objects.py, so both conftest levels can share them.
    • Regression tests for the OFF filters: a rocke UKD is pruned by kind (inline and standalone .ukd.json forms), a KDP left with no enabled kind does not ship, an excluded folder is never read, and a mixed KDP keeps its hip UKDs.
    • test_hkp_pack_wiring.py covers the rocKE-OFF CMake wiring and its misuse errors.
    • Helpers shared across test modules live in plain modules (synthesised_objects.py, pack_helpers.py, cmake_harness.py).
  • Docs: the provider README, descriptor-packaging/README.md, projects/hipdnn/docs/Building.md and the hipDNN ingestor/superbuild skill docs describe the rocKE-ON and rocKE-OFF packaging modes.

HIPDNN_ENABLE_KERNEL_INGESTOR=ON with HIPKERNELPROVIDER_ENABLE_ROCKE=OFF
failed at configure: the provider hard-errored on the combination, and
descriptor packaging treated the rocKE wheels, comgr probe and private wheel
interpreter as mandatory for every pack root.

Gate every rocKE-specific piece of descriptor packaging on
HIPKERNELPROVIDER_ENABLE_ROCKE:

- hkp_wire_pack_target takes a required ENABLE_ROCKE. OFF runs the pack
  under the base Python3 interpreter with no rocKE environment, wheel edge
  or PYTHONPATH prepend, and passes --no-rocke to hkp_pack.py.
- hkp_pack.py --no-rocke makes any rocke UKD selected for a packed arch a
  hard pack error naming the flag; arch-pruned rocke UKDs are left alone.
- The wheel-supply assertions, comgr resolution and wheel install run only
  with rocKE enabled.
- With rocKE disabled, the rocKE-only pytest files are not registered and
  rocKE tests in shared files (marked `rocke`) are deselected.

With rocKE enabled the pack commands and pytest registrations are
unchanged.
@therock-pr-bot

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

Copy link
Copy Markdown

✅ All Checks Passed — Ready for Review

Check Status Details
📝 PR Description ✅ Pass —
⛔ Forbidden Files ✅ Pass —
🧪 Unit Test ✅ Pass —
🔎 pre-commit ✅ Pass —
🚫 Draft PR 🔜 To Be Enabled —
🚩 Feature Flag 🔜 To Be Enabled —
📊 Code Coverage 🔜 To Be Enabled —
🤖 therock-pr-bot ✅ Pass —

🎉 All checks passed! This PR is ready for review.

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

🙋 Wish to Override Policy?

@therock-pr-bot

Copy link
Copy Markdown

🎉 All checks passed! This PR is ready for review.

…rocke

Every descriptor-packaging test that needs rocKE (the rocke/kernels
packages, comgr, the rocKE wheels, the rocKE example corpus, all-rocke
fixtures, or the rocke producer) lives under tests/rocke/, with its own
conftest owning the rocke import path and the rocke_available /
rocke_importable gates. No shared test file carries rocKE tests.

With HIPKERNELPROVIDER_ENABLE_ROCKE=OFF, hkp_register_tests passes a single
--ignore for tests/rocke; with it ON the pytest commands are unchanged from
develop. The per-test `rocke` marker, its conftest hook and the marker
deselection are removed.

Producer-agnostic coverage that previously came only from rocKE corpora
is backfilled with hip-driven tests: desk-check invariants 2/3 and CLI
verdicts on a real hip pack, the pre-pack toc_key NOT-APPLICABLE report,
same-filename folders both shipping, the hip example tree packing end to
end, hipcc provenance, and the pool naming the first failure in walk
order. The synthesised ELF/msgpack helpers move to synthesised_objects.py
so both conftest levels can share them.
- The arch-pruned --no-rocke gate test now packs a KDP that survives the
  requested arch through a hip UKD while carrying a rocke UKD scoped to
  another arch, inline and as a standalone .ukd.json, so it reaches the
  gate; a gate that ignored per-UKD arch fails it.
- Add test_hkp_pack_wiring.py: sub-configures HkpPackaging.cmake with
  rocKE OFF and a pip-less interpreter, asserting the pack runs with
  --no-rocke and no rocKE env, PYTHONPATH prepend or wheel stamp; that any
  ROCKE_* keyword (including an empty value) and a missing ENABLE_ROCKE fail
  configure; and that only the OFF suites ignore tests/rocke.
- The --no-rocke gate raises inside the per-arch error handling, naming
  every offending arch and dropping each failing shard.
- _hkp_pack_producer reads the caller's parsed arguments instead of
  re-parsing ${ARGV}, so an empty ROCKE_* value is rejected under OFF.
- rocKE configure errors attribute the requirement to rocKE being enabled
  and offer -DHIPKERNELPROVIDER_ENABLE_ROCKE=OFF; the kpack runtime check no
  longer demands pip, which only the rocKE wheel install needs.
- test_worker_inherits_parent_sys_path checks a conftest-only path so it
  can fail again; the desk-check packed variant set models the real
  post-pack shape (spec under provenance.spec) and gains a drift case.
- Helpers shared across test modules move to plain modules
  (pack_helpers.py, cmake_harness.py); no test imports another test
  module's private names.
- Building.md and the ingestor/superbuild skill docs describe the
  rocKE-optional ingestor.
@codecov

codecov Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #12659      +/-   ##
===========================================
- Coverage    71.93%   70.46%   -1.46%     
===========================================
  Files         2863     2936      +73     
  Lines       472676   483327   +10651     
  Branches     69824    69675     -149     
===========================================
+ Hits        339975   340566     +591     
- Misses      109118   118839    +9721     
- Partials     23583    23922     +339     
Flag Coverage Δ *Carryforward flag
TensileLite-CPP 48.82% <ø> (-0.50%) ⬇️ Carriedforward from 553f3c1
TensileLite-Unit 81.58% <ø> (-1.69%) ⬇️ Carriedforward from 553f3c1
hipBLAS 90.62% <ø> (ø) Carriedforward from 553f3c1
hipBLASLt 35.55% <ø> (-3.36%) ⬇️ Carriedforward from 553f3c1
hipCUB 82.68% <ø> (ø) Carriedforward from 553f3c1
hipDNN 86.64% <ø> (+<0.01%) ⬆️
hipFFT 54.32% <ø> (+10.89%) ⬆️ Carriedforward from 553f3c1
hipRAND 76.12% <ø> (ø) Carriedforward from 553f3c1
hipSOLVER 68.96% <ø> (ø) Carriedforward from 553f3c1
hipSPARSE 86.99% <ø> (ø) Carriedforward from 553f3c1
rocBLAS 48.30% <ø> (+0.05%) ⬆️ Carriedforward from 553f3c1
rocFFT 46.67% <ø> (-0.95%) ⬇️ Carriedforward from 553f3c1
rocRAND 57.42% <ø> (-0.03%) ⬇️ Carriedforward from 553f3c1
rocSOLVER 76.83% <ø> (+<0.01%) ⬆️ Carriedforward from 553f3c1
rocSPARSE 74.76% <ø> (+0.13%) ⬆️ Carriedforward from 553f3c1
rocThrust 78.34% <ø> (-14.81%) ⬇️ Carriedforward from 553f3c1

*This pull request uses carry forward flags. Click here to find out more.
see 304 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…platform-independent

- cmake_harness strips the rocKE runtime environment (ROCKE_*) from the
  child build's environment alongside PYTHON*/PIP_*/CMAKE_*. A rocKE-ON
  ctest entry exports ROCKE_COMGR_LIB into pytest, which leaked into the
  rocKE-OFF wiring test's recorded environment and failed its no-rocKE-env
  assertion.
- The arch-pruned --no-rocke gate test no longer asserts the missing hipcc's
  name appears in the failure: Windows' FileNotFoundError text omits the
  filename. It still asserts the failure is the hip compile for the arch and
  not the rocKE gate.
…dormant without rocKE

Since #12311 the default production root holds only the rocKE gfx950
attention_dense bundle, so an ingestor-ON, rocKE-OFF build targeting
gfx950 failed the product pack on the --no-rocke gate.

With rocKE disabled, the default root now goes dormant when every UKD the
packer selects for the build's arches is kind rocke, decided by the
packer's own selection (pipeline.selects_only_rocke) at configure. A named
root, or a default root that selects any hip UKD, stays wired and still
fails on a selected rocke UKD.
…d kinds, skip empty packs

Replace the rocKE-specific --no-rocke gate and default-root special case
with two generic filters and one dormancy rule:

- HKP_DESCRIPTOR_FAMILIES maps a top-level family folder to the option
  that enables it (rocKE=HIPKERNELPROVIDER_ENABLE_ROCKE); a disabled
  family's folder is excluded under every root (--exclude-folder).
- A kernel_source kind the build has no producer for is pruned like an
  arch-pruned UKD (--disable-kind); a KDP left empty does not ship.
  Unknown kinds remain a validation error.
- A root with nothing to pack is skipped, not failed. Configure asks the
  packer (pipeline.shipped_engines) what each arch would ship, leaves the
  production root dormant when nothing, named or default, and derives
  Gfx950AttentionDense availability from the same answer, replacing the
  CMake JSON mirrors.
…g every filter drop, one arch-selection rule
…-ingestor-without-rocke

# Conflicts:
#	dnn-providers/hip-kernel-provider/descriptor-packaging/examples/descriptors/README.md
#	dnn-providers/hip-kernel-provider/descriptor-packaging/tests/test_desk_check_invariants.py
#	projects/hipdnn/tools/ai/skills/hipdnn-ingestor-engine/RUNBOOK.md
@BrianHarrisonAMD
BrianHarrisonAMD marked this pull request as ready for review October 4, 2026 19:36
@BrianHarrisonAMD
BrianHarrisonAMD requested review from a team as code owners October 4, 2026 19:36
…acker CLI, invariant 4 on hip packs, and the no-archive guard
…-ingestor-without-rocke

# Conflicts:
#	dnn-providers/hip-kernel-provider/descriptor-packaging/python/hkp_pack/pipeline.py
#	projects/hipdnn/tools/ai/skills/hipdnn-superbuild/SKILL.md

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

It appears to do what is claimed. I'm unsure if the benefit of having the ingestor enabled with ROCKE disabled is enough to offset all the extra complexity. Maybe something to discuss further. Approving for now as I don't see any blockers.

Reject unrecognised hkp_wire_pack_target arguments, quote the ENABLE_ROCKE
values, match --exclude-folder case-insensitively in the packer and CMake, and
document exclude_folders / disabled_kinds on load_flat_input.
BradPepersAMD added a commit that referenced this pull request Oct 6, 2026
The kernel ingestor builds without rocKE; FlyDSL packs on the ingestor
gate.


Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
BradPepersAMD added a commit that referenced this pull request Oct 6, 2026
The kernel ingestor builds without rocKE; FlyDSL packs on the ingestor
gate.


Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@BrianHarrisonAMD
BrianHarrisonAMD merged commit 4bb5ad7 into develop Oct 7, 2026
98 of 99 checks passed
@BrianHarrisonAMD
BrianHarrisonAMD deleted the users/bharriso/hkp-ingestor-without-rocke branch October 7, 2026 18:49
@assistant-librarian

Copy link
Copy Markdown
Contributor

TheRock Submodule Bump Activity

Newest first

yassinsolim added a commit that referenced this pull request Oct 9, 2026
Four conflicts, all between develop's descriptor-packaging rework (#12950, #12943, #12729, #12659) and this branch's field-test tooling.

DescriptorLoader.hpp: both conflicts are comment only. Kept develop's streaming KDP parse and its statement of where the packager puts provenance (inline on a KDP header, sidecar for a packed UKD, anywhere in unpacked or authored trees), and kept this branch's behaviour that provenance is ignored without a warning. The code (PROVENANCE_KEY, isExtensionKey, the skip in requireKnownKeys) merged clean.

IngestorGenerator/README.md: merged the verify_variant_sets row, keeping develop's --provenance-root synopsis and sentence and this branch's rocm_kpack fallback and exit 3 sentence. Took develop's variant_reachability row.

tests/test_mine_shapes.py: both sides append to the end of the file. Kept both, develop's TestAnEmittedBenchmarkShapeListIsMinable after this branch's dtype-exclusion and node-inputs classes. No helper names collide.

RUNBOOK.md stage 4: kept this branch's clang-tidy pointer and took develop's rewritten HIPKERNELPROVIDER_ENABLE_ROCKE paragraph, which no longer claims the option is unconditional.
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.

2 participants