@@ -63,24 +63,24 @@ install_pytorch_and_domains() {
63
63
git submodule update --init --recursive
64
64
65
65
SYSTEM_NAME=$( uname)
66
- PLATFORM=$( python -c ' import sysconfig; print(sysconfig.get_platform().replace("-", "_").replace(".", "_"))' )
67
- PYTHON_VERSION=$( python -c ' import platform; v = platform.python_version_tuple(); print(f"{v[0]}{v[1]}")' )
66
+ # The platform version needs to match MACOSX_DEPLOYMENT_TARGET used to build the wheel
67
+ PLATFORM=$( python -c ' import sysconfig; platform=sysconfig.get_platform(); platform[1]="14_0"; print("_".join(platform))' )
68
+ PYTHON_VERSION=$( python -c ' import platform; v=platform.python_version_tuple(); print(f"{v[0]}{v[1]}")' )
68
69
TORCH_RELEASE=$( cat version.txt)
69
70
TORCH_SHORT_HASH=${TORCH_VERSION: 0: 7}
70
- TORCH_WHEEL_NAME=" torch-${TORCH_RELEASE} %2Bgit${TORCH_SHORT_HASH} -cp${PYTHON_VERSION} -cp${PYTHON_VERSION} -${PLATFORM} .whl"
71
71
TORCH_WHEEL_PATH=" cached_artifacts/pytorch/executorch/pytorch_wheels/${SYSTEM_NAME} /${PYTHON_VERSION} "
72
+ TORCH_WHEEL_NAME=" torch-${TORCH_RELEASE} %2Bgit${TORCH_SHORT_HASH} -cp${PYTHON_VERSION} -cp${PYTHON_VERSION} -${PLATFORM} .whl"
72
73
74
+ CACHE_TORCH_WHEEL=" https://gha-artifacts.s3.us-east-1.amazonaws.com/${TORCH_WHEEL_PATH} /${TORCH_WHEEL_NAME} "
73
75
# Cache PyTorch wheel is only needed on MacOS, Linux CI already has this as part
74
76
# of the Docker image
75
77
if [[ " ${SYSTEM_NAME} " == " Darwin" ]]; then
76
- pip install " https://gha-artifacts.s3.us-east-1.amazonaws.com/ ${TORCH_WHEEL_PATH} / ${TORCH_WHEEL_NAME }" || TORCH_WHEEL_NOT_FOUND=1
78
+ pip install " ${CACHE_TORCH_WHEEL }" || TORCH_WHEEL_NOT_FOUND=1
77
79
fi
78
80
79
81
# Found no such wheel, we will build it from source then
80
82
if [[ " ${TORCH_WHEEL_NOT_FOUND:- 0} " == " 1" ]]; then
81
- export USE_DISTRIBUTED=1
82
- # Then build and install PyTorch
83
- python setup.py bdist_wheel
83
+ USE_DISTRIBUTED=1 MACOSX_DEPLOYMENT_TARGET=14.0 python setup.py bdist_wheel
84
84
pip install " $( echo dist/* .whl) "
85
85
86
86
# Only AWS runners have access to S3
@@ -90,6 +90,8 @@ install_pytorch_and_domains() {
90
90
aws s3 cp " ${WHEEL_PATH} " " s3://gha-artifacts/${TORCH_WHEEL_PATH} /${WHEEL_NAME} "
91
91
done
92
92
fi
93
+ else
94
+ echo " Use cached wheel at ${CACHE_TORCH_WHEEL} "
93
95
fi
94
96
95
97
# Grab the pinned audio and vision commits from PyTorch
0 commit comments