@@ -63,13 +63,14 @@ install_pytorch_and_domains() {
6363 git submodule update --init --recursive
6464
6565 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
6869 PYTHON_VERSION=$( python -c ' import platform; v=platform.python_version_tuple(); print(f"{v[0]}{v[1]}")' )
6970 TORCH_RELEASE=$( cat version.txt)
7071 TORCH_SHORT_HASH=${TORCH_VERSION: 0: 7}
7172 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"
7374
7475 CACHE_TORCH_WHEEL=" https://gha-artifacts.s3.us-east-1.amazonaws.com/${TORCH_WHEEL_PATH} /${TORCH_WHEEL_NAME} "
7576 # Cache PyTorch wheel is only needed on MacOS, Linux CI already has this as part
@@ -80,7 +81,7 @@ install_pytorch_and_domains() {
8081
8182 # Found no such wheel, we will build it from source then
8283 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
8485 pip install " $( echo dist/* .whl) "
8586
8687 # Only AWS runners have access to S3
0 commit comments