@@ -284,71 +284,6 @@ jobs:
284284 exit 1
285285 fi
286286
287- test-arm-cortex-m-zephyr-size-test :
288- name : test-arm-cortex-m-zephyr-size-test
289- uses : pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
290- permissions :
291- id-token : write
292- contents : read
293- with :
294- runner : linux.2xlarge
295- docker-image : executorch-ubuntu-22.04-arm-sdk
296- submodules : ' recursive'
297- ref : ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
298- timeout : 90
299- script : |
300- # The generic Linux job chooses to use base env, not the one setup by the image
301- CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
302- conda activate "${CONDA_ENV}"
303-
304- source .ci/scripts/utils.sh
305- install_executorch "--use-pt-pinned-commit"
306- .ci/scripts/setup-arm-baremetal-tools.sh ${setup_script_args}
307- source examples/arm/ethos-u-scratch/setup_path.sh
308-
309- # User toolchain
310- ${toolchain_prefix}c++ --version
311-
312- # Setup cmake target to desired toolchain
313- toolchain_cmake=$(realpath ${toolchain_cmake})
314-
315- # Build and run size test
316- if [[ ${{ matrix.os}} == "bare_metal" ]]; then
317- bash test/build_size_test.sh "-DCMAKE_TOOLCHAIN_FILE=${toolchain_cmake} -DEXECUTORCH_BUILD_ARM_BAREMETAL=ON"
318- elif [[ ${{ matrix.os}} == "zephyr-preset" ]]; then
319- CXXFLAGS=${cxx_flags} cmake --preset zephyr -DCMAKE_BUILD_TYPE=Release -DEXECUTORCH_OPTIMIZE_SIZE=ON -DCMAKE_INSTALL_PREFIX=cmake-out -Bcmake-out .
320- cmake --build cmake-out -j9 --target install --config Release
321- CXXFLAGS=${cxx_flags} cmake -DCMAKE_TOOLCHAIN_FILE=${toolchain_cmake} -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=cmake-out -Bcmake-out/test test
322- cmake --build cmake-out/test -j9 --config Release
323- else
324- echo "Fail unsupport OS selection ${{ matrix.os }}"
325- exit 1
326- fi
327-
328- elf="cmake-out/test/size_test"
329-
330- # Dump basic info
331- ls -al ${elf}
332- ${toolchain_prefix}size ${elf}
333-
334- # Dump symbols
335- python .github/scripts/run_nm.py -e ${elf}
336- python .github/scripts/run_nm.py -e ${elf} -f "executorch" -p "${toolchain_prefix}"
337- python .github/scripts/run_nm.py -e ${elf} -f "executorch_text" -p "${toolchain_prefix}"
338-
339- # Add basic guard - TODO: refine this!
340- ${toolchain_prefix}strip ${elf}
341- output=$(ls -la ${elf})
342- arr=($output)
343- size=${arr[4]}
344- echo "size: $size, threshold: $threshold"
345- if [[ "$size" -le "$threshold" ]]; then
346- echo "Success $size <= $threshold"
347- else
348- echo "Fail $size > $threshold"
349- exit 1
350- fi
351-
352287 test-coreml-delegate :
353288 name : test-coreml-delegate
354289 uses : pytorch/test-infra/.github/workflows/macos_job.yml@main
0 commit comments