Skip to content

Remove special cases for Python 3.11 #1381

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 23 additions & 41 deletions .github/scripts/validate_binaries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,49 +2,31 @@ if [[ ${MATRIX_PACKAGE_TYPE} == "libtorch" ]]; then
curl ${MATRIX_INSTALLATION} -o libtorch.zip
unzip libtorch.zip
else
#special case for Python 3.11
if [[ ${MATRIX_PYTHON_VERSION} == '3.11' ]]; then
conda create -y -n ${ENV_NAME} python=${MATRIX_PYTHON_VERSION}
conda activate ${ENV_NAME}

INSTALLATION=${MATRIX_INSTALLATION/"-c pytorch"/"-c malfet -c pytorch"}
INSTALLATION=${INSTALLATION/"pytorch-cuda"/"pytorch-${MATRIX_CHANNEL}::pytorch-cuda"}
INSTALLATION=${INSTALLATION/"conda install"/"conda install -y"}

eval $INSTALLATION
python ./test/smoke_test/smoke_test.py
# Special case Pypi installation package, only applicable to linux nightly CUDA 11.7 builds, wheel package
if [[ ${TARGET_OS} == 'linux' && ${MATRIX_GPU_ARCH_VERSION} == '11.7' && ${MATRIX_PACKAGE_TYPE} == 'manywheel' && ${MATRIX_CHANNEL} != 'nightly' ]]; then
conda create -yp ${ENV_NAME}_pypi python=${MATRIX_PYTHON_VERSION} numpy ffmpeg
INSTALLATION_PYPI=${MATRIX_INSTALLATION/"cu117"/"cu117_pypi_cudnn"}
INSTALLATION_PYPI=${INSTALLATION_PYPI/"torchvision torchaudio"/""}
INSTALLATION_PYPI=${INSTALLATION_PYPI/"index-url"/"extra-index-url"}
conda run -p ${ENV_NAME}_pypi ${INSTALLATION_PYPI}
conda run -p ${ENV_NAME}_pypi python ./test/smoke_test/smoke_test.py --package torchonly
conda deactivate
conda env remove -n ${ENV_NAME}
else



# Special case Pypi installation package, only applicable to linux nightly CUDA 11.7 builds, wheel package
if [[ ${TARGET_OS} == 'linux' && ${MATRIX_GPU_ARCH_VERSION} == '11.7' && ${MATRIX_PACKAGE_TYPE} == 'manywheel' && ${MATRIX_CHANNEL} != 'nightly' ]]; then
conda create -yp ${ENV_NAME}_pypi python=${MATRIX_PYTHON_VERSION} numpy ffmpeg
INSTALLATION_PYPI=${MATRIX_INSTALLATION/"cu117"/"cu117_pypi_cudnn"}
INSTALLATION_PYPI=${INSTALLATION_PYPI/"torchvision torchaudio"/""}
INSTALLATION_PYPI=${INSTALLATION_PYPI/"index-url"/"extra-index-url"}
conda run -p ${ENV_NAME}_pypi ${INSTALLATION_PYPI}
conda run -p ${ENV_NAME}_pypi python ./test/smoke_test/smoke_test.py --package torchonly
conda deactivate
conda env remove -p ${ENV_NAME}_pypi
fi

# Please note ffmpeg is required for torchaudio, see https://github.com/pytorch/pytorch/issues/96159
conda create -y -n ${ENV_NAME} python=${MATRIX_PYTHON_VERSION} numpy ffmpeg
conda activate ${ENV_NAME}
INSTALLATION=${MATRIX_INSTALLATION/"conda install"/"conda install -y"}
eval $INSTALLATION
conda env remove -p ${ENV_NAME}_pypi
fi

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

python ./test/smoke_test/smoke_test.py
conda deactivate
conda env remove -n ${ENV_NAME}
if [[ ${TARGET_OS} == 'linux' ]]; then
export CONDA_LIBRARY_PATH="$(dirname $(which python))/../lib"
export LD_LIBRARY_PATH=$CONDA_LIBRARY_PATH:$LD_LIBRARY_PATH
${PWD}/check_binary.sh
fi

python ./test/smoke_test/smoke_test.py
conda deactivate
conda env remove -n ${ENV_NAME}
fi
6 changes: 1 addition & 5 deletions aarch64_linux/build_aarch64_wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,14 +211,10 @@ def install_condaforge_python(host: RemoteHost, python_version="3.8") -> None:
# Python-3.6 EOLed and not compatible with conda-4.11
install_condaforge(host, suffix="download/4.10.3-10/Miniforge3-4.10.3-10-Linux-aarch64.sh")
host.run_cmd(f"conda install -y python={python_version} numpy pyyaml")
elif python_version == "3.11":
install_condaforge(host, suffix="download/4.11.0-4/Miniforge3-4.11.0-4-Linux-aarch64.sh")
# Pytorch-1.10 or older are not compatible with setuptools=59.6 or newer
host.run_cmd(f"conda install -y python={python_version} numpy pyyaml setuptools=59.8.0 -c malfet")
else:
install_condaforge(host, suffix="download/4.11.0-4/Miniforge3-4.11.0-4-Linux-aarch64.sh")
# Pytorch-1.10 or older are not compatible with setuptools=59.6 or newer
host.run_cmd(f"conda install -y python={python_version} numpy pyyaml setuptools=59.5.0")
host.run_cmd(f"conda install -y python={python_version} numpy pyyaml setuptools>=59.5.0")


def build_OpenBLAS(host: RemoteHost, git_clone_flags: str = "") -> None:
Expand Down
6 changes: 0 additions & 6 deletions conda/build_pytorch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -299,12 +299,6 @@ else
export CONDA_BUILD_EXTRA_ARGS=""
fi

if [[ "$DESIRED_PYTHON" == "3.11" ]]; then
# TODO: Remove me when numpy is available in default channel
# or copy numpy to pytorch channel
export CONDA_BUILD_EXTRA_ARGS="-c malfet ${CONDA_BUILD_EXTRA_ARGS}"
fi

# Build PyTorch with Gloo's TCP_TLS transport
if [[ "$(uname)" == 'Linux' ]]; then
export USE_GLOO_WITH_OPENSSL=1
Expand Down