From 82d1625b11a7a0f5f5dca547cf04008c77d25783 Mon Sep 17 00:00:00 2001 From: Gasoonjia Date: Wed, 2 Jul 2025 10:46:10 -0700 Subject: [PATCH] update building from source doc to make the backend support guidance clearer Differential Revision: D77609951 Pull Request resolved: https://github.com/pytorch/executorch/pull/12140 (cherry picked from commit 22b9e59890c7fb75784480efb100e4a68897967b) --- docs/source/using-executorch-building-from-source.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/source/using-executorch-building-from-source.md b/docs/source/using-executorch-building-from-source.md index a5518818263..6be44946dff 100644 --- a/docs/source/using-executorch-building-from-source.md +++ b/docs/source/using-executorch-building-from-source.md @@ -60,7 +60,7 @@ Or alternatively, [install conda on your machine](https://conda.io/projects/cond ## Install ExecuTorch pip package from source ```bash # Install ExecuTorch pip package and its dependencies, as well as - # development tools like CMake. + # development tools like CMake, and backend support for XNNPACK and CoreML. # If developing on a Mac, make sure to install the Xcode Command Line Tools first. # Intel-based macOS systems require building PyTorch from source (see below) ./install_executorch.sh @@ -79,10 +79,16 @@ Or alternatively, [install conda on your machine](https://conda.io/projects/cond ./install_executorch.sh --use-pt-pinned-commit --minimal ``` - 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: + Notice that only XNNPACK and CoreML backends are supported by default. You can enable additional backends or disable default backends by setting the corresponding CMake flags: ```bash + # Enable the MPS backend CMAKE_ARGS="-DEXECUTORCH_BUILD_MPS=ON" ./install_executorch.sh + ``` + + ```bash + # Disable the XNNPACK backend + CMAKE_ARGS="-DEXECUTORCH_BUILD_XNNPACK=OFF" ./install_executorch.sh ``` For development mode, run the command with `--editable`, which allows us to modify Python source code and see changes reflected immediately.