Skip to content

Updates docs to reflect changes in CoreML #9645

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Mar 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions backends/apple/coreml/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,8 @@ This is a tutorial for setting up the Core ML backend.

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

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

```
cd executorch

./backends/apple/coreml/scripts/install_requirements.sh

```

3. Run the example script to validate that the **Core ML** backend is set up correctly.
2. Run the example script to validate that the **Core ML** backend is set up correctly.

```
cd executorch
Expand All @@ -26,7 +18,7 @@ python3 -m examples.apple.coreml.scripts.export --model_name add

```

4. You can now integrate the **Core ML** backend in code.
3. You can now integrate the **Core ML** backend in code.

```python
# Delegate to Core ML backend
Expand Down
6 changes: 0 additions & 6 deletions docs/source/backends-coreml.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ Before starting, make sure you install the Xcode Command Line Tools:
xcode-select --install
```

Finally you must install the CoreML backend by running the following script:
```bash
sh ./backends/apple/coreml/scripts/install_requirements.sh
```


----

## Using the CoreML Backend
Expand Down
13 changes: 6 additions & 7 deletions docs/source/using-executorch-ios.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,19 +103,18 @@ git clone https://github.com/pytorch/executorch.git --depth 1 --recurse-submodul
3. Set up [Python](https://www.python.org/downloads/macos/) 3.10+ and activate a virtual environment:

```bash
python3 -m venv .venv && source .venv/bin/activate && pip install --upgrade pip
python3 -m venv .venv && source .venv/bin/activate && ./install_requirements.sh
```

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:
4. Install the required dependencies, including those needed for the backends like [Core ML](backends-coreml.md) or [MPS](backends-mps.md). Choose one:

```bash
./install_executorch.sh --pybind coreml mps xnnpack
# ExecuTorch with xnnpack and CoreML backend
./install_executorch.sh --pybind xnnpack

# Optional dependencies for Core ML backend.
./backends/apple/coreml/scripts/install_requirements.sh

# And MPS backend.
# Optional: ExecuTorch with xnnpack, CoreML, and MPS backend
./backends/apple/mps/install_requirements.sh
./install_executorch.sh --pybind xnnpack mps
```

5. Install [CMake](https://cmake.org):
Expand Down
15 changes: 5 additions & 10 deletions examples/apple/coreml/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,8 @@ We will walk through an example model to generate a Core ML delegated binary fil
1. Following the setup guide in [Setting Up ExecuTorch](https://pytorch.org/executorch/stable/getting-started-setup)
you should be able to get the basic development environment for ExecuTorch working.

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

```bash
cd executorch

./backends/apple/coreml/scripts/install_requirements.sh

```

3. Run the export script to generate a Core ML delegated binary file.
2. Run the export script to generate a Core ML delegated binary file.

```bash
cd executorch
Expand All @@ -39,11 +31,14 @@ python3 -m examples.portable.scripts.export -h
python3 -m examples.apple.coreml.scripts.export --model_name add
```

4. Run the binary file using the `coreml_executor_runner`.
3. Run the binary file using the `coreml_executor_runner`.

```bash
cd executorch

# Install requirements needed to run the example runner
./backends/apple/coreml/scripts/install_requirements.sh

# Builds the Core ML executor runner. Generates ./coreml_executor_runner if successful.
./examples/apple/coreml/scripts/build_executor_runner.sh

Expand Down
Loading