Skip to content

fix(ci): restore rocm-systems DVC pull for external rocm-libraries builds (wkmi) - #8204

Merged
tony-davis merged 2 commits into
mainfrom
users/todavis/fix-dvc-rocm-systems-external-libraries
Sep 15, 2026
Merged

tony-davis merged 2 commits into
mainfrom
users/todavis/fix-dvc-rocm-systems-external-libraries

Conversation

@tony-davis

Copy link
Copy Markdown
Contributor

Summary

Fixes #8203. REPO_CONFIGS["rocm-libraries"] in detect_external_repo_config.py
only lists dvc_projects: ["external-rocm-libraries"], but fetch_sources.py --dvc-projects
replaces its own default project list rather than extending it. That silently dropped
rocm-systems from the DVC pull for rocm-libraries-triggered external-repo builds, so the
DVC-tracked wkmi prebuilt libs under TheRock's own rocm-systems submodule
(shared/amdgpu-windows-interop/wkmi/{win,lnx}/lib/) never get pulled — breaking CLR linking
on both Windows (compiler-runtime, missing wkmi.lib) and Linux (wsl-rocdxg, missing
libwkmi.a).

Risk Assessment

Low risk (2/5). Single-entry addition to an existing list, isolated to the rocm-libraries
external-repo path, mirrors the already-shipped rocm-systems entry exactly, and does not
change behavior for any other external repo (rocm-systems, rocgdb).

Related

Device / Architecture Coverage

Build/CI-tooling change, not device/arch-scoped. Affects Windows and Linux external-repo
builds of rocm-libraries equally (both are currently broken the same way; this fix addresses
both).

Testing Summary

  • Unit tests covering REPO_CONFIGS, and generated fetch_sources_args for both
    rocm-libraries and rocm-systems.
  • New regression test (test_rocm_libraries_also_pulls_rocm_systems_dvc) that fails against
    the pre-fix config and passes with the fix.
  • New integration-level regression test
    (test_rocm_libraries_scenario_pulls_rocm_systems_wkmi), mirroring the existing
    test_wsl_rocdxg_scenario (written for the rocm-systems-triggered path), but for the
    rocm-libraries-triggered path — the one that was actually broken.
  • Manually confirmed the new integration test fails against the pre-fix
    dvc_projects=["external-rocm-libraries"] (rocm-systems/wkmi never pulled) and passes with
    the fix.

Testing Checklist

  • Config/detection unit tests - python -m unittest build_tools/github_actions/tests/dvc_external_repo_test.py - Status: Passed
  • fetch_sources DVC unit tests (incl. new regression tests) - python -m unittest build_tools/tests/fetch_sources_dvc_test.py - Status: Passed
  • detect_external_repo_config unit tests - python -m unittest build_tools/github_actions/tests/detect_external_repo_config_test.py - Status: Passed
  • PR CI - GitHub PR checks - Status: Pending
  • Downstream validation - rerun of ROCm/rocm-libraries Multi-Arch CI once this ref is picked up - Status: Pending

Flags / Guardrails

None.

Adjacent Tests Considered

Checked the rocm-systems and rocgdb REPO_CONFIGS entries — unaffected by this change.
Considered making fetch_sources.py --dvc-projects additive to its default instead of
replacing it, which would prevent this whole class of regression at the source; leaving that
as a follow-up idea rather than folding it into this fix, to keep this PR minimal and low-risk.

Technical Changes

  • Add "rocm-systems" to REPO_CONFIGS["rocm-libraries"]["dvc_projects"] in
    detect_external_repo_config.py, with a comment explaining why both entries are required.
  • Update dvc_external_repo_test.py: relax the rocm-libraries dvc_projects equality
    assertions to assertIn (list now has two entries) and add a dedicated regression test.
  • Add an integration-level regression test to fetch_sources_dvc_test.py for the
    rocm-libraries-triggered path.

…ilds (wkmi)

REPO_CONFIGS["rocm-libraries"] in detect_external_repo_config.py only lists
dvc_projects: ["external-rocm-libraries"] (added in #8132 to fix #8131's
missing hipdnn golden-data pull). fetch_sources.py's --dvc-projects flag
replaces its own default project list (["rocm-libraries", "rocm-systems"] on
Windows) rather than extending it. Before #8132, no --dvc-projects flag was
emitted for rocm-libraries at all, so the default silently covered
rocm-systems too. Since #8132, rocm-systems dropped out of the pull list, so
the DVC-tracked wkmi prebuilt libs under TheRock's own rocm-systems submodule
(shared/amdgpu-windows-interop/wkmi/{win,lnx}/lib/) are never pulled for a
rocm-libraries-triggered external-repo build. This broke CLR linking on both
Windows (compiler-runtime, missing wkmi.lib) and Linux (wsl-rocdxg, missing
libwkmi.a).

Add "rocm-systems" back to the dvc_projects list, and add regression tests at
both the config-generation level and the fetch_sources.pull_large_files()
level (mirroring the existing test_wsl_rocdxg_scenario, but for the
rocm-libraries-triggered path).

Fixes #8203

Co-authored-by: Cursor <cursoragent@cursor.com>
@therock-pr-bot

therock-pr-bot Bot commented Sep 14, 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.

@tony-davis
tony-davis requested a review from geomin12 September 14, 2026 22:23
@tony-davis
tony-davis marked this pull request as ready for review September 14, 2026 22:23
Copilot AI lite review requested due to automatic review settings September 14, 2026 22:23
Comment on lines -49 to +57
"dvc_projects": ["external-rocm-libraries"],
# "external-rocm-libraries" pulls DVC-tracked hipdnn golden data from the
# external rocm-libraries checkout itself (#8131). "rocm-systems"
# additionally pulls TheRock's own rocm-systems submodule DVC data
# (e.g. the amdgpu-windows-interop/wkmi prebuilt libs that CLR links
# against on both Windows and Linux/wsl-rocdxg). fetch_sources.py's
# --dvc-projects replaces its default project list rather than
# extending it, so both entries must be listed explicitly here or the
# rocm-systems pull silently disappears again.
"dvc_projects": ["external-rocm-libraries", "rocm-systems"],

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.

Something is wrong here. Why is this code choosing which DVC files to fetch based on the repository that the workflow is running in, rather than the build stage that it is fetching sources for?

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.

Okay to patch as needed to get CI working but this is confusing...

We also shouldn't be fetching rocm-systems sources during builds of the math-libs stage, see

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks Scott, appreciate the context. I'm not steeped in the CI/build system the way you are, so I'll defer to you here.

This PR was really just a proposal to go along with the issue (#8203), meant to unblock the two failing rocm-libraries CI runs. Happy to have you all take it from here, whether that's approving it as-is, adjusting it, or closing it out in favor of something better.

Sounds like the deeper problem (fetching driven by which repo triggers a workflow, rather than the resolved stage/source-sets) is already something your team's been chipping away at (#460, #7560). I'll leave that one with you all.

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.

The usual way to handle an unexpected break is to revert and send back to the original author (#8132 + @adickin-amd in this case).

I don't mind the code here too much, but it's indicative of some preexisting brittleness / inefficiencies in the code (tracing through the history it's a relatively new code path used for just external repos, so some bugs and unforseen usage scenarios can be expected)

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.

🔵 Needs a closer look

The regression test must exercise the production-generated configuration to detect the original failure.

Pull request overview

Restores rocm-systems DVC pulls for external rocm-libraries builds so wkmi libraries are available.

Changes:

  • Adds rocm-systems to the configured DVC projects.
  • Updates configuration and regression tests.
  • Adds coverage for the affected DVC pull scenario.
File summaries
File Summary
build_tools/tests/fetch_sources_dvc_test.py Adds affected-scenario coverage, but the regression test should derive projects from the production configuration so it fails if rocm-systems is removed.
build_tools/github_actions/tests/dvc_external_repo_test.py Verifies the updated configuration and generated arguments.
build_tools/github_actions/detect_external_repo_config.py Adds the missing rocm-systems DVC project.
Review details

Suppressed comments (1)

build_tools/tests/fetch_sources_dvc_test.py:365

  • This test hard-codes the corrected dvc_projects list instead of deriving it from REPO_CONFIGS or the generated fetch_sources_args. As a result, reverting the production config to the pre-fix ['external-rocm-libraries'] still leaves this test passing; it only exercises the already-covered pull_large_files two-project case. Wire the scenario through the external-repo config (or parse the generated arguments) so the regression test fails when the config drops rocm-systems.
            dvc_projects = ["external-rocm-libraries", "rocm-systems"]
            projects = ["rocm-systems"]  # rocm-systems submodule is enabled
  • Files reviewed: 3/3 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Trim the added comments/docstrings in detect_external_repo_config.py
and the two test files down to match the existing terse, present-tense
style. Historical context now lives only in the PR description.

Co-authored-by: Cursor <cursoragent@cursor.com>
@tony-davis

Copy link
Copy Markdown
Contributor Author

Tested in https://github.com/ROCm/rocm-libraries/actions/runs/34909648491?pr=12082, where this fixes the problem.

@tony-davis
tony-davis merged commit 5cbabe7 into main Sep 15, 2026
182 of 185 checks passed
@tony-davis
tony-davis deleted the users/todavis/fix-dvc-rocm-systems-external-libraries branch September 15, 2026 16:47
@github-project-automation github-project-automation Bot moved this from TODO to Done in TheRock Triage Sep 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

4 participants