Skip to content

Commit 2a77980

Browse files
authored
Merge branch 'main' into amd-compiler-ww-2026-15-FixasanCP2FixesSMP
2 parents 3d00807 + de74a0b commit 2a77980

20 files changed

Lines changed: 477 additions & 97 deletions

.github/workflows/multi_arch_release_linux.yml

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,6 @@ jobs:
3939
contents: read
4040
id-token: write
4141

42-
# TODO: dispatch test artifacts per family (add workflow_dispatch to
43-
# test_artifacts.yml, then use benc-uk/workflow-dispatch here)
44-
4542
build_tarballs:
4643
needs: [build_artifacts]
4744
name: Build Tarballs
@@ -55,14 +52,10 @@ jobs:
5552
contents: read
5653
id-token: write
5754

58-
# TODO: publish_tarballs - copy from artifacts bucket to release bucket
59-
# (as part of multi_arch_build_tarballs or a separate job?)
60-
6155
# TODO(#3334): build python packages
6256
# build_python_packages:
6357
# needs: [build_artifacts]
6458
# name: Build Python Packages
65-
# if: ${{ !failure() && !cancelled() && fromJSON(inputs.build_config).expect_failure == false }}
6659
# uses: ./.github/workflows/build_portable_linux_python_packages.yml
6760
# with:
6861
# artifact_group: ${{ fromJSON(inputs.build_config).artifact_group }}
@@ -74,9 +67,40 @@ jobs:
7467
# contents: read
7568
# id-token: write
7669

77-
# TODO: publish_python_packages
70+
# TODO(#3334): build native packages (build_native_linux_packages.yml)
71+
72+
publish_to_release_buckets:
73+
needs: [build_tarballs]
74+
name: Publish to Release Buckets
75+
runs-on: ubuntu-24.04
76+
permissions:
77+
id-token: write
78+
steps:
79+
- name: Checkout
80+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
7881

79-
# TODO: dispatch native packages (build_native_linux_packages.yml)
82+
- name: Setting up Python
83+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
84+
with:
85+
python-version: "3.12"
86+
87+
- name: Install Python requirements
88+
run: pip install -r requirements.txt
89+
90+
- name: Configure AWS Credentials
91+
uses: ./.github/actions/configure_aws_artifacts_credentials
92+
with:
93+
release_type: ${{ inputs.release_type }}
94+
95+
- name: Copy to release buckets
96+
run: |
97+
python build_tools/github_actions/publish_rocm_to_release_buckets.py \
98+
--run-id="${{ github.run_id }}" \
99+
--platform=linux \
100+
--release-type="${{ inputs.release_type }}"
101+
102+
# TODO: dispatch test artifacts per family (add workflow_dispatch to
103+
# test_artifacts.yml, then use benc-uk/workflow-dispatch here)
80104

81105
# TODO: dispatch pytorch wheels (release_portable_linux_pytorch_wheels.yml)
82106

BUILD_TOPOLOGY.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,6 @@ artifact_deps = ["core-runtime", "core-hip", "miopen", "hipdnn", "miopenprovider
630630
artifact_group = "ml-libs"
631631
type = "target-neutral"
632632
artifact_deps = ["core-runtime", "core-hip", "hipdnn"]
633-
disable_platforms = ["linux", "windows"]
634633

635634
# --- IREE Integration ---
636635

FLAGS.cmake

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,20 @@ include(therock_flag_utils)
1717

1818
therock_declare_flag(
1919
NAME KPACK_SPLIT_ARTIFACTS
20-
DEFAULT_VALUE OFF
20+
DEFAULT_VALUE ON
2121
DESCRIPTION "Split target-specific artifacts into generic and arch-specific components"
2222
)
2323

24+
therock_declare_flag(
25+
NAME HIP_KERNEL_PROVIDER_ENABLE
26+
DEFAULT_VALUE OFF
27+
DESCRIPTION "Enable hip-kernel-provider plugin"
28+
CMAKE_VARS
29+
HIP_KERNEL_PROVIDER_ENABLE=ON
30+
SUB_PROJECTS
31+
hipkernelprovider
32+
)
33+
2434
###############################################################################
2535
# Branch-specific flag overrides.
2636
# BRANCH_FLAGS.cmake is .gitignored on main but can be committed on

build_tools/_therock_utils/s3_buckets.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ def write_access_iam_role(self) -> str | None:
7777

7878
_ALLOWED_RELEASE_TYPES = {"dev", "nightly", "prerelease"}
7979

80+
_ALLOWED_RELEASE_BUCKET_TYPES = {"tarball", "python", "packages"}
81+
8082
# Repositories allowed to use release_type. Only these repositories are trusted
8183
# to assume release IAM roles that grant write access to release buckets.
8284
_ALLOWED_RELEASE_REPOS = {"ROCm/TheRock", "ROCm/rockrel"}
@@ -93,6 +95,9 @@ def get_artifacts_bucket_config(
9395
release_type: "" for CI builds, or "dev", "nightly", "prerelease".
9496
repository: GitHub repository (e.g. "ROCm/TheRock").
9597
is_pr_from_fork: Whether this is a PR from a fork.
98+
99+
Raises:
100+
ValueError: If release_type is invalid.
96101
"""
97102
if release_type:
98103
if release_type not in _ALLOWED_RELEASE_TYPES:
@@ -115,6 +120,36 @@ def get_artifacts_bucket_config(
115120
return _BUCKET_CONFIGS_BY_NAME[bucket_name]
116121

117122

123+
def get_release_bucket_config(
124+
release_type: str,
125+
bucket_type: str,
126+
) -> S3BucketConfig:
127+
"""Look up the release bucket config for a given release type and bucket type.
128+
129+
Args:
130+
release_type: "dev", "nightly", or "prerelease".
131+
bucket_type: "tarball", "python", or "packages".
132+
133+
Returns:
134+
S3BucketConfig for the bucket ``therock-{release_type}-{bucket_type}``.
135+
136+
Raises:
137+
ValueError: If release_type or bucket_type is invalid.
138+
"""
139+
if release_type not in _ALLOWED_RELEASE_TYPES:
140+
raise ValueError(
141+
f"release_type={release_type!r} is invalid, "
142+
f"expected one of {_ALLOWED_RELEASE_TYPES}"
143+
)
144+
if bucket_type not in _ALLOWED_RELEASE_BUCKET_TYPES:
145+
raise ValueError(
146+
f"bucket_type={bucket_type!r} is invalid, "
147+
f"expected one of {_ALLOWED_RELEASE_BUCKET_TYPES}"
148+
)
149+
bucket_name = f"therock-{release_type}-{bucket_type}"
150+
return _BUCKET_CONFIGS_BY_NAME[bucket_name]
151+
152+
118153
def _is_current_run_pr_from_fork() -> bool:
119154
"""Check if the current workflow run is a pull request from a fork.
120155

build_tools/github_actions/amdgpu_family_matrix.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
"windows": {
100100
"test-runs-on": "windows-gfx110X-gpu-rocm",
101101
"family": "gfx110X-all",
102-
"fetch-gfx-targets": ["gfx1100"],
102+
"fetch-gfx-targets": ["gfx1100", "gfx1101"],
103103
"bypass_tests_for_releases": True,
104104
"build_variants": ["release"],
105105
},
@@ -175,7 +175,6 @@
175175
"family": "gfx900",
176176
"fetch-gfx-targets": [],
177177
"build_variants": ["release"],
178-
"expect_pytorch_failure": True,
179178
},
180179
},
181180
# gfx906/908/90a split into separate families - each has different instruction
@@ -195,7 +194,6 @@
195194
"family": "gfx906",
196195
"fetch-gfx-targets": [],
197196
"build_variants": ["release"],
198-
"expect_pytorch_failure": True,
199197
},
200198
},
201199
"gfx908": {
@@ -212,7 +210,6 @@
212210
"family": "gfx908",
213211
"fetch-gfx-targets": [],
214212
"build_variants": ["release"],
215-
"expect_pytorch_failure": True,
216213
},
217214
},
218215
"gfx90a": {
@@ -228,7 +225,6 @@
228225
"family": "gfx90a",
229226
"fetch-gfx-targets": [],
230227
"build_variants": ["release"],
231-
"expect_pytorch_failure": True,
232228
},
233229
},
234230
"gfx101x": {

build_tools/github_actions/build_configure.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,13 @@ def build_configure(build_dir, manylinux=False):
108108
f"-DCMAKE_C_COMPILER_LAUNCHER={c_launcher}",
109109
f"-DCMAKE_CXX_COMPILER_LAUNCHER={cxx_launcher}",
110110
"-DBUILD_TESTING=ON",
111+
# Opt-out of KPACK_SPLIT_ARTIFACTS for non-multi-arch CI/CD.
112+
# * Multi-arch CI/CD uses configure_stage.py instead of this script
113+
# * Local developer builds will use the flag default value
114+
# Related issues:
115+
# * multi-arch kpack parent: https://github.com/ROCm/TheRock/issues/3323
116+
# * multi-arch opt-in: https://github.com/ROCm/TheRock/issues/3338
117+
"-DTHEROCK_FLAG_KPACK_SPLIT_ARTIFACTS=OFF",
111118
]
112119
)
113120

build_tools/github_actions/new_amdgpu_family_matrix.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@
170170
"runs_on": {
171171
"test": "windows-gfx110X-gpu-rocm",
172172
},
173-
"fetch-gfx-targets": ["gfx1100"],
173+
"fetch-gfx-targets": ["gfx1100", "gfx1101"],
174174
"sanity_check_only_for_family": True,
175175
},
176176
"release": {
@@ -412,8 +412,6 @@
412412
"bypass_tests_for_releases": False,
413413
},
414414
},
415-
# TODO(#1927): Resolve error generating file `torch_hip_generated_int4mm.hip.obj`,
416-
# to enable PyTorch builds
417415
"windows": {
418416
"build": {
419417
"build_variants": ["release"],
@@ -422,7 +420,6 @@
422420
"run_tests": False,
423421
"runs_on": {},
424422
"fetch-gfx-targets": [],
425-
"expect_pytorch_failure": True,
426423
},
427424
"release": {
428425
"push_on_success": False,
@@ -496,7 +493,6 @@
496493
},
497494
"fetch-gfx-targets": [],
498495
"sanity_check_only_for_family": True,
499-
"expect_pytorch_failure": True,
500496
},
501497
"release": {
502498
"push_on_success": False,
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
#!/usr/bin/env python3
2+
# Copyright Advanced Micro Devices, Inc.
3+
# SPDX-License-Identifier: MIT
4+
5+
"""Publish ROCm release files from an artifacts bucket to release buckets.
6+
7+
These release file types are supported:
8+
9+
- [x] tarballs
10+
- [ ] python packages
11+
- [ ] native linux packages
12+
- [ ] native windows packages
13+
14+
Example with ``--run-id 12345 --platform linux --release-type dev``:
15+
16+
s3://therock-dev-artifacts/12345-linux/tarballs/therock-dist-linux-gfx94X-dcgpu-7.10.0.tar.gz
17+
-> s3://therock-dev-tarball/v4/tarball/therock-dist-linux-gfx94X-dcgpu-7.10.0.tar.gz
18+
19+
Test usage:
20+
python build_tools/github_actions/publish_rocm_to_release_buckets.py \\
21+
--run-id 12345 --platform linux --release-type dev --dry-run
22+
"""
23+
24+
import argparse
25+
import logging
26+
import platform as platform_module
27+
import sys
28+
from pathlib import Path
29+
30+
_BUILD_TOOLS_DIR = Path(__file__).resolve().parent.parent
31+
sys.path.insert(0, str(_BUILD_TOOLS_DIR))
32+
33+
from _therock_utils.s3_buckets import get_release_bucket_config
34+
from _therock_utils.storage_backend import StorageBackend, create_storage_backend
35+
from _therock_utils.storage_location import StorageLocation
36+
from _therock_utils.workflow_outputs import WorkflowOutputRoot
37+
38+
logger = logging.getLogger(__name__)
39+
40+
41+
def publish_tarballs(
42+
artifacts_root: WorkflowOutputRoot,
43+
release_type: str,
44+
backend: StorageBackend,
45+
) -> int:
46+
"""Copy tarballs from the artifacts bucket to the release tarball bucket.
47+
48+
Example:
49+
s3://therock-dev-artifacts/12345-linux/tarballs/
50+
-> s3://therock-dev-tarball/v4/tarball/
51+
52+
Returns:
53+
Number of tarballs copied.
54+
"""
55+
source = artifacts_root.tarballs()
56+
dest_bucket = get_release_bucket_config(release_type, "tarball")
57+
dest = StorageLocation(dest_bucket.name, "v4/tarball")
58+
59+
logger.info("Tarballs: %s -> %s", source.s3_uri, dest.s3_uri)
60+
count = backend.copy_directory(source, dest, include=["*.tar.gz"])
61+
logger.info("Copied %d tarballs", count)
62+
if count == 0:
63+
raise FileNotFoundError(f"No tarballs found at {source.s3_uri}")
64+
65+
66+
def main(argv: list[str]) -> None:
67+
parser = argparse.ArgumentParser(
68+
description="Publish ROCm release files to release buckets"
69+
)
70+
parser.add_argument("--run-id", required=True, help="Source workflow run ID")
71+
parser.add_argument(
72+
"--platform",
73+
default=platform_module.system().lower(),
74+
choices=["linux", "windows"],
75+
help="Platform (default: current system)",
76+
)
77+
parser.add_argument(
78+
"--release-type",
79+
required=True,
80+
choices=["dev", "nightly", "prerelease"],
81+
help="Release type (determines source and destination buckets)",
82+
)
83+
parser.add_argument(
84+
"--dry-run", action="store_true", help="Print plan without copying"
85+
)
86+
args = parser.parse_args(argv)
87+
88+
artifacts_root = WorkflowOutputRoot.from_workflow_run(
89+
run_id=args.run_id, platform=args.platform, release_type=args.release_type
90+
)
91+
backend = create_storage_backend(dry_run=args.dry_run)
92+
93+
publish_tarballs(artifacts_root, args.release_type, backend)
94+
95+
96+
if __name__ == "__main__":
97+
logging.basicConfig(level=logging.INFO)
98+
main(sys.argv[1:])

build_tools/github_actions/test_executable_scripts/test_rocrtst.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@
2828

2929
# TODO(#3851): Excluded tests (flaky or disabled in CI).
3030
TEST_TO_IGNORE = {
31+
"gfx90a": {
32+
"linux": [
33+
"rocrtstFunc.Memory_Max_Mem",
34+
]
35+
},
3136
"gfx94X-dcgpu": {
3237
"linux": [
3338
"rocrtstFunc.Memory_Max_Mem",
@@ -70,9 +75,10 @@
7075
"rocrtstFunc.Memory_Atomic_Xchg_Test",
7176
]
7277

78+
exclude_filter = "-"
7379
if AMDGPU_FAMILIES in TEST_TO_IGNORE and os_type in TEST_TO_IGNORE[AMDGPU_FAMILIES]:
7480
ignored_tests = TEST_TO_IGNORE[AMDGPU_FAMILIES][os_type]
75-
exclude_filter = "-" + ":".join(ignored_tests)
81+
exclude_filter += ":".join(ignored_tests)
7682

7783
test_type = os.getenv("TEST_TYPE", "full")
7884

0 commit comments

Comments
 (0)