Skip to content

feat(ci): adding prefix ci: to gfx targets along with configure_ci_labels.py script to keep it uniform - #8435

Merged
geomin12 merged 8 commits into
mainfrom
users/geomin12/ci-label-multi-arch-p1
Sep 23, 2026
Merged

geomin12 merged 8 commits into
mainfrom
users/geomin12/ci-label-multi-arch-p1

Conversation

@geomin12

Copy link
Copy Markdown
Contributor

Progress on #7375 with much more updates incoming as we expand our labelling system

We are beginning the label enhancement work incrementally, with some work starting when #8322 lands.

In this PR, we are handling:

  • adding prefix ci: to gfx targets
  • CI labels in multi-arch are available to external repos and TheRock. must be consistent

We are adding a script to create labels and ensure uniformity across all repos that use multi-arch CI. we are also adding ci: on the gfx targets and using the script to ensure uniformity. The script has no destructive properties, only creating or updating

Local dry run:

$ python3 configure_ci_labels.py --repo ROCm/TheRock --create --force --dry-run

Creating CI labels in ROCm/TheRock...
(--force: existing labels will be updated to match)
(DRY RUN - no changes will be made)

  [DRY RUN] Would create label: ci:gfx103X-linux
  [DRY RUN] Would create label: ci:gfx103X
  [DRY RUN] Would create label: ci:gfx90X-dcgpu
  [DRY RUN] Would create label: ci:gfx94X-dcgpu
  [DRY RUN] Would create label: ci:gfx950-dcgpu
  [DRY RUN] Would create label: ci:gfx110X-dgpu
  [DRY RUN] Would create label: ci:gfx110X-all
  [DRY RUN] Would create label: ci:gfx1103
  [DRY RUN] Would create label: ci:gfx1150
  [DRY RUN] Would create label: ci:gfx1151
  [DRY RUN] Would create label: ci:gfx1152
  [DRY RUN] Would create label: ci:gfx1153
  [DRY RUN] Would create label: ci:gfx120X-all
  [DRY RUN] Would create label: ci:gfx125x
  [DRY RUN] Would create label: ci:gfx125X-dcgpu
  [DRY RUN] Would create label: ci:gfx900
  [DRY RUN] Would create label: ci:gfx906
  [DRY RUN] Would create label: ci:gfx908
  [DRY RUN] Would create label: ci:gfx90a
  [DRY RUN] Would create label: ci:gfx90c
  [DRY RUN] Would update label: test:ocltst (color: #03B8ED -> #3FA7D6)
  [DRY RUN] Would update label: test:hip-tests (color: #20566E -> #3FA7D6)
  [DRY RUN] Would update label: test:hipkernelprovider (color: #20566E -> #3FA7D6)
  [DRY RUN] Would update label: test:amdsmi (color: #277804 -> #3FA7D6, desc: "" -> "For pull requests, runs full t...")
  [DRY RUN] Would update label: test:rocgdb-cpu (color: #20566E -> #3FA7D6)
  [DRY RUN] Would update label: test:rocgdb-gpu (color: #20566E -> #3FA7D6)
  [DRY RUN] Would update label: test:rocgdb (color: #20566E -> #3FA7D6)
  [DRY RUN] Would update label: test:rocprofiler-sdk-spm (desc: "To run rocprofier-sdk-spm jobs" -> "To run rocprofiler-sdk-spm job...")
  [DRY RUN] Would update label: test:rpp (desc: "" -> "For pull requests, runs full t...")

Summary: 20 created, 9 updated, 40 already matched

Local actual run:

$ python3 configure_ci_labels.py --repo ROCm/TheRock --create --force

Creating CI labels in ROCm/TheRock...
(--force: existing labels will be updated to match)
  Created label: ci:gfx103X-linux
  Created label: ci:gfx103X
  Created label: ci:gfx90X-dcgpu
  Created label: ci:gfx94X-dcgpu
  Created label: ci:gfx950-dcgpu
  Created label: ci:gfx110X-dgpu
  Created label: ci:gfx110X-all
  Created label: ci:gfx1103
  Created label: ci:gfx1150
  Created label: ci:gfx1151
  Created label: ci:gfx1152
  Created label: ci:gfx1153
  Created label: ci:gfx120X-all
  Created label: ci:gfx125x
  Created label: ci:gfx125X-dcgpu
  Created label: ci:gfx900
  Created label: ci:gfx906
  Created label: ci:gfx908
  Created label: ci:gfx90a
  Created label: ci:gfx90c
  Updated label: test:ocltst (color: #03B8ED -> #3FA7D6)
  Updated label: test:hip-tests (color: #20566E -> #3FA7D6)
  Updated label: test:hipkernelprovider (color: #20566E -> #3FA7D6)
  Updated label: test:amdsmi (color: #277804 -> #3FA7D6, desc: "" -> "For pull requests, runs full t...")
  Updated label: test:rocgdb-cpu (color: #20566E -> #3FA7D6)
  Updated label: test:rocgdb-gpu (color: #20566E -> #3FA7D6)
  Updated label: test:rocgdb (color: #20566E -> #3FA7D6)
  Updated label: test:rocprofiler-sdk-spm (desc: "To run rocprofier-sdk-spm jobs" -> "To run rocprofiler-sdk-spm job...")
  Updated label: test:rpp (desc: "" -> "For pull requests, runs full t...")

Summary: 20 created, 9 updated, 40 already matched

geomin12 and others added 6 commits September 22, 2026 13:30
Add configure_ci_labels.py to create and sync CI-related labels
(ci:, gfx, test:, test_filter:, etc.) across repositories. Cleanup
only targets gfx, test:, and test_filter: prefixes to avoid touching
other labels. Intended for local use only.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove cleanup feature from configure_ci_labels.py (create only)
- Add ci: prefix to gfx labels (e.g., ci:gfx120X-all, ci:gfx950-dcgpu)
- Update ci_behavior_manipulation.md docs to reflect new label format

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Update configure_multi_arch_ci.py to recognize the new ci:gfx prefix
for GPU architecture labels (e.g., ci:gfx120X-all instead of gfx120X-all).
Also update tests to use the new label format.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When using --create --force, existing labels will be updated to match
the color and description defined in the script. Without --force,
existing labels are skipped (checked by name only).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
All test: labels now use consistent color #3FA7D6 (light blue).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When using --force --dry-run, now shows what will change:
  [DRY RUN] Would update label: test:amdsmi (color: #277804 -> #3FA7D6)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@geomin12 geomin12 added the ci:skip Skip all CI builds/tests for this PR label Sep 22, 2026
@therock-pr-bot

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

Pre-commit check failed

⛔ pre-commit failed

Please run locally:

  • python -m pip install pre-commit
  • pre-commit install
  • pre-commit run --all-files --show-diff-on-failure

This repo uses .pre-commit-config.yaml.

- Add fmt: off/on around CI_LABELS to preserve readability
- Shorten test: label descriptions to fit line limits
- Fix other long lines to pass black formatter

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@therock-pr-bot

Copy link
Copy Markdown

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

# Labels from ROCm/TheRock for CI behavior manipulation.
# Format: (name, color, description)
# fmt: off
CI_LABELS: list[tuple[str, str, str]] = [

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.

Any specific reason we have CI_LABELS as list of tuples instead of list[Label]?
I see that the Label dataclass (line 115) is only used for labels read back from GitHub and CI_LABELS as list of tuples. Now create_labels compares tuples against a Label-keyed map on every iteration. Would it make more sense to make this as list[Label] too?

# Family keys are lowercase, so normalize the target.
target = label.split("-")[0].lower()
# Strip ci: prefix, then split on dash to get the base family.
target = label[3:].split("-")[0].lower()

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.

nit: might want to remove hardcoded length 3 here and use len. Using manual length will cause silent failures in case the prefix changes in the future.

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.

We can use label.removeprefix("ci:") here instead of label[3:]

Suggested change
target = label[3:].split("-")[0].lower()
target = label.removeprefix("ci:")].split("-")[0].lower()

| `ci:asan` | Enable ASAN CI builds and tests. ASAN CI is skipped by default on PRs unless this label is present. |
| `ci:host-asan` | Alias for `ci:asan`. Enable ASAN CI builds and tests. |
| `gfx...` | Opt-in to building and testing the specified gfx family (e.g. `gfx120X`, `gfx950`) |
| `ci:gfx...` | Opt-in to building and testing the specified gfx family (e.g. `ci:gfx120X-all`, `ci:gfx950-dcgpu`) |

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.

(follow-up ok) let's consider ways to make this table easier to understand and reference, such as:

# Family keys are lowercase, so normalize the target.
target = label.split("-")[0].lower()
# Strip ci: prefix, then split on dash to get the base family.
target = label[3:].split("-")[0].lower()

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.

We can use label.removeprefix("ci:") here instead of label[3:]

Suggested change
target = label[3:].split("-")[0].lower()
target = label.removeprefix("ci:")].split("-")[0].lower()

Comment on lines +64 to +66
# test: labels (project-specific test opt-in)
("test:hipblaslt", "3FA7D6", "Run full tests for hipblaslt"),
("test:hipcub", "3FA7D6", "Run full tests for hipcub"),

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.

How about a named constant for each color? Then we can document the colors in one place and change them with a one line code change as needed.

Comment on lines +191 to +193
if dry_run:
print(f" [DRY RUN] Would update label: {name} ({change_str})")
return True

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.

Does this script also log when a label does not need updates? The Summary: 20 created, 9 updated, 40 already matched output seems like no?

How about logging that too?

  [DRY RUN] Would create label: ci:gfx90a
  [DRY RUN] Would create label: ci:gfx90c
+ [DRY RUN] Label is already up to date: test:rocprim (color: #3FA7D6)
  [DRY RUN] Would update label: test:ocltst (color: #03B8ED -> #3FA7D6)
  [DRY RUN] Would update label: test:hip-tests (color: #20566E -> #3FA7D6)

The lines don't fit neatly along the same column that way though :P

- Convert CI_LABELS from list of tuples to list[Label] dataclass
- Add named color constants for label categories (COLOR_CI_GENERAL, etc.)
- Use label.removeprefix("ci:") instead of hardcoded label[3:]
- Add logging for labels already up to date during dry run

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

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

LGTM

@geomin12
geomin12 merged commit aecba2e into main Sep 23, 2026
21 of 22 checks passed
@geomin12
geomin12 deleted the users/geomin12/ci-label-multi-arch-p1 branch September 23, 2026 20:26
# Trim suffixes from labels since amdgpu_family_matrix.py
# specifies families with no suffix (e.g. `gfx94x`) but
# we have some labels like `gfx94X-dcgpu` or `gfx103X-linux`.
# we have some labels like `ci:gfx94X-dcgpu` or `ci:gfx103X-linux`.

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.

Oh, should we also update https://github.com/ROCm/TheRock/blob/main/build_tools/github_actions/bump_automation.py ?

Bump PRs are still using the unprefixed labels:

# Changes to rocm-systems should run the full matrix of CI jobs:
# * Build for all gfx archs
# * Build for all variants (asan)
# * All builds and tests (including downstream rocm-libraries jobs)
# * gfx950-dcgpu/gfx125X-dcgpu tests (limited hardware, label-gated)
"labels": [*COMMON_CI_LABELS, "ci:asan", "gfx950-dcgpu", "gfx125X-dcgpu"],

Example: #8576

Image

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants