Skip to content

Commit a759487

Browse files
Merge branch 'release/1.2' into cherry-pick-18229-by-pytorch_bot_bot_
2 parents 248b4c1 + 5dd1703 commit a759487

22 files changed

+325
-168
lines changed

.ci/docker/common/install_pytorch.sh

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -12,39 +12,11 @@ source "$(dirname "${BASH_SOURCE[0]}")/utils.sh"
1212

1313
install_domains() {
1414
echo "Install torchvision and torchaudio"
15-
pip_install --no-build-isolation --user "git+https://github.com/pytorch/audio.git@${TORCHAUDIO_VERSION}"
16-
pip_install --no-build-isolation --user "git+https://github.com/pytorch/vision.git@${TORCHVISION_VERSION}"
15+
pip_install --force-reinstall --no-cache-dir torchvision==0.26.0 torchaudio==2.11.0 --index-url https://download.pytorch.org/whl/test/cpu
1716
}
1817

1918
install_pytorch_and_domains() {
20-
git clone https://github.com/pytorch/pytorch.git
21-
22-
# Fetch the target commit
23-
pushd pytorch || true
24-
git checkout "${TORCH_VERSION}"
25-
git submodule update --init --recursive
26-
27-
chown -R ci-user .
28-
29-
export _GLIBCXX_USE_CXX11_ABI=1
30-
# Then build and install PyTorch
31-
conda_run python setup.py bdist_wheel
32-
pip_install "$(echo dist/*.whl)"
33-
34-
# Grab the pinned audio and vision commits from PyTorch
35-
TORCHAUDIO_VERSION=release/2.11
36-
export TORCHAUDIO_VERSION
37-
TORCHVISION_VERSION=release/0.26
38-
export TORCHVISION_VERSION
39-
40-
install_domains
41-
42-
popd || true
43-
# Clean up the cloned PyTorch repo to reduce the Docker image size
44-
rm -rf pytorch
45-
46-
# Print sccache stats for debugging
47-
as_ci_user sccache --show-stats
19+
pip_install --force-reinstall --no-cache-dir torch==2.11.0 torchvision==0.26.0 torchaudio==2.11.0 --index-url https://download.pytorch.org/whl/test/cpu
4820
}
4921

5022
install_pytorch_and_domains

.ci/scripts/unittest-linux-cmake.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ if ! python -c "import tosa_serializer" >/dev/null 2>&1; then
1919
TOSA_SERIALIZATION_DIR="${TOSA_TOOLS_DIR}/serialization"
2020
fi
2121

22+
# NOTE: Will be removed when tosa-tools is installed via pypi
23+
python -m pip install pybind11==2.10.4
2224
CMAKE_POLICY_VERSION_MINIMUM=3.5 BUILD_PYBIND=1 \
2325
python -m pip install --no-dependencies \
2426
"${TOSA_SERIALIZATION_DIR}"

.ci/scripts/utils.sh

Lines changed: 2 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -84,73 +84,11 @@ dedupe_macos_loader_path_rpaths() {
8484

8585
install_domains() {
8686
echo "Install torchvision and torchaudio"
87-
pip install --no-build-isolation --user "git+https://github.com/pytorch/audio.git@${TORCHAUDIO_VERSION}"
88-
pip install --no-build-isolation --user "git+https://github.com/pytorch/vision.git@${TORCHVISION_VERSION}"
87+
pip install --force-reinstall --no-cache-dir torchvision==0.26.0 torchaudio==2.11.0 --index-url https://download.pytorch.org/whl/test/cpu
8988
}
9089

9190
install_pytorch_and_domains() {
92-
pushd .ci/docker || return
93-
TORCH_VERSION=$(cat ci_commit_pins/pytorch.txt)
94-
popd || return
95-
96-
git clone https://github.com/pytorch/pytorch.git
97-
98-
# Fetch the target commit
99-
pushd pytorch || return
100-
git checkout "${TORCH_VERSION}"
101-
102-
local system_name=$(uname)
103-
if [[ "${system_name}" == "Darwin" ]]; then
104-
local 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))')
105-
fi
106-
local python_version=$(python -c 'import platform; v=platform.python_version_tuple(); print(f"{v[0]}{v[1]}")')
107-
local torch_release=$(cat version.txt)
108-
local torch_short_hash=${TORCH_VERSION:0:7}
109-
local torch_wheel_path="cached_artifacts/pytorch/executorch/pytorch_wheels/${system_name}/${python_version}"
110-
local torch_wheel_name="torch-${torch_release}%2Bgit${torch_short_hash}-cp${python_version}-cp${python_version}-${platform:-}.whl"
111-
112-
local cached_torch_wheel="https://gha-artifacts.s3.us-east-1.amazonaws.com/${torch_wheel_path}/${torch_wheel_name}"
113-
# Cache PyTorch wheel is only needed on MacOS, Linux CI already has this as part
114-
# of the Docker image
115-
local torch_wheel_not_found=0
116-
if [[ "${system_name}" == "Darwin" ]]; then
117-
pip install "${cached_torch_wheel}" || torch_wheel_not_found=1
118-
else
119-
torch_wheel_not_found=1
120-
fi
121-
122-
# Found no such wheel, we will build it from source then
123-
if [[ "${torch_wheel_not_found}" == "1" ]]; then
124-
echo "No cached wheel found, continue with building PyTorch at ${TORCH_VERSION}"
125-
126-
git submodule update --init --recursive
127-
USE_DISTRIBUTED=1 python setup.py bdist_wheel
128-
pip install "$(echo dist/*.whl)"
129-
130-
# Only AWS runners have access to S3
131-
if command -v aws && [[ -z "${GITHUB_RUNNER:-}" ]]; then
132-
for wheel_path in dist/*.whl; do
133-
local wheel_name=$(basename "${wheel_path}")
134-
echo "Caching ${wheel_name}"
135-
aws s3 cp "${wheel_path}" "s3://gha-artifacts/${torch_wheel_path}/${wheel_name}"
136-
done
137-
fi
138-
else
139-
echo "Use cached wheel at ${cached_torch_wheel}"
140-
fi
141-
142-
dedupe_macos_loader_path_rpaths
143-
# Grab the pinned audio and vision commits from PyTorch
144-
TORCHAUDIO_VERSION=release/2.11
145-
export TORCHAUDIO_VERSION
146-
TORCHVISION_VERSION=release/0.26
147-
export TORCHVISION_VERSION
148-
149-
install_domains
150-
151-
popd || return
152-
# Print sccache stats for debugging
153-
sccache --show-stats || true
91+
pip install --force-reinstall --no-cache-dir torch==2.11.0 torchvision==0.26.0 torchaudio==2.11.0 --index-url https://download.pytorch.org/whl/test/cpu
15492
}
15593

15694
build_executorch_runner_buck2() {

.ci/scripts/wheel/pre_build_script.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,12 @@ fi
2626
# we should update the core job in test-infra to enable long paths before
2727
# checkout to avoid needing to do this.
2828
pushd extension/llm/tokenizers
29-
git submodule update --init
29+
UNAME_S=$(uname -s)
30+
if [[ $UNAME_S == *"MINGW"* || $UNAME_S == *"MSYS"* ]]; then
31+
git -c http.sslBackend=openssl submodule update --init
32+
else
33+
git submodule update --init
34+
fi
3035
popd
3136

3237
# On Windows, enable symlinks and re-checkout the current revision to create

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ for their help in the PR comments.
327327

328328
See https://hud.pytorch.org/hud/pytorch/executorch/main for the current state of <!-- @lint-ignore -->
329329
the CI (continuous integration) jobs. If `main` is broken, consider rebasing
330-
your PR onto the `viable/strict` branch, which points to the most recent
330+
your PR onto the `release/1.2` branch, which points to the most recent
331331
all-green commit.
332332

333333
&nbsp;

backends/arm/requirements-arm-tosa.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ ml_dtypes == 0.5.1
77
flatbuffers == 24.3.25
88
tosa-adapter-model-explorer == 0.1.0
99
ai-edge-model-explorer >= 0.1.16
10+
# NOTE: Will be removed when tosa-tools is installed via pypi
11+
pybind11 == 2.10.4

backends/arm/scripts/docgen/ethos-u/backends-arm-ethos-u-overview.md.in

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,14 @@ An example runtime application is available in [examples/arm/executor_runner](ht
5959
The example application is recommended to use for testing basic functionality of your lowered models, as well as a starting point for developing runtime integrations for your own targets.
6060
For an in-depth explanation of the architecture of the executor_runner and the steps required for doing such an integration, please refer to [Ethos-U porting guide](https://github.com/pytorch/executorch/blob/main/examples/arm/ethos-u-porting-guide.md).
6161

62+
### Example: Image classification flow
63+
64+
[`examples/arm/image_classification_example_ethos_u`](https://github.com/pytorch/executorch/tree/main/examples/arm/image_classification_example_ethos_u)
65+
contains a complete DeiT-based export and runtime walkthrough. The README shows
66+
how to run `model_export/export_deit.py`, build the sample firmware, and convert
67+
test images into C arrays so the workflow described in this guide can be tried
68+
end to end.
69+
6270
### Ethos-U memory modes
6371

6472
The Ethos-U NPU provides two distinct memory interfaces:
@@ -147,6 +155,10 @@ ExecuTorch for the Ethos-U backend, you automatically install the compiler conta
147155

148156
**→{doc}`/backends/arm-ethos-u/tutorials/arm-ethos-u-tutorials` — Tutorials.**
149157

158+
**→{doc}`/backends/arm-ethos-u/U55_op_support` — Ethos-U55 supported operators.**
159+
160+
**→{doc}`/backends/arm-ethos-u/U85_op_support` — Ethos-U85 supported operators.**
161+
150162

151163
```{toctree}
152164
:maxdepth: 2
@@ -157,4 +169,6 @@ arm-ethos-u-partitioner
157169
arm-ethos-u-quantization
158170
arm-ethos-u-troubleshooting
159171
tutorials/arm-ethos-u-tutorials
172+
U55_op_support
173+
U85_op_support
160174
```

backends/arm/scripts/docgen/vgf/backends-arm-vgf-overview.md.in

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,21 @@ For more information on quantization, see [Quantization](arm-vgf-quantization.md
5656
The VGF backend can use the default ExecuTorch runner. The steps required for building and running it are explained in the [VGF Backend Tutorial](tutorials/vgf-getting-started.md). <!-- @lint-ignore -->
5757
The example application is recommended to use for testing basic functionality of your lowered models, as well as a starting point for developing runtime integrations for your own targets.
5858

59+
### Example: Image classification flow
60+
61+
[`examples/arm/image_classification_example_vgf`](https://github.com/pytorch/executorch/tree/main/examples/arm/image_classification_example_vgf)
62+
contains a ready-to-run DeiT image classification pipeline for VGF targets.
63+
The example README documents how to:
64+
65+
- Export the quantized INT8 weights via `model_export/export_deit.py`.
66+
- Use the provided requirements file to install the ML SDK converter scripts
67+
and produce a `.pte` artifact.
68+
- Build and launch the Vulkan-based runtime under `runtime/`, which loads the
69+
`.pte` alongside the generated VGF blob.
70+
71+
Following this walkthrough ensures you exercise the same lowering + runtime flow
72+
described in the rest of this guide but with a concrete end-to-end sample.
73+
5974
## Reference
6075

6176
**→{doc}`/backends/arm-vgf/arm-vgf-partitioner` — Partitioner options.**

docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ To build the documentation locally:
4040
1. Clone the ExecuTorch repo to your machine.
4141

4242
```bash
43-
git clone -b viable/strict https://github.com/pytorch/executorch.git && cd executorch
43+
git clone -b release/1.2 https://github.com/pytorch/executorch.git && cd executorch
4444
```
4545

4646
1. If you don't have it already, start either a Python virtual environment:

docs/source/backends/arm-ethos-u/arm-ethos-u-overview.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,14 @@ An example runtime application is available in [examples/arm/executor_runner](ht
137137
The example application is recommended to use for testing basic functionality of your lowered models, as well as a starting point for developing runtime integrations for your own targets.
138138
For an in-depth explanation of the architecture of the executor_runner and the steps required for doing such an integration, please refer to [Ethos-U porting guide](https://github.com/pytorch/executorch/blob/main/examples/arm/ethos-u-porting-guide.md).
139139

140+
### Example: Image classification flow
141+
142+
[`examples/arm/image_classification_example_ethos_u`](https://github.com/pytorch/executorch/tree/main/examples/arm/image_classification_example_ethos_u)
143+
contains a complete DeiT-based export and runtime walkthrough. The README shows
144+
how to run `model_export/export_deit.py`, build the sample firmware, and convert
145+
test images into C arrays so the workflow described in this guide can be tried
146+
end to end.
147+
140148
### Ethos-U memory modes
141149

142150
The Ethos-U NPU provides two distinct memory interfaces:
@@ -229,6 +237,7 @@ ExecuTorch for the Ethos-U backend, you automatically install the compiler conta
229237

230238
**→{doc}`/backends/arm-ethos-u/U85_op_support` — Ethos-U85 supported operators.**
231239

240+
232241
```{toctree}
233242
:maxdepth: 2
234243
:hidden:

0 commit comments

Comments
 (0)