Skip to content

Commit a66b6b9

Browse files
set MKLROOT env var in manywheel/libtorch Dockerfile; default to CI env value; use env var in all scripts
1 parent cea20fc commit a66b6b9

File tree

4 files changed

+11
-18
lines changed

4 files changed

+11
-18
lines changed

common/install_mkl.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ set -ex
55
# MKL
66
MKL_VERSION=2022.2.1
77
MKL_BUILD=16993
8-
mkdir -p /opt/intel/lib
8+
mkdir -p ${MKLROOT}/lib
99
pushd /tmp
1010
curl -fsSL https://anaconda.org/intel/mkl-static/${MKL_VERSION}/download/linux-64/mkl-static-${MKL_VERSION}-intel_${MKL_BUILD}.tar.bz2 | tar xjv
11-
mv lib/* /opt/intel/lib/
11+
mv lib/* ${MKLROOT}/lib/
1212
curl -fsSL https://anaconda.org/intel/mkl-include/${MKL_VERSION}/download/linux-64/mkl-include-${MKL_VERSION}-intel_${MKL_BUILD}.tar.bz2 | tar xjv
13-
mv include /opt/intel/
13+
mv include ${MKLROOT}

common/install_rocm_magma.sh

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,17 @@
11
#!/bin/bash
22

3-
# TODO upstream differences from this file is into the (eventual) one in pytorch
4-
# - (1) check for static lib mkl
5-
# - (2) MKLROOT as env var
6-
73
set -ex
84

9-
# TODO (2)
10-
MKLROOT=${MKLROOT:-/opt/intel}
11-
5+
MKLROOT=${MKLROOT:-/opt/conda/envs/py_$ANACONDA_PYTHON_VERSION}
126
# "install" hipMAGMA into /opt/rocm/magma by copying after build
137
git clone https://bitbucket.org/icl/magma.git
148
pushd magma
15-
if [[ $PYTORCH_BRANCH == "release/1.10.1" ]]; then
16-
git checkout magma_ctrl_launch_bounds
17-
else
18-
git checkout a1625ff4d9bc362906bd01f805dbbe12612953f6
19-
fi
9+
10+
# Version 2.7.2 + ROCm related updates
11+
git checkout a1625ff4d9bc362906bd01f805dbbe12612953f6
12+
2013
cp make.inc-examples/make.inc.hip-gcc-mkl make.inc
2114
echo 'LIBDIR += -L$(MKLROOT)/lib' >> make.inc
22-
# TODO (1)
2315
if [[ -f "${MKLROOT}/lib/libmkl_core.a" ]]; then
2416
echo 'LIB = -Wl,--start-group -lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core -Wl,--end-group -lpthread -lstdc++ -lm -lgomp -lhipblas -lhipsparse' >> make.inc
2517
fi

libtorch/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
ARG BASE_TARGET=base
22
ARG GPU_IMAGE=ubuntu:20.04
3+
ARG MKLROOT /opt/intel
34
FROM ${GPU_IMAGE} as base
45

56
ENV DEBIAN_FRONTEND=noninteractive
@@ -63,7 +64,6 @@ RUN ln -sf /usr/local/cuda-12.4 /usr/local/cuda
6364
FROM cpu as rocm
6465
ARG PYTORCH_ROCM_ARCH
6566
ENV PYTORCH_ROCM_ARCH ${PYTORCH_ROCM_ARCH}
66-
ENV MKLROOT /opt/intel
6767
# Adding ROCM_PATH env var so that LoadHip.cmake (even with logic updated for ROCm6.0)
6868
# find HIP works for ROCm5.7. Not needed for ROCm6.0 and above.
6969
# Remove below when ROCm5.7 is not in support matrix anymore.

manywheel/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ ARG ROCM_VERSION=3.7
33
ARG BASE_CUDA_VERSION=11.8
44

55
ARG GPU_IMAGE=centos:7
6+
ARG MKLROOT=/opt/intel
67
FROM centos:7 as base
78

89
ENV LC_ALL en_US.UTF-8
@@ -118,7 +119,7 @@ COPY --from=openssl /opt/openssl /opt/openss
118119
COPY --from=python /opt/python /opt/python
119120
COPY --from=python /opt/_internal /opt/_internal
120121
COPY --from=python /opt/python/cp39-cp39/bin/auditwheel /usr/local/bin/auditwheel
121-
COPY --from=intel /opt/intel /opt/intel
122+
COPY --from=intel ${MKLROOT} ${MKLROOT}
122123
COPY --from=patchelf /usr/local/bin/patchelf /usr/local/bin/patchelf
123124
COPY --from=jni /usr/local/include/jni.h /usr/local/include/jni.h
124125
COPY --from=libpng /usr/local/bin/png* /usr/local/bin/

0 commit comments

Comments
 (0)