Skip to content

Commit 9dffd12

Browse files
jithunnair-amdjeffdailypruthvistony
authored andcommitted
Upgrade ROCm wheels to manylinux2_28 - 2 of 2 (binaries) (#141423)
Depends on #140681 and #141609 Highlights: * Upgrade binaries to ROCm6.2.4 to use latest docker images * Remove pre-cxx11 builds for libtorch on ROCm * Use manylinux2_28 docker images for ROCm * Set `DESIRED_DEVTOOLSET=cxx-abi` (and hence `_GLIBCXX_USE_CXX11_ABI=1`) for ROCm manylinux2_28 wheels (ROCm RHEL8 packages also have GCC_ABI=1, so it keeps it consistent) Pull Request resolved: #141423 Approved by: https://github.com/jeffdaily Co-authored-by: Jeff Daily <[email protected]> Co-authored-by: Pruthvi Madugundu <[email protected]>
1 parent c0e1fc4 commit 9dffd12

7 files changed

+168
-349
lines changed

.ci/manywheel/build_rocm.sh

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,25 +107,36 @@ if [[ $ROCM_INT -ge 60200 ]]; then
107107
fi
108108

109109
OS_NAME=`awk -F= '/^NAME/{print $2}' /etc/os-release`
110-
if [[ "$OS_NAME" == *"CentOS Linux"* ]]; then
110+
if [[ "$OS_NAME" == *"CentOS Linux"* || "$OS_NAME" == *"AlmaLinux"* ]]; then
111111
LIBGOMP_PATH="/usr/lib64/libgomp.so.1"
112112
LIBNUMA_PATH="/usr/lib64/libnuma.so.1"
113113
LIBELF_PATH="/usr/lib64/libelf.so.1"
114-
LIBTINFO_PATH="/usr/lib64/libtinfo.so.5"
114+
if [[ "$OS_NAME" == *"CentOS Linux"* ]]; then
115+
LIBTINFO_PATH="/usr/lib64/libtinfo.so.5"
116+
else
117+
LIBTINFO_PATH="/usr/lib64/libtinfo.so.6"
118+
fi
115119
LIBDRM_PATH="/opt/amdgpu/lib64/libdrm.so.2"
116120
LIBDRM_AMDGPU_PATH="/opt/amdgpu/lib64/libdrm_amdgpu.so.1"
117121
if [[ $ROCM_INT -ge 60100 ]]; then
118122
# Below libs are direct dependencies of libhipsolver
119123
LIBSUITESPARSE_CONFIG_PATH="/lib64/libsuitesparseconfig.so.4"
120-
LIBCHOLMOD_PATH="/lib64/libcholmod.so.2"
124+
if [[ "$OS_NAME" == *"CentOS Linux"* ]]; then
125+
LIBCHOLMOD_PATH="/lib64/libcholmod.so.2"
126+
# Below libs are direct dependencies of libsatlas
127+
LIBGFORTRAN_PATH="/lib64/libgfortran.so.3"
128+
else
129+
LIBCHOLMOD_PATH="/lib64/libcholmod.so.3"
130+
# Below libs are direct dependencies of libsatlas
131+
LIBGFORTRAN_PATH="/lib64/libgfortran.so.5"
132+
fi
121133
# Below libs are direct dependencies of libcholmod
122134
LIBAMD_PATH="/lib64/libamd.so.2"
123135
LIBCAMD_PATH="/lib64/libcamd.so.2"
124136
LIBCCOLAMD_PATH="/lib64/libccolamd.so.2"
125137
LIBCOLAMD_PATH="/lib64/libcolamd.so.2"
126138
LIBSATLAS_PATH="/lib64/atlas/libsatlas.so.3"
127139
# Below libs are direct dependencies of libsatlas
128-
LIBGFORTRAN_PATH="/lib64/libgfortran.so.3"
129140
LIBQUADMATH_PATH="/lib64/libquadmath.so.0"
130141
fi
131142
MAYBE_LIB64=lib64
@@ -175,9 +186,12 @@ do
175186
OS_SO_FILES[${#OS_SO_FILES[@]}]=$file_name # Append lib to array
176187
done
177188

178-
# PyTorch-version specific
179-
# AOTriton dependency only for PyTorch >= 2.4
180-
if (( $(echo "${PYTORCH_VERSION} 2.4" | awk '{print ($1 >= $2)}') )); then
189+
# FIXME: Temporary until https://github.com/pytorch/pytorch/pull/137443 lands
190+
# Install AOTriton
191+
if [ -e ${PYTORCH_ROOT}/.ci/docker/aotriton_version.txt ]; then
192+
cp -a ${PYTORCH_ROOT}/.ci/docker/aotriton_version.txt aotriton_version.txt
193+
bash ${PYTORCH_ROOT}/.ci/docker/common/install_aotriton.sh ${ROCM_HOME} && rm aotriton_version.txt
194+
export AOTRITON_INSTALLED_PREFIX=${ROCM_HOME}/aotriton
181195
ROCM_SO_FILES+=("libaotriton_v2.so")
182196
fi
183197

.github/scripts/amd/package_triton_wheel.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,14 @@ fi
3030
# Remove packaged libs and headers
3131
rm -rf $TRITON_ROCM_DIR/include/*
3232

33-
LIBTINFO_PATH="/usr/lib64/libtinfo.so.5"
3433
LIBNUMA_PATH="/usr/lib64/libnuma.so.1"
3534
LIBELF_PATH="/usr/lib64/libelf.so.1"
35+
OS_NAME=`awk -F= '/^NAME/{print $2}' /etc/os-release`
36+
if [[ "$OS_NAME" == *"CentOS Linux"* ]]; then
37+
LIBTINFO_PATH="/usr/lib64/libtinfo.so.5"
38+
else
39+
LIBTINFO_PATH="/usr/lib64/libtinfo.so.6"
40+
fi
3641

3742
OS_SO_PATHS=(
3843
$LIBELF_PATH

.github/scripts/generate_binary_build_matrix.py

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
CUDA_ARCHES_FULL_VERSION = {"11.8": "11.8.0", "12.4": "12.4.1", "12.6": "12.6.3"}
2121
CUDA_ARCHES_CUDNN_VERSION = {"11.8": "9", "12.4": "9", "12.6": "9"}
2222

23-
ROCM_ARCHES = ["6.1", "6.2"]
23+
ROCM_ARCHES = ["6.1", "6.2.4"]
2424

2525
XPU_ARCHES = ["xpu"]
2626

@@ -162,7 +162,7 @@ def arch_type(arch_version: str) -> str:
162162
"12.4": f"pytorch/manylinux-builder:cuda12.4-{DEFAULT_TAG}",
163163
"12.6": f"pytorch/manylinux2_28-builder:cuda12.6-{DEFAULT_TAG}",
164164
**{
165-
gpu_arch: f"pytorch/manylinux-builder:rocm{gpu_arch}-{DEFAULT_TAG}"
165+
gpu_arch: f"pytorch/manylinux2_28-builder:rocm{gpu_arch}-{DEFAULT_TAG}"
166166
for gpu_arch in ROCM_ARCHES
167167
},
168168
"xpu": f"pytorch/manylinux2_28-builder:xpu-{DEFAULT_TAG}",
@@ -194,13 +194,6 @@ def arch_type(arch_version: str) -> str:
194194
): f"pytorch/libtorch-cxx11-builder:cuda{gpu_arch}-{DEFAULT_TAG}"
195195
for gpu_arch in CUDA_ARCHES
196196
},
197-
**{
198-
(
199-
gpu_arch,
200-
PRE_CXX11_ABI,
201-
): f"pytorch/manylinux-builder:rocm{gpu_arch}-{DEFAULT_TAG}"
202-
for gpu_arch in ROCM_ARCHES
203-
},
204197
**{
205198
(
206199
gpu_arch,
@@ -262,7 +255,9 @@ def generate_libtorch_matrix(
262255
gpu_arch_type = arch_type(arch_version)
263256
gpu_arch_version = "" if arch_version == "cpu" else arch_version
264257
# ROCm builds without-deps failed even in ROCm runners; skip for now
265-
if gpu_arch_type == "rocm" and "without-deps" in libtorch_variant:
258+
if gpu_arch_type == "rocm" and (
259+
"without-deps" in libtorch_variant or "pre-cxx11" in abi_version
260+
):
266261
continue
267262
ret.append(
268263
{
@@ -428,7 +423,8 @@ def generate_wheels_matrix(
428423
"use_split_build": "True" if use_split_build else "False",
429424
"devtoolset": (
430425
"cxx11-abi"
431-
if arch_version in ["cpu-cxx11-abi", "cpu-aarch64"]
426+
if (arch_version in ["cpu-cxx11-abi", "cpu-aarch64"])
427+
or gpu_arch_type == "rocm"
432428
else ""
433429
),
434430
"container_image": WHEEL_CONTAINER_IMAGES[arch_version],

.github/workflows/build-triton-wheel.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,17 @@ jobs:
4949
docker-image: ["pytorch/manylinux-builder:cpu", "pytorch/manylinux2_28-builder:cpu"]
5050
exclude:
5151
- device: "rocm"
52-
docker-image: "pytorch/manylinux2_28-builder:cpu"
52+
docker-image: "pytorch/manylinux-builder:cpu"
5353
- device: "xpu"
5454
docker-image: "pytorch/manylinux2_28-builder:cpu"
5555
include:
5656
- device: "rocm"
57-
rocm_version: "6.2"
57+
rocm_version: "6.2.4"
5858
- device: "cuda"
5959
rocm_version: ""
6060
timeout-minutes: 40
6161
env:
62-
DOCKER_IMAGE: ${{ matrix.device == 'rocm' && format('pytorch/manylinux-builder:rocm{0}', matrix.rocm_version) || matrix.docker-image }}
62+
DOCKER_IMAGE: ${{ matrix.device == 'rocm' && format('pytorch/manylinux2_28-builder:rocm{0}', matrix.rocm_version) || matrix.docker-image }}
6363
PY_VERS: ${{ matrix.py_vers }}
6464
BUILD_DEVICE: ${{ matrix.device }}
6565
PLATFORM: ${{ contains(matrix.docker-image, '2_28') && 'manylinux_2_28_x86_64' || 'manylinux2014_x86_64' }}
@@ -128,7 +128,7 @@ jobs:
128128
129129
docker exec -t "${container_name}" yum install -y zlib-devel zip
130130
docker exec -t "${container_name}" "${PYTHON_EXECUTABLE}" -m pip install -U setuptools==67.4.0 pybind11==2.13.1 auditwheel
131-
if [[ "${{ matrix.device }}" == "cuda" && "${PLATFORM}" == "manylinux_2_28_x86_64" ]]; then
131+
if [[ ("${{ matrix.device }}" == "cuda" || "${{ matrix.device }}" == "rocm") && "${PLATFORM}" == "manylinux_2_28_x86_64" ]]; then
132132
# With this install, it gets clang 16.0.6.
133133
docker exec -t "${container_name}" dnf install clang lld -y
134134
WITH_CLANG_LDD="--with-clang-ldd"

.github/workflows/generated-linux-binary-libtorch-cxx11-abi-nightly.yml

Lines changed: 18 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)