Skip to content

Commit e0fd49f

Browse files
authored
Remove special cases for Python 3.11 (#1381)
* Remove special case for Python 3.11 * Remove install torch script
1 parent d1cea8b commit e0fd49f

File tree

3 files changed

+24
-52
lines changed

3 files changed

+24
-52
lines changed

.github/scripts/validate_binaries.sh

Lines changed: 23 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -2,49 +2,31 @@ if [[ ${MATRIX_PACKAGE_TYPE} == "libtorch" ]]; then
22
curl ${MATRIX_INSTALLATION} -o libtorch.zip
33
unzip libtorch.zip
44
else
5-
#special case for Python 3.11
6-
if [[ ${MATRIX_PYTHON_VERSION} == '3.11' ]]; then
7-
conda create -y -n ${ENV_NAME} python=${MATRIX_PYTHON_VERSION}
8-
conda activate ${ENV_NAME}
9-
10-
INSTALLATION=${MATRIX_INSTALLATION/"-c pytorch"/"-c malfet -c pytorch"}
11-
INSTALLATION=${INSTALLATION/"pytorch-cuda"/"pytorch-${MATRIX_CHANNEL}::pytorch-cuda"}
12-
INSTALLATION=${INSTALLATION/"conda install"/"conda install -y"}
13-
14-
eval $INSTALLATION
15-
python ./test/smoke_test/smoke_test.py
5+
# Special case Pypi installation package, only applicable to linux nightly CUDA 11.7 builds, wheel package
6+
if [[ ${TARGET_OS} == 'linux' && ${MATRIX_GPU_ARCH_VERSION} == '11.7' && ${MATRIX_PACKAGE_TYPE} == 'manywheel' && ${MATRIX_CHANNEL} != 'nightly' ]]; then
7+
conda create -yp ${ENV_NAME}_pypi python=${MATRIX_PYTHON_VERSION} numpy ffmpeg
8+
INSTALLATION_PYPI=${MATRIX_INSTALLATION/"cu117"/"cu117_pypi_cudnn"}
9+
INSTALLATION_PYPI=${INSTALLATION_PYPI/"torchvision torchaudio"/""}
10+
INSTALLATION_PYPI=${INSTALLATION_PYPI/"index-url"/"extra-index-url"}
11+
conda run -p ${ENV_NAME}_pypi ${INSTALLATION_PYPI}
12+
conda run -p ${ENV_NAME}_pypi python ./test/smoke_test/smoke_test.py --package torchonly
1613
conda deactivate
17-
conda env remove -n ${ENV_NAME}
18-
else
19-
20-
21-
22-
# Special case Pypi installation package, only applicable to linux nightly CUDA 11.7 builds, wheel package
23-
if [[ ${TARGET_OS} == 'linux' && ${MATRIX_GPU_ARCH_VERSION} == '11.7' && ${MATRIX_PACKAGE_TYPE} == 'manywheel' && ${MATRIX_CHANNEL} != 'nightly' ]]; then
24-
conda create -yp ${ENV_NAME}_pypi python=${MATRIX_PYTHON_VERSION} numpy ffmpeg
25-
INSTALLATION_PYPI=${MATRIX_INSTALLATION/"cu117"/"cu117_pypi_cudnn"}
26-
INSTALLATION_PYPI=${INSTALLATION_PYPI/"torchvision torchaudio"/""}
27-
INSTALLATION_PYPI=${INSTALLATION_PYPI/"index-url"/"extra-index-url"}
28-
conda run -p ${ENV_NAME}_pypi ${INSTALLATION_PYPI}
29-
conda run -p ${ENV_NAME}_pypi python ./test/smoke_test/smoke_test.py --package torchonly
30-
conda deactivate
31-
conda env remove -p ${ENV_NAME}_pypi
32-
fi
33-
34-
# Please note ffmpeg is required for torchaudio, see https://github.com/pytorch/pytorch/issues/96159
35-
conda create -y -n ${ENV_NAME} python=${MATRIX_PYTHON_VERSION} numpy ffmpeg
36-
conda activate ${ENV_NAME}
37-
INSTALLATION=${MATRIX_INSTALLATION/"conda install"/"conda install -y"}
38-
eval $INSTALLATION
14+
conda env remove -p ${ENV_NAME}_pypi
15+
fi
3916

40-
if [[ ${TARGET_OS} == 'linux' ]]; then
41-
export CONDA_LIBRARY_PATH="$(dirname $(which python))/../lib"
42-
export LD_LIBRARY_PATH=$CONDA_LIBRARY_PATH:$LD_LIBRARY_PATH
43-
${PWD}/check_binary.sh
44-
fi
17+
# Please note ffmpeg is required for torchaudio, see https://github.com/pytorch/pytorch/issues/96159
18+
conda create -y -n ${ENV_NAME} python=${MATRIX_PYTHON_VERSION} numpy ffmpeg
19+
conda activate ${ENV_NAME}
20+
INSTALLATION=${MATRIX_INSTALLATION/"conda install"/"conda install -y"}
21+
eval $INSTALLATION
4522

46-
python ./test/smoke_test/smoke_test.py
47-
conda deactivate
48-
conda env remove -n ${ENV_NAME}
23+
if [[ ${TARGET_OS} == 'linux' ]]; then
24+
export CONDA_LIBRARY_PATH="$(dirname $(which python))/../lib"
25+
export LD_LIBRARY_PATH=$CONDA_LIBRARY_PATH:$LD_LIBRARY_PATH
26+
${PWD}/check_binary.sh
4927
fi
28+
29+
python ./test/smoke_test/smoke_test.py
30+
conda deactivate
31+
conda env remove -n ${ENV_NAME}
5032
fi

aarch64_linux/build_aarch64_wheel.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -211,14 +211,10 @@ def install_condaforge_python(host: RemoteHost, python_version="3.8") -> None:
211211
# Python-3.6 EOLed and not compatible with conda-4.11
212212
install_condaforge(host, suffix="download/4.10.3-10/Miniforge3-4.10.3-10-Linux-aarch64.sh")
213213
host.run_cmd(f"conda install -y python={python_version} numpy pyyaml")
214-
elif python_version == "3.11":
215-
install_condaforge(host, suffix="download/4.11.0-4/Miniforge3-4.11.0-4-Linux-aarch64.sh")
216-
# Pytorch-1.10 or older are not compatible with setuptools=59.6 or newer
217-
host.run_cmd(f"conda install -y python={python_version} numpy pyyaml setuptools=59.8.0 -c malfet")
218214
else:
219215
install_condaforge(host, suffix="download/4.11.0-4/Miniforge3-4.11.0-4-Linux-aarch64.sh")
220216
# Pytorch-1.10 or older are not compatible with setuptools=59.6 or newer
221-
host.run_cmd(f"conda install -y python={python_version} numpy pyyaml setuptools=59.5.0")
217+
host.run_cmd(f"conda install -y python={python_version} numpy pyyaml setuptools>=59.5.0")
222218

223219

224220
def build_OpenBLAS(host: RemoteHost, git_clone_flags: str = "") -> None:

conda/build_pytorch.sh

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -299,12 +299,6 @@ else
299299
export CONDA_BUILD_EXTRA_ARGS=""
300300
fi
301301

302-
if [[ "$DESIRED_PYTHON" == "3.11" ]]; then
303-
# TODO: Remove me when numpy is available in default channel
304-
# or copy numpy to pytorch channel
305-
export CONDA_BUILD_EXTRA_ARGS="-c malfet ${CONDA_BUILD_EXTRA_ARGS}"
306-
fi
307-
308302
# Build PyTorch with Gloo's TCP_TLS transport
309303
if [[ "$(uname)" == 'Linux' ]]; then
310304
export USE_GLOO_WITH_OPENSSL=1

0 commit comments

Comments
 (0)