With the ExecuTorch source checked out and your virtual environment active, you can now build ExecuTorch and set up the Arm toolchain for Ethos-U cross-compilation.
For a full tutorial on building ExecuTorch, see the Learning Path Introduction to TinyML on Arm using PyTorch and ExecuTorch .
Upgrade pip and install build tools:
pip install --upgrade pip setuptools wheel
Build and install the executorch pip package:
./install_executorch.sh
After the installation finishes, verify the package is available:
pip list | grep executorch
Initialize the Arm-specific environment and accept the EULA:
./examples/arm/setup.sh --i-agree-to-the-contained-eula
Source the environment variables:
source ./examples/arm/ethos-u-scratch/setup_path.sh
If install_executorch.sh fails, install the dependencies manually:
pip install torch torchvision
pip install --no-build-isolation .
pip install --no-build-isolation third-party/ao
If buck2 hangs during the build:
ps aux | grep buck
pkill -f buck
To clean the build environment and start fresh:
./install_executorch.sh --clean
git submodule sync
git submodule update --init --recursive
./install_executorch.sh
In this section you’ve:
With ExecuTorch installed and the Arm toolchain configured, you can now compile .pte model files targeting the Ethos-U65 NPU.