@@ -63,13 +63,14 @@ install_pytorch_and_domains() {
63
63
git submodule update --init --recursive
64
64
65
65
SYSTEM_NAME=$( uname)
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().split("-"); platform[1]="14_0"; print("_".join(platform))' )
66
+ if [[ " ${SYSTEM_NAME} " == " Darwin" ]]; then
67
+ PLATFORM=$( python -c ' import sysconfig; import platform; v=platform.mac_ver()[0].split(".")[0]; platform=sysconfig.get_platform().split("-"); platform[1]=f"{v}_0"; print("_".join(platform))' )
68
+ fi
68
69
PYTHON_VERSION=$( python -c ' import platform; v=platform.python_version_tuple(); print(f"{v[0]}{v[1]}")' )
69
70
TORCH_RELEASE=$( cat version.txt)
70
71
TORCH_SHORT_HASH=${TORCH_VERSION: 0: 7}
71
72
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"
73
+ TORCH_WHEEL_NAME=" torch-${TORCH_RELEASE} %2Bgit${TORCH_SHORT_HASH} -cp${PYTHON_VERSION} -cp${PYTHON_VERSION} -${PLATFORM:- } .whl"
73
74
74
75
CACHE_TORCH_WHEEL=" https://gha-artifacts.s3.us-east-1.amazonaws.com/${TORCH_WHEEL_PATH} /${TORCH_WHEEL_NAME} "
75
76
# Cache PyTorch wheel is only needed on MacOS, Linux CI already has this as part
@@ -80,7 +81,7 @@ install_pytorch_and_domains() {
80
81
81
82
# Found no such wheel, we will build it from source then
82
83
if [[ " ${TORCH_WHEEL_NOT_FOUND:- 0} " == " 1" ]]; then
83
- USE_DISTRIBUTED=1 MACOSX_DEPLOYMENT_TARGET=14.0 python setup.py bdist_wheel
84
+ USE_DISTRIBUTED=1 python setup.py bdist_wheel
84
85
pip install " $( echo dist/* .whl) "
85
86
86
87
# Only AWS runners have access to S3
0 commit comments