Skip to content

feat(ci): scope multi-arch nightly tests to rocm-libraries subtrees - #14048

Closed
geomin12 wants to merge 5 commits into
developfrom
users/geomin12/nightlies-no-sys-tests
Closed

geomin12 wants to merge 5 commits into
developfrom
users/geomin12/nightlies-no-sys-tests

Conversation

@geomin12

@geomin12 geomin12 commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

This is a temporary fix to trigger rocm-libraries tests only for schedule runs.

Currently, this logic ONLY applies to PRs + pushes, however, after ROCm/TheRock#9062 lands, we will make a permanent fix in TheRock in order for rocm-libraries to not run unnecessary rocm-systems tests!

test ran here: https://github.com/ROCm/rocm-libraries/actions/runs/40338314942

local output:

 ===== INPUT: changed_projects =====
     dnn-providers/hip-kernel-provider,dnn-providers/hipblaslt-provider,dnn-providers/integration
     -tests,dnn-providers/miopen-provider,projects/composablekernel,projects/hipblas,projects/hip
     blas-common,projects/hipblaslt,projects/hipblaslt/tensilelite,projects/hipcub,projects/hipdn
     n,projects/hipfft,projects/hiprand,projects/hipsolver,projects/hipsparse,projects/hipsparsel
     t,projects/hiptensor,projects/hipthreads,projects/miopen,projects/rocalution,projects/rocbla
     s,projects/rocfft,projects/rocprim,projects/rocrand,projects/rocsolver,projects/rocsparse,pr
     ojects/rocthrust,projects/rocwmma,projects/rpp,shared/mxdatagenerator,shared/origami,shared/
     rocroller,shared/stinkytofu,shared/tensile

     ===== OUTPUT: projects_to_test =====
     [
       "composable_kernel",
       "hipblas",
       "hipblas-common",
       "hipblaslt",
       "hipblasltprovider",
       "hipcub",
       "hipdnn",
       "hipdnn-integration-tests",
       "hipdnn-samples",
       "hipfft",
       "hipkernelprovider",
       "hiprand",
       "hipsolver",
       "hipsparse",
       "hipsparselt",
       "hiptensor",
       "hipthreads",
       "miopen",
       "miopenprovider",
       "origami",
       "rocalution",
       "rocblas",
       "rocfft",
       "rocprim",
       "rocprim_tests",
       "rocrand",
       "rocroller",
       "rocsolver",
       "rocsparse",
       "rocthrust",
       "rocwmma",
       "rpp",
       "tensilelite",
       "tensilelite-common"
     ]

Closes ROCm/TheRock#9401

The nightly passed `changed_projects: ''`, TheRock's "test everything"
signal, so every scheduled run spent GPU runner time on ROCm system
components (hip-tests, rocrtst, rocgdb, rocprofiler-*, amdsmi, rccl, ...)
that no change in this repository can affect.

Derive the test scope from .github/repos-config.json so the nightly
resolves tests through TheRock's consumer graph, the same path presubmit
already takes. Reading the config rather than hardcoding a list keeps the
scope correct as subtrees are added or removed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@geomin12
geomin12 requested a review from tony-davis October 20, 2026 18:57
@geomin12 geomin12 added the ci:skip Skip all CI builds/tests for this PR label Oct 20, 2026
@geomin12
geomin12 requested review from a team as code owners October 20, 2026 18:57
@github-actions github-actions Bot added github actions project: none Does not target any component labels Oct 20, 2026
@therock-pr-bot

therock-pr-bot Bot commented Oct 20, 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

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

Copy link
Copy Markdown

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

.github/repos-config.json
sparse-checkout-cone-mode: false

- name: Collect rocm-libraries subtrees

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.

can we move this please into a proper script? that is horrible to read and debug here

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good call

The inline heredoc-Python and shell step-summary block in the multi-arch
nightly workflow were hard to read and impossible to run locally. Move the
logic into .github/scripts/therock_nightly_test_scope.py, reusing the existing
load_repo_config/get_valid_prefixes helpers instead of re-parsing
repos-config.json ad hoc, so there is one definition of a `category/name`
subtree. Output is identical to the inline version.

An empty subtree list now fails the job, since TheRock reads an empty
changed_projects as "test everything" -- the opposite of this job's purpose.

The configure job checks out .github and sets up Python to match
therock-ci-nightly.yml.
Record why the script exists and what has to land in TheRock before it,
its test, and the configure job that consumes it can be deleted.
@geomin12
geomin12 requested a review from a team as a code owner October 26, 2026 14:07
Trim the module docstring to the temporary-workaround rationale and cut the
tests to the three cases that carry weight: the category/name mapping, the
empty-config guard, and a smoke check against the real repos-config.json.

Use the runner's preinstalled python3 instead of actions/setup-python, which
drops a step but needs --break-system-packages under PEP 668, as noted in
.github/scripts/DEVELOPMENT.md. Move the job to ubuntu-26.04.
Pinning the interpreter via actions/setup-python installs into a Python the
action owns, so pip needs no --break-system-packages escape hatch and the job
is unaffected by whatever the runner image ships.
Comment on lines +8 to +14
A scheduled run has no diff to narrow testing against, so TheRock would
otherwise test every component it builds, including ROCm system components
(hip-tests, rocrtst, rocgdb, rocprofiler-*, amdsmi, rccl, ...) that no change
in this repository can affect. This script emits every subtree registered in
.github/repos-config.json in `category/name` form, which the workflow passes to
TheRock as `changed_projects` so testing stays scoped to the code this
repository owns (plus the consumers TheRock's dependency graph pulls in).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See this issue please:

We can build something into the scheduled CI that limits which builds/tests to run to those affected by specific submodules only. Consider that there are 11 submodules in https://github.com/ROCm/TheRock/blob/main/.gitmodules and each may want to run some tests (filtered following https://github.com/ROCm/TheRock/blob/main/docs/rfcs/RFC0013-Consumer-Based-Test-Selection.md). As implemented here, each of up to those 11 repositories may want to fork this 200 lines of code. We should teach the common code how to handle this. Each repository shouldn't need to maintain its own list of repos-config.json files for the CI system to understand how to test changes in it.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point! that's a better approach than this (hacky for sure)

@tony-davis

tony-davis commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Hi all! I'm picking this up from Geo (thanks Geo!).

I think @ScottTodd is right that this belongs in TheRock and not in each repo. Here's the plan. I'd love a sanity check before I go too far.

  1. The generator in Activate the static consumer-graph parser for test selection TheRock#8757 already knows which root (rocm-libraries or rocm-systems) each subtree came from. It just drops it. I have a change that keeps it, so therock_subtree_map.json is grouped by repo, and the hand overrides are too. @endurthiabhilash, I'd like to put it up as a PR against your branch (like fix(ci): make every test-matrix job reachable by scoped selection TheRock#8990), if that works for you. Separately, I think the projects/cuid override should be shared/cuid.
  2. For a scheduled run from an external repo with no changed_projects, configure_multi_arch_ci.py would expand it to every subtree that repo owns, and setup_multi_arch.yml would expose it as an output. Manual dispatch would stay "test everything" so a full run is still possible.
  3. This PR then shrinks to passing needs.setup.outputs.changed_projects through to the build jobs. No script, no repos-config.json parsing, and no pin bump (the normal bump automation picks it up). Until the pin includes the TheRock change, the output is empty, which is the same "test everything" we have today, so it's safe to merge in either order. To test it, I'll temporarily bump the pin on this branch, do a manual run, and revert that before final review. rocm-systems gets the same thing for a one-line change.

I checked parity locally. TheRock's own view of rocm-libraries selects the same 38 test jobs as this PR's script, and no rocm-systems jobs.

The thing is, step 2 lands in the same spot as ROCm/TheRock#8827 and Geo's follow-up to ROCm/TheRock#9062. @geomin12, would you rather I fold it into your part 3, or go first and you rebase? Either is fine with me.

One behavior note: this keeps direct consumers, so a rocm-systems component that consumes a library can still run. I think that's what we want, since it's a break rocm-libraries could actually cause. It's the main difference from the exclude_test_owners approach in ROCm/TheRock#8138. I bet we can close that one out if this works.

I'll leave this PR open until the TheRock side is in.

cc: @

@geomin12

Copy link
Copy Markdown
Collaborator Author

approach is rather hacky. starting a new worktree

@geomin12 geomin12 closed this Oct 29, 2026
@ScottTodd

Copy link
Copy Markdown
Member

Regarding the design points, one idea I've had is for the GitContext struct we have here: https://github.com/ROCm/TheRock/blob/d5b1dc2f6aa4a64f44b44f89b222437bbe433ca4/build_tools/github_actions/configure_multi_arch_ci.py#L459-L544 to change from:

math-libs/CMakeLists.txt                        # files in TheRock
math-libs/artifact-prim.toml                    # files in TheRock
rocm-libraries                                  # opaque submodule

to contain a general top down view of the full virtual monorepo, e.g. list of files changed like

math-libs/CMakeLists.txt                        # files in TheRock
math-libs/artifact-prim.toml                    # files in TheRock
rocm-libraries/projects/rocprim/CMakeLists.txt  # file in a submodule

then we'd associate each file with some nodes in the build graph, e.g.

  • math-libs/CMakeLists.txt is associated with (potentially) all math-libs projects (rocPRIM, rocThrust, rocFFT, etc.), TheRock could conservatively say "build/test everything" or it could scope to "safe to use prebuilt artifacts for rocm-systems projects" (artifact fingerprints should handle this) and "safe to skip tests for rocm-systems projects" (artifact fingerprints could feed into this decision, or other heuristics)
  • math-libs/artifact-prim.toml is associated with the prim artifact: https://github.com/ROCm/TheRock/blob/d5b1dc2f6aa4a64f44b44f89b222437bbe433ca4/math-libs/CMakeLists.txt#L252-L261
      therock_provide_artifact(prim
        DESCRIPTOR artifact-prim.toml
  • rocm-libraries/projects/rocprim/CMakeLists.txt is part of the rocPRIM subproject declared here: rocm-libraries/projects/rocprim/CMakeLists.txt
      therock_cmake_subproject_declare(rocPRIM
        EXTERNAL_SOURCE_DIR "${THEROCK_ROCM_LIBRARIES_SOURCE_DIR}/projects/rocprim"

Note how the mapping is more difficult for the superproject code in TheRock but we have a pretty good idea from just the build system code itself what each path in rocm-libraries/rocm-systems affects.

Where a full file list is difficult to generate (API limitations, large diffs), we could at least hint to the CI system that a particular submodule is what changed and ensure that only the relevant builds/tests get scheduled.

I'm not opposed to incremental approaches to better scoping of builds/tests, but I want us to keep in mind:

  1. Maintenance costs as subprojects are added/removed/changed
  2. Where the code lives, and which repositories need to make edits (I don't want to block rocm-libraries on needing a more recent TheRock commit, there shouldn't be multiple conflicting sources of truth for configuration data, etc.)
  3. What the fallback behavior is. In TheRock we default to "build and test [quick] everything" but in rocm-libraries the default should be closer to "build and test [standard] rocm-libraries projects"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:skip Skip all CI builds/tests for this PR github actions organization: ROCm project: none Does not target any component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CI] The rocm-libraries Multi-Arch Nightly runs rocm-systems and standalone-repo tests that rocm-libraries doesn't own

4 participants