Skip to content

Commit bba7552

Browse files
authored
[docs] Refresh README, runtime APIs, and success stories (pytorch#22620)
> Updated to `be40b66f45` after merging upstream `main` at `f5e136973d`. The review fixes are pushed, the PR diff remains documentation-only, and fresh CI is in progress. ### Summary Refreshes the README, documentation homepage, examples index, and success stories around the current ExecuTorch feature set. The new structure leads with current workloads, a runnable export-to-runtime path, language APIs, hardware backends, and evidence-backed production use. The model section is intentionally representative rather than exhaustive. It shows credible text, multimodal, speech, vision, and embedded workflows, then explains how developers can adapt those patterns to another PyTorch model and validate export, operator, backend, numerical, memory, and performance coverage for their own target. The getting-started path now continues through serialization, Python runtime loading, execution, and an eager-output assertion. Export guidance distinguishes standard PyTorch export, the experimental Transformers ExecuTorch exporter, Optimum ExecuTorch, and native `export_llm` workflows. Runtime documentation maps general `.pte` execution and high-level generation APIs across C++, Python, Android, Apple platforms, and WebAssembly. Production claims cite primary sources and are separated from published case studies, integrations, technical showcases, and community prototypes. Additional ecosystem stories cover NVIDIA FLARE, Unsloth, and Digica. NoemaAI appears near the bottom as a community app explicitly marked as not yet vetted by the ExecuTorch team, not as a production deployment. Follow-up review corrections align both Android build guides with the helper's current `ANDROID_SDK` behavior, make nightly installation commands upgrade existing packages, fix the installed LLM exporter module path, and distinguish streaming Voxtral Realtime from offline Parakeet speech recognition. This PR intentionally contains documentation content only. Runtime, build, package-manifest, and repository-configuration findings from validation are tracked in follow-up issues below. The standalone `website/` is unchanged from `origin/main`; its visual redesign will be handled separately. This includes release-facing documentation: `README-wheel.md` is the published PyPI description, removes the old beta notice, and advertises Windows x86-64 wheels. API, backend, and model availability/maturity labels and the Vulkan quantization description are also part of this review. These are documentation claims to review against the lifecycle policy, source, and published artifacts; no packaging code or API lifecycle implementation is changed. For review, start with `README.md`, then `docs/source/index.md`, `docs/source/pathway-quickstart.md`, and `docs/source/success-stories.md`. The platform details are in the Android, iOS, build-from-source, Vulkan, MLX, LLM, and runtime API pages. Authored with Codex (OpenAI). ### Review follow-up `10c02b87b9` corrects the Android release/snapshot paths and legacy download links, documents the separate QNN runtime dependency, and restores the `viable/strict` source-build pin used by the release script. It fixes all seven checkout-only LLM exporter commands and corrects metadata names and Hydra JSON quoting. It separates YAML from shell commands, and documents Python custom/quantized operator registration and the currently ignored grammar fields. It also corrects artifact trust guidance, Apple lifecycle wording, the Gradle variable, and the MLX configuration explanation, and restores the LoRA/audio-generation showcase links. `d6700c5538` keeps the language API table on the API page, fixes the separate text/multimodal runner links, and points README documentation links at rendered pages. The README retains its backend table, restores the desktop guide link, and scopes CUDA wheel guidance to Linux. Read the instruction-fix commit first, then this navigation cleanup. Wider cross-page consolidation remains separate. Both commits modify Markdown only; the full PR still changes 32 Markdown files. ### Validation #### After upstream synchronization Merged current `main` (`f5e136973d`) in `be40b66f45`, incorporating the existing MLX batched-runner and LoRA shared-cache cleanup fixes from pytorch#22627 and pytorch#22632. All 13 review-fix files were preserved unchanged; the C++ guide also retains main's clarification that `kernels_torchao` supports Linux and macOS on aarch64. GitHub and local comparison against the new base both show 32 Markdown files, with no website, runtime implementation, build-system, or configuration changes in the PR diff. The configured pre-commit hook passed before the merge. After the merge, lintrunner, URL/xref/file-size lints against `origin/main`, diff checks, and rendered-HTML/anchor checks passed. URL lint checked 166 links without warnings. `make -C docs html-noplot` completed with exit 0, but logged 131 warnings and one CRITICAL missing-include diagnostic in `llm/llama-demo-ios.md`. The same missing iOS demo README include exists on `main` and in the pre-merge log; it is not changed by this PR. Tutorial execution was disabled, and this is not a clean Sphinx build. The earlier end-to-end checks below were not rerun as part of this synchronization, and local validation does not establish full CI success. #### Review follow-up validation The configured pre-commit hook ran successfully for both local commits without bypassing it. Lintrunner, URL/xref/file-size lints over the full PR range, and diff checks passed at `d6700c5538`. No runtime, workflow, or build-system changes are included in these commits. Before committing, the exact README and quickstart Add/XNNPACK blocks ran outside the checkout with the published macOS arm64 `executorch-1.6.0.dev20260915` wheel; both exported, serialized, loaded, executed, compared against eager, and printed `Output: tensor([2.])`. Six tiny random-weight Llama exports passed, including KV-cache/SDPA, quantization, XNNPACK, and ETRecord; basic Runtime execution and optimized/delegated TextLLMRunner generation also passed. The six YAML snippets, corrected Hydra metadata command, and operator-registration snippet were checked; nine runner Python blocks compiled, and the generated ETRecord parsed. The initial optimized-runner missing-operator errors were resolved by explicitly registering the custom and quantized kernels. The wheel ships them; this is now documented, not reported as a missing-artifact runtime defect. The test venv reused existing dependencies via `--system-site-packages`, so this is not a pristine dependency-installation test. Tiny random models and a synthetic tokenizer validate the path, not pretrained-model quality or performance. Seven Android AAR/checksum pairs downloaded and verified: 1.4.1 XNNPACK/QNN/Vulkan, the 2026-09-14 XNNPACK snapshot, and the three restored legacy releases. Both documented download blocks ran verbatim; artifact inspection confirmed the separate Qualcomm runtime requirement. No new Android build, Gradle sync, or physical-device execution was performed in this follow-up. Rendered README destinations and actual section anchors were checked, including 19 live documentation URLs and all 45 README main-docs URLs against local HTML. `make -C docs html-noplot` succeeded with 138 reported diagnostics on the first rebuild and 126 on the final incremental build; tutorial execution was disabled. This is not a warning-free build or a claim that every documented snippet ran end to end. #### Earlier validation For the success-stories follow-up `c0c34676f7`, the configured pre-commit hook, URL/xref/file-size lints, and diff checks passed. All six new source links return HTTP 200. `make -C docs html-noplot` passed with 126 reported diagnostics elsewhere in the docs and none for `success-stories.md`; tutorial execution was disabled. These checks validate the documentation and sources, not the external vendor workflows. Checks rerun for review follow-up `b3f1cfb1d2`: ```text .githooks/pre-commit lintrunner -m 01cc075 scripts/lint_urls.sh 01cc075 HEAD scripts/lint_xrefs.sh 01cc075 HEAD bash scripts/lint_file_size.sh 01cc075 HEAD make -C docs html-noplot git diff --check 01cc075...HEAD ``` All passed. The configured pre-commit hook also ran during `git commit`, without bypassing it. Sphinx completed with 224 reported diagnostics; tutorial execution was disabled for this documentation-only follow-up. A full `make -C docs clean html` was run during the earlier validation. Executed end to end on Apple silicon/macOS while developing the documentation: - Stable 1.4.1 and nightly 1.5.dev wheel installs; the README Add/XNNPACK flow; MobileNet V2 export and runtime comparison; dynamic-shape export; and separate `.pte`/`.ptd` loading. - The nightly C++ wheel walkthrough through export, CMake configuration, compilation, linking, loading, and execution, including the XNNPACK component. - Core ML export and execution with eager comparison. MLX MobileNet export produced one delegate, and 82 MLX export/unit tests passed. MLX GPU execution was unavailable because this host blocks the Metal JIT cache. - Portable, float XNNPACK, and quantized XNNPACK MobileNet; Wav2Letter, MLPerf Tiny DS-CNN, Silero VAD, Whisper preprocessing, and scaled YOLO26 export and runtime comparisons. - Native tiny-Llama export plus Python and C++ generation; 13 Python LLM binding tests and 117 runnable C++ runner tests. Transformers exporters were exercised with tiny BERT and Llama models through `.pte` execution. - Fresh `optimum-executorch==1.1.0` basic and optimized SmolLM2-135M exports, reload, and generation; plus tiny XNNPACK and portable Llama paths. - Published stable and nightly Apple xcframeworks through Swift and Objective-C execution, 130 Swift tests, simulator builds for both channels, a nightly iOS device build, and compile validation of `TextRunner`. - The documented Android 1.4.1 XNNPACK AAR download and SHA-256 verification; Maven/release artifact contents, ABIs, and Java/Kotlin API symbols; ModuleAdd export and host execution. - Vulkan MobileNet, dynamic-shape, bundled-program, FP16 Inception V3, 4-bit, and 8-bit exports, plus 119 non-runtime Vulkan tests. Large Llama, Qwen, Gemma, Parakeet, and Voxtral weights were not downloaded in full; their CLI/configuration surfaces were checked and smaller models exercised the same exporters and runners. CUDA, QNN, MediaTek, Samsung, Arm accelerator, and physical-device execution require hardware or toolchains unavailable on this host. Repository CI remains the cross-platform gate. ### CI status Fresh checks are attached to the published head `be40b66f45`, not inherited from the previous head. [Lint](https://github.com/pytorch/executorch/actions/runs/35006697462), [documentation build](https://github.com/pytorch/executorch/actions/runs/35006697815), and [MLX](https://github.com/pytorch/executorch/actions/runs/35006698009), together with the [pull tests](https://github.com/pytorch/executorch/actions/runs/35006698583) including LoRA and QNN, are running or queued. Results were pending at publication; this is not a claim that CI is fully green. The upstream fixes for the three MLX offgraph failures (pytorch#22627) and two LoRA cleanup failures (pytorch#22632) observed at `dd042e5537` are now incorporated. The old DFlash/QNN failures occurred during dependency downloads. Fresh runs of all seven previously failing jobs have been scheduled and must complete before those failures can be considered cleared. See the [current PR checks](https://github.com/pytorch/executorch/pull/22620/checks). ### Follow-up implementation issues - pytorch#22681: correct the deprecated llama `seq_len` CLI help - pytorch#22682: honor standard Android SDK environment variables - pytorch#22683: probe the usable Metal compiler in Apple CMake presets - pytorch#22684: avoid unnecessary portable-kernel linkage from Core ML - pytorch#22685: align the LLM image tensor layout contract with runtime behavior - pytorch#22686: declare SwiftPM system-framework dependencies - pytorch#22687: add the structured deployment-story issue form
1 parent 7bc5e0e commit bba7552

32 files changed

Lines changed: 1272 additions & 855 deletions

‎README-wheel.md‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ standard on-device iOS and Android mobile deployments. One of the main goals for
44
ExecuTorch is to enable wider customization and deployment capabilities of the
55
PyTorch programs.
66

7-
The `executorch` pip package is in beta.
87
* Supported python versions: 3.10, 3.11, 3.12, 3.13, 3.14
9-
* Compatible systems: Linux x86_64, Linux aarch64, macOS aarch64
8+
* Compatible systems: Linux x86_64, Linux aarch64, macOS aarch64, Windows x86_64
109

1110
Backend export tools can require optional Python dependencies. For example,
1211
install the dependencies needed for Ethos-U ahead-of-time (AOT) export with:
@@ -24,7 +23,7 @@ That wheel contains the Python EXIR export path and `flatc` for `.pte`
2423
serialization, but omits runtime pybindings, kernels, backend packages, headers,
2524
examples, and devtools. It also declares only the Python dependencies the export
2625
path needs (no `coremltools`, `pandas`, `scikit-learn`, `hydra-core`, or
27-
`omegaconf`), so a normal install stays small. Like the full wheel it does not
26+
`omegaconf`), so a normal install stays small. Like the full wheel, it does not
2827
bundle PyTorch, so install a compatible `torch` separately. The wheel is still
2928
platform specific because it ships `flatc`.
3029

‎README.md‎

Lines changed: 187 additions & 204 deletions
Large diffs are not rendered by default.

‎backends/mlx/README.md‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,24 @@ The MLX delegate compiles PyTorch models to run on Apple Silicon GPUs via the
1414
1515
## Getting Started
1616

17-
The MLX delegate requires **Apple Silicon** (M1 or later) and the **Metal
18-
compiler**, which ships with Xcode (not the standalone Command Line Tools).
17+
The MLX delegate requires **Apple Silicon** (M1 or later), the full **Xcode**
18+
application (not just Command Line Tools), and the separately installed **Metal
19+
Toolchain** component.
1920

2021
**Check if Metal is available:**
2122

2223
```bash
23-
xcrun -sdk macosx --find metal
24+
xcrun -sdk macosx metal --version
2425
```
2526

26-
If this prints a path (e.g. `/Applications/Xcode.app/.../metal`), you're set.
27-
If it errors, you either need to install Xcode from the
27+
If this prints version information, you're set. If it errors, install Xcode from the
2828
[App Store](https://apps.apple.com/us/app/xcode/id497799835) or
29-
<https://developer.apple.com/xcode/>, or — if Xcode is already installed but the
30-
command line developer directory points at Command Line Tools — switch it:
29+
<https://developer.apple.com/xcode/>, select it as the active developer
30+
directory, and download the Metal Toolchain:
3131

3232
```bash
3333
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
34+
xcodebuild -downloadComponent MetalToolchain
3435
```
3536

3637
### Python (pybindings)

‎docs/source/api-section.md‎

Lines changed: 57 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,68 @@
11
(api-section)=
22
# API
33

4-
In this section, find complete API documentation for ExecuTorch's export, runtime, and extension interfaces. Includes comprehensive references for Python, C++, and Java APIs across all supported platforms.
4+
ExecuTorch has two runtime layers:
5+
6+
- The **core runtime** loads and executes methods in a compatible `.pte`
7+
program. Use it when your application owns preprocessing, postprocessing,
8+
and task orchestration.
9+
- The **LLM runner** builds on the core runtime with tokenization, prefill and
10+
decode orchestration, sampling, and streaming generation for text and
11+
multimodal models.
12+
13+
The table below is the entry point for choosing a language binding. Maturity
14+
follows the {doc}`api-life-cycle`: an API is stable unless it is explicitly
15+
marked experimental or deprecated. An annotation on an individual API takes
16+
precedence over this summary.
17+
18+
```{list-table} Runtime and LLM APIs by language
19+
:header-rows: 1
20+
:widths: 18 33 33 16
21+
22+
* - **Language / platform**
23+
- **Core runtime**
24+
- **LLM runner**
25+
- **Maturity**
26+
* - C++
27+
- {doc}`extension-module` for the high-level `Module` API, or
28+
{doc}`executorch-runtime-api-reference` for `Program` and `Method`
29+
- {doc}`TextLLMRunner <llm/run-with-c-plus-plus>` and
30+
[MultimodalRunner](https://github.com/pytorch/executorch/blob/main/extension/llm/runner/README.md#multimodalrunner)
31+
- Core: **stable**; LLM: **experimental**
32+
* - Python
33+
- {doc}`runtime-python-api-reference` for host-side loading, execution, and
34+
validation
35+
- [Python LLM runner bindings](https://github.com/pytorch/executorch/blob/main/extension/llm/runner/README.md#python-api),
36+
whose availability depends on the installed package or source build
37+
- Core: **stable**; LLM: **experimental**
38+
* - Android: Java / Kotlin
39+
- {doc}`using-executorch-android` and the
40+
[Javadoc](https://pytorch.org/executorch/main/javadoc/) for `Module`,
41+
`Tensor`, and `EValue`
42+
- {doc}`llm/run-on-android` for `LlmModule`
43+
- Core: **experimental**; LLM: **experimental**
44+
* - Apple: Swift / Objective-C
45+
- {doc}`using-executorch-ios` for `Module`, `Tensor`, and `Value`
46+
- {doc}`llm/run-on-ios` for `TextRunner` and `MultimodalRunner`
47+
- Core: follows {doc}`api-life-cycle`; LLM: **experimental**
48+
* - Browser: JavaScript / WebAssembly
49+
- [WebAssembly `Module` and `Tensor`](https://github.com/pytorch/executorch/blob/main/extension/wasm/README.md),
50+
currently built from source
51+
- No high-level LLM runner API
52+
- Core: **experimental**
53+
```
54+
55+
Use the core runtime for any compatible exported model, including vision,
56+
audio, and custom workloads. Use an LLM runner only when the exported program
57+
and tokenizer satisfy that runner's model metadata and packaging requirements.
58+
59+
## Export and reference documentation
560

661
- {doc}`export-to-executorch-api-reference` — Export to ExecuTorch API Reference
762
- {doc}`executorch-runtime-api-reference` — ExecuTorch Runtime API Reference
863
- {doc}`runtime-python-api-reference` — Runtime Python API Reference
964
- {doc}`api-life-cycle` — API Life Cycle
10-
- [Android doc →](https://pytorch.org/executorch/main/javadoc/) — Android API Documentation
65+
- [Android API reference](https://pytorch.org/executorch/main/javadoc/): Java/Kotlin API documentation
1166
- {doc}`extension-module` — Extension Module
1267
- {doc}`extension-tensor` — Extension Tensor
1368
- {doc}`running-a-model-cpp-tutorial` — Detailed C++ Runtime APIs Tutorial

‎docs/source/backends/mlx/mlx-overview.md‎

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,23 @@ One of:
2828
## Development Requirements
2929

3030
- [macOS](https://developer.apple.com/macos) on Apple Silicon (M1 or later)
31-
- [Xcode](https://developer.apple.com/xcode/) (full installation, not just Command Line Tools — the Metal compiler is required)
31+
- [Xcode](https://developer.apple.com/xcode/) (full installation, not just Command Line Tools)
32+
- The Metal Toolchain component, installed separately with
33+
`xcodebuild -downloadComponent MetalToolchain`
3234

3335
Verify the Metal compiler is available:
3436

3537
```bash
36-
xcrun -sdk macosx --find metal
38+
xcrun -sdk macosx metal --version
3739
```
3840

39-
If this prints a path (e.g., `/Applications/Xcode.app/.../metal`), you're set. If it errors, install Xcode from [developer.apple.com](https://developer.apple.com/xcode/), then switch the active developer directory:
41+
If this prints version information, you're set. If it errors, install Xcode from
42+
[developer.apple.com](https://developer.apple.com/xcode/), select it as the active
43+
developer directory, and download the Metal Toolchain:
4044

4145
```bash
4246
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
47+
xcodebuild -downloadComponent MetalToolchain
4348
```
4449

4550
----
@@ -54,7 +59,7 @@ import torchvision.models as models
5459
from torchvision.models.mobilenetv2 import MobileNet_V2_Weights
5560
from executorch.backends.mlx import MLXPartitioner
5661
from executorch.backends.mlx.passes import get_default_passes
57-
from executorch.exir import to_edge_transform_and_lower
62+
from executorch.exir import EdgeCompileConfig, to_edge_transform_and_lower
5863

5964
mobilenet_v2 = models.mobilenetv2.mobilenet_v2(weights=MobileNet_V2_Weights.DEFAULT).eval()
6065
sample_inputs = (torch.randn(1, 3, 224, 224), )
@@ -63,13 +68,20 @@ et_program = to_edge_transform_and_lower(
6368
torch.export.export(mobilenet_v2, sample_inputs),
6469
transform_passes=get_default_passes(),
6570
partitioner=[MLXPartitioner()],
71+
compile_config=EdgeCompileConfig(
72+
_check_ir_validity=False,
73+
_skip_dim_order=True,
74+
),
6675
).to_executorch()
6776

6877
with open("mv2_mlx.pte", "wb") as file:
6978
et_program.write_to_file(file)
7079
```
7180

7281
`get_default_passes()` includes RMSNorm fusion, consecutive view/permute/dtype-cast collapsing, no-op removal, and common subexpression elimination. These are recommended for all models and required for optimal LLM performance.
82+
The accompanying `EdgeCompileConfig` uses the settings in the MLX export examples.
83+
The `_check_ir_validity` and `_skip_dim_order` fields are internal and may change
84+
between ExecuTorch versions.
7385

7486
::::{note}
7587
The MLX backend is primarily designed for LLM and generative AI workloads on Apple Silicon. The MobileNet V2 example above is shown for simplicity, but in practice you would use this backend for models like Llama, Whisper, and other transformer-based architectures. See [LLM example](https://github.com/pytorch/executorch/tree/main/backends/mlx/examples/llm) for a more representative use case.

‎docs/source/backends/mlx/mlx-troubleshooting.md‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,19 @@ python -m executorch.backends.mlx.pte_inspector model.pte --extract-delegate mlx
9292

9393
### Metal compiler not found
9494

95-
**Error:** `xcrun -sdk macosx --find metal` fails.
95+
**Error:** `xcrun -sdk macosx metal --version` fails.
9696

97-
**Solution:** Install the full Xcode application (not just Command Line Tools). The Metal compiler ships with Xcode. If Xcode is installed but not selected:
97+
**Solution:** Install the full Xcode application (not just Command Line Tools),
98+
select it as the active developer directory, and download the separately
99+
installed Metal Toolchain component:
98100

99101
```bash
100102
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
103+
xcodebuild -downloadComponent MetalToolchain
101104
```
102105

106+
Then rerun `xcrun -sdk macosx metal --version` to verify the compiler.
107+
103108
### `MLXPartitioner must be used with to_edge_transform_and_lower()`
104109

105110
**Error:** RuntimeError when using the legacy `to_edge()` + `to_backend()` workflow.

‎docs/source/backends/vulkan/tutorials/etvk-llama-tutorial.md‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@ export CONTEXT_LENGTH=2048
4444
```
4545

4646
Then, export the Llama 3.2 1B/3B Instruct model to ExecuTorch Vulkan. Note that
47-
that `--vulkan-force-fp16` flag is set, which will improve model inference
47+
the `--vulkan-force-fp16` flag is set, which will improve model inference
4848
latency at the cost of model accuracy. Feel free to remove this flag.
4949

5050
```shell
5151
python -m examples.models.llama.export_llama \
5252
-c $HOME/.llama/checkpoints/${LLM_NAME}-${LLM_SIZE}${LLM_SUFFIX}/consolidated.00.pth \
5353
-p $HOME/.llama/checkpoints/${LLM_NAME}-${LLM_SIZE}${LLM_SUFFIX}/params.json \
54-
-d fp32 --${BACKEND} \
54+
-d fp32 --${BACKEND} --vulkan-force-fp16 \
5555
-qmode ${QUANT} -G ${GROUP_SIZE} \
5656
--max_seq_length ${CONTEXT_LENGTH} \
5757
--max_context_length ${CONTEXT_LENGTH} \
@@ -136,7 +136,6 @@ adb shell /data/local/tmp/etvk/llama_main \
136136
Here is some sample output captured from a Galaxy S24:
137137

138138
```shell
139-
E tokenizers:hf_tokenizer.cpp:60] Error parsing json file: [json.exception.parse_error.101] parse error at line 1, column 1: syntax error while parsing value - invalid literal; last read: 'I'
140139
<|begin_of_text|><|start_header_id|>system<|end_header_id|>Write me a short poem.<|eot_id|><|start_header_id|>assistant<|end_header_id|>
141140

142141
Here is a short poem I came up with:

‎docs/source/backends/vulkan/vulkan-overview.md‎

Lines changed: 19 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ modes is on the way.
2525

2626
## Development Requirements
2727

28-
To contribute to the Vulkan delegate, the [Vulkan SDK](https://vulkan.lunarg.com/sdk/home#android)
29-
must be installed on the development system. After installation, the `glslc` binary must
30-
be found in your `PATH` in order to compile Vulkan shaders. This can be checked by
31-
running
28+
To build the Vulkan delegate, install the
29+
[Vulkan SDK](https://vulkan.lunarg.com/sdk/home) 1.4.341.1 or newer.
30+
After installation, the `glslc` binary must be found in your `PATH` in order
31+
to compile Vulkan shaders. This can be checked by running
3232

3333
```sh
3434
glslc --version
@@ -47,8 +47,9 @@ or alternatively,
4747
python install_vulkan.py
4848
```
4949

50-
The [Android NDK](https://developer.android.com/ndk/downloads) must also be installed.
51-
Any NDK version past NDK r17c should suffice.
50+
To target Android, also install a current
51+
[Android NDK](https://developer.android.com/ndk/downloads). ExecuTorch CI uses
52+
NDK r28c.
5253

5354
----
5455

@@ -85,15 +86,15 @@ with open("mv2_vulkan.pte", "wb") as file:
8586
etvk_program.write_to_file(file)
8687
```
8788

88-
See [Partitioner API](vulkan-partitioner.md)
89+
See {doc}`/backends/vulkan/vulkan-partitioner`
8990
for a reference on available partitioner options.
9091

9192
----
9293

9394
## Quantization
9495

9596
The Vulkan delegate currently supports execution of quantized linear layers.
96-
See [Vulkan Quantization](vulkan-quantization.md)
97+
See {doc}`/backends/vulkan/vulkan-quantization`
9798
for more information on available quantization schemes and APIs.
9899

99100
----
@@ -110,33 +111,19 @@ When building from source, pass `-DEXECUTORCH_BUILD_VULKAN=ON` when configuring
110111
the CMake build to compile the Vulkan backend. See [Running on Device](/getting-started.md#running-on-device)
111112
for more information.
112113

113-
To link against the backend, add the `executorch_backends` CMake target as a
114-
build dependency, or link directly against `libvulkan_backend`. Due to the use
115-
of static initialization to register available compute shaders and operators,
116-
it is required to ensure that the library is linked with `--whole-archive`.
114+
To link against the backend, use the `vulkan_backend` CMake target. The target
115+
propagates the platform-specific linker options needed to retain the static
116+
initializers that register Vulkan compute shaders and operators.
117117

118118
```cmake
119119
# CMakeLists.txt
120-
find_package(executorch CONFIG REQUIRED COMPONENTS vulkan_backend executorch_backends)
120+
find_package(executorch CONFIG REQUIRED COMPONENTS vulkan_backend)
121121
122-
...
123122
target_link_libraries(
124123
my_target
125124
PRIVATE
126125
executorch
127-
executorch_backends
128-
...
129-
)
130-
131-
# Ensure that unused code is not discarded. The required linker options may be
132-
# different depending on the target platform. Typically, the
133-
# executorch_target_link_options_shared_lib function from
134-
# executorch/tools/cmake/Utils.cmake can be used to set the required linker
135-
# options.
136-
target_link_options(
137-
executorch_backends INTERFACE "SHELL:LINKER:--whole-archive \
138-
$<TARGET_FILE:${target_name}> \
139-
LINKER:--no-whole-archive"
126+
vulkan_backend
140127
)
141128
```
142129

@@ -156,9 +143,9 @@ Any Vulkan-delegated .pte file will automatically run on the registered backend.
156143
:hidden:
157144
:caption: Vulkan Backend
158145
159-
vulkan-partitioner
160-
vulkan-quantization
161-
vulkan-op-support
162-
vulkan-troubleshooting
146+
/backends/vulkan/vulkan-partitioner
147+
/backends/vulkan/vulkan-quantization
148+
/backends/vulkan/vulkan-op-support
149+
/backends/vulkan/vulkan-troubleshooting
163150
164-
tutorials/vulkan-tutorials
151+
/backends/vulkan/tutorials/vulkan-tutorials

‎docs/source/backends/vulkan/vulkan-partitioner.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ etvk_program = to_edge_transform_and_lower(
3838
### `require_dynamic_shapes`
3939

4040
If a model is expected to use dynamic shapes, then it is recommended to set the
41-
`"required_dynamic_shapes"` key in `compile_options`.
41+
`"require_dynamic_shapes"` key in `compile_options`.
4242

4343
Not all operators in Vulkan support dynamic shapes at the moment, although the
4444
majority do. This flag will prevent operators that don't support dynamic shapes

0 commit comments

Comments
 (0)