Skip to content

Commit 4026073

Browse files
authored
Pin MKL to 2021.2.0 (#1655) (#1764)
* Pin MKL to 2021.2.0 Fixes pytorch/pytorch#62424 * Apply the same constraint for conda builds Use less-than-equals constraint to avoid dependency conflicts for python-3.6 environment
1 parent 028b639 commit 4026073

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

.circleci/unittest/linux/scripts/install.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,15 @@ else
3535
fi
3636
printf "Installing PyTorch with %s\n" "${cudatoolkit}"
3737
(
38+
if [ "${os}" == MacOSX ] ; then
39+
# TODO: this can be removed as soon as linking issue could be resolved
40+
# see https://github.com/pytorch/pytorch/issues/62424 from details
41+
MKL_CONSTRAINT='mkl==2021.2.0'
42+
else
43+
MKL_CONSTRAINT=''
44+
fi
3845
set -x
39-
conda install ${CONDA_CHANNEL_FLAGS:-} -y -c "pytorch-${UPLOAD_CHANNEL}" "pytorch-${UPLOAD_CHANNEL}::pytorch" ${cudatoolkit}
46+
conda install ${CONDA_CHANNEL_FLAGS:-} -y -c "pytorch-${UPLOAD_CHANNEL}" $MKL_CONSTRAINT "pytorch-${UPLOAD_CHANNEL}::pytorch" ${cudatoolkit}
4047
)
4148

4249
# 2. Install torchaudio

packaging/pkg_helpers.bash

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,11 @@ setup_conda_pytorch_constraint() {
238238
export CONDA_PYTORCH_BUILD_CONSTRAINT="- pytorch==${PYTORCH_VERSION}${PYTORCH_VERSION_SUFFIX}"
239239
export CONDA_PYTORCH_CONSTRAINT="- pytorch==${PYTORCH_VERSION}${PYTORCH_VERSION_SUFFIX}"
240240
fi
241+
# TODO: Remove me later, see https://github.com/pytorch/pytorch/issues/62424 for more details
242+
if [[ "$(uname)" == Darwin ]]; then
243+
# Use less than equal to avoid version conflict in python=3.6 environment
244+
export CONDA_EXTRA_BUILD_CONSTRAINT="- mkl<=2021.2.0"
245+
fi
241246
}
242247

243248
# Translate CUDA_VERSION into CUDA_CUDATOOLKIT_CONSTRAINT

packaging/torchaudio/meta.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,13 @@ requirements:
1717
- cmake
1818
- ninja
1919
- defaults::numpy >=1.11
20-
{{ environ.get('CONDA_PYTORCH_BUILD_CONSTRAINT') }}
20+
{{ environ.get('CONDA_PYTORCH_BUILD_CONSTRAINT', 'pytorch') }}
21+
{{ environ.get('CONDA_EXTRA_BUILD_CONSTRAINT', '') }}
2122

2223
run:
2324
- python
2425
- defaults::numpy >=1.11
25-
{{ environ.get('CONDA_PYTORCH_CONSTRAINT') }}
26+
{{ environ.get('CONDA_PYTORCH_CONSTRAINT', 'pytorch') }}
2627

2728
build:
2829
string: py{{py}}

0 commit comments

Comments
 (0)