Skip to content

Commit 7ea3967

Browse files
praguptaAMD
andauthored
[rocm7.1_internal_testing][SWDEV-554101] Fix bad merge of install_rocm_magma.sh (#2651)
Fixes #ISSUE_NUMBER --------- Co-authored-by: AMD <[email protected]>
1 parent b5abe5e commit 7ea3967

File tree

4 files changed

+8
-61
lines changed

4 files changed

+8
-61
lines changed

.ci/docker/centos-rocm/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ COPY ./common/install_rocm.sh install_rocm.sh
6363
RUN bash ./install_rocm.sh
6464
RUN rm install_rocm.sh
6565
COPY ./common/install_rocm_magma.sh install_rocm_magma.sh
66-
RUN bash ./install_rocm_magma.sh
66+
RUN bash ./install_rocm_magma.sh ${ROCM_VERSION}
6767
RUN rm install_rocm_magma.sh
6868
COPY ./common/install_amdsmi.sh install_amdsmi.sh
6969
RUN bash ./install_amdsmi.sh
Lines changed: 5 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
1-
#!/bin/bash
2-
# Script used in CI and CD pipeline
1+
#!/usr/bin/env bash
2+
# Script used only in CD pipeline
33

4-
set -ex
5-
6-
ver() {
7-
printf "%3d%03d%03d%03d" $(echo "$1" | tr '.' ' ');
8-
}
4+
set -eou pipefail
95

106
function do_install() {
117
rocm_version=$1
@@ -36,55 +32,6 @@ function do_install() {
3632
fi
3733
popd
3834
)
35+
}
3936

40-
# Magma build scripts need `python`
41-
ln -sf /usr/bin/python3 /usr/bin/python
42-
43-
ID=$(grep -oP '(?<=^ID=).+' /etc/os-release | tr -d '"')
44-
case "$ID" in
45-
almalinux)
46-
yum install -y gcc-gfortran
47-
;;
48-
*)
49-
echo "No preinstalls to build magma..."
50-
;;
51-
esac
52-
53-
MKLROOT=${MKLROOT:-/opt/conda/envs/py_$ANACONDA_PYTHON_VERSION}
54-
55-
# "install" hipMAGMA into /opt/rocm/magma by copying after build
56-
if [[ $(ver $ROCM_VERSION) -ge $(ver 7.0) ]]; then
57-
git clone https://github.com/ROCm/utk-magma.git -b release/2.9.0_rocm70 magma
58-
pushd magma
59-
# version 2.9 + ROCm 7.0 related updates
60-
git checkout 91c4f720a17e842b364e9de41edeef76995eb9ad
61-
else
62-
git clone https://bitbucket.org/icl/magma.git
63-
pushd magma
64-
# Version 2.7.2 + ROCm related updates
65-
git checkout a1625ff4d9bc362906bd01f805dbbe12612953f6
66-
fi
67-
68-
cp make.inc-examples/make.inc.hip-gcc-mkl make.inc
69-
echo 'LIBDIR += -L$(MKLROOT)/lib' >> make.inc
70-
if [[ -f "${MKLROOT}/lib/libmkl_core.a" ]]; then
71-
echo 'LIB = -Wl,--start-group -lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core -Wl,--end-group -lpthread -lstdc++ -lm -lgomp -lhipblas -lhipsparse' >> make.inc
72-
fi
73-
echo 'LIB += -Wl,--enable-new-dtags -Wl,--rpath,/opt/rocm/lib -Wl,--rpath,$(MKLROOT)/lib -Wl,--rpath,/opt/rocm/magma/lib -ldl' >> make.inc
74-
echo 'DEVCCFLAGS += --gpu-max-threads-per-block=256' >> make.inc
75-
export PATH="${PATH}:/opt/rocm/bin"
76-
if [[ -n "$PYTORCH_ROCM_ARCH" ]]; then
77-
amdgpu_targets=`echo $PYTORCH_ROCM_ARCH | sed 's/;/ /g'`
78-
else
79-
amdgpu_targets=`rocm_agent_enumerator | grep -v gfx000 | sort -u | xargs`
80-
fi
81-
for arch in $amdgpu_targets; do
82-
echo "DEVCCFLAGS += --offload-arch=$arch" >> make.inc
83-
done
84-
# hipcc with openmp flag may cause isnan() on __device__ not to be found; depending on context, compiler may attempt to match with host definition
85-
sed -i 's/^FOPENMP/#FOPENMP/g' make.inc
86-
make -f make.gen.hipMAGMA -j $(nproc)
87-
LANG=C.UTF-8 make lib/libmagma.so -j $(nproc) MKLROOT="${MKLROOT}"
88-
make testing/testing_dgemm -j $(nproc) MKLROOT="${MKLROOT}"
89-
popd
90-
mv magma /opt/rocm
37+
do_install $1

.ci/docker/manywheel/Dockerfile_2_28

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ RUN bash ./install_rocm_drm.sh && rm install_rocm_drm.sh
164164
RUN yum install -y libdrm-devel
165165
ENV MKLROOT /opt/intel
166166
ADD ./common/install_rocm_magma.sh install_rocm_magma.sh
167-
RUN bash ./install_rocm_magma.sh && rm install_rocm_magma.sh
167+
RUN bash ./install_rocm_magma.sh ${ROCM_VERSION} && rm install_rocm_magma.sh
168168
ADD ./common/install_miopen.sh install_miopen.sh
169169
RUN bash ./install_miopen.sh ${ROCM_VERSION} && rm install_miopen.sh
170170

.ci/docker/ubuntu-rocm/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ COPY ./common/install_rocm.sh install_rocm.sh
5656
RUN bash ./install_rocm.sh
5757
RUN rm install_rocm.sh
5858
COPY ./common/install_rocm_magma.sh install_rocm_magma.sh
59-
RUN bash ./install_rocm_magma.sh
59+
RUN bash ./install_rocm_magma.sh ${ROCM_VERSION}
6060
RUN rm install_rocm_magma.sh
6161
ADD ./common/install_miopen.sh install_miopen.sh
6262
RUN bash ./install_miopen.sh ${ROCM_VERSION} && rm install_miopen.sh

0 commit comments

Comments
 (0)