From 34f3799dc627261478c0addd61e38736904c8a0f Mon Sep 17 00:00:00 2001 From: Mengwei Liu Date: Fri, 7 Mar 2025 10:00:12 -0800 Subject: [PATCH 1/2] Remove submodule update commands To make the getting started page simpler. These commands will be run in ./install_executorch.sh so we don't have to ask the users to run it. --- docs/source/using-executorch-building-from-source.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/docs/source/using-executorch-building-from-source.md b/docs/source/using-executorch-building-from-source.md index 842c00b842c..fa261a9ddef 100644 --- a/docs/source/using-executorch-building-from-source.md +++ b/docs/source/using-executorch-building-from-source.md @@ -54,10 +54,6 @@ portability details. git clone --branch viable/strict https://github.com/pytorch/executorch.git cd executorch - # Update and pull submodules - git submodule sync - git submodule update --init - # 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. From eb7a72879eb95ff6ce7306c6e10769cd667be73c Mon Sep 17 00:00:00 2001 From: Mengwei Liu Date: Fri, 7 Mar 2025 10:18:07 -0800 Subject: [PATCH 2/2] Update using-executorch-building-from-source.md --- .../using-executorch-building-from-source.md | 34 +++++++++---------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/docs/source/using-executorch-building-from-source.md b/docs/source/using-executorch-building-from-source.md index fa261a9ddef..9f9b104d927 100644 --- a/docs/source/using-executorch-building-from-source.md +++ b/docs/source/using-executorch-building-from-source.md @@ -45,7 +45,7 @@ portability details. conda activate executorch ``` -### Clone and install ExecuTorch requirements +### Clone ExecuTorch ```bash # Clone the ExecuTorch repo from GitHub @@ -54,13 +54,20 @@ portability details. git clone --branch viable/strict https://github.com/pytorch/executorch.git cd executorch + # Update and pull submodules + git submodule sync + git submodule update --init + ``` + +## 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. ./install_executorch.sh ``` - Use the [`--pybind` flag](https://github.com/pytorch/executorch/blob/main/install_executorch.sh#L26-L29) to install with pybindings and dependencies for other backends. + Use the [`--pybind` flag](https://github.com/pytorch/executorch/blob/main/install_executorch.sh#L26-L29) to install with pybindings and dependencies for other backends. ```bash ./install_executorch.sh --pybind @@ -76,7 +83,7 @@ portability details. ./install_executorch.sh --pybind off ``` - For development, install the package in `--editable` mode, which allows to modify Python source code and see changes reflected immediately. + For development mode, run the command with `--editable`, which allows us to modify Python source code and see changes reflected immediately. ```bash ./install_executorch.sh --editable [--pybind xnnpack] @@ -101,7 +108,7 @@ portability details. > git submodule update --init > ``` -## Targets Built by the CMake Build System +## Build ExecuTorch C++ runtime from source ExecuTorch's CMake build system covers the pieces of the runtime that are likely to be useful to embedded systems users. @@ -121,17 +128,8 @@ likely to be useful to embedded systems users. `libportable_kernels.a`, so the program may use any of the operators it implements. -## One-time setup to prepare for CMake Build - -Follow the steps below to have the tools ready before using CMake to build on your machine. - -1. If your system's version of python3 is older than 3.11: - - Run `pip install tomli` -3. Install CMake version 3.19 or later: - - Run `conda install cmake` or `pip install cmake`. - -## Configure the CMake Build +### Configure the CMake build Follow these steps after cloning or pulling the upstream repo, since the build dependencies may have changed. @@ -148,7 +146,7 @@ cd executorch Once this is done, you don't need to do it again until you pull from the upstream repo again, or if you modify any CMake-related files. -### CMake Build Options +### CMake build options The release build offers optimizations intended to improve performance and reduce binary size. It disables program verification and executorch logging, and adds optimizations flags. ```bash @@ -163,7 +161,7 @@ To further optimize the release build for size, use both: See [CMakeLists.txt](https://github.com/pytorch/executorch/blob/main/CMakeLists.txt) -## Build the runtime components +### Build the runtime components Build all targets with @@ -180,7 +178,7 @@ cd executorch cmake --build cmake-out -j9 ``` -## Use an example app `executor_runner` to execute a .pte file +## Use an example binary `executor_runner` to execute a .pte file First, generate an `add.pte` or other ExecuTorch program file using the instructions as described in @@ -192,7 +190,7 @@ Then, pass it to the command line tool: ./cmake-out/executor_runner --model_path path/to/model.pte ``` -If it worked, you should see the message "Model executed successfully" followed +You should see the message "Model executed successfully" followed by the output values. ```