From b9122f1e0e0733fe76fc378190f48e6181534dd6 Mon Sep 17 00:00:00 2001 From: Andrey Talman Date: Tue, 19 Mar 2024 15:54:35 -0400 Subject: [PATCH 1/5] [BE] Remove macos x86 build statements, remove python <3.8 (#1745) * [BE] Remove macos x86 build statements, remove python <3.8 * fix * deprecate --- manywheel/build_common.sh | 17 ++----- manywheel/conda_build.sh | 89 --------------------------------- wheel/build_wheel.sh | 47 ++++------------- windows/condaenv.bat | 2 - windows/internal/smoke_test.bat | 2 - 5 files changed, 14 insertions(+), 143 deletions(-) delete mode 100755 manywheel/conda_build.sh diff --git a/manywheel/build_common.sh b/manywheel/build_common.sh index 31f188d94..60f8221d5 100644 --- a/manywheel/build_common.sh +++ b/manywheel/build_common.sh @@ -76,15 +76,7 @@ fi # in this case if [[ -n "$DESIRED_PYTHON" && "$DESIRED_PYTHON" != cp* ]]; then python_nodot="$(echo $DESIRED_PYTHON | tr -d m.u)" - case ${DESIRED_PYTHON} in - 3.[6-7]*) - DESIRED_PYTHON="cp${python_nodot}-cp${python_nodot}m" - ;; - # Should catch 3.8+ - 3.*) - DESIRED_PYTHON="cp${python_nodot}-cp${python_nodot}" - ;; - esac + DESIRED_PYTHON="cp${python_nodot}-cp${python_nodot}" fi if [[ ${python_nodot} -ge 310 ]]; then @@ -119,10 +111,7 @@ pushd "$PYTORCH_ROOT" python setup.py clean retry pip install -qr requirements.txt case ${DESIRED_PYTHON} in - cp36-cp36m) - retry pip install -q numpy==1.11 - ;; - cp3[7-8]*) + cp38*) retry pip install -q numpy==1.15 ;; cp310*) @@ -280,7 +269,7 @@ replace_needed_sofiles() { patchedname=$3 if [[ "$origname" != "$patchedname" ]] || [[ "$DESIRED_CUDA" == *"rocm"* ]]; then set +e - origname=$($PATCHELF_BIN --print-needed $sofile | grep "$origname.*") + origname=$($PATCHELF_BIN --print-needed $sofile | grep "$origname.*") ERRCODE=$? set -e if [ "$ERRCODE" -eq "0" ]; then diff --git a/manywheel/conda_build.sh b/manywheel/conda_build.sh deleted file mode 100755 index 407b4e4d4..000000000 --- a/manywheel/conda_build.sh +++ /dev/null @@ -1,89 +0,0 @@ -#!/usr/bin/env bash -set -e - -yum install -y wget git cmake - -# make sure CUDA 7.5 and 8.0 are installed -if ! ls /usr/local/cuda-7.5 -then - echo "Downloading CUDA 7.5" - wget -c http://developer.download.nvidia.com/compute/cuda/7.5/Prod/local_installers/cuda_7.5.18_linux.run \ - -O /remote/cuda_7.5.18_linux.run - - echo "Installing CUDA 7.5" - chmod +x /remote/cuda_7.5.18_linux.run - bash remote/cuda_7.5.18_linux.run --silent --toolkit --no-opengl-libs - - echo "\nDone installing CUDA 7.5" -else - echo "CUDA 7.5 already installed" -fi - -if ! ls /usr/local/cuda-8.0 -then - echo "Downloading CUDA 8.0" - wget -c https://developer.nvidia.com/compute/cuda/8.0/Prod2/local_installers/cuda_8.0.61_375.26_linux-run \ - -O /remote/cuda_8.0.61_linux-run - - echo "Installing CUDA 8.0" - chmod +x /remote/cuda_8.0.61_linux-run - bash /remote/cuda_8.0.61_linux-run --silent --toolkit --no-opengl-libs - - echo "\nDone installing CUDA 8.0" -else - echo "CUDA 8.0 already installed" -fi - -# make sure cudnn is installed -if ! ls /usr/local/cuda-7.5/lib64/libcudnn.so.6.0.21 -then - rm -rf /tmp/cuda - wget -c http://developer.download.nvidia.com/compute/redist/cudnn/v6.0/cudnn-7.5-linux-x64-v6.0.tgz \ - -O /remote/cudnn-7.5-linux-x64-v6.0.tgz - pushd /tmp - tar -xvf /remote/cudnn-7.5-linux-x64-v6.0.tgz - cp -P /tmp/cuda/include/* /usr/local/cuda-7.5/include/ - cp -P /tmp/cuda/lib64/* /usr/local/cuda-7.5/lib64/ - popd -fi - -if ! ls /usr/local/cuda-8.0/lib64/libcudnn.so.6.0.21 -then - rm -rf /tmp/cuda - wget -c http://developer.download.nvidia.com/compute/redist/cudnn/v6.0/cudnn-8.0-linux-x64-v6.0.tgz \ - -O /remote/cudnn-8.0-linux-x64-v6.0.tgz - pushd /tmp - tar -xvf /remote/cudnn-8.0-linux-x64-v6.0.tgz - cp -P /tmp/cuda/include/* /usr/local/cuda-8.0/include/ - cp -P /tmp/cuda/lib64/* /usr/local/cuda-8.0/lib64/ - popd -fi - -# Install Anaconda -if ! ls /py -then - echo "Miniconda needs to be installed" - wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh - bash ~/miniconda.sh -b -p /py -else - echo "Miniconda is already installed" -fi - -export PATH="/py/bin:$PATH" - -# Anaconda token -if ls /remote/token -then - source /remote/token -fi - -conda install -y conda-build anaconda-client -yes | pip install awscli - -unset CUDA_VERSION # set in docker image :-/ - -# build conda packages -rm -rf /b -git clone https://github.com/pytorch/builder /b -cd /b/conda -./build_all.sh diff --git a/wheel/build_wheel.sh b/wheel/build_wheel.sh index 5e9c68041..b509fb7a9 100755 --- a/wheel/build_wheel.sh +++ b/wheel/build_wheel.sh @@ -97,13 +97,8 @@ fi whl_tmp_dir="${MAC_PACKAGE_WORK_DIR}/dist" mkdir -p "$whl_tmp_dir" -if [[ -n "$CROSS_COMPILE_ARM64" || $(uname -m) == "arm64" ]]; then - mac_version='macosx_11_0_arm64' - libtorch_arch='arm64' -else - mac_version='macosx_10_9_x86_64' - libtorch_arch='x86_64' -fi +mac_version='macosx_11_0_arm64' +libtorch_arch='arm64' # Create a consistent wheel package name to rename the wheel to wheel_filename_new="${TORCH_PACKAGE_NAME}-${build_version}${build_number_prefix}-cp${python_nodot}-none-${mac_version}.whl" @@ -163,13 +158,9 @@ case $desired_python in ;; 3.8) echo "Using 3.8 deps" - if [[ "$(uname -m)" == "arm64" ]]; then - SETUPTOOLS_PINNED_VERSION=">=46.0.0" - PYYAML_PINNED_VERSION=">=5.3" - NUMPY_PINNED_VERSION="=1.19" - else - NUMPY_PINNED_VERSION="=1.17" - fi + SETUPTOOLS_PINNED_VERSION=">=46.0.0" + PYYAML_PINNED_VERSION=">=5.3" + NUMPY_PINNED_VERSION="=1.19" ;; *) echo "Using default deps" @@ -182,30 +173,19 @@ tmp_env_name="wheel_py$python_nodot" conda create ${EXTRA_CONDA_INSTALL_FLAGS} -yn "$tmp_env_name" python="$desired_python" source activate "$tmp_env_name" -retry conda install ${EXTRA_CONDA_INSTALL_FLAGS} -yq "numpy${NUMPY_PINNED_VERSION}" nomkl "setuptools${SETUPTOOLS_PINNED_VERSION}" "pyyaml${PYYAML_PINNED_VERSION}" typing_extensions requests - -if [[ "$(uname -m)" == "arm64" ]]; then - retry conda install ${EXTRA_CONDA_INSTALL_FLAGS} -yq cmake ninja -else - retry conda install ${EXTRA_CONDA_INSTALL_FLAGS} -yq cmake ninja mkl-include==2022.2.1 mkl-static==2022.2.1 -c intel -fi +retry conda install ${EXTRA_CONDA_INSTALL_FLAGS} -yq "numpy${NUMPY_PINNED_VERSION}" nomkl cmake ninja "setuptools${SETUPTOOLS_PINNED_VERSION}" "pyyaml${PYYAML_PINNED_VERSION}" typing_extensions requests retry pip install -qr "${pytorch_rootdir}/requirements.txt" || true # For USE_DISTRIBUTED=1 on macOS, need libuv and pkg-config to find libuv. export USE_DISTRIBUTED=1 retry conda install ${EXTRA_CONDA_INSTALL_FLAGS} -yq libuv pkg-config -if [[ -n "$CROSS_COMPILE_ARM64" || "$(uname -m)" == "arm64" ]]; then - if [[ -n "$CROSS_COMPILE_ARM64" ]]; then - export CMAKE_OSX_ARCHITECTURES=arm64 - fi - export USE_MKLDNN=OFF - export USE_QNNPACK=OFF - export BUILD_TEST=OFF -elif [[ "$(uname -m)" == "x86_64" ]]; then - retry conda install ${EXTRA_CONDA_INSTALL_FLAGS} -yq llvmdev=9 - export USE_LLVM="${CONDA_PREFIX}" +if [[ -n "$CROSS_COMPILE_ARM64" ]]; then + export CMAKE_OSX_ARCHITECTURES=arm64 fi +export USE_MKLDNN=OFF +export USE_QNNPACK=OFF +export BUILD_TEST=OFF pushd "$pytorch_rootdir" echo "Calling setup.py bdist_wheel at $(date)" @@ -289,9 +269,4 @@ else zip -rq "$PYTORCH_FINAL_PACKAGE_DIR/libtorch-macos-${libtorch_arch}-$PYTORCH_BUILD_VERSION.zip" libtorch cp "$PYTORCH_FINAL_PACKAGE_DIR/libtorch-macos-${libtorch_arch}-$PYTORCH_BUILD_VERSION.zip" \ "$PYTORCH_FINAL_PACKAGE_DIR/libtorch-macos-${libtorch_arch}-latest.zip" - if [[ "${libtorch_arch}" == "x86_64" ]]; then - # For backward compatibility make unarched latest to point to x86_64 - cp "$PYTORCH_FINAL_PACKAGE_DIR/libtorch-macos-${libtorch_arch}-$PYTORCH_BUILD_VERSION.zip" \ - "$PYTORCH_FINAL_PACKAGE_DIR/libtorch-macos-latest.zip" - fi fi diff --git a/windows/condaenv.bat b/windows/condaenv.bat index 4475b0568..022e61891 100644 --- a/windows/condaenv.bat +++ b/windows/condaenv.bat @@ -9,13 +9,11 @@ FOR %%v IN (%DESIRED_PYTHON%) DO ( set PYTHON_VERSION_STR=%%v set PYTHON_VERSION_STR=!PYTHON_VERSION_STR:.=! conda remove -n py!PYTHON_VERSION_STR! --all -y || rmdir %CONDA_HOME%\envs\py!PYTHON_VERSION_STR! /s - if "%%v" == "3.7" call conda create -n py!PYTHON_VERSION_STR! -y -q numpy=1.11 "mkl=2020.2" pyyaml boto3 cmake ninja typing_extensions python=%%v if "%%v" == "3.8" call conda create -n py!PYTHON_VERSION_STR! -y -q numpy=1.11 "mkl=2020.2" pyyaml boto3 cmake ninja typing_extensions python=%%v if "%%v" == "3.9" call conda create -n py!PYTHON_VERSION_STR! -y -q numpy>=1.11 "mkl=2020.2" pyyaml boto3 cmake ninja typing_extensions python=%%v if "%%v" == "3.10" call conda create -n py!PYTHON_VERSION_STR! -y -q -c=conda-forge numpy=1.21.3 "mkl=2020.2" intel-openmp=2023.2.0 pyyaml boto3 "cmake=3.19.6" ninja typing_extensions python=%%v if "%%v" == "3.11" call conda create -n py!PYTHON_VERSION_STR! -y -q -c=conda-forge numpy=1.23.4 "mkl=2020.2" intel-openmp=2023.2.0 pyyaml boto3 "cmake=3.19.6" ninja typing_extensions python=%%v if "%%v" == "3.12" call conda create -n py!PYTHON_VERSION_STR! -y -q -c=conda-forge numpy=1.26.0 "mkl=2023.1" intel-openmp=2023.2.0 pyyaml boto3 "cmake=3.19.6" ninja typing_extensions python=%%v - if "%%v" == "3" call conda create -n py!PYTHON_VERSION_STR! -y -q numpy=1.11 "mkl=2020.2" pyyaml boto3 cmake ninja typing_extensions python=%%v ) endlocal diff --git a/windows/internal/smoke_test.bat b/windows/internal/smoke_test.bat index 8c5aed2ef..b6200d751 100644 --- a/windows/internal/smoke_test.bat +++ b/windows/internal/smoke_test.bat @@ -35,8 +35,6 @@ if "%DESIRED_PYTHON%" == "3.11" set "PYTHON_INSTALLER_URL=https://www.python.org if "%DESIRED_PYTHON%" == "3.10" set "PYTHON_INSTALLER_URL=https://www.python.org/ftp/python/3.10.0/python-3.10.0-amd64.exe" if "%DESIRED_PYTHON%" == "3.9" set "PYTHON_INSTALLER_URL=https://www.python.org/ftp/python/3.9.0/python-3.9.0-amd64.exe" if "%DESIRED_PYTHON%" == "3.8" set "PYTHON_INSTALLER_URL=https://www.python.org/ftp/python/3.8.2/python-3.8.2-amd64.exe" -if "%DESIRED_PYTHON%" == "3.7" set "PYTHON_INSTALLER_URL=https://www.python.org/ftp/python/3.7.9/python-3.7.9-amd64.exe" -if "%DESIRED_PYTHON%" == "3.6" set "PYTHON_INSTALLER_URL=https://www.python.org/ftp/python/3.6.8/python-3.6.8-amd64.exe" if "%PYTHON_INSTALLER_URL%" == "" ( echo Python %DESIRED_PYTHON% not supported yet ) From 17c66613f33b7fc7ca1618faa6bca37b0984784f Mon Sep 17 00:00:00 2001 From: Andrey Talman Date: Wed, 20 Mar 2024 16:05:02 -0400 Subject: [PATCH 2/5] Update nightly wheel build numpy to 2.0 (#1747) * Update wheel build numpy to 2.0 (#1746) * Update wheel build numpy to 2.0 * aarch64 * Update build_wheel.sh * Simplify --- aarch64_linux/aarch64_ci_setup.sh | 6 +++--- manywheel/build_common.sh | 12 +++--------- wheel/build_wheel.sh | 15 ++++++++++----- windows/internal/smoke_test.bat | 8 +++++++- 4 files changed, 23 insertions(+), 18 deletions(-) diff --git a/aarch64_linux/aarch64_ci_setup.sh b/aarch64_linux/aarch64_ci_setup.sh index 07a4757ff..f6f07a6f3 100755 --- a/aarch64_linux/aarch64_ci_setup.sh +++ b/aarch64_linux/aarch64_ci_setup.sh @@ -26,11 +26,11 @@ conda create -y -c conda-forge -n "${CONDA_ENV_NAME}" python=${DESIRED_PYTHON} conda activate "${CONDA_ENV_NAME}" if [[ "$DESIRED_PYTHON" == "3.8" ]]; then - NUMPY_VERSION="1.24.4" + pip install -q numpy==1.24.4 else - NUMPY_VERSION="1.26.2" + pip install -q --pre numpy==2.0.0b1 fi -conda install -y -c conda-forge numpy==${NUMPY_VERSION} pyyaml==6.0.1 patchelf==0.17.2 pygit2==1.13.2 openblas==0.3.25=*openmp* ninja==1.11.1 scons==4.5.2 +conda install -y -c conda-forge pyyaml==6.0.1 patchelf==0.17.2 pygit2==1.13.2 openblas==0.3.25=*openmp* ninja==1.11.1 scons==4.5.2 python --version conda --version diff --git a/manywheel/build_common.sh b/manywheel/build_common.sh index 60f8221d5..bd825dc63 100644 --- a/manywheel/build_common.sh +++ b/manywheel/build_common.sh @@ -114,18 +114,12 @@ case ${DESIRED_PYTHON} in cp38*) retry pip install -q numpy==1.15 ;; - cp310*) - retry pip install -q numpy==1.21.2 - ;; - cp311*) - retry pip install -q numpy==1.23.1 - ;; - cp312*) - retry pip install -q numpy==1.26.1 + cp31*) + retry pip install -q --pre numpy==2.0.0b1 ;; # Should catch 3.9+ *) - retry pip install -q numpy==1.19.4 + retry pip install -q --pre numpy==2.0.0b1 ;; esac diff --git a/wheel/build_wheel.sh b/wheel/build_wheel.sh index b509fb7a9..57c6418b4 100755 --- a/wheel/build_wheel.sh +++ b/wheel/build_wheel.sh @@ -136,25 +136,25 @@ case $desired_python in echo "Using 3.12 deps" SETUPTOOLS_PINNED_VERSION=">=68.0.0" PYYAML_PINNED_VERSION=">=6.0.1" - NUMPY_PINNED_VERSION="==1.26.0" + NUMPY_PINNED_VERSION="=2.0.0b1" ;; 3.11) echo "Using 3.11 deps" SETUPTOOLS_PINNED_VERSION=">=46.0.0" PYYAML_PINNED_VERSION=">=5.3" - NUMPY_PINNED_VERSION="==1.23.5" + NUMPY_PINNED_VERSION="=2.0.0b1" ;; 3.10) echo "Using 3.10 deps" SETUPTOOLS_PINNED_VERSION=">=46.0.0" PYYAML_PINNED_VERSION=">=5.3" - NUMPY_PINNED_VERSION="=1.21.2" + NUMPY_PINNED_VERSION="=2.0.0b1" ;; 3.9) echo "Using 3.9 deps" SETUPTOOLS_PINNED_VERSION=">=46.0.0" PYYAML_PINNED_VERSION=">=5.3" - NUMPY_PINNED_VERSION="=1.19" + NUMPY_PINNED_VERSION="=2.0.0b1" ;; 3.8) echo "Using 3.8 deps" @@ -173,7 +173,12 @@ tmp_env_name="wheel_py$python_nodot" conda create ${EXTRA_CONDA_INSTALL_FLAGS} -yn "$tmp_env_name" python="$desired_python" source activate "$tmp_env_name" -retry conda install ${EXTRA_CONDA_INSTALL_FLAGS} -yq "numpy${NUMPY_PINNED_VERSION}" nomkl cmake ninja "setuptools${SETUPTOOLS_PINNED_VERSION}" "pyyaml${PYYAML_PINNED_VERSION}" typing_extensions requests +if [[ $desired_python != "3.8" ]]; then + pip install -q --pre numpy=${NUMPY_PINNED_VERSION} +else + retry conda install ${EXTRA_CONDA_INSTALL_FLAGS} -yq "numpy${NUMPY_PINNED_VERSION}" +fi +retry conda install ${EXTRA_CONDA_INSTALL_FLAGS} -yq nomkl cmake ninja "setuptools${SETUPTOOLS_PINNED_VERSION}" "pyyaml${PYYAML_PINNED_VERSION}" typing_extensions requests retry pip install -qr "${pytorch_rootdir}/requirements.txt" || true # For USE_DISTRIBUTED=1 on macOS, need libuv and pkg-config to find libuv. diff --git a/windows/internal/smoke_test.bat b/windows/internal/smoke_test.bat index b6200d751..1a5b9e02c 100644 --- a/windows/internal/smoke_test.bat +++ b/windows/internal/smoke_test.bat @@ -52,7 +52,13 @@ if errorlevel 1 exit /b 1 set "PATH=%CD%\Python%PYTHON_VERSION%\Scripts;%CD%\Python;%PATH%" -pip install -q numpy protobuf + +if "%DESIRED_PYTHON%" == "3.12" pip install -q --pre numpy==2.0.0b1 protobuf +if "%DESIRED_PYTHON%" == "3.11" pip install -q --pre numpy==2.0.0b1 protobuf +if "%DESIRED_PYTHON%" == "3.10" pip install -q --pre numpy==2.0.0b1 protobuf +if "%DESIRED_PYTHON%" == "3.9" pip install -q --pre numpy==2.0.0b1 protobuf +if "%DESIRED_PYTHON%" == "3.8" pip install -q numpy protobuf + if errorlevel 1 exit /b 1 for /F "delims=" %%i in ('where /R "%PYTORCH_FINAL_PACKAGE_DIR:/=\%" *.whl') do pip install "%%i" From dcc58c30b5e3803d45a823595f6a23262e487099 Mon Sep 17 00:00:00 2001 From: Nikita Shulga <2453524+malfet@users.noreply.github.com> Date: Tue, 2 Apr 2024 18:15:47 -0700 Subject: [PATCH 3/5] Install llvm-openmp for M1 PyTorch builds Otherwise the binary will be super slow Also drop `nomkl` as there were never mkl on Apple silicon --- wheel/build_wheel.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wheel/build_wheel.sh b/wheel/build_wheel.sh index 57c6418b4..3ce10c7e5 100755 --- a/wheel/build_wheel.sh +++ b/wheel/build_wheel.sh @@ -178,7 +178,7 @@ if [[ $desired_python != "3.8" ]]; then else retry conda install ${EXTRA_CONDA_INSTALL_FLAGS} -yq "numpy${NUMPY_PINNED_VERSION}" fi -retry conda install ${EXTRA_CONDA_INSTALL_FLAGS} -yq nomkl cmake ninja "setuptools${SETUPTOOLS_PINNED_VERSION}" "pyyaml${PYYAML_PINNED_VERSION}" typing_extensions requests +retry conda install ${EXTRA_CONDA_INSTALL_FLAGS} -yq llvm-openmp=14.0.6 cmake ninja "setuptools${SETUPTOOLS_PINNED_VERSION}" "pyyaml${PYYAML_PINNED_VERSION}" typing_extensions requests retry pip install -qr "${pytorch_rootdir}/requirements.txt" || true # For USE_DISTRIBUTED=1 on macOS, need libuv and pkg-config to find libuv. From 01ebb45411950e7fba379de95fab4a5a7354ab50 Mon Sep 17 00:00:00 2001 From: Andrey Talman Date: Wed, 3 Apr 2024 16:16:11 -0400 Subject: [PATCH 4/5] Add numpy 2.0.0rc1 support to conda and wheels (#1768) * Add numpy 2.0.0rc1 support to conda and wheels * conda * conda * test * fix --- aarch64_linux/aarch64_ci_setup.sh | 2 +- conda/build_pytorch.sh | 6 ++++-- conda/pytorch-nightly/meta.yaml | 4 +--- manywheel/build_common.sh | 4 ++-- wheel/build_wheel.sh | 8 ++++---- windows/internal/smoke_test.bat | 8 ++++---- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/aarch64_linux/aarch64_ci_setup.sh b/aarch64_linux/aarch64_ci_setup.sh index f6f07a6f3..87ed70a72 100755 --- a/aarch64_linux/aarch64_ci_setup.sh +++ b/aarch64_linux/aarch64_ci_setup.sh @@ -28,7 +28,7 @@ conda activate "${CONDA_ENV_NAME}" if [[ "$DESIRED_PYTHON" == "3.8" ]]; then pip install -q numpy==1.24.4 else - pip install -q --pre numpy==2.0.0b1 + pip install -q --pre numpy==2.0.0rc1 fi conda install -y -c conda-forge pyyaml==6.0.1 patchelf==0.17.2 pygit2==1.13.2 openblas==0.3.25=*openmp* ninja==1.11.1 scons==4.5.2 diff --git a/conda/build_pytorch.sh b/conda/build_pytorch.sh index ed999fd32..d38c6abed 100755 --- a/conda/build_pytorch.sh +++ b/conda/build_pytorch.sh @@ -85,7 +85,7 @@ if [ -z "$ANACONDA_TOKEN" ]; then fi if [[ -z "$ANACONDA_USER" ]]; then # This is the channel that finished packages will be uploaded to - ANACONDA_USER=soumith + ANACONDA_USER='pytorch' fi if [[ -z "$GITHUB_ORG" ]]; then GITHUB_ORG='pytorch' @@ -360,12 +360,14 @@ for py_ver in "${DESIRED_PYTHON[@]}"; do fi echo "Calling conda-build at $(date)" + # TODO: Remove atalman channel once we can wend numpy from + # anaconda or pytorch or pytorch nightly channel time CMAKE_ARGS=${CMAKE_ARGS[@]} \ EXTRA_CAFFE2_CMAKE_FLAGS=${EXTRA_CAFFE2_CMAKE_FLAGS[@]} \ PYTORCH_GITHUB_ROOT_DIR="$pytorch_rootdir" \ PYTORCH_BUILD_STRING="$build_string" \ PYTORCH_MAGMA_CUDA_VERSION="$cuda_nodot" \ - conda build -c "$ANACONDA_USER" \ + conda build -c "$ANACONDA_USER" -c atalman \ ${NO_TEST:-} \ --no-anaconda-upload \ --python "$py_ver" \ diff --git a/conda/pytorch-nightly/meta.yaml b/conda/pytorch-nightly/meta.yaml index 3da1625c4..977ba187f 100644 --- a/conda/pytorch-nightly/meta.yaml +++ b/conda/pytorch-nightly/meta.yaml @@ -30,9 +30,7 @@ requirements: - ninja - libuv # [win] - numpy=1.19 # [py <= 39] - - numpy=1.21.5 # [py == 310] - - numpy=1.23.5 # [py == 311] - - numpy=1.26.0 # [py >= 312] + - numpy=2.0.0rc1 # [py >= 39] - openssl=1.1.1l # [py >= 38 and py <= 310 and linux] - openssl=1.1.1s # [py == 311 and linux] - openssl=3.0.12 # [py >= 312 and linux] diff --git a/manywheel/build_common.sh b/manywheel/build_common.sh index bd825dc63..0fc23a0c5 100644 --- a/manywheel/build_common.sh +++ b/manywheel/build_common.sh @@ -115,11 +115,11 @@ case ${DESIRED_PYTHON} in retry pip install -q numpy==1.15 ;; cp31*) - retry pip install -q --pre numpy==2.0.0b1 + retry pip install -q --pre numpy==2.0.0rc1 ;; # Should catch 3.9+ *) - retry pip install -q --pre numpy==2.0.0b1 + retry pip install -q --pre numpy==2.0.0rc1 ;; esac diff --git a/wheel/build_wheel.sh b/wheel/build_wheel.sh index 3ce10c7e5..08e18e515 100755 --- a/wheel/build_wheel.sh +++ b/wheel/build_wheel.sh @@ -136,25 +136,25 @@ case $desired_python in echo "Using 3.12 deps" SETUPTOOLS_PINNED_VERSION=">=68.0.0" PYYAML_PINNED_VERSION=">=6.0.1" - NUMPY_PINNED_VERSION="=2.0.0b1" + NUMPY_PINNED_VERSION="=2.0.0rc1" ;; 3.11) echo "Using 3.11 deps" SETUPTOOLS_PINNED_VERSION=">=46.0.0" PYYAML_PINNED_VERSION=">=5.3" - NUMPY_PINNED_VERSION="=2.0.0b1" + NUMPY_PINNED_VERSION="=2.0.0rc1" ;; 3.10) echo "Using 3.10 deps" SETUPTOOLS_PINNED_VERSION=">=46.0.0" PYYAML_PINNED_VERSION=">=5.3" - NUMPY_PINNED_VERSION="=2.0.0b1" + NUMPY_PINNED_VERSION="=2.0.0rc1" ;; 3.9) echo "Using 3.9 deps" SETUPTOOLS_PINNED_VERSION=">=46.0.0" PYYAML_PINNED_VERSION=">=5.3" - NUMPY_PINNED_VERSION="=2.0.0b1" + NUMPY_PINNED_VERSION="=2.0.0rc1" ;; 3.8) echo "Using 3.8 deps" diff --git a/windows/internal/smoke_test.bat b/windows/internal/smoke_test.bat index 1a5b9e02c..d8a0516b1 100644 --- a/windows/internal/smoke_test.bat +++ b/windows/internal/smoke_test.bat @@ -53,10 +53,10 @@ if errorlevel 1 exit /b 1 set "PATH=%CD%\Python%PYTHON_VERSION%\Scripts;%CD%\Python;%PATH%" -if "%DESIRED_PYTHON%" == "3.12" pip install -q --pre numpy==2.0.0b1 protobuf -if "%DESIRED_PYTHON%" == "3.11" pip install -q --pre numpy==2.0.0b1 protobuf -if "%DESIRED_PYTHON%" == "3.10" pip install -q --pre numpy==2.0.0b1 protobuf -if "%DESIRED_PYTHON%" == "3.9" pip install -q --pre numpy==2.0.0b1 protobuf +if "%DESIRED_PYTHON%" == "3.12" pip install -q --pre numpy==2.0.0rc1 protobuf +if "%DESIRED_PYTHON%" == "3.11" pip install -q --pre numpy==2.0.0rc1 protobuf +if "%DESIRED_PYTHON%" == "3.10" pip install -q --pre numpy==2.0.0rc1 protobuf +if "%DESIRED_PYTHON%" == "3.9" pip install -q --pre numpy==2.0.0rc1 protobuf if "%DESIRED_PYTHON%" == "3.8" pip install -q numpy protobuf if errorlevel 1 exit /b 1 From 70eefacf12abe450f272b41ddac03cf89c4f033f Mon Sep 17 00:00:00 2001 From: Andrey Talman Date: Wed, 3 Apr 2024 16:31:14 -0400 Subject: [PATCH 5/5] Add numpy 2.0.0rc1 support to conda and wheels (#1769) --- conda/pytorch-nightly/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conda/pytorch-nightly/meta.yaml b/conda/pytorch-nightly/meta.yaml index 977ba187f..61a78bd8f 100644 --- a/conda/pytorch-nightly/meta.yaml +++ b/conda/pytorch-nightly/meta.yaml @@ -29,7 +29,7 @@ requirements: - typing_extensions - ninja - libuv # [win] - - numpy=1.19 # [py <= 39] + - numpy=1.19 # [py == 38] - numpy=2.0.0rc1 # [py >= 39] - openssl=1.1.1l # [py >= 38 and py <= 310 and linux] - openssl=1.1.1s # [py == 311 and linux]