Skip to content
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ It supports a wide range of models including LLMs (Large Language Models), CV (C
Platform Support:
- Operating Systems:
- iOS
- Mac
- MacOS (ARM64)
- Android
- Linux
- Microcontrollers
Expand Down
2 changes: 1 addition & 1 deletion docs/source/backends-xnnpack.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The XNNPACK delegate is the ExecuTorch solution for CPU execution on mobile CPUs
- ARM64 on Android, iOS, macOS, Linux, and Windows.
- ARMv7 (with NEON) on Android.
- ARMv6 (with VFPv2) on Linux.
- x86 and x86-64 (up to AVX512) on Windows, Linux, macOS, Android, and iOS simulator.
- x86 and x86-64 (up to AVX512) on Windows, Linux, Android.

## Development Requirements

Expand Down
5 changes: 3 additions & 2 deletions docs/source/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ The following are required to install the ExecuTorch host libraries, needed to e

- Python 3.10 - 3.12
- g++ version 7 or higher, clang++ version 5 or higher, or another C++17-compatible toolchain.
- Linux or MacOS operating system (Arm or x86).
- Windows is supported via WSL.
- Linux (x86_64 or ARM64) or macOS (ARM64).
- Intel-based macOS systems require building PyTorch from source (see [Building From Source](using-executorch-building-from-source.md) for instructions).
- Windows is supported via WSL.

## Installation
To use ExecuTorch, you will need to install both the Python package and the appropriate platform-specific runtime libraries. Pip is the recommended way to install the ExecuTorch python package.
Expand Down
12 changes: 10 additions & 2 deletions docs/source/using-executorch-building-from-source.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Linux (x86_64)
- Ubuntu 20.04.6 LTS+
- RHEL 8+

macOS (x86_64/M1/M2)
macOS (x86_64/ARM64)
- Big Sur (11.0)+

Windows (x86_64)
Expand Down Expand Up @@ -56,13 +56,21 @@ Or alternatively, [install conda on your machine](https://conda.io/projects/cond
conda create -yn executorch python=3.10.0 && conda activate executorch
```

## Install ExecuTorch pip package from Source
## Install ExecuTorch pip package from source
```bash
# Install ExecuTorch pip package and its dependencies, as well as
# development tools like CMake.
# If developing on a Mac, make sure to install the Xcode Command Line Tools first.
# Intel-based macOS systems require building PyTorch, Torchvision, and Torchaudio from source (see below)
./install_executorch.sh
```

Use the [`--use-pt-pinned-commit` flag](https://github.com/pytorch/executorch/blob/main/install_executorch.sh) to install Executorch with an existing PyTorch build.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/Executorch/ExecuTorch/g

See the [PyTorch instructions](https://github.com/pytorch/pytorch#installation) on how to build PyTorch from source.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use relative paths

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the flag links to use relative paths to the .py file.
For the PyTorch instructions link, since it points to a doc in the PyTorch repo, is there a way to reference that using a relative path, or should we keep the current path?

```bash
./install_executorch.sh --use-pt-pinned-commit
```

Not all backends are built into the pip wheel by default. You can link these missing/experimental backends by turning on the corresponding cmake flag. For example, to include the MPS backend:

Expand Down
9 changes: 8 additions & 1 deletion docs/source/using-executorch-ios.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ExecuTorch supports both iOS and macOS via Objective-C, Swift, and C++. ExecuTor

## Integration

The ExecuTorch Runtime for iOS and macOS is distributed as a collection of prebuilt [.xcframework](https://developer.apple.com/documentation/xcode/creating-a-multi-platform-binary-framework-bundle) binary targets. These targets are compatible with both iOS and macOS devices and simulators and are available in both release and debug modes:
The ExecuTorch Runtime for iOS and macOS (ARM64) is distributed as a collection of prebuilt [.xcframework](https://developer.apple.com/documentation/xcode/creating-a-multi-platform-binary-framework-bundle) binary targets. These targets are compatible with both iOS and macOS devices and simulators and are available in both release and debug modes:

* `executorch` - Main Runtime components
* `backend_coreml` - Core ML backend
Expand Down Expand Up @@ -114,6 +114,13 @@ python3 -m venv .venv && source .venv/bin/activate && pip install --upgrade pip
./backends/apple/coreml/scripts/install_requirements.sh
```

- **Intel-based macOS** systems require building PyTorch, Torchvision, and Torchaudio from source:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not have two instructions. Let's consolidate Intel based instructions in "building from source section" and call it a day

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, moved the instructions.

- Use the [`--use-pt-pinned-commit --minimal` flags](https://github.com/pytorch/executorch/blob/main/install_executorch.py) to install Executorch with an existing PyTorch build.
See the [PyTorch instructions](https://github.com/pytorch/pytorch#installation) on how to build PyTorch from source.
```bash
./install_executorch.sh --use-pt-pinned-commit --minimal
```

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

Download the macOS binary distribution from the [CMake website](https://cmake.org/download), open the `.dmg` file, move `CMake.app` to the `/Applications` directory, and then run the following command to install the CMake command-line tools:
Expand Down
20 changes: 20 additions & 0 deletions install_requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,15 @@ def python_is_compatible():


def install_requirements(use_pytorch_nightly):
# Skip pip install on Intel macOS if using nightly.
if use_pytorch_nightly and is_intel_mac_os():
print(
"ERROR: Prebuilt PyTorch wheels are no longer available for Intel-based macOS.\n"
"Please build from source by following https://docs.pytorch.org/executorch/main/using-executorch-building-from-source.html",
file=sys.stderr,
)
sys.exit(1)

# pip packages needed by exir.
TORCH_PACKAGE = [
# Setting use_pytorch_nightly to false to test the pinned PyTorch commit. Note
Expand Down Expand Up @@ -163,6 +172,17 @@ def install_optional_example_requirements(use_pytorch_nightly):
)


# Prebuilt binaries for Intel-based macOS are no longer available on PyPI; users must compile from source.
# PyTorch stopped building macOS x86_64 binaries since version 2.3.0 (January 2024).
def is_intel_mac_os():
# Returns True if running on Intel macOS
return platform.system().lower() == "darwin" and platform.machine().lower() in (
"x86",
"x86_64",
"i386",
)


def main(args):
parser = argparse.ArgumentParser()
parser.add_argument(
Expand Down
Loading