Repository navigation
feat(setup): pin ROCm + rocm-libraries in rocm-pin.json, remove rocm-libraries submodule (ALMIOPEN-3465) #147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
967eab1
feat(setup): install the newest ROCm nightly that Quartz reports usab…
tvy-amd 580c10e
feat(setup): pin ROCm + rocm-libraries in rocm-pin.json, remove rocm-…
SamuelReeder 436727c
feat(setup): switch rocm-pin.json to per-arch pins and enable bump PR…
SamuelReeder 65aec3e
refactor(setup): extract tools/bump_rocm_pin.py and make workflow man…
SamuelReeder File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,105 @@ | ||
| # Copyright Advanced Micro Devices, Inc. | ||
| # SPDX-License-Identifier: MIT | ||
|
|
||
| name: bump-rocm-pin | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| rocm_version: | ||
| description: 'Optional ROCm nightly version (e.g. 10.3.0a20261123); blank or latest bumps each arch independently from Quartz.' | ||
| required: false | ||
| type: string | ||
| default: '' | ||
| archs: | ||
| description: 'Optional comma-separated archs to update (e.g. gfx942,gfx950); blank updates all archs in rocm-pin.json.' | ||
| required: false | ||
| type: string | ||
| default: '' | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: bump-rocm-pin | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| bump: | ||
| runs-on: ubuntu-24.04 | ||
| timeout-minutes: 15 | ||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0 | ||
| with: | ||
| python-version: '3.12' | ||
|
|
||
| - name: Resolve per-arch ROCm pins from Quartz | ||
| id: resolve | ||
| env: | ||
| REQUESTED_VERSION: ${{ inputs.rocm_version || '' }} | ||
| REQUESTED_ARCHS: ${{ inputs.archs || '' }} | ||
| run: | | ||
| python3 tools/bump_rocm_pin.py \ | ||
| --rocm-version "${REQUESTED_VERSION}" \ | ||
| --archs "${REQUESTED_ARCHS}" \ | ||
| --body-file "${RUNNER_TEMP}/bump-rocm-pin-body.md" \ | ||
| --github-output "${GITHUB_OUTPUT}" | ||
|
|
||
| - name: Open or update bump PR | ||
| if: steps.resolve.outputs.changed == 'true' | ||
| env: | ||
| # Setting repository secret ROCM_PIN_BUMP_TOKEN (a PAT or GitHub App | ||
| # token) lets the pushed branch trigger pull_request CI checks | ||
| # automatically; otherwise GITHUB_TOKEN opens/updates the PR. | ||
| GH_TOKEN: ${{ secrets.ROCM_PIN_BUMP_TOKEN || secrets.GITHUB_TOKEN }} | ||
| PR_TITLE: ${{ steps.resolve.outputs.title }} | ||
| REPO: ${{ github.repository }} | ||
| run: | | ||
| set -euo pipefail | ||
| branch="chore/bump-rocm-pin" | ||
| body_file="${RUNNER_TEMP}/bump-rocm-pin-body.md" | ||
|
|
||
| remote="https://x-access-token:${GH_TOKEN}@github.com/${REPO}.git" | ||
| # Skip pushing when the open bump branch already carries this exact | ||
| # pin, so repeated runs do not trigger redundant GPU CI or overwrite | ||
| # manual fix-up commits on the bump PR. | ||
| if git fetch --quiet "${remote}" "refs/heads/${branch}" 2>/dev/null; then | ||
| if git show FETCH_HEAD:rocm-pin.json 2>/dev/null | cmp -s - rocm-pin.json; then | ||
| echo "Branch ${branch} already has this exact rocm-pin.json; skipping push." | ||
| exit 0 | ||
| fi | ||
| fi | ||
|
|
||
| git config user.name "github-actions[bot]" | ||
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
| git checkout -B "${branch}" | ||
| git add rocm-pin.json | ||
| git commit -m "${PR_TITLE}" | ||
| git push --force "${remote}" "HEAD:refs/heads/${branch}" | ||
|
|
||
| pr_number=$(gh pr list --repo "${REPO}" --head "${branch}" --state open --json number --jq '.[0].number // empty') | ||
| if [ -n "${pr_number}" ]; then | ||
| gh api -X PATCH "repos/${REPO}/pulls/${pr_number}" \ | ||
| -f title="${PR_TITLE}" \ | ||
| -F body=@"${body_file}" >/dev/null | ||
| echo "Updated PR #${pr_number}" | ||
| else | ||
| pr_url=$(gh pr create --repo "${REPO}" --base main --head "${branch}" \ | ||
| --title "${PR_TITLE}" \ | ||
| --body-file "${body_file}") | ||
| echo "Created ${pr_url}" | ||
| pr_number="${pr_url##*/}" | ||
| fi | ||
|
|
||
| # Enable squash auto-merge so the bump PR merges as soon as required | ||
| # checks and CODEOWNER approval pass (main ruleset blocks direct push). | ||
| if ! gh pr merge "${pr_number}" --repo "${REPO}" --auto --squash; then | ||
| echo "::warning::Could not enable auto-merge on PR #${pr_number}; merge manually after review." | ||
| fi | ||
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.