Skip to content

Commit 74e4308

Browse files
authored
Updates docs to reflect changes in CoreML (#9645)
### Summary * After #9483, we should have CoreML support out of the box for macOS * Unfortunately, we still need `backends/apple/coreml/scripts/install_requirements.sh` to use the [coreml_executorch_runner](https://github.com/pytorch/executorch/tree/main/examples/apple/coreml/executor_runner) (used for testing) * I should have caught all the usage ### Test plan Read
1 parent 91be93c commit 74e4308

File tree

4 files changed

+13
-33
lines changed

4 files changed

+13
-33
lines changed

backends/apple/coreml/setup.md

+2-10
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,8 @@ This is a tutorial for setting up the Core ML backend.
66

77
1. Follow the instructions described in [Setting Up ExecuTorch](/docs/source/getting-started-setup.md) to set up ExecuTorch environment.
88

9-
2. Run `install_requirements.sh` to install dependencies required by the **Core ML** backend.
109

11-
```
12-
cd executorch
13-
14-
./backends/apple/coreml/scripts/install_requirements.sh
15-
16-
```
17-
18-
3. Run the example script to validate that the **Core ML** backend is set up correctly.
10+
2. Run the example script to validate that the **Core ML** backend is set up correctly.
1911

2012
```
2113
cd executorch
@@ -26,7 +18,7 @@ python3 -m examples.apple.coreml.scripts.export --model_name add
2618
2719
```
2820

29-
4. You can now integrate the **Core ML** backend in code.
21+
3. You can now integrate the **Core ML** backend in code.
3022

3123
```python
3224
# Delegate to Core ML backend

docs/source/backends-coreml.md

-6
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,6 @@ Before starting, make sure you install the Xcode Command Line Tools:
2828
xcode-select --install
2929
```
3030

31-
Finally you must install the CoreML backend by running the following script:
32-
```bash
33-
sh ./backends/apple/coreml/scripts/install_requirements.sh
34-
```
35-
36-
3731
----
3832

3933
## Using the CoreML Backend

docs/source/using-executorch-ios.md

+6-7
Original file line numberDiff line numberDiff line change
@@ -103,19 +103,18 @@ git clone https://github.com/pytorch/executorch.git --depth 1 --recurse-submodul
103103
3. Set up [Python](https://www.python.org/downloads/macos/) 3.10+ and activate a virtual environment:
104104

105105
```bash
106-
python3 -m venv .venv && source .venv/bin/activate && pip install --upgrade pip
106+
python3 -m venv .venv && source .venv/bin/activate && ./install_requirements.sh
107107
```
108108

109-
4. Install the required dependencies, including those needed for the backends like [Core ML](backends-coreml.md) or [MPS](backends-mps.md), if you plan to build them as well:
109+
4. Install the required dependencies, including those needed for the backends like [Core ML](backends-coreml.md) or [MPS](backends-mps.md). Choose one:
110110

111111
```bash
112-
./install_executorch.sh --pybind coreml mps xnnpack
112+
# ExecuTorch with xnnpack and CoreML backend
113+
./install_executorch.sh --pybind xnnpack
113114

114-
# Optional dependencies for Core ML backend.
115-
./backends/apple/coreml/scripts/install_requirements.sh
116-
117-
# And MPS backend.
115+
# Optional: ExecuTorch with xnnpack, CoreML, and MPS backend
118116
./backends/apple/mps/install_requirements.sh
117+
./install_executorch.sh --pybind xnnpack mps
119118
```
120119

121120
5. Install [CMake](https://cmake.org):

examples/apple/coreml/README.md

+5-10
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,8 @@ We will walk through an example model to generate a Core ML delegated binary fil
1818
1. Following the setup guide in [Setting Up ExecuTorch](https://pytorch.org/executorch/stable/getting-started-setup)
1919
you should be able to get the basic development environment for ExecuTorch working.
2020

21-
2. Run `install_requirements.sh` to install dependencies required by the **Core ML** backend.
2221

23-
```bash
24-
cd executorch
25-
26-
./backends/apple/coreml/scripts/install_requirements.sh
27-
28-
```
29-
30-
3. Run the export script to generate a Core ML delegated binary file.
22+
2. Run the export script to generate a Core ML delegated binary file.
3123

3224
```bash
3325
cd executorch
@@ -39,11 +31,14 @@ python3 -m examples.portable.scripts.export -h
3931
python3 -m examples.apple.coreml.scripts.export --model_name add
4032
```
4133

42-
4. Run the binary file using the `coreml_executor_runner`.
34+
3. Run the binary file using the `coreml_executor_runner`.
4335

4436
```bash
4537
cd executorch
4638

39+
# Install requirements needed to run the example runner
40+
./backends/apple/coreml/scripts/install_requirements.sh
41+
4742
# Builds the Core ML executor runner. Generates ./coreml_executor_runner if successful.
4843
./examples/apple/coreml/scripts/build_executor_runner.sh
4944

0 commit comments

Comments
 (0)