Skip to content

Commit a522a56

Browse files
authored
[BE] Remove macos x86 build statements, remove python <3.8 (#1745)
* [BE] Remove macos x86 build statements, remove python <3.8 * fix * deprecate
1 parent 8ed9902 commit a522a56

File tree

5 files changed

+14
-143
lines changed

5 files changed

+14
-143
lines changed

manywheel/build_common.sh

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,7 @@ fi
7676
# in this case
7777
if [[ -n "$DESIRED_PYTHON" && "$DESIRED_PYTHON" != cp* ]]; then
7878
python_nodot="$(echo $DESIRED_PYTHON | tr -d m.u)"
79-
case ${DESIRED_PYTHON} in
80-
3.[6-7]*)
81-
DESIRED_PYTHON="cp${python_nodot}-cp${python_nodot}m"
82-
;;
83-
# Should catch 3.8+
84-
3.*)
85-
DESIRED_PYTHON="cp${python_nodot}-cp${python_nodot}"
86-
;;
87-
esac
79+
DESIRED_PYTHON="cp${python_nodot}-cp${python_nodot}"
8880
fi
8981

9082
if [[ ${python_nodot} -ge 310 ]]; then
@@ -119,10 +111,7 @@ pushd "$PYTORCH_ROOT"
119111
python setup.py clean
120112
retry pip install -qr requirements.txt
121113
case ${DESIRED_PYTHON} in
122-
cp36-cp36m)
123-
retry pip install -q numpy==1.11
124-
;;
125-
cp3[7-8]*)
114+
cp38*)
126115
retry pip install -q numpy==1.15
127116
;;
128117
cp310*)
@@ -280,7 +269,7 @@ replace_needed_sofiles() {
280269
patchedname=$3
281270
if [[ "$origname" != "$patchedname" ]] || [[ "$DESIRED_CUDA" == *"rocm"* ]]; then
282271
set +e
283-
origname=$($PATCHELF_BIN --print-needed $sofile | grep "$origname.*")
272+
origname=$($PATCHELF_BIN --print-needed $sofile | grep "$origname.*")
284273
ERRCODE=$?
285274
set -e
286275
if [ "$ERRCODE" -eq "0" ]; then

manywheel/conda_build.sh

Lines changed: 0 additions & 89 deletions
This file was deleted.

wheel/build_wheel.sh

Lines changed: 11 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,8 @@ fi
9797
whl_tmp_dir="${MAC_PACKAGE_WORK_DIR}/dist"
9898
mkdir -p "$whl_tmp_dir"
9999

100-
if [[ -n "$CROSS_COMPILE_ARM64" || $(uname -m) == "arm64" ]]; then
101-
mac_version='macosx_11_0_arm64'
102-
libtorch_arch='arm64'
103-
else
104-
mac_version='macosx_10_9_x86_64'
105-
libtorch_arch='x86_64'
106-
fi
100+
mac_version='macosx_11_0_arm64'
101+
libtorch_arch='arm64'
107102

108103
# Create a consistent wheel package name to rename the wheel to
109104
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
163158
;;
164159
3.8)
165160
echo "Using 3.8 deps"
166-
if [[ "$(uname -m)" == "arm64" ]]; then
167-
SETUPTOOLS_PINNED_VERSION=">=46.0.0"
168-
PYYAML_PINNED_VERSION=">=5.3"
169-
NUMPY_PINNED_VERSION="=1.19"
170-
else
171-
NUMPY_PINNED_VERSION="=1.17"
172-
fi
161+
SETUPTOOLS_PINNED_VERSION=">=46.0.0"
162+
PYYAML_PINNED_VERSION=">=5.3"
163+
NUMPY_PINNED_VERSION="=1.19"
173164
;;
174165
*)
175166
echo "Using default deps"
@@ -182,30 +173,19 @@ tmp_env_name="wheel_py$python_nodot"
182173
conda create ${EXTRA_CONDA_INSTALL_FLAGS} -yn "$tmp_env_name" python="$desired_python"
183174
source activate "$tmp_env_name"
184175

185-
retry conda install ${EXTRA_CONDA_INSTALL_FLAGS} -yq "numpy${NUMPY_PINNED_VERSION}" nomkl "setuptools${SETUPTOOLS_PINNED_VERSION}" "pyyaml${PYYAML_PINNED_VERSION}" typing_extensions requests
186-
187-
if [[ "$(uname -m)" == "arm64" ]]; then
188-
retry conda install ${EXTRA_CONDA_INSTALL_FLAGS} -yq cmake ninja
189-
else
190-
retry conda install ${EXTRA_CONDA_INSTALL_FLAGS} -yq cmake ninja mkl-include==2022.2.1 mkl-static==2022.2.1 -c intel
191-
fi
176+
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
192177
retry pip install -qr "${pytorch_rootdir}/requirements.txt" || true
193178

194179
# For USE_DISTRIBUTED=1 on macOS, need libuv and pkg-config to find libuv.
195180
export USE_DISTRIBUTED=1
196181
retry conda install ${EXTRA_CONDA_INSTALL_FLAGS} -yq libuv pkg-config
197182

198-
if [[ -n "$CROSS_COMPILE_ARM64" || "$(uname -m)" == "arm64" ]]; then
199-
if [[ -n "$CROSS_COMPILE_ARM64" ]]; then
200-
export CMAKE_OSX_ARCHITECTURES=arm64
201-
fi
202-
export USE_MKLDNN=OFF
203-
export USE_QNNPACK=OFF
204-
export BUILD_TEST=OFF
205-
elif [[ "$(uname -m)" == "x86_64" ]]; then
206-
retry conda install ${EXTRA_CONDA_INSTALL_FLAGS} -yq llvmdev=9
207-
export USE_LLVM="${CONDA_PREFIX}"
183+
if [[ -n "$CROSS_COMPILE_ARM64" ]]; then
184+
export CMAKE_OSX_ARCHITECTURES=arm64
208185
fi
186+
export USE_MKLDNN=OFF
187+
export USE_QNNPACK=OFF
188+
export BUILD_TEST=OFF
209189

210190
pushd "$pytorch_rootdir"
211191
echo "Calling setup.py bdist_wheel at $(date)"
@@ -289,9 +269,4 @@ else
289269
zip -rq "$PYTORCH_FINAL_PACKAGE_DIR/libtorch-macos-${libtorch_arch}-$PYTORCH_BUILD_VERSION.zip" libtorch
290270
cp "$PYTORCH_FINAL_PACKAGE_DIR/libtorch-macos-${libtorch_arch}-$PYTORCH_BUILD_VERSION.zip" \
291271
"$PYTORCH_FINAL_PACKAGE_DIR/libtorch-macos-${libtorch_arch}-latest.zip"
292-
if [[ "${libtorch_arch}" == "x86_64" ]]; then
293-
# For backward compatibility make unarched latest to point to x86_64
294-
cp "$PYTORCH_FINAL_PACKAGE_DIR/libtorch-macos-${libtorch_arch}-$PYTORCH_BUILD_VERSION.zip" \
295-
"$PYTORCH_FINAL_PACKAGE_DIR/libtorch-macos-latest.zip"
296-
fi
297272
fi

windows/condaenv.bat

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,11 @@ FOR %%v IN (%DESIRED_PYTHON%) DO (
99
set PYTHON_VERSION_STR=%%v
1010
set PYTHON_VERSION_STR=!PYTHON_VERSION_STR:.=!
1111
conda remove -n py!PYTHON_VERSION_STR! --all -y || rmdir %CONDA_HOME%\envs\py!PYTHON_VERSION_STR! /s
12-
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
1312
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
1413
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
1514
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
1615
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
1716
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
18-
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
1917
)
2018
endlocal
2119

windows/internal/smoke_test.bat

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ if "%DESIRED_PYTHON%" == "3.11" set "PYTHON_INSTALLER_URL=https://www.python.org
3535
if "%DESIRED_PYTHON%" == "3.10" set "PYTHON_INSTALLER_URL=https://www.python.org/ftp/python/3.10.0/python-3.10.0-amd64.exe"
3636
if "%DESIRED_PYTHON%" == "3.9" set "PYTHON_INSTALLER_URL=https://www.python.org/ftp/python/3.9.0/python-3.9.0-amd64.exe"
3737
if "%DESIRED_PYTHON%" == "3.8" set "PYTHON_INSTALLER_URL=https://www.python.org/ftp/python/3.8.2/python-3.8.2-amd64.exe"
38-
if "%DESIRED_PYTHON%" == "3.7" set "PYTHON_INSTALLER_URL=https://www.python.org/ftp/python/3.7.9/python-3.7.9-amd64.exe"
39-
if "%DESIRED_PYTHON%" == "3.6" set "PYTHON_INSTALLER_URL=https://www.python.org/ftp/python/3.6.8/python-3.6.8-amd64.exe"
4038
if "%PYTHON_INSTALLER_URL%" == "" (
4139
echo Python %DESIRED_PYTHON% not supported yet
4240
)

0 commit comments

Comments
 (0)