Skip to content

Commit 6880e46

Browse files
illsilinassistant-librarian[bot]
authored andcommitted
[rocm-libraries] ROCm/rocm-libraries#6147 (commit 8035856)
[CK] Replace daily CI builds with mainline compiler with TheRock compiler. (#6147) ## Motivation Since the compiler team has deprecated the amd-mainline branch and switched to TheRock, we'll start building a docker image with TheRock artifacts and building/testing Ck with that. ## Technical Details <!-- Explain the changes along with any relevant GitHub links. --> ## Test Plan <!-- Explain any relevant testing done to verify this PR. --> ## Test Result <!-- Briefly summarize test outcomes. --> ## Submission Checklist - [ ] Look over the contributing guidelines at https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.
1 parent cf847f9 commit 6880e46

4 files changed

Lines changed: 95 additions & 55 deletions

File tree

Dockerfile

Lines changed: 19 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,33 @@
22
FROM ubuntu:24.04
33
ARG DEBIAN_FRONTEND=noninteractive
44
ARG ROCMVERSION=7.1.1
5+
ARG DEB_ROCM_REPO=http://repo.radeon.com/rocm/apt/.apt_$ROCMVERSION/
6+
ARG TARBALL_URL=https://rocm.nightlies.amd.com/tarball/therock-dist-linux-gfx90X-dcgpu-7.12.0a20260218.tar.gz
57
ARG compiler_version=""
68
ARG compiler_commit=""
7-
ARG CK_SCCACHE=""
8-
ARG DEB_ROCM_REPO=http://repo.radeon.com/rocm/apt/.apt_$ROCMVERSION/
99
ENV APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=DontWarn
1010
ENV DEBIAN_FRONTEND=noninteractive
11+
ENV PATH=$PATH:/opt/rocm/bin
12+
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/rocm/lib
13+
ENV HIP_PLATFORM=amd
1114

1215
# Add rocm repository
1316
RUN set -xe && \
1417
apt-get update && apt-get install -y --allow-unauthenticated apt-utils wget gnupg2 curl
1518

16-
RUN wget https://repo.radeon.com/amdgpu-install/7.1.1/ubuntu/noble/amdgpu-install_7.1.1.70101-1_all.deb && \
17-
apt install ./amdgpu-install_7.1.1.70101-1_all.deb -y && \
18-
apt update && \
19-
apt install python3-setuptools python3-wheel -y && \
20-
apt install rocm-dev -y
19+
RUN if [ "$compiler_version" = "therock" ]; then \
20+
rm -rf /opt/rocm && mkdir /opt/rocm && \
21+
echo "Downloading ROCm tarball from $TARBALL_URL..." && \
22+
wget -q -O /tmp/rocm.tar.gz "$TARBALL_URL" && \
23+
echo "Extracting tarball to /opt/rocm..." && \
24+
tar -xzf /tmp/rocm.tar.gz -C /opt/rocm --strip-components=1 ; \
25+
else echo "using the release compiler" && \
26+
wget https://repo.radeon.com/amdgpu-install/7.1.1/ubuntu/noble/amdgpu-install_7.1.1.70101-1_all.deb && \
27+
apt install ./amdgpu-install_7.1.1.70101-1_all.deb -y && \
28+
apt update && \
29+
apt install python3-setuptools python3-wheel -y && \
30+
apt install rocm-dev -y; \
31+
fi
2132

2233
# Install SCCACHE
2334
ENV SCCACHE_VERSION="0.14.0"
@@ -34,7 +45,6 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-
3445
build-essential \
3546
cmake \
3647
git \
37-
hip-rocclr \
3848
iputils-ping \
3949
jq \
4050
libelf-dev \
@@ -44,8 +54,8 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-
4454
net-tools \
4555
pkg-config \
4656
python3-full \
57+
python3-pip \
4758
redis \
48-
rocm-llvm-dev \
4959
sshpass \
5060
stunnel \
5161
software-properties-common \
@@ -88,26 +98,3 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-
8898
git clone -b master https://github.com/ROCm/rocm-cmake.git && \
8999
cd rocm-cmake && mkdir build && cd build && \
90100
cmake .. && cmake --build . && cmake --build . --target install
91-
92-
WORKDIR /
93-
# Add alternative compilers, if necessary
94-
ENV compiler_version=$compiler_version
95-
ENV compiler_commit=$compiler_commit
96-
RUN sh -c "echo compiler version = '$compiler_version'" && \
97-
sh -c "echo compiler commit = '$compiler_commit'"
98-
99-
RUN if ( [ "$compiler_version" = "develop" ] || [ "$compiler_version" = "amd-mainline" ] ) && [ "$compiler_commit" = "" ]; then \
100-
git clone -b "$compiler_version" https://github.com/ROCm/llvm-project.git && \
101-
cd llvm-project && mkdir build && cd build && \
102-
cmake -DCMAKE_INSTALL_PREFIX=/opt/rocm/llvm -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=1 -DLLVM_TARGETS_TO_BUILD="AMDGPU;X86" -DLLVM_ENABLE_PROJECTS="clang;lld" -DLLVM_ENABLE_RUNTIMES="compiler-rt" ../llvm && \
103-
make -j 8 ; \
104-
else echo "using the release compiler"; \
105-
fi
106-
107-
RUN if ( [ "$compiler_version" = "develop" ] || [ "$compiler_version" = "amd-mainline" ] ) && [ "$compiler_commit" != "" ]; then \
108-
git clone -b "$compiler_version" https://github.com/ROCm/llvm-project.git && \
109-
cd llvm-project && git checkout "$compiler_commit" && echo "checking out commit $compiler_commit" && mkdir build && cd build && \
110-
cmake -DCMAKE_INSTALL_PREFIX=/opt/rocm/llvm -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=1 -DLLVM_TARGETS_TO_BUILD="AMDGPU;X86" -DLLVM_ENABLE_PROJECTS="clang;lld" -DLLVM_ENABLE_RUNTIMES="compiler-rt" ../llvm && \
111-
make -j 8 ; \
112-
else echo "using the release compiler"; \
113-
fi

Dockerfile.compiler

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ENV compiler_commit=$compiler_commit
99
RUN sh -c "echo compiler version = '$compiler_version'" && \
1010
sh -c "echo compiler commit = '$compiler_commit'"
1111

12-
RUN if ( [ "$compiler_version" = "develop" ] || [ "$compiler_version" = "amd-staging" ] || [ "$compiler_version" = "amd-mainline" ] ) && [ "$compiler_commit" = "" ]; then \
12+
RUN if ( [ "$compiler_version" = "develop" ] || [ "$compiler_version" = "amd-staging" ] ) && [ "$compiler_commit" = "" ]; then \
1313
git clone -b "$compiler_version" https://github.com/ROCm/llvm-project.git && \
1414
cd llvm-project && git log -1 && mkdir build && cd build && \
1515
cmake -G Ninja \
@@ -43,7 +43,7 @@ RUN if ( [ "$compiler_version" = "develop" ] || [ "$compiler_version" = "amd-sta
4343
else echo "using the release compiler"; \
4444
fi
4545

46-
RUN if ( [ "$compiler_version" = "develop" ] || [ "$compiler_version" = "amd-staging" ] || [ "$compiler_version" = "amd-mainline" ] ) && [ "$compiler_commit" != "" ]; then \
46+
RUN if ( [ "$compiler_version" = "develop" ] || [ "$compiler_version" = "amd-staging" ] ) && [ "$compiler_commit" != "" ]; then \
4747
git clone -b "$compiler_version" https://github.com/ROCm/llvm-project.git && \
4848
cd llvm-project && git checkout "$compiler_commit" && echo "checking out commit $compiler_commit" && mkdir build && cd build && \
4949
cmake -G Ninja \

Dockerfile.manylinux

Lines changed: 65 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ ARG DEBIAN_FRONTEND=noninteractive
33
ARG ROCMVERSION=7.2
44
ARG compiler_version=""
55
ARG compiler_commit=""
6-
ARG CK_SCCACHE=""
76
ARG DEB_ROCM_REPO=http://repo.radeon.com/rocm/apt/.apt_$ROCMVERSION/
87
ENV APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=DontWarn
98
ENV DEBIAN_FRONTEND=noninteractive
@@ -19,16 +18,15 @@ RUN wget https://repo.radeon.com/amdgpu-install/7.2/rhel/8.10/amdgpu-install-7.2
1918
dnf install python3-setuptools python3-wheel -y && \
2019
dnf install rocm-dev -y
2120

22-
## Sccache binary built from source for ROCm, only install if CK_SCCACHE is defined
23-
ARG SCCACHE_REPO_URL=http://compute-artifactory.amd.com/artifactory/rocm-generic-experimental/rocm-sccache
21+
# Install SCCACHE
22+
ENV SCCACHE_VERSION="0.14.0"
2423
ENV SCCACHE_INSTALL_LOCATION=/usr/local/.cargo/bin
2524
ENV PATH=$PATH:${SCCACHE_INSTALL_LOCATION}
26-
ENV CK_SCCACHE=$CK_SCCACHE
27-
RUN if [ "$CK_SCCACHE" != "" ]; then \
28-
mkdir -p ${SCCACHE_INSTALL_LOCATION} && \
29-
curl ${SCCACHE_REPO_URL}/portable/0.2.16/sccache-0.2.16-alpha.1-rocm --output ${SCCACHE_INSTALL_LOCATION}/sccache && \
30-
chmod +x ${SCCACHE_INSTALL_LOCATION}/sccache; \
31-
fi
25+
RUN set -x && \
26+
mkdir -p ${SCCACHE_INSTALL_LOCATION} && \
27+
wget -qO sccache.tar.gz https://github.com/mozilla/sccache/releases/latest/download/sccache-v$SCCACHE_VERSION-x86_64-unknown-linux-musl.tar.gz && \
28+
tar -xzf sccache.tar.gz --strip-components=1 -C ${SCCACHE_INSTALL_LOCATION} && \
29+
chmod +x ${SCCACHE_INSTALL_LOCATION}/sccache
3230

3331
# Install dependencies
3432
RUN dnf update -y && DEBIAN_FRONTEND=noninteractive dnf install -y \
@@ -83,19 +81,71 @@ ENV compiler_commit=$compiler_commit
8381
RUN sh -c "echo compiler version = '$compiler_version'" && \
8482
sh -c "echo compiler commit = '$compiler_commit'"
8583

86-
RUN if ( [ "$compiler_version" = "develop" ] || [ "$compiler_version" = "amd-mainline" ] ) && [ "$compiler_commit" = "" ]; then \
84+
RUN if ( [ "$compiler_version" = "develop" ] || [ "$compiler_version" = "amd-staging" ] ) && [ "$compiler_commit" = "" ]; then \
8785
git clone -b "$compiler_version" https://github.com/ROCm/llvm-project.git && \
8886
cd llvm-project && mkdir build && cd build && \
89-
cmake -DCMAKE_INSTALL_PREFIX=/opt/rocm/llvm -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=1 -DLLVM_TARGETS_TO_BUILD="AMDGPU;X86" -DLLVM_ENABLE_PROJECTS="clang;lld" -DLLVM_ENABLE_RUNTIMES="compiler-rt" ../llvm && \
90-
make -j 8 ; \
87+
cmake -G Ninja \
88+
-DCMAKE_BUILD_TYPE=Release \
89+
-DLLVM_ENABLE_PROJECTS="clang;lld;clang-tools-extra;flang;mlir" \
90+
-DLLVM_LIT_ARGS="-vv --show-unsupported --show-xfail -j 32" \
91+
-DPACKAGE_VENDOR="AMD" \
92+
-DCMAKE_INSTALL_PREFIX=/home/$USER/rocm/pure_llvm_1.0 \
93+
-DLLVM_ENABLE_ASSERTIONS=ON \
94+
-DLLVM_BUILD_DOCS=ON \
95+
-DLLVM_TARGETS_TO_BUILD=all \
96+
-DLIBOMPTARGET_ENABLE_DEBUG=ON \
97+
-DOFFLOAD_ENABLE_EMISSARY_APIS=OFF \
98+
-DCLANG_DEFAULT_LINKER=lld \
99+
-DCLANG_DEFAULT_PIE_ON_LINUX=0 \
100+
-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;openmp;compiler-rt;libunwind;flang-rt" \
101+
-DLIBCXX_ENABLE_SHARED=OFF \
102+
-DLIBCXX_ENABLE_STATIC=ON \
103+
-DLIBCXX_INSTALL_LIBRARY=OFF \
104+
-DLIBCXX_INSTALL_HEADERS=OFF \
105+
-DLIBCXXABI_ENABLE_SHARED=OFF \
106+
-DLIBCXXABI_ENABLE_STATIC=ON \
107+
-DLIBCXXABI_INSTALL_STATIC_LIBRARY=OFF \
108+
-DLLVM_ENABLE_ASSERTIONS=1 \
109+
-DLLVM_ENABLE_Z3_SOLVER=OFF \
110+
-DLLVM_ENABLE_ZLIB=ON \
111+
-DLLVM_LINK_LLVM_DYLIB=OFF \
112+
-DCLANG_LINK_CLANG_DYLIB=OFF \
113+
../llvm && \
114+
ninja -j16 ; \
91115
else echo "using the release compiler"; \
92116
fi
93117

94-
RUN if ( [ "$compiler_version" = "develop" ] || [ "$compiler_version" = "amd-mainline" ] ) && [ "$compiler_commit" != "" ]; then \
118+
RUN if ( [ "$compiler_version" = "develop" ] || [ "$compiler_version" = "amd-staging" ] ) && [ "$compiler_commit" != "" ]; then \
95119
git clone -b "$compiler_version" https://github.com/ROCm/llvm-project.git && \
96120
cd llvm-project && git checkout "$compiler_commit" && echo "checking out commit $compiler_commit" && mkdir build && cd build && \
97-
cmake -DCMAKE_INSTALL_PREFIX=/opt/rocm/llvm -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=1 -DLLVM_TARGETS_TO_BUILD="AMDGPU;X86" -DLLVM_ENABLE_PROJECTS="clang;lld" -DLLVM_ENABLE_RUNTIMES="compiler-rt" ../llvm && \
98-
make -j 8 ; \
121+
cmake -G Ninja \
122+
-DCMAKE_BUILD_TYPE=Release \
123+
-DLLVM_ENABLE_PROJECTS="clang;lld;clang-tools-extra;flang;mlir" \
124+
-DLLVM_LIT_ARGS="-vv --show-unsupported --show-xfail -j 32" \
125+
-DPACKAGE_VENDOR="AMD" \
126+
-DCMAKE_INSTALL_PREFIX=/home/$USER/rocm/pure_llvm_1.0 \
127+
-DLLVM_ENABLE_ASSERTIONS=ON \
128+
-DLLVM_BUILD_DOCS=ON \
129+
-DLLVM_TARGETS_TO_BUILD=all \
130+
-DLIBOMPTARGET_ENABLE_DEBUG=ON \
131+
-DOFFLOAD_ENABLE_EMISSARY_APIS=OFF \
132+
-DCLANG_DEFAULT_LINKER=lld \
133+
-DCLANG_DEFAULT_PIE_ON_LINUX=0 \
134+
-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;openmp;compiler-rt;libunwind;flang-rt" \
135+
-DLIBCXX_ENABLE_SHARED=OFF \
136+
-DLIBCXX_ENABLE_STATIC=ON \
137+
-DLIBCXX_INSTALL_LIBRARY=OFF \
138+
-DLIBCXX_INSTALL_HEADERS=OFF \
139+
-DLIBCXXABI_ENABLE_SHARED=OFF \
140+
-DLIBCXXABI_ENABLE_STATIC=ON \
141+
-DLIBCXXABI_INSTALL_STATIC_LIBRARY=OFF \
142+
-DLLVM_ENABLE_ASSERTIONS=1 \
143+
-DLLVM_ENABLE_Z3_SOLVER=OFF \
144+
-DLLVM_ENABLE_ZLIB=ON \
145+
-DLLVM_LINK_LLVM_DYLIB=OFF \
146+
-DCLANG_LINK_CLANG_DYLIB=OFF \
147+
../llvm && \
148+
ninja -j16 ; \
99149
else echo "using the release compiler"; \
100150
fi
101151

Jenkinsfile

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -421,10 +421,13 @@ def buildDocker(install_prefix){
421421
def image_name = getDockerImageName()
422422
def base_image_name = getBaseDockerImageName()
423423
echo "Building Docker for ${image_name}"
424-
def dockerArgs = "--build-arg PREFIX=${install_prefix} --build-arg CK_SCCACHE='${env.CK_SCCACHE}' --build-arg compiler_version='${params.COMPILER_VERSION}' --build-arg compiler_commit='${params.COMPILER_COMMIT}' --build-arg ROCMVERSION='${params.ROCMVERSION}' "
425-
if(params.COMPILER_VERSION == "develop" || params.COMPILER_VERSION == "amd-staging" || params.COMPILER_VERSION == "amd-mainline" || params.COMPILER_COMMIT != ""){
424+
def dockerArgs = "--build-arg PREFIX=${install_prefix} --build-arg compiler_version='${params.COMPILER_VERSION}' --build-arg compiler_commit='${params.COMPILER_COMMIT}' --build-arg ROCMVERSION='${params.ROCMVERSION}' "
425+
if(params.COMPILER_VERSION == "develop" || params.COMPILER_VERSION == "amd-staging" || params.COMPILER_COMMIT != ""){
426426
dockerArgs = dockerArgs + " --no-cache --build-arg BASE_DOCKER='${base_image_name}' -f projects/composablekernel/Dockerfile.compiler . "
427427
}
428+
else if(params.COMPILER_VERSION == "therock"){
429+
dockerArgs = dockerArgs + " --no-cache -f projects/composablekernel/Dockerfile . "
430+
}
428431
else if(params.RUN_AITER_TESTS){
429432
image_name = "${env.CK_DOCKERHUB_PRIVATE}:ck_aiter"
430433
dockerArgs = dockerArgs + " --no-cache -f projects/composablekernel/Dockerfile.aiter --build-arg AITER_BRANCH='${params.aiter_branch}' --build-arg CK_AITER_BRANCH='${params.ck_aiter_branch}' . "
@@ -470,10 +473,10 @@ def get_docker_options(){
470473
else{ //only add kfd and dri paths if you actually going to run somthing on GPUs
471474
dockerOpts = "--network=host --device=/dev/kfd --device=/dev/dri --group-add video --group-add render --cap-add=SYS_PTRACE --security-opt seccomp=unconfined"
472475
}
473-
if (params.COMPILER_VERSION == "develop" || params.COMPILER_VERSION == "amd-staging" || params.COMPILER_VERSION == "amd-mainline" || params.COMPILER_COMMIT != ""){
476+
if (params.COMPILER_VERSION == "develop" || params.COMPILER_VERSION == "amd-staging" || params.COMPILER_VERSION == "therock" || params.COMPILER_COMMIT != ""){
474477
// the --env COMPRESSED_BUNDLE_FORMAT_VERSION=2 env variable is required when building code with offload-compress flag with
475478
// newer clang22 compilers and running with older hip runtima libraries
476-
dockerOpts = dockerOpts + " --env HIP_CLANG_PATH='/llvm-project/build/bin' --env COMPRESSED_BUNDLE_FORMAT_VERSION=2 "
479+
dockerOpts = dockerOpts + " --env HIP_CLANG_PATH='/llvm-project/build/bin' --env COMPRESSED_BUNDLE_FORMAT_VERSION=2 --env HIP_PLATFORM=amd "
477480
}
478481
// on some machines the group ids for video and render groups may not be the same as in the docker image!
479482
def video_id = sh(returnStdout: true, script: 'getent group video | cut -d: -f3')
@@ -1183,7 +1186,7 @@ CRON_SETTINGS = BRANCH_NAME == "develop" ? '''0 23 * * * % RUN_FULL_QA=true;RUN_
11831186
0 22 * * * % RUN_FULL_QA=true;DISABLE_DL_KERNELS=true;RUN_TILE_ENGINE_BASIC_TESTS=true;RUN_TILE_ENGINE_GEMM_TESTS=true;RUN_PERFORMANCE_TESTS=true;RUN_ALL_UNIT_TESTS=true;FORCE_CI=true
11841187
0 21 * * * % RUN_GROUPED_CONV_LARGE_CASES_TESTS=true;hipTensor_test=true;BUILD_GFX101=false;BUILD_GFX908=false;BUILD_GFX942=true;BUILD_GFX950=true;RUN_PERFORMANCE_TESTS=true;RUN_ALL_UNIT_TESTS=true;FORCE_CI=true;BUILD_PACKAGES=true
11851188
0 19 * * * % BUILD_DOCKER=true;COMPILER_VERSION=develop;BUILD_COMPILER=/llvm-project/build/bin/clang++;USE_SCCACHE=false;NINJA_BUILD_TRACE=true;RUN_ALL_UNIT_TESTS=true;FORCE_CI=true
1186-
0 17 * * * % BUILD_DOCKER=true;COMPILER_VERSION=amd-mainline;BUILD_COMPILER=/llvm-project/build/bin/clang++;USE_SCCACHE=false;NINJA_BUILD_TRACE=true;RUN_ALL_UNIT_TESTS=true;FORCE_CI=true
1189+
0 17 * * * % BUILD_DOCKER=true;COMPILER_VERSION=therock;USE_SCCACHE=false;NINJA_BUILD_TRACE=true;RUN_ALL_UNIT_TESTS=true;FORCE_CI=true
11871190
0 15 * * * % BUILD_DOCKER=true;COMPILER_VERSION=amd-staging;BUILD_COMPILER=/llvm-project/build/bin/clang++;USE_SCCACHE=false;NINJA_BUILD_TRACE=true;RUN_ALL_UNIT_TESTS=true;FORCE_CI=true
11881191
0 13 * * * % BUILD_INSTANCES_ONLY=true;USE_SCCACHE=false;NINJA_BUILD_TRACE=true;FORCE_CI=true
11891192
0 11 * * * % RUN_FULL_CONV_TILE_TESTS=true;RUN_AITER_TESTS=true;USE_SCCACHE=false;RUN_PERFORMANCE_TESTS=false;FORCE_CI=true
@@ -1217,7 +1220,7 @@ pipeline {
12171220
string(
12181221
name: 'COMPILER_VERSION',
12191222
defaultValue: '',
1220-
description: 'Specify which version of compiler to use: release, develop, amd-staging, amd-mainline, or leave blank (default).')
1223+
description: 'Specify which version of compiler to use: develop, amd-staging, therock, or leave blank (default).')
12211224
string(
12221225
name: 'COMPILER_COMMIT',
12231226
defaultValue: '',

0 commit comments

Comments
 (0)