Repository navigation
feat(setup): match rocm-libraries commit to Quartz nightly's TheRock commit - #145
Closed
SamuelReeder wants to merge 2 commits into
Closed
SamuelReeder wants to merge 2 commits into
SamuelReeder wants to merge 2 commits into
Conversation
…commit In --torch-mode rocm, setup_env.py installs ROCm PyTorch and SDK wheels from a Quartz-selected TheRock nightly, then builds hipDNN and its providers (including miopen-provider) from rocm-libraries against that wheel's MIOpen. When the rocm-libraries submodule lags the nightly wheel across a MIOpen/miopen-provider ABI change (for example the MIOpen_private symbol rename in ROCm/rocm-libraries#16128), libmiopen_plugin.so fails to load at runtime. Resolve the rocm-libraries submodule gitlink from ROCm/TheRock at the Quartz-selected nightly's therock_commit via a tree-filtered git fetch (~10 KB, no GitHub REST API rate limit) and use it by default when rocm-libraries/ is absent: - Explicit --rocm-libraries-ref always takes precedence. - Otherwise, in rocm mode (or existing mode on a ROCm venv) with a Quartz-known therock_commit, resolve and cache rocm_libraries_commit in dnn-bench-rocm-build.json so reused venvs make no network call. - Non-ROCm modes and builds without a Quartz therock_commit keep the repository's pinned rocm-libraries submodule commit. - build-dnn-benchmark-performance-image.sh resolves the matched rocm-libraries commit on the host (with an optional --rocm-libraries-ref override) instead of overriding Quartz with the local submodule pin. - CI job summaries now print the matched rocm-libraries commit.
…Docker apt cache, validate ref - Make Quartz therock_commit -> rocm-libraries resolution advisory when rocm-libraries/.git already exists: warn and keep the existing checkout instead of aborting setup when offline or git is unavailable. - Capture git stderr cleanly and handle missing git (FileNotFoundError) without a traceback. - Move ARG ROCM_LIBRARIES_REF below COPY . . in Dockerfile.dnn-benchmark-performance-linux so new nightlies reuse the apt layer. - Validate --rocm-libraries-ref up front in build-dnn-benchmark-performance-image.sh before Quartz or docker build. - Update docs/setup.md options table and Docker section, and add unit tests for offline existing-checkout reuse and missing git.
SamuelReeder
force-pushed
the
users/sareeder/quartz-lock-rocm-libraries
branch
from
November 23, 2026 19:20
4218f15 to
47df596
Compare
SamuelReeder
changed the base branch from
main
to
fm/dnn-bench-quartz-nightly
November 23, 2026 19:20
Collaborator
Author
|
Superseded by #147. |
SamuelReeder
added a commit
that referenced
this pull request
Nov 24, 2026
…libraries submodule (ALMIOPEN-3465) (#147) ## Summary > Builds on the Quartz reader from #135 (rebased onto `main`) and supersedes #145. Previously, `setup_env.py --torch-mode rocm` installed rolling ROCm/PyTorch nightly wheels while building hipDNN and `miopen-provider` from the pinned `rocm-libraries` git submodule. Whenever the nightly wheel's MIOpen and `miopen-provider` changed together (such as `ROCm/rocm-libraries#16128`, renaming `miopenConvolution*GetWorkSpaceSizeRange` to `*_impl` in `libMIOpen_private.so`), `libmiopen_plugin.so` failed to load on `main`. Conversely, rolling both live on every CI run exposes developer PRs to upstream regressions that Quartz does not test (for example rocKE, which TheRock builds with `HIPKERNELPROVIDER_ENABLE_ROCKE=OFF`). This PR replaces the `rocm-libraries` submodule with a per-architecture checked-in **`rocm-pin.json`** updated via gated Quartz bump PRs: 1. **Per-arch checked-in lockstep pin (`rocm-pin.json`):** Maps each architecture (`gfx90a`, `gfx942`, `gfx950`, `gfx1151`) to its own last-known-good `rocm_version`, `build_date`, `therock_commit`, `rocm_libraries_commit`, and `index_url`, with a `default` fallback (`gfx950`) for unlisted architectures and non-ROCm modes. - `gfx90a`: `10.3.0a20261120` / `rocm-libraries` `bd4da658…` (newest nightly passing `gfx90a` Quartz tests) - `gfx942`, `gfx950`, `gfx1151`: `10.3.0a20261123` / `rocm-libraries` `6b5f0a16…` - Default `setup_env.py`, CI (`setup.yml`, `check-deserialize.yml`), and Docker builds read `rocm-pin.json` with zero Quartz/TheRock network calls. 2. **Removed `rocm-libraries` git submodule:** Deleted the `rocm-libraries` gitlink and `.gitmodules` entry (keeping `aiter`), gitignored `/rocm-libraries/`, and updated `setup_env.py` to sparse-clone from `https://github.com/ROCm/rocm-libraries.git` on demand. Eliminates broken Dependabot `rocm-libraries` bump PRs. 3. **Opt-in live Quartz & overrides:** - `--rocm-version latest` queries Quartz live and resolves the matching `rocm-libraries` commit from `ROCm/TheRock` via a bare `--depth 1 --filter=tree:0` fetch (~10 KB, no GitHub REST API rate limit). - `--rocm-version <VERSION>` pins another nightly and resolves its matched `rocm-libraries` commit. - `--rocm-libraries-ref <SHA>` or an existing `rocm-libraries/` checkout/worktree overrides the source commit; on an existing checkout, TheRock lookup is advisory (warns instead of failing offline). 4. **Scheduled per-arch Quartz bump workflow (`.github/workflows/bump-rocm-pin.yml`):** Runs Mon/Wed (and on `workflow_dispatch`), checks each architecture independently in Quartz (`gfx90a`/`gfx942`/`gfx950` on Linux; `gfx1151` on Windows + Linux builds), advances only architectures with a newer passing nightly, leaves failing architectures untouched, opens/updates a PR on `chore/bump-rocm-pin` (skipping redundant pushes when unchanged), and enables squash auto-merge (`gh pr merge --auto --squash`). Updated `check-deserialize.yml` path filters to include `rocm-pin.json` and `setup_env.py`. 5. **Docker:** `build-dnn-benchmark-performance-image.sh` reads `rocm-pin.json` for `--device-target` offline by default (no host `git` or network required), validates `--rocm-version` / `--rocm-libraries-ref` up front, and `Dockerfile.dnn-benchmark-performance-linux` declares `ROCM_TORCH_INDEX_URL`, `ROCM_VERSION`, and `ROCM_LIBRARIES_REF` below `COPY . .` so new pins reuse the apt layer. ## Verification - `.venv/bin/pytest tests/unit/test_setup_env.py tests/unit/metrics/test_machine_info.py tests/unit/reporting/test_schema_v3.py -q`: **186 passed, 1 skipped** (Windows-only test). - `uvx black==25.12.0 --check setup_env.py tests/unit/test_setup_env.py`: passed. - Workflow YAML syntax, `bash -n`, Docker dry runs across `gfx90a`/`gfx942`/`gfx950`/`gfx1201`, and live simulations of `.github/workflows/bump-rocm-pin.yml` (both no-op and single-arch bump paths): all passed. --------- Co-authored-by: Thomas Vy <tvy@amd.com>
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
In
--torch-mode rocm,setup_env.pyinstalls ROCm PyTorch and SDK wheels from a Quartz-selected TheRock nightly, then builds hipDNN and its providers (miopen-provider,hipblaslt-provider,hip-kernel-provider) fromrocm-librariesagainst that wheel's MIOpen. When the pinnedrocm-librariessubmodule lags the nightly wheel across a MIOpen/miopen-providerABI change (such asROCm/rocm-libraries#16128, which renamedmiopenConvolution*GetWorkSpaceSizeRangeto*_implinlibMIOpen_private.so),libmiopen_plugin.sofails to load at runtime andMIOPEN_ENGINEdisappears.This change resolves the
rocm-librariessubmodule commit fromROCm/TheRockat the Quartz nightly'stherock_commit, keepingmiopen-providerand hipDNN in lockstep with the wheel's MIOpen by default:resolve_therock_rocm_libraries_commit()reads therocm-librariesgitlink fromhttps://github.com/ROCm/TheRock.gitattherock_commitusing a bare, tree-filtered git fetch (--depth 1 --filter=tree:0, ~10 KB, no GitHub REST API rate limit) andgit ls-tree. Missinggitand fetch failures produce actionable errors with captured stderr.Setup.ensure_rocm_libraries_checkout()resolves therocm-librariescommit in this order:--rocm-libraries-ref <sha>.rocmmode (orexistingmode with a ROCm venv carryingdnn-bench-rocm-build.json), therocm-librariescommit pinned bytherock_commit. Setup cachesrocm_libraries_commitindnn-bench-rocm-build.jsonso reused venvs make no network call.cpu,none, custom--torch-index-urlwithout Quartz, or a--rocm-versionunknown to Quartz), the repository's pinnedrocm-librariessubmodule commit.rocm-libraries/checkout is kept untouched: the TheRock lookup is advisory (required=False), warning instead of aborting if offline or unreachable, and warning ifHEADdiffers from the Quartz-matched commit.dockerfiles/build-dnn-benchmark-performance-image.shvalidates--rocm-libraries-refup front and resolves the Quartz-matchedrocm-librariescommit on the host instead of overriding Quartz with the local submodule pin.Dockerfile.dnn-benchmark-performance-linuxdeclaresARG ROCM_LIBRARIES_REFafterCOPY . .(next toROCM_VERSION) so new nightlies reuse the apt layer..github/workflows/setup.ymland.github/workflows/check-deserialize.ymlprintrocm_libraries_commitin theLog the ROCm buildsummary line.Verification
pytest tests/unit/test_setup_env.py tests/unit/metrics/test_machine_info.py tests/unit/reporting/test_schema_v2.py -q: 179 passed, 1 skipped (including real-git bare-repo tests, advisory offline reuse, missinggithandling, lockstep checkout + cache reuse, mismatch warning,--rocm-libraries-refoverride, and non-Quartz fallbacks).black==25.12.0 --check setup_env.py tests/unit/test_setup_env.py: passed.bash -n dockerfiles/build-dnn-benchmark-performance-image.sh, invalid--rocm-libraries-refearly exit (code 2), and live dry run (--container-command true --device-target gfx950->ROCm 10.3.0a20261123,rocm-libraries 6b5f0a16f7562fdb94fe4405836998322b507431).