@@ -223,6 +223,10 @@ jobs:
223223 permissions :
224224 id-token : write
225225 contents : read
226+ strategy :
227+ matrix :
228+ os : [bare_metal, zephyr-preset]
229+ fail-fast : false
226230 with :
227231 runner : linux.2xlarge
228232 docker-image : executorch-ubuntu-22.04-arm-sdk
@@ -234,35 +238,62 @@ jobs:
234238 CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
235239 conda activate "${CONDA_ENV}"
236240
241+ cxx_flags="-fno-exceptions -fno-rtti -Wall -Werror -Wno-int-in-bool-context -DET_HAVE_PREAD=0"
242+ setup_script_args=""
243+ if [[ ${{ matrix.os}} == "bare_metal" ]]; then
244+ toolchain_prefix=arm-none-eabi-
245+ threshold="103268" # ~100KiB
246+ toolchain_cmake=examples/arm/ethos-u-setup/arm-none-eabi-gcc.cmake
247+ elif [[ ${{ matrix.os}} == "zephyr-preset" ]]; then
248+ setup_script_args="--target-toolchain zephyr"
249+ toolchain_prefix=arm-zephyr-eabi-
250+ threshold="133120" # should be ~125KB, set threshold to 130KB
251+ toolchain_cmake=examples/zephyr/x86_64-linux-arm-zephyr-eabi-gcc.cmake
252+ else
253+ echo "Fail unsupport OS selection ${{ matrix.os }}"
254+ exit 1
255+ fi
256+
237257 source .ci/scripts/utils.sh
238258 install_executorch "--use-pt-pinned-commit"
239- .ci/scripts/setup-arm-baremetal-tools.sh
259+ .ci/scripts/setup-arm-baremetal-tools.sh ${setup_script_args}
240260 source examples/arm/ethos-u-scratch/setup_path.sh
241261
242- # User baremetal toolchain
243- arm-none-eabi-c++ --version
244- toolchain_cmake=examples/arm/ethos-u-setup/arm-none-eabi-gcc.cmake
262+ # User toolchain
263+ ${toolchain_prefix}c++ --version
264+
265+ # Setup cmake target to desired toolchain
245266 toolchain_cmake=$(realpath ${toolchain_cmake})
246267
247- # Build and test size test
248- bash test/build_size_test.sh "-DCMAKE_TOOLCHAIN_FILE=${toolchain_cmake} -DEXECUTORCH_BUILD_ARM_BAREMETAL=ON"
268+ # Build and run size test
269+ if [[ ${{ matrix.os}} == "bare_metal" ]]; then
270+ bash test/build_size_test.sh "-DCMAKE_TOOLCHAIN_FILE=${toolchain_cmake} -DEXECUTORCH_BUILD_ARM_BAREMETAL=ON"
271+ elif [[ ${{ matrix.os}} == "zephyr-preset" ]]; then
272+ CXXFLAGS=${cxx_flags} cmake --preset zephyr -DCMAKE_BUILD_TYPE=Release -DEXECUTORCH_OPTIMIZE_SIZE=ON -DCMAKE_INSTALL_PREFIX=cmake-out -Bcmake-out .
273+ cmake --build cmake-out -j9 --target install --config Release
274+ CXXFLAGS=${cxx_flags} cmake -DCMAKE_TOOLCHAIN_FILE=${toolchain_cmake} -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=cmake-out -Bcmake-out/test test
275+ cmake --build cmake-out/test -j9 --config Release
276+ else
277+ echo "Fail unsupport OS selection ${{ matrix.os }}"
278+ exit 1
279+ fi
280+
249281 elf="cmake-out/test/size_test"
250282
251283 # Dump basic info
252284 ls -al ${elf}
253- arm-none-eabi- size ${elf}
285+ ${toolchain_prefix} size ${elf}
254286
255- # Dump symbols
287+ # Dump symbol
256288 python .github/scripts/run_nm.py -e ${elf}
257- python .github/scripts/run_nm.py -e ${elf} -f "executorch" -p "arm-none-eabi- "
258- python .github/scripts/run_nm.py -e ${elf} -f "executorch_text" -p "arm-none-eabi- "
289+ python .github/scripts/run_nm.py -e ${elf} -f "executorch" -p "${toolchain_prefix} "
290+ python .github/scripts/run_nm.py -e ${elf} -f "executorch_text" -p "${toolchain_prefix} "
259291
260292 # Add basic guard - TODO: refine this!
261- arm-none-eabi- strip ${elf}
293+ ${toolchain_prefix} strip ${elf}
262294 output=$(ls -la ${elf})
263295 arr=($output)
264296 size=${arr[4]}
265- threshold="103268" # ~100KiB
266297 echo "size: $size, threshold: $threshold"
267298 if [[ "$size" -le "$threshold" ]]; then
268299 echo "Success $size <= $threshold"
@@ -271,6 +302,36 @@ jobs:
271302 exit 1
272303 fi
273304
305+ nxp-build-test :
306+ name : nxp-build-test
307+ uses : pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
308+ permissions :
309+ id-token : write
310+ contents : read
311+ with :
312+ runner : linux.2xlarge
313+ docker-image : executorch-ubuntu-22.04-arm-sdk
314+ submodules : ' recursive'
315+ ref : ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
316+ timeout : 90
317+ script : |
318+ # The generic Linux job chooses to use base env, not the one setup by the image
319+ CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
320+ conda activate "${CONDA_ENV}"
321+
322+ # Build
323+ cmake -DEXECUTORCH_BUILD_NXP_NEUTRON=ON -Bcmake-out .
324+ cmake --build cmake-out --target executorch_delegate_neutron --config Release
325+
326+ # Build check for the neutron backend library
327+ lib_neutron="cmake-out/backends/nxp/libexecutorch_delegate_neutron.a"
328+ if [ -f $lib_neutron ]; then
329+ echo "Neutron backend library built."
330+ else
331+ echo "Neutron backend library not found!"
332+ exit 1
333+ fi
334+
274335 test-coreml-delegate :
275336 name : test-coreml-delegate
276337 uses : pytorch/test-infra/.github/workflows/macos_job.yml@main
@@ -470,7 +531,7 @@ jobs:
470531 docker-image : executorch-ubuntu-22.04-qnn-sdk
471532 submodules : ' recursive'
472533 ref : ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
473- timeout : 90
534+ timeout : 900
474535 script : |
475536 # The generic Linux job chooses to use base env, not the one setup by the image
476537 CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
@@ -489,14 +550,14 @@ jobs:
489550 strategy :
490551 matrix :
491552 dtype : [fp32]
492- model : [cvt, dit, efficientnet, focalnet, mobilevit_v1, mobilevit_v2, pvt, swin, albert, bert, distilbert, roberta ] # eurobert requires transfomer >= 4.48.0, skip for now
553+ model : [albert, bert, distilbert] # eurobert requires transfomer >= 4.48.0, skip for now
493554 fail-fast : false
494555 with :
495556 runner : linux.2xlarge
496557 docker-image : executorch-ubuntu-22.04-qnn-sdk
497558 submodules : ' recursive'
498559 ref : ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
499- timeout : 90
560+ timeout : 900
500561 script : |
501562 # The generic Linux job chooses to use base env, not the one setup by the image
502563 CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
0 commit comments