Skip to content

Commit

Permalink
Update builder images to ROCm6.0 (pytorch#1647)
Browse files Browse the repository at this point in the history
* Update ROCm versions for docker images

* Don't build MIOpen from source for ROCm6.0

* Temporarily use magma fork with ROCm6.0 patch

* Update ROCm versions for docker images

* Add gfx942

* Update MIOpen repo

* Magma PR 42 is merged, so use upstream repo master branch now

* gfx942 target only fully supported for ROCm6.0 and above
  • Loading branch information
jithunnair-amd authored Dec 23, 2023
1 parent 524a027 commit b9d2b93
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-libtorch-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
runs-on: linux.12xlarge
strategy:
matrix:
rocm_version: ["5.6", "5.7"]
rocm_version: ["5.7", "6.0"]
env:
GPU_ARCH_TYPE: rocm
GPU_ARCH_VERSION: ${{ matrix.rocm_version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-manywheel-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
runs-on: linux.12xlarge
strategy:
matrix:
rocm_version: ["5.6", "5.7"]
rocm_version: ["5.7", "6.0"]
env:
GPU_ARCH_TYPE: rocm
GPU_ARCH_VERSION: ${{ matrix.rocm_version }}
Expand Down
7 changes: 5 additions & 2 deletions common/install_miopen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ MIOPEN_CMAKE_COMMON_FLAGS="
-DMIOPEN_BUILD_DRIVER=OFF
"
# Pull MIOpen repo and set DMIOPEN_EMBED_DB based on ROCm version
if [[ $ROCM_INT -ge 50700 ]] && [[ $ROCM_INT -lt 50800 ]]; then
if [[ $ROCM_INT -ge 60000 ]] && [[ $ROCM_INT -lt 60100 ]]; then
echo "ROCm 6.0 MIOpen does not need any patches, do not build from source"
exit 0
elif [[ $ROCM_INT -ge 50700 ]] && [[ $ROCM_INT -lt 60000 ]]; then
echo "ROCm 5.7 MIOpen does not need any patches, do not build from source"
exit 0
elif [[ $ROCM_INT -ge 50600 ]] && [[ $ROCM_INT -lt 50700 ]]; then
Expand Down Expand Up @@ -85,7 +88,7 @@ fi

yum remove -y miopen-hip

git clone https://github.com/ROCmSoftwarePlatform/MIOpen -b ${MIOPEN_BRANCH}
git clone https://github.com/ROCm/MIOpen -b ${MIOPEN_BRANCH}
pushd MIOpen
# remove .git to save disk space since CI runner was running out
rm -rf .git
Expand Down
2 changes: 1 addition & 1 deletion common/install_rocm_magma.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pushd magma
if [[ $PYTORCH_BRANCH == "release/1.10.1" ]]; then
git checkout magma_ctrl_launch_bounds
else
git checkout 28592a7170e4b3707ed92644bf4a689ed600c27f
git checkout a1625ff4d9bc362906bd01f805dbbe12612953f6
fi
cp make.inc-examples/make.inc.hip-gcc-mkl make.inc
echo 'LIBDIR += -L$(MKLROOT)/lib' >> make.inc
Expand Down
2 changes: 1 addition & 1 deletion libtorch/build_all_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ for cuda_version in 12.1 11.8; do
GPU_ARCH_TYPE=cuda GPU_ARCH_VERSION="${cuda_version}" "${TOPDIR}/libtorch/build_docker.sh"
done

for rocm_version in 5.6 5.7; do
for rocm_version in 5.7 6.0; do
GPU_ARCH_TYPE=rocm GPU_ARCH_VERSION="${rocm_version}" "${TOPDIR}/libtorch/build_docker.sh"
done
3 changes: 3 additions & 0 deletions libtorch/build_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ case ${GPU_ARCH_TYPE} in
echo "ERROR: rocm regex failed"
exit 1
fi
if [[ $ROCM_VERSION_INT -ge 60000 ]]; then
PYTORCH_ROCM_ARCH+=";gfx942"
fi
DOCKER_GPU_BUILD_ARG="--build-arg PYTORCH_ROCM_ARCH=${PYTORCH_ROCM_ARCH}"
;;
*)
Expand Down
2 changes: 1 addition & 1 deletion manywheel/build_all_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ for cuda_version in 12.1 11.8; do
MANYLINUX_VERSION=2014 GPU_ARCH_TYPE=cuda GPU_ARCH_VERSION="${cuda_version}" "${TOPDIR}/manywheel/build_docker.sh"
done

for rocm_version in 5.6 5.7; do
for rocm_version in 5.7 6.0; do
GPU_ARCH_TYPE=rocm GPU_ARCH_VERSION="${rocm_version}" "${TOPDIR}/manywheel/build_docker.sh"
MANYLINUX_VERSION=2014 GPU_ARCH_TYPE=rocm GPU_ARCH_VERSION="${rocm_version}" "${TOPDIR}/manywheel/build_docker.sh"
done
3 changes: 3 additions & 0 deletions manywheel/build_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ case ${GPU_ARCH_TYPE} in
echo "ERROR: rocm regex failed"
exit 1
fi
if [[ $ROCM_VERSION_INT -ge 60000 ]]; then
PYTORCH_ROCM_ARCH+=";gfx942"
fi
DOCKER_GPU_BUILD_ARG="--build-arg ROCM_VERSION=${GPU_ARCH_VERSION} --build-arg PYTORCH_ROCM_ARCH=${PYTORCH_ROCM_ARCH} --build-arg DEVTOOLSET_VERSION=9"
;;
*)
Expand Down

0 comments on commit b9d2b93

Please sign in to comment.