Skip to content

Commit 20e9b5d

Browse files
author
Github Executorch
committed
Summary: Add Pico2 script to CI
Test Plan: Reviewers: Subscribers: Tasks: Tags:
1 parent c85ece4 commit 20e9b5d

File tree

2 files changed

+51
-1
lines changed

2 files changed

+51
-1
lines changed

.github/workflows/trunk.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1066,3 +1066,48 @@ jobs:
10661066
10671067
.ci/scripts/test_model.ps1 -modelName ${{ matrix.model }} -backend ${{ matrix.backend }}
10681068
}"
1069+
1070+
test-rpi-scripts:
1071+
name: test-rpi-scripts
1072+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@release/2.9
1073+
strategy:
1074+
matrix:
1075+
include:
1076+
- build-tool: cmake
1077+
fail-fast: false
1078+
permissions:
1079+
id-token: write
1080+
contents: read
1081+
with:
1082+
runner: linux.2xlarge
1083+
docker-image: ci-image:executorch-ubuntu-22.04-arm-sdk
1084+
submodules: 'recursive'
1085+
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
1086+
timeout: 90
1087+
script: |
1088+
# The generic Linux job chooses to use base env, not the one setup by the image
1089+
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
1090+
conda activate "${CONDA_ENV}"
1091+
1092+
source .ci/scripts/utils.sh
1093+
1094+
# Validate the Raspberry Pi setup scripts
1095+
## Pi5
1096+
examples/raspberry_pi/setup.sh pi5
1097+
examples/raspberry_pi/setup.sh pi5 --clean
1098+
## Pi4
1099+
examples/raspberry_pi/setup.sh pi4
1100+
examples/raspberry_pi/setup.sh pi4 --clean
1101+
1102+
# Validate the script for Pico2 setup
1103+
## Generate model
1104+
cd ./examples/raspberry_pi/pico2
1105+
## Creates balanced_tiny_mlp_mnist.pte
1106+
python export_mlp_mnist.py
1107+
cd -
1108+
1109+
.ci/scripts/setup-arm-baremetal-tools.sh
1110+
source examples/arm/ethos-u-scratch/setup_path.sh
1111+
examples/raspberry_pi/pico2/build_firmware_pico.sh --model=balanced_tiny_mlp_mnist.pte
1112+
examples/raspberry_pi/pico2/build_firmware_pico.sh --clean
1113+
rm ./examples/raspberry_pi/pico2/balanced_tiny_mlp_mnist.pte

examples/raspberry_pi/setup.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ setup_environment() {
269269
# Install ExecuTorch
270270
log_info "Installing ExecuTorch dependencies..."
271271
if [[ -f "./install_executorch.sh" ]]; then
272-
./install_executorch.sh
272+
./install_executorch.sh --use-pt-pinned-commit
273273
else
274274
log_error "./install_executorch.sh not found"
275275
log_info "Make sure you're in the ExecuTorch root directory"
@@ -450,9 +450,14 @@ build_executorch_core() {
450450
fi
451451

452452
log_info "Building ExecuTorch core libraries..."
453+
# log info
454+
log_info "WORKSPACE_DIR: $WORKSPACE_DIR"
455+
log_info "CMAKE_OUT_DIR: $CMAKE_OUT_DIR"
456+
log_info "PWD: $(pwd)"
453457

454458
# Configure
455459
cmake --preset llm \
460+
-B "$CMAKE_OUT_DIR" \
456461
-DCMAKE_TOOLCHAIN_FILE="$CMAKE_TOOLCHAIN_FILE" \
457462
-DCMAKE_BUILD_TYPE=Release \
458463
-DCMAKE_INSTALL_PREFIX="$CMAKE_OUT_DIR" \

0 commit comments

Comments
 (0)