diff --git a/.github/workflows/trunk.yml b/.github/workflows/trunk.yml index 9b801801e08..fcc19660648 100644 --- a/.github/workflows/trunk.yml +++ b/.github/workflows/trunk.yml @@ -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 diff --git a/examples/raspberry_pi/setup.sh b/examples/raspberry_pi/setup.sh index 0b4f43ed1d3..500895cfc6c 100755 --- a/examples/raspberry_pi/setup.sh +++ b/examples/raspberry_pi/setup.sh @@ -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" @@ -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" \