Skip to content
This repository was archived by the owner on Aug 15, 2025. It is now read-only.

Commit 0e70435

Browse files
set MKLROOT env var in manywheel/libtorch Dockerfile; default to CI env value; use env var in all scripts
1 parent 987dcb0 commit 0e70435

File tree

4 files changed

+12
-19
lines changed

4 files changed

+12
-19
lines changed

common/install_mkl.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ set -ex
44
# MKL
55
MKL_VERSION=2024.2.0
66

7-
mkdir -p /opt/intel/
7+
mkdir -p ${MKLROOT}
88
pushd /tmp
99

1010
python3 -mpip install wheel
1111
python3 -mpip download -d . mkl-static==${MKL_VERSION}
1212
python3 -m wheel unpack mkl_static-${MKL_VERSION}-py2.py3-none-manylinux1_x86_64.whl
1313
python3 -m wheel unpack mkl_include-${MKL_VERSION}-py2.py3-none-manylinux1_x86_64.whl
14-
mv mkl_static-${MKL_VERSION}/mkl_static-${MKL_VERSION}.data/data/lib /opt/intel/
15-
mv mkl_include-${MKL_VERSION}/mkl_include-${MKL_VERSION}.data/data/include /opt/intel/
14+
mv mkl_static-${MKL_VERSION}/mkl_static-${MKL_VERSION}.data/data/lib ${MKLROOT}
15+
mv mkl_include-${MKL_VERSION}/mkl_include-${MKL_VERSION}.data/data/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: 2 additions & 2 deletions
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
@@ -69,8 +70,7 @@ RUN ln -sf /usr/local/cuda-12.4 /usr/local/cuda
6970
FROM cpu as rocm
7071
ARG PYTORCH_ROCM_ARCH
7172
ENV PYTORCH_ROCM_ARCH ${PYTORCH_ROCM_ARCH}
72-
ENV MKLROOT /opt/intel
73-
# Adding ROCM_PATH env var so that LoadHip.cmake (even with logic updated for ROCm6.0)
73+
# Adding ROCM_PATH env var so that LoadHip.cmake (even with logic updated for ROCm6.0)
7474
# find HIP works for ROCm5.7. Not needed for ROCm6.0 and above.
7575
# Remove below when ROCm5.7 is not in support matrix anymore.
7676
ENV ROCM_PATH /opt/rocm

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
@@ -131,7 +132,7 @@ COPY --from=openssl /opt/openssl /opt/openss
131132
COPY --from=python /opt/python /opt/python
132133
COPY --from=python /opt/_internal /opt/_internal
133134
COPY --from=python /opt/python/cp39-cp39/bin/auditwheel /usr/local/bin/auditwheel
134-
COPY --from=intel /opt/intel /opt/intel
135+
COPY --from=intel ${MKLROOT} ${MKLROOT}
135136
COPY --from=patchelf /usr/local/bin/patchelf /usr/local/bin/patchelf
136137
COPY --from=jni /usr/local/include/jni.h /usr/local/include/jni.h
137138
COPY --from=libpng /usr/local/bin/png* /usr/local/bin/

0 commit comments

Comments
 (0)