Skip to content

Commit 6cb0c29

Browse files
[RELEASE ONLY CHANGES] Bump release version to 1.3.1 (#19818)
Updates the release branch version marker to 1.3.1 and refreshes the iOS SwiftPM examples to use swiftpm-1.3.1. Also fixes the Android APK test setup on the release branch by replacing the expired fixed XNNPACK golden artifact URL with discovery of the newest available golden artifact, and by making related downloads fail fast with retries. Test Plan: - `git diff --check` - `bash -n extension/android/executorch_android/android_test_setup.sh` - Verified the golden artifact discovery logic finds `golden_artifacts_26052719.zip` This PR was authored with Claude.
1 parent 6eb4263 commit 6cb0c29

4 files changed

Lines changed: 57 additions & 8 deletions

File tree

docs/source/getting-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ For a full example of running a model on Android, see the [DeepLabV3AndroidDemo]
160160
#### Installation
161161
ExecuTorch supports both iOS and macOS via C++, as well as hardware backends for CoreML, MPS, and CPU. The iOS runtime library is provided as a collection of .xcframework targets and are made available as a Swift PM package.
162162

163-
To get started with Xcode, go to File > Add Package Dependencies. Paste the URL of the ExecuTorch repo into the search bar and select it. Make sure to change the branch name to the desired ExecuTorch version in format “swiftpm-”, (e.g. “swiftpm-1.3.0”). The ExecuTorch dependency can also be added to the package file manually. See [Using ExecuTorch on iOS](using-executorch-ios.md) for more information.
163+
To get started with Xcode, go to File > Add Package Dependencies. Paste the URL of the ExecuTorch repo into the search bar and select it. Make sure to change the branch name to the desired ExecuTorch version in format “swiftpm-”, (e.g. “swiftpm-1.3.1”). The ExecuTorch dependency can also be added to the package file manually. See [Using ExecuTorch on iOS](using-executorch-ios.md) for more information.
164164

165165
#### Runtime APIs
166166
Models can be loaded and run from Objective-C using the C++ APIs.

docs/source/using-executorch-ios.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ The prebuilt ExecuTorch runtime, backend, and kernels are available as a [Swift
2828

2929
#### Xcode
3030

31-
In Xcode, go to `File > Add Package Dependencies`. Paste the URL of the [ExecuTorch repo](https://github.com/pytorch/executorch) into the search bar and select it. Make sure to change the branch name to the desired ExecuTorch version in format "swiftpm-<version>", (e.g. "swiftpm-1.3.0"), or a branch name in format "swiftpm-<version>.<year_month_date>" (e.g. "swiftpm-1.4.0-20260601") for a [nightly build](https://ossci-ios.s3.amazonaws.com/list.html) on a specific date.
31+
In Xcode, go to `File > Add Package Dependencies`. Paste the URL of the [ExecuTorch repo](https://github.com/pytorch/executorch) into the search bar and select it. Make sure to change the branch name to the desired ExecuTorch version in format "swiftpm-<version>", (e.g. "swiftpm-1.3.1"), or a branch name in format "swiftpm-<version>.<year_month_date>" (e.g. "swiftpm-1.4.0-20260601") for a [nightly build](https://ossci-ios.s3.amazonaws.com/list.html) on a specific date.
3232

3333
![](_static/img/swiftpm_xcode1.png)
3434

@@ -61,7 +61,7 @@ let package = Package(
6161
],
6262
dependencies: [
6363
// Use "swiftpm-<version>.<year_month_day>" branch name for a nightly build.
64-
.package(url: "https://github.com/pytorch/executorch.git", branch: "swiftpm-1.3.0")
64+
.package(url: "https://github.com/pytorch/executorch.git", branch: "swiftpm-1.3.1")
6565
],
6666
targets: [
6767
.target(

extension/android/executorch_android/android_test_setup.sh

Lines changed: 53 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ fi
1313
which "${PYTHON_EXECUTABLE}"
1414

1515
BASEDIR=$(dirname "$(realpath $0)")
16+
DEFAULT_GOLDEN_ARTIFACTS_BASE_URL="https://gha-artifacts.s3.amazonaws.com/pytorch/executorch" # @lint-ignore
17+
DEFAULT_GOLDEN_ARTIFACTS_BASE_URL+="/test-backend-artifacts/golden-artifacts-xnnpack"
18+
GOLDEN_ARTIFACTS_BASE_URL="${GOLDEN_ARTIFACTS_BASE_URL:-${DEFAULT_GOLDEN_ARTIFACTS_BASE_URL}}"
19+
export GOLDEN_ARTIFACTS_BASE_URL
1620

1721
prepare_xor() {
1822
pushd "${BASEDIR}/../../training/"
@@ -24,13 +28,58 @@ prepare_xor() {
2428

2529
prepare_tinyllama() {
2630
local S3_BASE="https://ossci-android.s3.amazonaws.com/executorch/stories/snapshot-20260114"
27-
curl -C - -Ls "${S3_BASE}/stories110M.pte" --output "${BASEDIR}/src/androidTest/resources/stories.pte"
28-
curl -C - -Ls "${S3_BASE}/tokenizer.model" --output "${BASEDIR}/src/androidTest/resources/tokenizer.bin"
31+
curl -fL --retry 3 --retry-all-errors -C - \
32+
"${S3_BASE}/stories110M.pte" \
33+
--output "${BASEDIR}/src/androidTest/resources/stories.pte"
34+
curl -fL --retry 3 --retry-all-errors -C - \
35+
"${S3_BASE}/tokenizer.model" \
36+
--output "${BASEDIR}/src/androidTest/resources/tokenizer.bin"
37+
}
38+
39+
find_latest_golden_artifacts_url() {
40+
"${PYTHON_EXECUTABLE}" <<'PY'
41+
from datetime import datetime, timedelta, timezone
42+
import os
43+
import sys
44+
import urllib.error
45+
import urllib.request
46+
47+
base_url = os.environ["GOLDEN_ARTIFACTS_BASE_URL"]
48+
lookback_days = int(os.environ.get("GOLDEN_ARTIFACT_LOOKBACK_DAYS", "14"))
49+
50+
for hours_ago in range(lookback_days * 24):
51+
timestamp = (datetime.now(timezone.utc) - timedelta(hours=hours_ago)).strftime(
52+
"%y%m%d%H"
53+
)
54+
url = f"{base_url}/golden_artifacts_{timestamp}.zip"
55+
request = urllib.request.Request(url, method="HEAD")
56+
try:
57+
with urllib.request.urlopen(request, timeout=10) as response:
58+
if 200 <= response.status < 300:
59+
print(url)
60+
sys.exit(0)
61+
except urllib.error.HTTPError as error:
62+
if error.code not in (403, 404):
63+
print(f"Skipping {url}: HTTP {error.code}", file=sys.stderr)
64+
except Exception as error:
65+
print(f"Skipping {url}: {error}", file=sys.stderr)
66+
67+
print(
68+
f"No XNNPACK golden artifact found under {base_url} from the last {lookback_days} days",
69+
file=sys.stderr,
70+
)
71+
sys.exit(1)
72+
PY
2973
}
3074

3175
prepare_golden() {
32-
local url="https://gha-artifacts.s3.amazonaws.com/pytorch/executorch/test-backend-artifacts/golden-artifacts-xnnpack/golden_artifacts_26022500.zip"
33-
curl -sL -o /tmp/golden.zip "$url"
76+
local url="${GOLDEN_ARTIFACTS_URL:-}"
77+
if [[ -z "${url}" ]]; then
78+
url=$(find_latest_golden_artifacts_url)
79+
fi
80+
echo "Downloading XNNPACK golden artifacts from ${url}"
81+
rm -rf /tmp/golden /tmp/golden.zip
82+
curl -fL --retry 3 --retry-all-errors -o /tmp/golden.zip "$url"
3483
unzip -o /tmp/golden.zip -d /tmp/golden/
3584
for model in mobilenet_v2 vit_b_16; do
3685
cp "/tmp/golden/xnnpack/${model}.pte" "${BASEDIR}/src/androidTest/resources/"

version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.3.0
1+
1.3.1

0 commit comments

Comments
 (0)