Skip to content
Open
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
45 changes: 45 additions & 0 deletions .github/workflows/trunk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1066,3 +1066,48 @@ jobs:

.ci/scripts/test_model.ps1 -modelName ${{ matrix.model }} -backend ${{ matrix.backend }}
}"

test-rpi-scripts:
name: test-rpi-scripts
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@release/2.9
strategy:
matrix:
include:
- build-tool: cmake
fail-fast: false
permissions:
id-token: write
contents: read
with:
runner: linux.2xlarge
docker-image: ci-image:executorch-ubuntu-22.04-arm-sdk
submodules: 'recursive'
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
timeout: 90
script: |
# The generic Linux job chooses to use base env, not the one setup by the image
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
conda activate "${CONDA_ENV}"

source .ci/scripts/utils.sh

# Validate the Raspberry Pi setup scripts
## Pi5
examples/raspberry_pi/setup.sh pi5
examples/raspberry_pi/setup.sh pi5 --clean
## Pi4
examples/raspberry_pi/setup.sh pi4
examples/raspberry_pi/setup.sh pi4 --clean

# Validate the script for Pico2 setup
## Generate model
cd ./examples/raspberry_pi/pico2
## Creates balanced_tiny_mlp_mnist.pte
python export_mlp_mnist.py
cd -

.ci/scripts/setup-arm-baremetal-tools.sh
source examples/arm/ethos-u-scratch/setup_path.sh
examples/raspberry_pi/pico2/build_firmware_pico.sh --model=balanced_tiny_mlp_mnist.pte
examples/raspberry_pi/pico2/build_firmware_pico.sh --clean
rm ./examples/raspberry_pi/pico2/balanced_tiny_mlp_mnist.pte
7 changes: 6 additions & 1 deletion examples/raspberry_pi/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ setup_environment() {
# Install ExecuTorch
log_info "Installing ExecuTorch dependencies..."
if [[ -f "./install_executorch.sh" ]]; then
./install_executorch.sh
./install_executorch.sh --use-pt-pinned-commit
else
log_error "./install_executorch.sh not found"
log_info "Make sure you're in the ExecuTorch root directory"
Expand Down Expand Up @@ -450,9 +450,14 @@ build_executorch_core() {
fi

log_info "Building ExecuTorch core libraries..."
# log info
log_info "WORKSPACE_DIR: $WORKSPACE_DIR"
log_info "CMAKE_OUT_DIR: $CMAKE_OUT_DIR"
log_info "PWD: $(pwd)"

# Configure
cmake --preset llm \
-B "$CMAKE_OUT_DIR" \
-DCMAKE_TOOLCHAIN_FILE="$CMAKE_TOOLCHAIN_FILE" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="$CMAKE_OUT_DIR" \
Expand Down
Loading