Skip to content

Commit 590f009

Browse files
committed
Debugging
1 parent 741f9a2 commit 590f009

File tree

1 file changed

+132
-132
lines changed

1 file changed

+132
-132
lines changed

.github/workflows/trunk.yml

Lines changed: 132 additions & 132 deletions
Original file line numberDiff line numberDiff line change
@@ -18,139 +18,139 @@ concurrency:
1818
cancel-in-progress: true
1919

2020
jobs:
21-
# test-models-macos-cpu:
22-
# name: test-models-macos-cpu
23-
# uses: pytorch/test-infra/.github/workflows/macos_job.yml@main
24-
# strategy:
25-
# matrix:
26-
# # Mac runners are expensive and limited, and non reliable.
27-
# # Do some basic testing for macos jobs, and rely mostly on
28-
# # test-models-linux-aarch64 job instead.
29-
# model: [emformer_join, ic4, llama2, mobilebert, mv3, resnet50, vit, w2l]
30-
# backend: [xnnpack-quantization-delegation]
31-
# include:
32-
# - model: efficient_sam
33-
# backend: portable
34-
# - model: llama
35-
# backend: portable
36-
# - model: llama3_2_vision_encoder
37-
# backend: portable
38-
# - model: mv3
39-
# backend: portable
40-
# fail-fast: false
41-
# with:
42-
# runner: macos-m1-stable
43-
# python-version: '3.11'
44-
# submodules: 'recursive'
45-
# ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
46-
# timeout: 90
47-
# script: |
48-
# MODEL_NAME=${{ matrix.model }}
49-
# BUILD_TOOL=cmake
50-
# BACKEND=${{ matrix.backend }}
21+
test-models-macos-cpu:
22+
name: test-models-macos-cpu
23+
uses: pytorch/test-infra/.github/workflows/macos_job.yml@main
24+
strategy:
25+
matrix:
26+
# Mac runners are expensive and limited, and non reliable.
27+
# Do some basic testing for macos jobs, and rely mostly on
28+
# test-models-linux-aarch64 job instead.
29+
model: [emformer_join, ic4, llama2, mobilebert, mv3, resnet50, vit, w2l]
30+
backend: [xnnpack-quantization-delegation]
31+
include:
32+
- model: efficient_sam
33+
backend: portable
34+
- model: llama
35+
backend: portable
36+
- model: llama3_2_vision_encoder
37+
backend: portable
38+
- model: mv3
39+
backend: portable
40+
fail-fast: false
41+
with:
42+
runner: macos-m1-stable
43+
python-version: '3.11'
44+
submodules: 'recursive'
45+
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
46+
timeout: 90
47+
script: |
48+
MODEL_NAME=${{ matrix.model }}
49+
BUILD_TOOL=cmake
50+
BACKEND=${{ matrix.backend }}
5151
52-
# bash .ci/scripts/setup-conda.sh
53-
# # Setup MacOS dependencies as there is no Docker support on MacOS atm
54-
# PYTHON_EXECUTABLE=python ${CONDA_RUN} bash .ci/scripts/setup-macos.sh --build-tool "${BUILD_TOOL}"
55-
# # Build and test executorch
56-
# PYTHON_EXECUTABLE=python ${CONDA_RUN} bash .ci/scripts/test_model.sh "${MODEL_NAME}" "${BUILD_TOOL}" "${BACKEND}"
57-
58-
# test-models-arm-zephyr:
59-
# name: test-models-arm-zephyr
60-
# uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
61-
# strategy:
62-
# matrix:
63-
# model: [add, softmax, mv2]
64-
# fail-fast: false
65-
# with:
66-
# runner: linux.2xlarge
67-
# docker-image: ci-image:executorch-ubuntu-22.04-zephyr-sdk
68-
# submodules: 'recursive'
69-
# ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
70-
# timeout: 120
71-
# script: |
72-
# MODEL_NAME=${{ matrix.model }}
73-
# CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
74-
# conda activate "${CONDA_ENV}"
75-
# if [[ ${{ matrix.model}} == "add" ]]; then
76-
# SIM_LIMIT_SEC=60
77-
# elif [[ ${{ matrix.model}} == "softmax" ]]; then
78-
# SIM_LIMIT_SEC=60
79-
# elif [[ ${{ matrix.model}} == "mv2" ]]; then
80-
# SIM_LIMIT_SEC=5000
81-
# else
82-
# echo "Failed unsupported model selection ${{ matrix.model }}"
83-
# exit 1
84-
# fi
85-
#
86-
# source .ci/scripts/utils.sh
87-
# source .ci/scripts/zephyr-utils.sh
88-
# mkdir -p zephyr_scratch/
89-
# cd zephyr_scratch
90-
# export ZEPHYR_PROJ_ROOT=$(realpath $(pwd))
91-
# export ARM_FVP_TUTORIALS_ROOT=$ZEPHYR_PROJ_ROOT/zephyr/samples/modules/executorch/arm-fvp-tutorials
92-
#
93-
# # TODO @Bujji: Should see if this can be moved into the docker image itself
94-
# download_arm_zephyr_sdk
95-
# ./zephyr-sdk-0.17.2/setup.sh -c -t arm-zephyr-eabi
96-
# cd $ZEPHYR_PROJ_ROOT
97-
# setup_zephyr_et_module
98-
#
99-
# # Run setup scripts for Arm FVP and Arm AOT Compilation
100-
# cd $ZEPHYR_PROJ_ROOT/modules/lib/executorch
101-
# install_executorch
102-
# .ci/scripts/setup-arm-baremetal-tools.sh --target-toolchain zephyr
103-
# source examples/arm/ethos-u-scratch/setup_path.sh
104-
# source $ZEPHYR_PROJ_ROOT/zephyr/zephyr-env.sh
105-
#
106-
# # Get the model as PTE
107-
# python -m examples.arm.aot_arm_compiler \
108-
# --model_name="${MODEL_NAME}" \
109-
# --output="${MODEL_NAME}.pte"
110-
#
111-
# # Generate the C-style header
112-
# cd $ARM_FVP_TUTORIALS_ROOT
113-
# python build_model.py \
114-
# --executorch-root $ZEPHYR_PROJ_ROOT/modules/lib/executorch \
115-
# --pte-file $ZEPHYR_PROJ_ROOT/modules/lib/executorch/${MODEL_NAME}.pte \
116-
# --output-path $ARM_FVP_TUTORIALS_ROOT/models/${MODEL_NAME}/src/
117-
#
118-
# cd $ARM_FVP_TUTORIALS_ROOT/models/${MODEL_NAME}/
119-
#
120-
# # Build the zephyr elf
121-
# west build -p always -b mps3/corstone300/fvp -- \
122-
# -DET_PTE_FILE_PATH_FOR_SELECTIVE_BUILD=$ZEPHYR_PROJ_ROOT/modules/lib/executorch/${MODEL_NAME}.pte
123-
#
124-
# # Run the simulation
125-
# FVP_Corstone_SSE-300_Ethos-U55 -a build/zephyr/zephyr.elf \
126-
# -C mps3_board.visualisation.disable-visualisation=1 \
127-
# -C mps3_board.telnetterminal0.start_telnet=0 \
128-
# -C mps3_board.uart0.out_file='sim.out' \
129-
# -C cpu0.CFGITCMSZ=15 \
130-
# -C cpu0.CFGDTCMSZ=15 \
131-
# --simlimit ${SIM_LIMIT_SEC}
132-
#
133-
# # Disable exit on error
134-
# set +e
135-
# # Report failure if any of the ouptut verification checks fail
136-
# grep -qF "ERROR" sim.out
137-
# exit_status=$? #store 0 if found (failure), 1 if not (success)
138-
# if [[ "$exit_status" -eq "0" ]]; then
139-
# cat sim.out
140-
# set -e
141-
# exit 1
142-
# fi
143-
#
144-
# # Report fail if simulation does not complete successfully
145-
# grep -qF "SUCCESS: Program complete, exiting." sim.out
146-
# exit_status=$? #store 0 if found (success), 1 if not (failure)
147-
# if [[ "$exit_status" -eq "1" ]]; then
148-
# cat sim.out
149-
# set -e
150-
# exit 1
151-
# fi
152-
# # Re-enable exit on error
153-
# set -e
52+
bash .ci/scripts/setup-conda.sh
53+
# Setup MacOS dependencies as there is no Docker support on MacOS atm
54+
PYTHON_EXECUTABLE=python ${CONDA_RUN} bash .ci/scripts/setup-macos.sh --build-tool "${BUILD_TOOL}"
55+
# Build and test executorch
56+
PYTHON_EXECUTABLE=python ${CONDA_RUN} bash .ci/scripts/test_model.sh "${MODEL_NAME}" "${BUILD_TOOL}" "${BACKEND}"
57+
58+
test-models-arm-zephyr:
59+
name: test-models-arm-zephyr
60+
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
61+
strategy:
62+
matrix:
63+
model: [add, softmax, mv2]
64+
fail-fast: false
65+
with:
66+
runner: linux.2xlarge
67+
docker-image: ci-image:executorch-ubuntu-22.04-zephyr-sdk
68+
submodules: 'recursive'
69+
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
70+
timeout: 120
71+
script: |
72+
MODEL_NAME=${{ matrix.model }}
73+
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
74+
conda activate "${CONDA_ENV}"
75+
if [[ ${{ matrix.model}} == "add" ]]; then
76+
SIM_LIMIT_SEC=60
77+
elif [[ ${{ matrix.model}} == "softmax" ]]; then
78+
SIM_LIMIT_SEC=60
79+
elif [[ ${{ matrix.model}} == "mv2" ]]; then
80+
SIM_LIMIT_SEC=5000
81+
else
82+
echo "Failed unsupported model selection ${{ matrix.model }}"
83+
exit 1
84+
fi
85+
86+
source .ci/scripts/utils.sh
87+
source .ci/scripts/zephyr-utils.sh
88+
mkdir -p zephyr_scratch/
89+
cd zephyr_scratch
90+
export ZEPHYR_PROJ_ROOT=$(realpath $(pwd))
91+
export ARM_FVP_TUTORIALS_ROOT=$ZEPHYR_PROJ_ROOT/zephyr/samples/modules/executorch/arm-fvp-tutorials
92+
93+
# TODO @Bujji: Should see if this can be moved into the docker image itself
94+
download_arm_zephyr_sdk
95+
./zephyr-sdk-0.17.2/setup.sh -c -t arm-zephyr-eabi
96+
cd $ZEPHYR_PROJ_ROOT
97+
setup_zephyr_et_module
98+
99+
# Run setup scripts for Arm FVP and Arm AOT Compilation
100+
cd $ZEPHYR_PROJ_ROOT/modules/lib/executorch
101+
install_executorch
102+
.ci/scripts/setup-arm-baremetal-tools.sh --target-toolchain zephyr
103+
source examples/arm/ethos-u-scratch/setup_path.sh
104+
source $ZEPHYR_PROJ_ROOT/zephyr/zephyr-env.sh
105+
106+
# Get the model as PTE
107+
python -m examples.arm.aot_arm_compiler \
108+
--model_name="${MODEL_NAME}" \
109+
--output="${MODEL_NAME}.pte"
110+
111+
# Generate the C-style header
112+
cd $ARM_FVP_TUTORIALS_ROOT
113+
python build_model.py \
114+
--executorch-root $ZEPHYR_PROJ_ROOT/modules/lib/executorch \
115+
--pte-file $ZEPHYR_PROJ_ROOT/modules/lib/executorch/${MODEL_NAME}.pte \
116+
--output-path $ARM_FVP_TUTORIALS_ROOT/models/${MODEL_NAME}/src/
117+
118+
cd $ARM_FVP_TUTORIALS_ROOT/models/${MODEL_NAME}/
119+
120+
# Build the zephyr elf
121+
west build -p always -b mps3/corstone300/fvp -- \
122+
-DET_PTE_FILE_PATH_FOR_SELECTIVE_BUILD=$ZEPHYR_PROJ_ROOT/modules/lib/executorch/${MODEL_NAME}.pte
123+
124+
# Run the simulation
125+
FVP_Corstone_SSE-300_Ethos-U55 -a build/zephyr/zephyr.elf \
126+
-C mps3_board.visualisation.disable-visualisation=1 \
127+
-C mps3_board.telnetterminal0.start_telnet=0 \
128+
-C mps3_board.uart0.out_file='sim.out' \
129+
-C cpu0.CFGITCMSZ=15 \
130+
-C cpu0.CFGDTCMSZ=15 \
131+
--simlimit ${SIM_LIMIT_SEC}
132+
133+
# Disable exit on error
134+
set +e
135+
# Report failure if any of the ouptut verification checks fail
136+
grep -qF "ERROR" sim.out
137+
exit_status=$? #store 0 if found (failure), 1 if not (success)
138+
if [[ "$exit_status" -eq "0" ]]; then
139+
cat sim.out
140+
set -e
141+
exit 1
142+
fi
143+
144+
# Report fail if simulation does not complete successfully
145+
grep -qF "SUCCESS: Program complete, exiting." sim.out
146+
exit_status=$? #store 0 if found (success), 1 if not (failure)
147+
if [[ "$exit_status" -eq "1" ]]; then
148+
cat sim.out
149+
set -e
150+
exit 1
151+
fi
152+
# Re-enable exit on error
153+
set -e
154154
155155
test-models-linux-aarch64:
156156
name: test-models-linux-aarch64

0 commit comments

Comments
 (0)