Skip to content

Commit 5558b99

Browse files
Fix Apple CI toolchain after the PyTorch pin bump (pytorch#23543)
## Summary Forward fix for the Apple failures after pytorch#23406. The three Apple build jobs and trunk CoreML delegate job fail while building pinned PyTorch at `e91899ca45f99811049ac7d539820f92a9acddde`, before reaching the ExecuTorch framework or app builds. On `macos-14-xlarge`, Xcode 15.4 supplies the macOS 14.5 SDK, and `aten/src/ATen/mps/MPSDevice.mm:129` fails with `use of undeclared identifier MTLLanguageVersion3_2`. The pinned source also asserts against `MTLLanguageVersion4_0`, so the default Xcode 16 toolchain on macOS 15 would still be too old. Move the demo, frameworks, benchmark, and CoreML delegate jobs to `macos-15-xlarge` and select the installed Xcode 26.0.1 toolchain through `DEVELOPER_DIR` before setup. Add the PyTorch pins and shared macOS setup scripts to the Apple pull request path filter and the pins to the CoreML delegate condition so future bumps exercise these jobs before merge. Failing Apple run: https://github.com/pytorch/executorch/actions/runs/37656529192 Failing CoreML job: https://github.com/pytorch/executorch/actions/runs/37656530248/job/112913289020 The Xcode upgrade also exposed device test packaging that specified `platform=iOS` without a connected device. Change both demo and benchmark `build-for-testing` invocations to `generic/platform=iOS`, matching the available Any iOS Device destination on hosted CI runners. The demo simulator tests passed on Xcode 26.0.1 before reaching this packaging failure. The device build then succeeded but the follow-up `-showBuildSettings` query without a scheme returned a different build directory. Give both device builds an explicit DerivedData directory and configuration, and package from that directory. This also keeps benchmark packaging aligned with its Release configuration. ## Test plan `git diff --check` passes. Workflow validation with actionlint passes after excluding its existing old-action-version diagnostics. `bash -n` passes for all four changed reusable workflow scripts. The exact Metal language enum and three SDK assertions extracted from the pinned PyTorch source compile locally against Xcode 26.6 / macOS SDK 26.5 with a macOS 15 deployment target; Xcode 26.0.1 itself is listed in the macOS 15 Arm64 runner image. Shell syntax checks also pass for the two app packaging scripts. Both scripts produce the expected IPA and xctestrun archives with build-output fixtures, including work directories containing spaces. Hosted CI confirms the generic demo device build and simulator tests succeed; full artifact verification will run with the explicit output directory fix. A local Xcode destination probe is blocked because the local iOS platform is not installed for use by xcodebuild; full device packaging verification requires the PR's hosted Apple CI. Authored with OpenAI Codex.
1 parent df2c02b commit 5558b99

4 files changed

Lines changed: 40 additions & 18 deletions

File tree

‎.ci/scripts/test_ios_ci.sh‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,17 @@ xcodebuild test \
108108
# NB: https://docs.aws.amazon.com/devicefarm/latest/developerguide/test-types-ios-xctest-ui.html
109109
say "Package The Test Suite"
110110

111+
DERIVED_DATA_PATH="$(pwd)/cmake-out/ios-demo-derived-data"
112+
BUILD_DIR="${DERIVED_DATA_PATH}/Build/Products"
113+
MODE="Debug"
114+
PLATFORM="iphoneos"
115+
111116
xcodebuild build-for-testing \
112117
-project "$APP_PATH.xcodeproj" \
113118
-scheme MobileNetClassifierTest \
114-
-destination platform="iOS" \
119+
-configuration "${MODE}" \
120+
-derivedDataPath "${DERIVED_DATA_PATH}" \
121+
-destination "generic/platform=iOS" \
115122
-allowProvisioningUpdates \
116123
DEVELOPMENT_TEAM=78E7V7QP35 \
117124
CODE_SIGN_STYLE=Manual \
@@ -120,12 +127,7 @@ xcodebuild build-for-testing \
120127
CODE_SIGNING_REQUIRED=No \
121128
CODE_SIGNING_ALLOWED=No
122129

123-
# The hack to figure out where the xctest package locates
124-
BUILD_DIR=$(xcodebuild -showBuildSettings -project "$APP_PATH.xcodeproj" -json | jq -r ".[0].buildSettings.BUILD_DIR")
125-
126130
# Prepare the demo app
127-
MODE="Debug"
128-
PLATFORM="iphoneos"
129131
pushd "${BUILD_DIR}/${MODE}-${PLATFORM}"
130132

131133
rm -rf Payload && mkdir Payload

‎.github/workflows/apple.yml‎

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ on:
99
- ciflow/trunk/*
1010
pull_request:
1111
paths:
12+
- .ci/docker/ci_commit_pins/pytorch.txt
13+
- .ci/scripts/setup-macos.sh
14+
- .ci/scripts/utils.sh
1215
- .ci/scripts/setup-ios.sh
1316
- .github/workflows/apple.yml
1417
- install_executorch.sh
@@ -24,6 +27,7 @@ on:
2427
- extension/apple/**
2528
- extension/benchmark/apple/**
2629
- extension/module/**
30+
- torch_pin.py
2731
workflow_dispatch:
2832
schedule:
2933
- cron: '0 10 * * *' # Runs daily at 2 AM PST
@@ -93,7 +97,7 @@ jobs:
9397
secrets: inherit
9498
with:
9599
default-packages: ""
96-
runner: macos-14-xlarge
100+
runner: macos-15-xlarge
97101
python-version: '3.11'
98102
submodules: 'recursive'
99103
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
@@ -102,6 +106,9 @@ jobs:
102106
upload-artifact: ios-demo-app
103107
script: |
104108
set -eux
109+
# Pinned PyTorch's MPS build requires the Metal 4 SDK.
110+
export DEVELOPER_DIR=/Applications/Xcode_26.0.1.app/Contents/Developer
111+
xcodebuild -version
105112
106113
BUILD_TOOL=cmake
107114
@@ -193,14 +200,17 @@ jobs:
193200
uses: pytorch/test-infra/.github/workflows/macos_job.yml@main
194201
with:
195202
default-packages: ""
196-
runner: macos-14-xlarge
203+
runner: macos-15-xlarge
197204
python-version: '3.11'
198205
submodules: 'recursive'
199206
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
200207
upload-artifact: executorch-frameworks-ios
201208
timeout: 90
202209
script: |
203210
set -eux
211+
# Pinned PyTorch's MPS build requires the Metal 4 SDK.
212+
export DEVELOPER_DIR=/Applications/Xcode_26.0.1.app/Contents/Developer
213+
xcodebuild -version
204214
205215
BUILD_TOOL=cmake
206216
VERSION="${{ needs.set-version.outputs.version }}"
@@ -414,7 +424,7 @@ jobs:
414424
secrets: inherit
415425
with:
416426
default-packages: ""
417-
runner: macos-14-xlarge
427+
runner: macos-15-xlarge
418428
python-version: '3.11'
419429
submodules: 'recursive'
420430
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
@@ -423,6 +433,9 @@ jobs:
423433
timeout: 90
424434
script: |
425435
set -eux
436+
# Pinned PyTorch's MPS build requires the Metal 4 SDK.
437+
export DEVELOPER_DIR=/Applications/Xcode_26.0.1.app/Contents/Developer
438+
xcodebuild -version
426439
427440
echo "::group::Setting up CI environment"
428441
.ci/scripts/setup-conda.sh

‎.github/workflows/trunk.yml‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,18 +368,25 @@ jobs:
368368
contains(needs.changed-files.outputs.changed-files, 'examples/apple/coreml') ||
369369
contains(needs.changed-files.outputs.changed-files, '.ci/scripts/setup-macos.sh') ||
370370
contains(needs.changed-files.outputs.changed-files, '.ci/scripts/setup-conda.sh') ||
371+
contains(needs.changed-files.outputs.changed-files, '.ci/docker/ci_commit_pins/pytorch.txt') ||
372+
contains(needs.changed-files.outputs.changed-files, 'torch_pin.py') ||
371373
contains(needs.changed-files.outputs.changed-files, '.github/workflows/trunk.yml') ||
372374
needs.run-decision.outputs.is-full-run == 'true'
373375
name: test-coreml-delegate
374376
uses: pytorch/test-infra/.github/workflows/macos_job.yml@main
375377
with:
376378
default-packages: ""
377-
runner: macos-14-xlarge
379+
runner: macos-15-xlarge
378380
python-version: '3.11'
379381
submodules: 'recursive'
380382
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
381383
timeout: 90
382384
script: |
385+
set -eux
386+
# Pinned PyTorch's MPS build requires the Metal 4 SDK.
387+
export DEVELOPER_DIR=/Applications/Xcode_26.0.1.app/Contents/Developer
388+
xcodebuild -version
389+
383390
BUILD_TOOL=cmake
384391
385392
bash .ci/scripts/setup-conda.sh

‎scripts/build_apple_llm_demo.sh‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,17 @@ set -euo pipefail
99

1010
ARTIFACTS_DIR_NAME="$1"
1111
APP_PATH="extension/benchmark/apple/Benchmark/Benchmark"
12+
DERIVED_DATA_PATH="$(pwd)/cmake-out/ios-benchmark-derived-data"
13+
BUILD_DIR="${DERIVED_DATA_PATH}/Build/Products"
14+
MODE="Release"
15+
PLATFORM="iphoneos"
1216

1317
xcodebuild build-for-testing \
1418
-project "${APP_PATH}.xcodeproj" \
1519
-scheme Benchmark \
16-
-destination "platform=iOS" \
20+
-configuration "${MODE}" \
21+
-derivedDataPath "${DERIVED_DATA_PATH}" \
22+
-destination "generic/platform=iOS" \
1723
-sdk iphoneos \
1824
-allowProvisioningUpdates \
1925
DEVELOPMENT_TEAM=78E7V7QP35 \
@@ -23,13 +29,7 @@ xcodebuild build-for-testing \
2329
CODE_SIGNING_REQUIRED=No \
2430
CODE_SIGNING_ALLOWED=No
2531

26-
# The hack to figure out where the xctest package locates
27-
BUILD_DIR=$(xcodebuild -showBuildSettings -project "$APP_PATH.xcodeproj" -json | jq -r ".[0].buildSettings.BUILD_DIR")
28-
29-
# Prepare the demo app, debug mode here is the default from xcodebuild and match
30-
# with what we have in the test spec
31-
MODE="Release"
32-
PLATFORM="iphoneos"
32+
# Prepare the benchmark app.
3333
pushd "${BUILD_DIR}/${MODE}-${PLATFORM}"
3434

3535
rm -rf Payload && mkdir Payload

0 commit comments

Comments
 (0)